krita

kis_multi_double_filter_widget.h

00001 /*
00002  *  Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program 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
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #ifndef _KIS_MULTI_DOUBLE_FILTER_WIDGET_H_
00020 #define _KIS_MULTI_DOUBLE_FILTER_WIDGET_H_
00021 
00022 #include <vector>
00023 #include <knuminput.h>
00024 #include <kis_filter_config_widget.h>
00025 #include "koffice_export.h"
00026 
00027 class KisDelayedActionDoubleInput : public KDoubleNumInput
00028 {
00029 
00030     Q_OBJECT
00031             
00032     public:
00033         
00034         KisDelayedActionDoubleInput(QWidget * parent, const char * name);
00035 
00036         void cancelDelayedSignal();
00037 
00038     private slots:
00039         void slotValueChanged();
00040         void slotTimeToUpdate();
00041 
00042     signals:
00043     
00044         void valueChangedDelayed(double value);
00045     
00046     private:
00047  
00048         QTimer * m_timer;
00049 };
00050 
00051 
00052 struct KRITA_EXPORT KisDoubleWidgetParam {
00053     KisDoubleWidgetParam(  double nmin, double nmax, double ninitvalue, QString label, QString nname);
00054     double min;
00055     double max;
00056     double initvalue;
00057     QString label;
00058     QString name;
00059 };
00060 
00061 typedef std::vector<KisDoubleWidgetParam> vKisDoubleWidgetParam;
00062 
00063 class KRITA_EXPORT KisMultiDoubleFilterWidget : public KisFilterConfigWidget
00064 {
00065     Q_OBJECT
00066 public:
00067     KisMultiDoubleFilterWidget(QWidget * parent, const char * name, const char * caption, vKisDoubleWidgetParam dwparam);
00068     virtual void setConfiguration(KisFilterConfiguration * cfg);
00069 public:
00070     inline Q_INT32 nbValues() { return m_nbdoubleWidgets; };
00071     inline double valueAt( Q_INT32 i ) { return m_doubleWidgets[i]->value(); };
00072 private:
00073     KisDelayedActionDoubleInput** m_doubleWidgets;
00074     Q_INT32 m_nbdoubleWidgets;
00075 };
00076 
00077 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys