krita

kis_double_widget.h

00001 /*
00002  *  kis_double_widget.h - part of Krita
00003  *
00004  *  Copyright (c) 1999 Carsten Pfeiffer <pfeiffer@kde.org>
00005  *  Copyright (c) 2004 Adrian Page <adrian@pagenet.plus.com>
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef KIS_DOUBLE_WIDGET_H
00023 #define KIS_DOUBLE_WIDGET_H
00024 
00025 #include <qwidget.h>
00026 #include <qslider.h>
00027 
00028 class QHBoxLayout;
00029 class KDoubleSpinBox;
00030 
00031 class KisDoubleWidget : public QWidget
00032 {
00033     Q_OBJECT
00034 
00035     typedef QWidget super;
00036 public:
00037     KisDoubleWidget(QWidget* parent = 0, const char* name = 0);
00038     KisDoubleWidget(double min, double max, QWidget* parent = 0, const char* name = 0);
00039     ~KisDoubleWidget();
00040 
00041     double value() const;
00042     void setRange(double min, double max);
00043 
00044     void setTickmarks(QSlider::TickSetting tickMarks);
00045     void setTickInterval(double tickInterval);
00046     double tickInterval() const;
00047 
00048     void setPrecision(int precision);
00049     void setLineStep(double step);
00050     void setPageStep(double step);
00051 
00052     void setTracking(bool tracking);
00053     bool tracking() const;
00054 
00055 signals:
00056     void valueChanged(double);
00057     void sliderPressed();
00058     void sliderReleased();
00059 
00060 public slots:
00061     void setValue(double value);
00062 
00063 protected slots:
00064     void setSliderValue(double);
00065     void sliderValueChanged(int);
00066 
00067 private:
00068     void init(double min, double max);
00069 
00070 protected:
00071     QHBoxLayout* m_layout;
00072     QSlider* m_slider;
00073     KDoubleSpinBox *m_spinBox;
00074 };
00075 
00076 #endif // KIS_DOUBLE_WIDGET_H
00077 
KDE Home | KDE Accessibility Home | Description of Access Keys