karbon

vcolorslider.h

00001 /* This file is part of the KDE project
00002    Made by Tomislav Lukman (tomislav.lukman@ck.tel.hr)
00003    Copyright (C) 2002, The Karbon Developers
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library 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 GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 /* vcolorslider.h */
00022 #ifndef VCOLORSLIDER_H
00023 #define VCOLORSLIDER_H
00024 
00025 #include <qwidget.h>
00026 
00027 class QLabel;
00028 class KIntSpinBox;
00029 class KGradientSelector;
00030 
00035 class VColorSlider : public QWidget
00036 {
00037     Q_OBJECT
00038 public:
00045     VColorSlider( QWidget* parent = 0L, const char* name = 0L );
00046 
00059     VColorSlider( const QString& label, const QColor& col1, const QColor& col2,
00060         int min, int max, int value, QWidget* parent = 0L, const char* name = 0L );
00061     
00063     ~VColorSlider();
00064     
00070     bool isDragging() { return m_isDragging; }
00071 public slots:
00072     
00078     virtual void setLabel( const QString& label );
00079     
00086     virtual void setColors( const QColor& color1, const QColor& color2 );
00087     
00093     virtual void setValue( int value );
00094 
00100     virtual void setMinValue( int value );
00101     
00107     virtual void setMaxValue( int value );
00108     
00114     int value();
00115 
00116 private:
00117     void init();
00118     bool eventFilter( QObject *obj, QEvent *ev );
00119     QLabel* m_label;
00120     KIntSpinBox* m_spinBox;
00121     KGradientSelector* m_gradientSelect;
00122     bool m_isDragging;
00123     int m_minValue;
00124     int m_maxValue;
00125 
00126 signals:
00133     void valueChanged( int value );
00134 
00135 private slots:
00136     void updateFrom_spinBox( int );
00137     void updateFrom_gradientSelect( int );
00138 };
00139 
00140 #endif
00141 
KDE Home | KDE Accessibility Home | Description of Access Keys