kpresenter
KPrBrushProperty.h
00001 /* This file is part of the KDE project 00002 Copyright (C) 2005 Thorsten Zachmann <zachmann@kde.org> 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 as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 */ 00019 #ifndef BRUSHSTYLEWIDGET_H 00020 #define BRUSHSTYLEWIDGET_H 00021 00022 #include <qbrush.h> 00023 #include <qwidget.h> 00024 00025 #include "KPrCommand.h" 00026 00027 class BrushPropertyUI; 00028 class GradientPropertyUI; 00029 class KPrPBPreview; 00030 00031 class QWidgetStack; 00032 00033 class KComboBox; 00034 00035 00036 class KPrBrushProperty : public QWidget 00037 { 00038 Q_OBJECT 00039 public: 00040 KPrBrushProperty( QWidget *parent, const char *name, const KPrBrushCmd::Brush &brush ); 00041 ~KPrBrushProperty(); 00042 00043 int getBrushPropertyChange() const; 00044 KPrBrushCmd::Brush getBrush() const; 00045 00046 void setBrush( KPrBrushCmd::Brush &brush ); 00047 00048 void apply(); 00049 00050 protected: 00051 FillType getFillType() const; 00052 QBrush getQBrush() const; 00053 00054 QColor getGColor1() const; 00055 QColor getGColor2() const; 00056 BCType getGType() const; 00057 bool getGUnbalanced() const; 00058 int getGXFactor() const; 00059 int getGYFactor() const; 00060 00061 void setQBrush( const QBrush &brush ); 00062 void setGradient( const QColor &_c1, const QColor &_c2, BCType _t, 00063 bool _unbalanced, int _xfactor, int _yfactor ); 00064 void setUnbalancedEnabled( bool state ); 00065 00066 KComboBox *m_typeCombo; 00067 QWidgetStack *m_stack; 00068 BrushPropertyUI *m_brushUI; 00069 GradientPropertyUI *m_gradientUI; 00070 KPrPBPreview *m_preview_color; 00071 KPrPBPreview *m_preview_gradient; 00072 00073 KPrBrushCmd::Brush m_brush; 00074 00075 protected slots: 00076 void slotReset(); 00077 void slotTypeChanged( int pos ); 00078 void slotBrushChanged(); 00079 00080 void slotColor1Changed(); 00081 void slotColor2Changed(); 00082 void slotBackColorTypeChanged(); 00083 void slotUnbalancedChanged(); 00084 void slotXFactorChanged(); 00085 void slotYFactorChanged(); 00086 }; 00087 00088 #endif /* BRUSHSTYLEWIDGET_H */