kivio

kivio_screen_painter.h

00001 /*
00002  * Kivio - Visual Modelling and Flowcharting
00003  * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00018  */
00019 #ifndef KIVIO_SCREEN_PAINTER_H
00020 #define KIVIO_SCREEN_PAINTER_H
00021 
00022 #include "kivio_painter.h"
00023 
00024 #include <qfont.h>
00025 #include <qpainter.h>
00026 #include <qpixmap.h>
00027 
00028 class KivioPoint;
00029 
00030 
00031 class KivioScreenPainter : public KivioPainter
00032 {
00033 protected:
00034     QPainter *m_pPainter;
00035     float m_transX, m_transY;
00036     int m_rotation;
00037 
00038 public:
00039     KivioScreenPainter();
00040     KivioScreenPainter(QPainter* painter);
00041     virtual ~KivioScreenPainter();
00042 
00043     virtual bool start( QPaintDevice * );
00044     virtual bool stop();
00045 
00046     QPainter *painter() { return m_pPainter; }
00047     void setPainter(QPainter* p) { m_pPainter = p; }
00048 
00049     /*\
00050     |*|
00051     |*| PRIMITIVE IMPLEMENTATIONS
00052     |*|
00053     |*|
00054     \*/
00055     void drawLine( float, float, float, float );
00056     void drawArc( float, float, float, float, float, float );
00057 
00058     void drawBezier( QPointArray & );
00059 
00060     void drawRect( float, float, float, float );
00061     void fillRect( float, float, float, float );
00062 
00063     void drawRoundRect( float, float, float, float, float, float );
00064     void fillRoundRect( float, float, float, float, float, float );
00065 
00066     void drawPie( float, float, float, float, float, float );
00067     void fillPie( float, float, float, float, float, float );
00068 
00069     void drawChord( float, float, float, float, float, float );
00070     void fillChord( float, float, float, float, float, float );
00071 
00072     void drawEllipse( float, float, float, float );
00073     void fillEllipse( float, float, float, float );
00074 
00075     void drawLineArray( QPtrList<KivioPoint> * );
00076 
00077 
00078     void drawPolyline( QPtrList<KivioPoint> * );
00079     void drawPolygon( QPtrList<KivioPoint> * );
00080 
00081     void drawPolyline( QPointArray & );
00082     void drawPolygon( QPointArray & );
00083     void drawLineArray( QPointArray & );
00084 
00085     void drawClosedPath( QPtrList<KivioPoint> * );
00086     void drawOpenPath( QPtrList<KivioPoint> * );
00087 
00088     void setFont( const QFont & );
00089     void drawText( int x, int y, int w, int h, int tf,
00090                 const QString &str );
00091     virtual QRect boundingRect( int, int, int, int, int, const QString & );
00092 
00093     void drawPixmap( float, float, const QPixmap & );
00094 
00095     void drawHandle( float, float, int );
00096     virtual void drawSelectionBox( const QRect& );
00097 
00098     virtual void saveState();
00099     virtual void restoreState();
00100     virtual void setTranslation(float, float);
00101     virtual void translateBy(float, float);
00102     virtual void setRotation(int);
00103     virtual void rotateBy(int);
00104     virtual int rotation();
00105 
00106     virtual void setWorldMatrix(QWMatrix, bool);
00107 };
00108 
00109 #endif
00110 
00111 
KDE Home | KDE Accessibility Home | Description of Access Keys