krita

kis_multi_integer_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_INTEGER_FILTER_WIDGET_H_
00020 #define _KIS_MULTI_INTEGER_FILTER_WIDGET_H_
00021 
00022 #include <vector>
00023 
00024 #include <knuminput.h>
00025 #include <kis_filter_config_widget.h>
00026 #include "koffice_export.h"
00027 
00028 class KisDelayedActionIntegerInput : public KIntNumInput
00029 {
00030 
00031     Q_OBJECT
00032             
00033 public:
00034         
00035     KisDelayedActionIntegerInput(QWidget * parent, const char * name);
00036 
00037     void cancelDelayedSignal();
00038 
00039 private slots:
00040     void slotValueChanged();
00041     void slotTimeToUpdate();
00042 
00043 signals:
00044     
00045     void valueChangedDelayed(int value);
00046     
00047 private:
00048  
00049         QTimer * m_timer;
00050 };
00051 
00052 
00053 struct KisIntegerWidgetParam {
00054     KRITA_EXPORT KisIntegerWidgetParam(  Q_INT32 nmin, Q_INT32 nmax, Q_INT32 ninitvalue, QString label, QString nname);
00055     Q_INT32 min;
00056     Q_INT32 max;
00057     Q_INT32 initvalue;
00058     QString label;
00059     QString name;
00060 };
00061 
00062 typedef std::vector<KisIntegerWidgetParam> vKisIntegerWidgetParam;
00063 
00064 class KRITA_EXPORT KisMultiIntegerFilterWidget : public KisFilterConfigWidget
00065 {
00066     Q_OBJECT
00067 public:
00068     KisMultiIntegerFilterWidget(QWidget * parent,  const char * name, const char *caption, vKisIntegerWidgetParam iwparam);
00069 
00070     virtual void setConfiguration(KisFilterConfiguration * config);
00071     
00072 public:
00073     inline Q_INT32 nbValues() { return m_nbintegerWidgets; };
00074     inline Q_INT32 valueAt( Q_INT32 i ) { return m_integerWidgets[i]->value(); };
00075     
00076 private:
00077     Q_INT32 m_nbintegerWidgets;
00078     KisDelayedActionIntegerInput** m_integerWidgets;
00079 };
00080 
00081 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys