00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _KOWMFWRITE_H_
00019 #define _KOWMFWRITE_H_
00020
00021 #include <qpen.h>
00022 #include <qbrush.h>
00023 #include <qcolor.h>
00024 #include <qfont.h>
00025 #include <qrect.h>
00026 #include <qbuffer.h>
00027 #include <qregion.h>
00028 #include <qstring.h>
00029 #include <qwmatrix.h>
00030 #include <qimage.h>
00031 #include <qptrlist.h>
00032 #include <qpointarray.h>
00033
00034 class KoWmfWritePrivate;
00035
00049 class KoWmfWrite
00050 {
00051 public:
00052 KoWmfWrite( const QString& fileName );
00053 virtual ~KoWmfWrite();
00054
00055
00056
00057
00058
00062 bool begin();
00066 bool end();
00067 void save();
00068 void restore();
00069
00075 void setDefaultDpi( int dpi );
00076
00077
00078 void setFont( const QFont& f );
00079
00080 void setPen( const QPen& p );
00081 void setBrush( const QBrush& b );
00082
00083
00084 void setBackgroundColor( const QColor& r );
00085 void setBackgroundMode( Qt::BGMode );
00086 void setRasterOp( Qt::RasterOp );
00087
00088
00089 void setWindow( int left, int top , int width, int height );
00090
00091
00092
00093
00094 void setClipRegion( const QRegion& r );
00095 void clipping( bool enable );
00096
00097
00098 void moveTo( int left, int top );
00099 void lineTo( int left, int top );
00100 void drawRect( int left, int top, int width, int height );
00101 void drawRoundRect( int left, int top, int width, int height, int = 25, int = 25 );
00102 void drawEllipse( int left, int top, int width, int height );
00103 void drawArc( int left, int top, int width, int height, int a, int alen );
00104 void drawPie( int left, int top, int width, int height, int a, int alen );
00105 void drawChord( int left, int top, int width, int height, int a, int alen );
00106 void drawPolyline( const QPointArray& pa );
00107 void drawPolygon( const QPointArray& pa, bool winding=FALSE );
00108
00109
00110 void drawPolyPolygon( QPtrList<QPointArray>& listPa, bool winding=FALSE );
00111 void drawImage( int left, int top, 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 private:
00119
00120
00121
00123 void pointArray( const QPointArray& pa );
00124
00126 Q_UINT32 winColor( QColor color );
00127
00129 void angleToxy( int& xStart, int& yStart, int& xEnd, int& yEnd, int a, int alen );
00130
00132 Q_UINT16 qtRasterToWin16( Qt::RasterOp op ) const;
00133 Q_UINT32 qtRasterToWin32( Qt::RasterOp op ) const;
00134
00135
00136 private:
00137 KoWmfWritePrivate *d;
00138
00139 };
00140
00141 #endif
00142