00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GWEFACTORYOPTIONH
00026 #define GWEFACTORYOPTIONH
00027
00028 #include <qobject.h>
00029 #include <qstring.h>
00030 #include <qstringlist.h>
00031 #include <qdom.h>
00032 #include <qmap.h>
00033 #include <QList>
00034
00035 namespace GWE
00036 {
00037
00059 class GweFactoryOption : public QObject
00060 {
00061 Q_OBJECT
00062
00063 protected:
00064
00069 QString OptionName;
00070
00075 QString Description;
00076
00081 QString Value;
00082
00087 QMap<QString,GweFactoryOption*> SubOptions;
00088
00089 protected:
00090
00094 void deleteSubOption(const QString& option_name);
00095
00100 void deleteAllSubOptions();
00101
00102 public:
00103
00107 GweFactoryOption(const QString& option_name, const QString& value = 0, const QString& description = 0);
00108
00112 virtual ~GweFactoryOption();
00113
00117 QString getOptionName() const;
00118
00122 QString getDescription() const;
00123
00127 QString getValue() const;
00128
00132 bool hasSubOptions() const;
00133
00140 QList<GweFactoryOption*> getSubOptions() const;
00141
00145 GweFactoryOption* getSubOption(const QString& option_name);
00146
00150 QString getValueOfSubOption(const QString& option_name);
00151
00159 bool hasPredefinedValues() const;
00160
00167 virtual QStringList getPredefinedValues() const;
00168
00169 public slots:
00170
00176 virtual void updateTree();
00177
00182 virtual void setValue(const QString& value);
00183
00188 virtual void setDescription(const QString& description);
00189
00194 virtual void loadFromXml(const QDomElement& options);
00195
00200 virtual void saveToXml(QDomElement storage);
00201
00206 virtual void setValueOfSubOption(const QString& sub_option_name, const QString& value);
00207
00208 signals:
00209
00214 void valueChanged(const QString& new_value);
00215
00220 void treeUpdated();
00221
00222 };
00223
00224 }
00225
00226 #endif