karbon

vstrokefillpreview.h
1/* This file is part of the KDE project
2 Copyright (C) 2002, The Karbon Developers
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __VSTROKEFILLPREVIEW_H__
21#define __VSTROKEFILLPREVIEW_H__
22
23#include <tqframe.h>
24#include <tqpixmap.h>
25
26class VKoPainter;
27class VFill;
28class VStroke;
29class KarbonPart;
30
31class VStrokeFillPreview : public TQFrame
32{
33 TQ_OBJECT
34
35
36public:
37 VStrokeFillPreview( KarbonPart *part, TQWidget* parent = 0L, const char* name = 0L );
38 ~VStrokeFillPreview();
39
40 virtual TQSize sizeHint() const
41 { return TQSize( 50, 50 ); }
42 virtual TQSize minimumSizeHint() const
43 { return TQSize( 20, 20 ); }
44 virtual TQSizePolicy sizePolicy() const
45 { return TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); }
46
47 void update( const VStroke &, const VFill & );
48
49 virtual bool eventFilter( TQObject* object, TQEvent* event );
50
51 bool strokeIsSelected() const { return m_strokeWidget; }
52 void setFillSelected();
53 void setStrokeSelected();
54signals:
55 void strokeChanged( const VStroke & );
56 void fillChanged( const VFill& );
57 void fillSelected();
58 void strokeSelected();
59
60protected:
61 virtual void paintEvent( TQPaintEvent* event );
62
63private:
64 VKoPainter* m_painter;
65 void drawFill( const VFill & );
66 void drawStroke( const VStroke & );
67 TQPixmap m_pixmap;
68 KarbonPart *m_part;
69 bool m_strokeWidget;
70 VFill m_fill;
71 VStroke m_stroke;
72};
73
74#endif
75
Keeps track of visual per document properties.
Definition karbon_part.h:46
Manages the fill of shapes.
Definition vfill.h:45
Manages stroke properties.
Definition vstroke.h:49