F:/KPlato/koffice/libs/kwmf/kowmfread.h

Aller à la documentation de ce fichier.
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., 51 Franklin Street, Fifth Floor,
00016  * Boston, MA 02110-1301, USA.
00017 */
00018 #ifndef _KOWMFREAD_H_
00019 #define _KOWMFREAD_H_
00020 
00021 #include <QPen>
00022 #include <QBrush>
00023 #include <QFont>
00024 #include <QColor>
00025 #include <QRect>
00026 #include <qregion.h>
00027 #include <QImage>
00028 #include <QMatrix>
00029 #include <QString>
00030 #include <q3ptrlist.h>
00031 #include <q3pointarray.h>
00032 #include <QPainter>
00033 
00034 #include <koffice_export.h>
00035 class KoWmfReadPrivate;
00036 
00047 class KOWMF_EXPORT KoWmfRead
00048 {
00049 public:
00050     KoWmfRead();
00051     virtual ~KoWmfRead();
00052 
00056     virtual bool load( const QString& fileName );
00057     virtual bool load( const QByteArray& array );
00058 
00062     virtual bool play(  );
00063 
00067     bool isStandard( void ) const;
00068     bool isPlaceable( void ) const;
00069     bool isEnhanced( void ) const;
00070     bool isValid( void ) const;
00071 
00078     virtual QRect boundingRect( void ) const;
00079 
00084     int defaultDpi( void ) const;
00085 
00091     void setDebug( int nbFunc );
00092 
00093     // -------------------------------------------------------------------------
00094     // A virtual QPainter : inherit those virtuals functions
00095     // for a good documentation : check QPainter documentation
00096     virtual bool  begin() = 0;
00097     virtual bool  end() = 0;
00098     virtual void  save() = 0;
00099     virtual void  restore() = 0;
00100 
00101     // Drawing tools
00102     virtual void  setFont( const QFont & ) = 0;
00103     // the pen : the width of the pen is in logical coordinate
00104     virtual void  setPen( const QPen &p ) = 0;
00105     virtual const QPen &pen() const = 0;
00106     virtual void  setBrush( const QBrush & ) = 0;
00107 
00108     // Drawing attributes/modes
00109     virtual void  setBackgroundColor( const QColor & ) = 0;
00110     virtual void  setBackgroundMode( Qt::BGMode ) = 0;
00111     virtual void  setCompositionMode( QPainter::CompositionMode ) = 0;
00112 
00113     // Change logical Coordinate
00114     // some wmf files call those functions several times in the middle of a drawing
00115     // others doesn't call setWindow* at all
00116     virtual void  setWindowOrg( int left, int top ) = 0;
00117     virtual void  setWindowExt( int width, int height ) = 0;
00118 
00119     // Clipping
00120     // the 'CoordinateMode' parameter is ommitted : always CoordPainter in wmf
00121     // setClipRegion() is often used with save() and restore() => implement all or none
00122     virtual void  setClipRegion( const QRegion & ) = 0;
00123     virtual QRegion clipRegion() = 0;
00124 
00125     // Graphics drawing functions
00126     virtual void  moveTo( int x, int y ) = 0;
00127     virtual void  lineTo( int x, int y ) = 0;
00128     virtual void  drawRect( int x, int y, int w, int h ) = 0;
00129     virtual void  drawRoundRect( int x, int y, int w, int h, int = 25, int = 25 ) = 0;
00130     virtual void  drawEllipse( int x, int y, int w, int h ) = 0;
00131     virtual void  drawArc( int x, int y, int w, int h, int a, int alen ) = 0;
00132     virtual void  drawPie( int x, int y, int w, int h, int a, int alen ) = 0;
00133     virtual void  drawChord( int x, int y, int w, int h, int a, int alen ) = 0;
00134     virtual void  drawPolyline( const QPolygon &pa ) = 0;
00135     virtual void  drawPolygon( const QPolygon &pa, bool winding=false ) = 0;
00136     // drawPolyPolygon draw the XOR of a list of polygons
00137     // listPa : list of polygons
00138     virtual void  drawPolyPolygon( Q3PtrList<QPolygon>& listPa, bool winding=false ) = 0;
00139     virtual void  drawImage( int x, int y, const QImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 ) = 0;
00140 
00141     // Text drawing functions
00142     // rotation = the degrees of rotation in counterclockwise
00143     // not yet implemented in KWinMetaFile
00144     virtual void  drawText( int x, int y, int w, int h, int flags, const QString &s, double rotation ) = 0;
00145 
00146     // matrix transformation : only used for bitmap manipulation
00147     virtual void  setMatrix( const QMatrix &, bool combine=false ) = 0;
00148 
00149 private:
00150     KoWmfReadPrivate  *mKwmf;
00151 
00152 };
00153 
00154 #endif
00155 

Généré le Wed Nov 22 23:41:13 2006 pour KPlato par  doxygen 1.5.1-p1