OpenMW
apps/opencs/model/settings/settingcontainer.hpp
Go to the documentation of this file.
00001 #ifndef SETTINGCONTAINER_HPP
00002 #define SETTINGCONTAINER_HPP
00003 
00004 #include <QObject>
00005 
00006 class QStringList;
00007 
00008 namespace CSMSettings
00009 {
00010     class SettingContainer : public QObject
00011     {
00012         Q_OBJECT
00013 
00014         QString *mValue;
00015         QStringList *mValues;
00016 
00017     public:
00018 
00019         explicit SettingContainer (QObject *parent = 0);
00020         explicit SettingContainer (const QString &value, QObject *parent = 0);
00021 
00024         void insert (const QString &value);
00025 
00028         void update (const QString &value, int index = 0);
00029 
00031         QString getValue (int index = -1) const;
00032 
00034         inline QStringList *getValues() const  { return mValues; }
00035 
00037         int count() const;
00038 
00041         inline bool isEmpty() const            { return (!mValue && !mValues); }
00042 
00043         inline bool isMultiValue() const       { return (mValues); }
00044     };
00045 }
00046 
00047 #endif // SETTINGCONTAINER_HPP