lib Library API Documentation

kowmfread.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 _KOWMFREAD_H_ 00019 #define _KOWMFREAD_H_ 00020 00021 #include <qpen.h> 00022 #include <qbrush.h> 00023 #include <qfont.h> 00024 #include <qcolor.h> 00025 #include <qrect.h> 00026 #include <qregion.h> 00027 #include <qimage.h> 00028 #include <qwmatrix.h> 00029 #include <qstring.h> 00030 #include <qptrlist.h> 00031 #include <qpointarray.h> 00032 00033 class KoWmfReadPrivate; 00034 00045 class KoWmfRead 00046 { 00047 public: 00048 KoWmfRead(); 00049 virtual ~KoWmfRead(); 00050 00054 virtual bool load( const QString& fileName ); 00055 virtual bool load( const QByteArray& array ); 00056 00060 virtual bool play( ); 00061 00065 bool isStandard( void ) const; 00066 bool isPlaceable( void ) const; 00067 bool isEnhanced( void ) const; 00068 bool isValid( void ) const; 00069 00076 virtual QRect boundingRect( void ) const; 00077 00082 int defaultDpi( void ) const; 00083 00089 void setDebug( int nbFunc ); 00090 00091 // ------------------------------------------------------------------------- 00092 // A virtual QPainter : inherit those virtuals functions 00093 // for a good documentation : check QPainter documentation 00094 virtual bool begin() = 0; 00095 virtual bool end() = 0; 00096 virtual void save() = 0; 00097 virtual void restore() = 0; 00098 00099 // Drawing tools 00100 virtual void setFont( const QFont & ) = 0; 00101 // the pen : the width of the pen is in logical coordinate 00102 virtual void setPen( const QPen &p ) = 0; 00103 virtual const QPen &pen() const = 0; 00104 virtual void setBrush( const QBrush & ) = 0; 00105 00106 // Drawing attributes/modes 00107 virtual void setBackgroundColor( const QColor & ) = 0; 00108 virtual void setBackgroundMode( Qt::BGMode ) = 0; 00109 virtual void setRasterOp( Qt::RasterOp ) = 0; 00110 00111 // Change logical Coordinate 00112 // some wmf files call those functions several times in the middle of a drawing 00113 // others doesn't call setWindow* at all 00114 virtual void setWindowOrg( int left, int top ) = 0; 00115 virtual void setWindowExt( int width, int height ) = 0; 00116 00117 // Clipping 00118 // the 'CoordinateMode' parameter is ommitted : always CoordPainter in wmf 00119 // setClipRegion() is often used with save() and restore() => implement all or none 00120 virtual void setClipRegion( const QRegion & ) = 0; 00121 virtual QRegion clipRegion() = 0; 00122 00123 // Graphics drawing functions 00124 virtual void moveTo( int x, int y ) = 0; 00125 virtual void lineTo( int x, int y ) = 0; 00126 virtual void drawRect( int x, int y, int w, int h ) = 0; 00127 virtual void drawRoundRect( int x, int y, int w, int h, int = 25, int = 25 ) = 0; 00128 virtual void drawEllipse( int x, int y, int w, int h ) = 0; 00129 virtual void drawArc( int x, int y, int w, int h, int a, int alen ) = 0; 00130 virtual void drawPie( int x, int y, int w, int h, int a, int alen ) = 0; 00131 virtual void drawChord( int x, int y, int w, int h, int a, int alen ) = 0; 00132 virtual void drawPolyline( const QPointArray &pa ) = 0; 00133 virtual void drawPolygon( const QPointArray &pa, bool winding=FALSE ) = 0; 00134 // drawPolyPolygon draw the XOR of a list of polygons 00135 // listPa : list of polygons 00136 virtual void drawPolyPolygon( QPtrList<QPointArray>& listPa, bool winding=FALSE ) = 0; 00137 virtual void drawImage( int x, int y, const QImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 ) = 0; 00138 00139 // Text drawing functions 00140 // rotation = the degrees of rotation in counterclockwise 00141 // not yet implemented in KWinMetaFile 00142 virtual void drawText( int x, int y, int w, int h, int flags, const QString &s, double rotation ) = 0; 00143 00144 // matrix transformation : only used for bitmap manipulation 00145 virtual void setWorldMatrix( const QWMatrix &, bool combine=FALSE ) = 0; 00146 00147 private: 00148 KoWmfReadPrivate *mKwmf; 00149 00150 }; 00151 00152 #endif 00153
KDE Logo
This file is part of the documentation for lib Library Version 1.3.5.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Nov 17 06:54:19 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003