kpresenter
KPrPBPreview.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef PBPREVIEW_H
00022 #define PBPREVIEW_H
00023
00024 #include "global.h"
00025
00026 #include <qframe.h>
00027
00028 #include "KPrGradient.h"
00029 #include <KoBrush.h>
00030 #include <KoPen.h>
00031
00032 class KoTextZoomHandler;
00033
00034
00035
00036
00037
00038 class KPrPBPreview : public QFrame
00039 {
00040 Q_OBJECT
00041
00042 public:
00043 enum PaintType {
00044 Pen,
00045 Brush,
00046 Gradient
00047 };
00048
00049 KPrPBPreview( QWidget* parent, const char* name, PaintType _paintType = Pen );
00050 ~KPrPBPreview();
00051 void setPen( const KoPen &_pen ) { pen = _pen; repaint( true ); }
00052 void setBrush( const QBrush &_brush ) { brush = _brush; repaint( true ); }
00053 void setLineBegin( LineEnd lb ) { lineBegin = lb; repaint( true ); }
00054 void setLineEnd( LineEnd le ) { lineEnd = le; repaint( true ); }
00055 void setGradient( KPrGradient *g ) { if ( g ) { gradient = g; } repaint( true ); }
00056 void setPaintType( PaintType pt ) { paintType = pt; repaint(true); }
00057
00058 void setGradient( const QColor &_c1, const QColor &_c2, BCType _t,
00059 bool _unbalanced, int _xfactor, int _yfactor );
00060 void setColor1( const QColor &_color ) { gradient->setColor1( _color ); repaint( false ); }
00061 void setColor2( const QColor &_color ) { gradient->setColor2( _color ); repaint( false ); }
00062 void setBackColorType( BCType _type ) { gradient->setBackColorType( _type ); repaint( false ); }
00063 void setUnbalanced( bool b ) { gradient->setUnbalanced( b ); repaint( false ); }
00064 void setXFactor( int i ) { gradient->setXFactor( i ); repaint( false ); }
00065 void setYFactor( int i ) { gradient->setYFactor( i ); repaint( false ); }
00066
00067 protected:
00068 void drawContents( QPainter *p );
00069 void resizeEvent( QResizeEvent *e );
00070
00071 private:
00072 PaintType paintType;
00073 KoPen pen;
00074 QBrush brush;
00075 LineEnd lineBegin, lineEnd;
00076 KPrGradient *gradient;
00077 KPrGradient *savedGradient;
00078 KoTextZoomHandler *_zoomHandler;
00079 };
00080
00081
00082 #endif
|