kpresenter

KPrPolygonObject.h
1/* This file is part of the KDE project
2 Copyright (C) 2001 Toshitaka Fujioka <fujioka@kde.org>
3 Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef kppolygonobject_h
22#define kppolygonobject_h
23
24#include <tqpointarray.h>
25#include "KoPointArray.h"
26#include "KPrObject.h"
27
28class KPrGradient;
29class TQPainter;
30class DCOPObject;
31class KoPen;
32
33class KPrPolygonObject : public KPr2DObject
34{
35public:
36 KPrPolygonObject();
37 KPrPolygonObject( const KoPointArray &_points, const KoSize &_size, const KoPen &_pen, const TQBrush &_brush,
38 FillType _fillType, const TQColor &_gColor1, const TQColor &_gColor2, BCType _gType,
39 bool _unbalanced, int _xfactor, int _yfactor,
40 bool _checkConcavePolygon, int _cornersValue, int _sharpnessValue );
41
42 virtual ~KPrPolygonObject() {}
43 virtual DCOPObject* dcopObject();
44
45 KPrPolygonObject &operator=( const KPrPolygonObject & );
46
47 virtual void setSize( double _width, double _height );
48 virtual void setSize( const KoSize & _size )
49 { setSize( _size.width(), _size.height() ); }
50
51 virtual ObjType getType() const { return OT_POLYGON; }
52 virtual TQString getTypeString() const { return i18n( "Polygon" ); }
53
54 void setCheckConcavePolygon(bool _concavePolygon) { checkConcavePolygon = _concavePolygon; drawPolygon(); }
55 void setCornersValue(int _cornersValue) { cornersValue = _cornersValue; drawPolygon(); }
56 void setSharpnessValue(int _sharpnessValue) { sharpnessValue = _sharpnessValue; drawPolygon(); }
57 bool getCheckConcavePolygon() const { return checkConcavePolygon; }
58 int getCornersValue() const { return cornersValue; }
59 int getSharpnessValue() const { return sharpnessValue; }
60
61 virtual TQDomDocumentFragment save( TQDomDocument& doc, double offset );
62
63 virtual double load( const TQDomElement &element );
64 virtual void loadOasis( const TQDomElement &element, KoOasisContext & context, KPrLoadingInfo *info );
65
66 virtual void flip( bool horizontal );
67 virtual KoSize getRealSize() const;
68 virtual KoPoint getRealOrig() const;
69
70protected:
71 virtual const char * getOasisElementName() const;
72 virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
73
74 virtual void paint( TQPainter *_painter,KoTextZoomHandler*_zoomHandler,
75 int /* pageNum */, bool drawingShadow, bool drawContour );
76
77 void updatePoints( double _fx, double _fy );
78
79 void drawPolygon();
80
81 KoPointArray points;
82 bool checkConcavePolygon;
83 int cornersValue;
84 int sharpnessValue;
85};
86
87#endif
Class: KPrGradient.
Definition KPrGradient.h:40
Temporary information used only during loading.