lib Library API Documentation

kowmfpaint.h

00001 /* This file is part of the KDE libraries 00002 * Copyright (c) 2003 thierry lorthiois (lorthioist@wanadoo.fr) 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Library General Public 00006 * License version 2 as published by the Free Software Foundation. 00007 * 00008 * This library is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 * Library General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU Library General Public License 00014 * along with this library; see the file COPYING.LIB. If not, write to 00015 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00016 * Boston, MA 02111-1307, USA. 00017 */ 00018 #ifndef _KOWMFPAINT_H_ 00019 #define _KOWMFPAINT_H_ 00020 00021 #include <qpainter.h> 00022 00023 #include "kowmfread.h" 00024 00042 class KoWmfPaint : public KoWmfRead 00043 { 00044 public: 00045 KoWmfPaint(); 00046 ~KoWmfPaint() { } 00047 00054 bool play( QPaintDevice& target, bool relativeCoord=false ); 00055 00056 00057 private: 00058 // ------------------------------------------------------------------------- 00059 // A virtual QPainter 00060 bool begin(); 00061 bool end(); 00062 void save(); 00063 void restore(); 00064 00065 // Drawing tools 00066 void setFont( const QFont& font ); 00067 // the pen : the width of the pen is in logical coordinate 00068 void setPen( const QPen& pen ); 00069 const QPen& pen() const; 00070 void setBrush( const QBrush& brush ); 00071 00072 // Drawing attributes/modes 00073 void setBackgroundColor( const QColor& c ); 00074 void setBackgroundMode( Qt::BGMode mode ); 00075 void setRasterOp( Qt::RasterOp op ); 00076 00083 void setWindowOrg( int left, int top ); 00084 void setWindowExt( int width, int height ); 00085 00086 // Clipping 00087 // the 'CoordinateMode' is ommitted : always CoordPainter in wmf 00088 // setClipRegion() is often used with save() and restore() => implement all or none 00089 void setClipRegion( const QRegion &rec ); 00090 QRegion clipRegion(); 00091 00092 // Graphics drawing functions 00093 void moveTo( int x, int y ); 00094 void lineTo( int x, int y ); 00095 void drawRect( int x, int y, int w, int h ); 00096 void drawRoundRect( int x, int y, int w, int h, int = 25, int = 25 ); 00097 void drawEllipse( int x, int y, int w, int h ); 00098 void drawArc( int x, int y, int w, int h, int a, int alen ); 00099 void drawPie( int x, int y, int w, int h, int a, int alen ); 00100 void drawChord( int x, int y, int w, int h, int a, int alen ); 00101 void drawPolyline( const QPointArray& pa ); 00102 void drawPolygon( const QPointArray& pa, bool winding=FALSE ); 00107 void drawPolyPolygon( QPtrList<QPointArray>& listPa, bool winding=FALSE ); 00108 void drawImage( int x, int y, const QImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 ); 00109 00110 // Text drawing functions 00111 // rotation = the degrees of rotation in counterclockwise 00112 // not yet implemented in KWinMetaFile 00113 void drawText( int x, int y, int w, int h, int flags, const QString &s, double rotation ); 00114 00115 // matrix transformation : only used in some bitmap manipulation 00116 void setWorldMatrix( const QWMatrix &, bool combine=FALSE ); 00117 00118 private: 00119 QPainter mPainter; 00120 QPaintDevice *mTarget; 00121 bool mRelativeCoord; 00122 // memorisation of WMF matrix transformation (in relative coordinate) 00123 QWMatrix mInternalWorldMatrix; 00124 00125 }; 00126 00127 #endif
KDE Logo
This file is part of the documentation for lib Library Version 1.3.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Sep 28 04:04:03 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003