kpresenter
KPrPolygonObject.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef kppolygonobject_h
00023 #define kppolygonobject_h
00024
00025 #include <qpointarray.h>
00026 #include "KoPointArray.h"
00027 #include "KPrObject.h"
00028
00029 class KPrGradient;
00030 class QPainter;
00031 class DCOPObject;
00032 class KoPen;
00033
00034 class KPrPolygonObject : public KPr2DObject
00035 {
00036 public:
00037 KPrPolygonObject();
00038 KPrPolygonObject( const KoPointArray &_points, const KoSize &_size, const KoPen &_pen, const QBrush &_brush,
00039 FillType _fillType, const QColor &_gColor1, const QColor &_gColor2, BCType _gType,
00040 bool _unbalanced, int _xfactor, int _yfactor,
00041 bool _checkConcavePolygon, int _cornersValue, int _sharpnessValue );
00042
00043 virtual ~KPrPolygonObject() {}
00044 virtual DCOPObject* dcopObject();
00045
00046 KPrPolygonObject &operator=( const KPrPolygonObject & );
00047
00048 virtual void setSize( double _width, double _height );
00049 virtual void setSize( const KoSize & _size )
00050 { setSize( _size.width(), _size.height() ); }
00051
00052 virtual ObjType getType() const { return OT_POLYGON; }
00053 virtual QString getTypeString() const { return i18n( "Polygon" ); }
00054
00055 void setCheckConcavePolygon(bool _concavePolygon) { checkConcavePolygon = _concavePolygon; drawPolygon(); }
00056 void setCornersValue(int _cornersValue) { cornersValue = _cornersValue; drawPolygon(); }
00057 void setSharpnessValue(int _sharpnessValue) { sharpnessValue = _sharpnessValue; drawPolygon(); }
00058 bool getCheckConcavePolygon() const { return checkConcavePolygon; }
00059 int getCornersValue() const { return cornersValue; }
00060 int getSharpnessValue() const { return sharpnessValue; }
00061
00062 virtual QDomDocumentFragment save( QDomDocument& doc, double offset );
00063
00064 virtual double load( const QDomElement &element );
00065 virtual void loadOasis( const QDomElement &element, KoOasisContext & context, KPrLoadingInfo *info );
00066
00067 virtual void flip( bool horizontal );
00068 virtual KoSize getRealSize() const;
00069 virtual KoPoint getRealOrig() const;
00070
00071 protected:
00072 virtual const char * getOasisElementName() const;
00073 virtual bool saveOasisObjectAttributes( KPOasisSaveContext &sc ) const;
00074
00075 virtual void paint( QPainter *_painter,KoTextZoomHandler*_zoomHandler,
00076 int , bool drawingShadow, bool drawContour );
00077
00078 void updatePoints( double _fx, double _fy );
00079
00080 void drawPolygon();
00081
00082 KoPointArray points;
00083 bool checkConcavePolygon;
00084 int cornersValue;
00085 int sharpnessValue;
00086 };
00087
00088 #endif
|