chalk

kis_filter_configuration.h
1/*
2 * Copyright (c) 2006 Boudewijn Rempt <boud@valdyas.org>
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#ifndef _KIS_FILTER_CONFIGURATION_H_
19#define _KIS_FILTER_CONFIGURATION_H_
20
21#include <tqstring.h>
22#include <tqmap.h>
23#include <tqvariant.h>
24#include <kdebug.h>
25#include "koffice_export.h"
26
27class KisPreviewDialog;
28class KisProgressDisplayInterface;
30class TQWidget;
31
38class KRITACORE_EXPORT KisFilterConfiguration {
39
40public:
41
45 KisFilterConfiguration(const TQString & name, TQ_INT32 version)
46 : m_name(name)
47 , m_version(version) {}
48
53
54public:
55
59 virtual void fromXML(const TQString &);
60
64 virtual TQString toString();
65
69 const TQString & name() const;
70
74 TQ_INT32 version() const;
75
79 virtual void setProperty(const TQString & name, const TQVariant & value);
80
85 virtual bool getProperty(const TQString & name, TQVariant & value);
86
87 virtual TQVariant getProperty(const TQString & name);
88
89 int getInt(const TQString & name, int def = 0);
90 double getDouble(const TQString & name, double def = 0.0);
91 bool getBool(const TQString & name, bool def = false);
92 TQString getString(const TQString & name, TQString def = TQString());
93
94private:
95 void dump();
96
97protected:
98
99 TQString m_name;
100 TQ_INT32 m_version;
101 TQStringVariantMap m_properties;
102
103};
104
105#endif // _KIS_FILTER_CONFIGURATION_H_
A KisFilterConfiguration is the serializable representation of the filter parameters.
const TQString & name() const
Get the unique, language independent name of the filter.
TQ_INT32 version() const
Get the version of the filter that has created this config.
KisFilterConfiguration(const TQString &name, TQ_INT32 version)
Create a new filter config.