krita

kis_filter_configuration.h

00001 /*
00002  *  Copyright (c) 2006 Boudewijn Rempt <boud@valdyas.org>
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 #ifndef _KIS_FILTER_CONFIGURATION_H_
00019 #define _KIS_FILTER_CONFIGURATION_H_
00020 
00021 #include <qstring.h>
00022 #include <qmap.h>
00023 #include <qvariant.h>
00024 #include <kdebug.h>
00025 #include "koffice_export.h"
00026 
00027 class KisPreviewDialog;
00028 class KisProgressDisplayInterface;
00029 class KisFilterConfigWidget;
00030 class QWidget;
00031 
00038 class KRITACORE_EXPORT KisFilterConfiguration {
00039 
00040 public:
00041 
00045     KisFilterConfiguration(const QString & name, Q_INT32 version)
00046         : m_name(name)
00047         , m_version(version) {}
00048 
00052     KisFilterConfiguration(const KisFilterConfiguration & rhs);
00053             
00054 public:
00055 
00059     virtual void fromXML(const QString &);
00060 
00064     virtual QString toString();
00065 
00069     const QString & name() const;
00070 
00074     Q_INT32 version() const;
00075 
00079     virtual void setProperty(const QString & name, const QVariant & value);
00080 
00085     virtual bool getProperty(const QString & name, QVariant & value);
00086 
00087     virtual QVariant getProperty(const QString & name);
00088 
00089     int getInt(const QString & name, int def = 0);
00090     double getDouble(const QString & name, double def = 0.0);
00091     bool getBool(const QString & name, bool def = false);
00092     QString getString(const QString & name, QString def = QString::null);
00093     
00094 private:
00095         void dump();
00096     
00097 protected:
00098 
00099     QString m_name;
00100     Q_INT32 m_version;
00101     QMap<QString, QVariant> m_properties;
00102     
00103 };
00104 
00105 #endif // _KIS_FILTER_CONFIGURATION_H_
KDE Home | KDE Accessibility Home | Description of Access Keys