F:/KPlato/koffice/libs/kwmf/kowmfpaint.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 _KOWMFPAINT_H_
00019 #define _KOWMFPAINT_H_
00020 
00021 #include <QPainter>
00022 //Added by qt3to4:
00023 #include <QPolygon>
00024 #include <Q3PtrList>
00025 
00026 #include "kowmfread.h"
00027 #include <koffice_export.h>
00045 class KOWMF_EXPORT KoWmfPaint : public KoWmfRead
00046 {
00047 public:
00048     KoWmfPaint();
00049     ~KoWmfPaint() { }
00050 
00057     bool play( QPaintDevice& target, bool relativeCoord=false );
00058 
00059 
00060 private:
00061     // -------------------------------------------------------------------------
00062     // A virtual QPainter
00063     bool  begin();
00064     bool  end();
00065     void  save();
00066     void  restore();
00067 
00068     // Drawing tools
00069     void  setFont( const QFont& font );
00070     // the pen : the width of the pen is in logical coordinate
00071     void  setPen( const QPen& pen );
00072     const QPen& pen() const;
00073     void  setBrush( const QBrush& brush );
00074 
00075     // Drawing attributes/modes
00076     void  setBackgroundColor( const QColor& c );
00077     void  setBackgroundMode( Qt::BGMode mode );
00078     void  setCompositionMode( QPainter::CompositionMode mode );
00079 
00086     void  setWindowOrg( int left, int top );
00087     void  setWindowExt( int width, int height );
00088 
00089     // Clipping
00090     // the 'CoordinateMode' is ommitted : always CoordPainter in wmf
00091     // setClipRegion() is often used with save() and restore() => implement all or none
00092     void  setClipRegion( const QRegion &rec );
00093     QRegion clipRegion();
00094 
00095     // Graphics drawing functions
00096     void  moveTo( int x, int y );
00097     void  lineTo( int x, int y );
00098     void  drawRect( int x, int y, int w, int h );
00099     void  drawRoundRect( int x, int y, int w, int h, int = 25, int = 25 );
00100     void  drawEllipse( int x, int y, int w, int h );
00101     void  drawArc( int x, int y, int w, int h, int a, int alen );
00102     void  drawPie( int x, int y, int w, int h, int a, int alen );
00103     void  drawChord( int x, int y, int w, int h, int a, int alen );
00104     void  drawPolyline( const QPolygon& pa );
00105     void  drawPolygon( const QPolygon& pa, bool winding=false );
00110     void  drawPolyPolygon( Q3PtrList<QPolygon>& listPa, bool winding=false );
00111     void  drawImage( int x, int y, const QImage &, int sx = 0, int sy = 0, int sw = -1, int sh = -1 );
00112 
00113     // Text drawing functions
00114     // rotation = the degrees of rotation in counterclockwise
00115     // not yet implemented in KWinMetaFile
00116     void  drawText( int x, int y, int w, int h, int flags, const QString &s, double rotation );
00117 
00118     // matrix transformation : only used in some bitmap manipulation
00119     void  setMatrix( const QMatrix &, bool combine=false );
00120 
00121 private:
00122     QPainter mPainter;
00123     QPaintDevice *mTarget;
00124     bool  mRelativeCoord;
00125     // memorisation of WMF matrix transformation (in relative coordinate)
00126     QMatrix  mInternalWorldMatrix;
00127     QPoint mLastPos;
00128 
00129 };
00130 
00131 #endif

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