kpresenter
KPrGradient.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef kpgradient_h
00022 #define kpgradient_h
00023
00024 #include <qcolor.h>
00025 #include <KoBrush.h>
00026 #include <kpixmap.h>
00027 #include "global.h"
00028
00029 class QPainter;
00030 class KoTextZoomHandler;
00031
00040 class KPrGradient
00041 {
00042 public:
00043 KPrGradient( const QColor &_color1, const QColor &_color2, BCType _bcType,
00044 bool _unbalanced, int _xfactor, int _yfactor );
00045 ~KPrGradient() {}
00046
00047 QColor getColor1() const { return color1; }
00048 QColor getColor2() const { return color2; }
00049 BCType getBackColorType() const { return bcType; }
00050 bool getUnbalanced() const { return unbalanced; }
00051 int getXFactor() const { return xFactor; }
00052 int getYFactor() const { return yFactor; }
00053
00054 void setColor1( const QColor &_color ) { color1 = _color; m_bDirty = true; }
00055 void setColor2( const QColor &_color ) { color2 = _color; m_bDirty = true; }
00056 void setBackColorType( BCType _type ) { bcType = _type; m_bDirty = true; }
00057 void setUnbalanced( bool b ) { unbalanced = b; m_bDirty = true; }
00058 void setXFactor( int i ) { xFactor = i; m_bDirty = true; }
00059 void setYFactor( int i ) { yFactor = i; m_bDirty = true; }
00060 void setSize( const QSize& _size )
00061 {
00062 if ( size() != _size ) {
00063 m_pixmap.resize( _size );
00064 m_bDirty = true;
00065 }
00066 }
00067
00068
00069 void setParameters(const QColor &c1, const QColor &c2, BCType _type,
00070 bool _unbalanced, int xf, int yf);
00071
00075 const QPixmap& pixmap() const;
00076 QSize size() const { return m_pixmap.size(); }
00077
00078 void addRef();
00079 bool removeRef();
00080
00081 protected:
00083 void paint();
00084
00085 KPrGradient() {}
00086
00087 QColor color1, color2;
00088 BCType bcType;
00089
00090 KPixmap m_pixmap;
00091 int refCount;
00092 int xFactor, yFactor;
00093 bool unbalanced;
00094 bool m_bDirty;
00095 };
00096
00097 #endif
|