chalk

kis_multi_integer_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_INTEGER_FILTER_WIDGET_H_
20#define _KIS_MULTI_INTEGER_FILTER_WIDGET_H_
21
22#include <vector>
23
24#include <knuminput.h>
25#include <kis_filter_config_widget.h>
26#include "koffice_export.h"
27
28class KisDelayedActionIntegerInput : public KIntNumInput
29{
30
31 TQ_OBJECT
32
33
34public:
35
36 KisDelayedActionIntegerInput(TQWidget * parent, const char * name);
37
38 void cancelDelayedSignal();
39
40private slots:
41 void slotValueChanged();
42 void slotTimeToUpdate();
43
44signals:
45
46 void valueChangedDelayed(int value);
47
48private:
49
50 TQTimer * m_timer;
51};
52
53
54struct KisIntegerWidgetParam {
55 KRITA_EXPORT KisIntegerWidgetParam( TQ_INT32 nmin, TQ_INT32 nmax, TQ_INT32 ninitvalue, TQString label, TQString nname);
56 TQ_INT32 min;
57 TQ_INT32 max;
58 TQ_INT32 initvalue;
59 TQString label;
60 TQString name;
61};
62
63typedef std::vector<KisIntegerWidgetParam> vKisIntegerWidgetParam;
64
65class KRITA_EXPORT KisMultiIntegerFilterWidget : public KisFilterConfigWidget
66{
67 TQ_OBJECT
68
69public:
70 KisMultiIntegerFilterWidget(TQWidget * parent, const char * name, const char *caption, vKisIntegerWidgetParam iwparam);
71
72 virtual void setConfiguration(KisFilterConfiguration * config);
73
74public:
75 inline TQ_INT32 nbValues() { return m_nbintegerWidgets; };
76 inline TQ_INT32 valueAt( TQ_INT32 i ) { return m_integerWidgets[i]->value(); };
77
78private:
79 TQ_INT32 m_nbintegerWidgets;
80 KisDelayedActionIntegerInput** m_integerWidgets;
81};
82
83#endif