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>
00022 #include <QBrush>
00023 #include <QColor>
00024 #include <QFont>
00025 #include <QRect>
00026 #include <QBuffer>
00027 #include <qregion.h>
00028 #include <QString>
00029 #include <QMatrix>
00030 #include <QImage>
00031 #include <q3ptrlist.h>
00032 #include <q3pointarray.h>
00033 #include <koffice_export.h>
00034 #include <QPainter>
00035 class KoWmfWritePrivate;
00036
00050 class KOWMF_EXPORT KoWmfWrite
00051 {
00052 public:
00053 KoWmfWrite( const QString& fileName );
00054 virtual ~KoWmfWrite();
00055
00056
00057
00058
00059
00063 bool begin();
00067 bool end();
00068 void save();
00069 void restore();
00070
00076 void setDefaultDpi( int dpi );
00077
00078
00079 void setFont( const QFont& f );
00080
00081 void setPen( const QPen& p );
00082 void setBrush( const QBrush& b );
00083
00084
00085 void setBackgroundColor( const QColor& r );
00086 void setBackgroundMode( Qt::BGMode );
00087 void setCompositionMode( QPainter::CompositionMode );
00088
00089
00090 void setWindow( int left, int top , int width, int height );
00091
00092
00093
00094
00095 void setClipRegion( const QRegion& r );
00096 void clipping( bool enable );
00097
00098
00099 void moveTo( int left, int top );
00100 void lineTo( int left, int top );
00101 void drawRect( int left, int top, int width, int height );
00102 void drawRoundRect( int left, int top, int width, int height, int = 25, int = 25 );
00103 void drawEllipse( int left, int top, int width, int height );
00104 void drawArc( int left, int top, int width, int height, int a, int alen );
00105 void drawPie( int left, int top, int width, int height, int a, int alen );
00106 void drawChord( int left, int top, int width, int height, int a, int alen );
00107 void drawPolyline( const QPolygon& pa );
00108 void drawPolygon( const QPolygon& pa, bool winding=false );
00109
00110
00111 void drawPolyPolygon( Q3PtrList<QPolygon>& listPa, bool winding=false );
00112 void drawImage( int left, int top, const QImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 );
00113
00114
00115
00116
00117 void drawText( int x, int y, int w, int h, int flags, const QString &s, double rotation );
00118
00119 private:
00120
00121
00122
00124 void pointArray( const QPolygon& pa );
00125
00127 quint32 winColor( QColor color );
00128
00130 void angleToxy( int& xStart, int& yStart, int& xEnd, int& yEnd, int a, int alen );
00131
00133 quint16 qtRasterToWin16( QPainter::CompositionMode op ) const;
00134 quint32 qtRasterToWin32( QPainter::CompositionMode op ) const;
00135
00136
00137 private:
00138 KoWmfWritePrivate *d;
00139
00140 };
00141
00142 #endif
00143