00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _KOWMFPAINT_H_
00019 #define _KOWMFPAINT_H_
00020
00021 #include <QPainter>
00022
00023 #include <QPolygon>
00024 #include <Q3PtrList>
00025
00026 #include "kowmfread.h"
00027 #include <koffice_export.h>
00045 class KOWMF_EXPORT KoWmfPaint : public KoWmfRead
00046 {
00047 public:
00048 KoWmfPaint();
00049 ~KoWmfPaint() { }
00050
00057 bool play( QPaintDevice& target, bool relativeCoord=false );
00058
00059
00060 private:
00061
00062
00063 bool begin();
00064 bool end();
00065 void save();
00066 void restore();
00067
00068
00069 void setFont( const QFont& font );
00070
00071 void setPen( const QPen& pen );
00072 const QPen& pen() const;
00073 void setBrush( const QBrush& brush );
00074
00075
00076 void setBackgroundColor( const QColor& c );
00077 void setBackgroundMode( Qt::BGMode mode );
00078 void setCompositionMode( QPainter::CompositionMode mode );
00079
00086 void setWindowOrg( int left, int top );
00087 void setWindowExt( int width, int height );
00088
00089
00090
00091
00092 void setClipRegion( const QRegion &rec );
00093 QRegion clipRegion();
00094
00095
00096 void moveTo( int x, int y );
00097 void lineTo( int x, int y );
00098 void drawRect( int x, int y, int w, int h );
00099 void drawRoundRect( int x, int y, int w, int h, int = 25, int = 25 );
00100 void drawEllipse( int x, int y, int w, int h );
00101 void drawArc( int x, int y, int w, int h, int a, int alen );
00102 void drawPie( int x, int y, int w, int h, int a, int alen );
00103 void drawChord( int x, int y, int w, int h, int a, int alen );
00104 void drawPolyline( const QPolygon& pa );
00105 void drawPolygon( const QPolygon& pa, bool winding=false );
00110 void drawPolyPolygon( Q3PtrList<QPolygon>& listPa, bool winding=false );
00111 void drawImage( int x, int y, const QImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 );
00112
00113
00114
00115
00116 void drawText( int x, int y, int w, int h, int flags, const QString &s, double rotation );
00117
00118
00119 void setMatrix( const QMatrix &, bool combine=false );
00120
00121 private:
00122 QPainter mPainter;
00123 QPaintDevice *mTarget;
00124 bool mRelativeCoord;
00125
00126 QMatrix mInternalWorldMatrix;
00127 QPoint mLastPos;
00128
00129 };
00130
00131 #endif