chalk

kis_multi_double_filter_widget.h
1/*
2 * Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef _KIS_MULTI_DOUBLE_FILTER_WIDGET_H_
20#define _KIS_MULTI_DOUBLE_FILTER_WIDGET_H_
21
22#include <vector>
23#include <knuminput.h>
24#include <kis_filter_config_widget.h>
25#include "koffice_export.h"
26
27class KisDelayedActionDoubleInput : public KDoubleNumInput
28{
29
30 TQ_OBJECT
31
32
33 public:
34
35 KisDelayedActionDoubleInput(TQWidget * parent, const char * name);
36
37 void cancelDelayedSignal();
38
39 private slots:
40 void slotValueChanged();
41 void slotTimeToUpdate();
42
43 signals:
44
45 void valueChangedDelayed(double value);
46
47 private:
48
49 TQTimer * m_timer;
50};
51
52
53struct KRITA_EXPORT KisDoubleWidgetParam {
54 KisDoubleWidgetParam( double nmin, double nmax, double ninitvalue, TQString label, TQString nname);
55 double min;
56 double max;
57 double initvalue;
58 TQString label;
59 TQString name;
60};
61
62typedef std::vector<KisDoubleWidgetParam> vKisDoubleWidgetParam;
63
64class KRITA_EXPORT KisMultiDoubleFilterWidget : public KisFilterConfigWidget
65{
66 TQ_OBJECT
67
68public:
69 KisMultiDoubleFilterWidget(TQWidget * parent, const char * name, const char * caption, vKisDoubleWidgetParam dwparam);
70 virtual void setConfiguration(KisFilterConfiguration * cfg);
71public:
72 inline TQ_INT32 nbValues() { return m_nbdoubleWidgets; };
73 inline double valueAt( TQ_INT32 i ) { return m_doubleWidgets[i]->value(); };
74private:
75 KisDelayedActionDoubleInput** m_doubleWidgets;
76 TQ_INT32 m_nbdoubleWidgets;
77};
78
79#endif
A KisFilterConfiguration is the serializable representation of the filter parameters.