diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2012-04-26 01:36:20 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2012-04-26 01:36:20 +0200 |
commit | 93f3acd128d6b349efe14e97b12c2703ca4f81f3 (patch) | |
tree | 937f3de2307444f0c28d6d21f26f1580e789b074 /libsowatch/configkey.h | |
parent | 1375a26b135547fdd8e07db62acf8116a8482560 (diff) | |
download | sowatch-93f3acd128d6b349efe14e97b12c2703ca4f81f3.tar.gz sowatch-93f3acd128d6b349efe14e97b12c2703ca4f81f3.zip |
Moved the core framework to GConf & D-Bus
Diffstat (limited to 'libsowatch/configkey.h')
-rw-r--r-- | libsowatch/configkey.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/libsowatch/configkey.h b/libsowatch/configkey.h new file mode 100644 index 0000000..ef7665e --- /dev/null +++ b/libsowatch/configkey.h @@ -0,0 +1,52 @@ +#ifndef SOWATCH_CONFIGKEY_H +#define SOWATCH_CONFIGKEY_H + +#include <QtCore/QObject> +#include <QtCore/QVariant> +#include <QtCore/QStringList> +#include "sowatch_global.h" + +namespace sowatch +{ + +class SOWATCH_EXPORT ConfigKey : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString key READ key CONSTANT) + Q_PROPERTY(QVariant value READ value WRITE set RESET unset NOTIFY changed USER true) + Q_PROPERTY(QStringList dirs READ dirs) + Q_PROPERTY(QStringList keys READ keys) + +public: + ConfigKey(QObject *parent = 0); + + virtual QString key() const = 0; + + virtual QVariant value() const = 0; + virtual void set(const QVariant& value) = 0; + virtual void unset() = 0; + virtual bool isSet() const = 0; + virtual bool isDir() const = 0; + + virtual QVariant value(const QString& subkey) const = 0; + virtual QVariant value(const QString& subkey, const QVariant& def) const = 0; + virtual void set(const QString& subkey, const QVariant& value) = 0; + virtual void unset(const QString& subkey) = 0; + virtual bool isSet(const QString& subkey) const = 0; + virtual bool isDir(const QString& subkey) const = 0; + + virtual QStringList dirs() const = 0; + virtual QStringList keys() const = 0; + + virtual void recursiveUnset() = 0; + + virtual ConfigKey* getSubkey(const QString& subkey, QObject *parent = 0) const = 0; + +signals: + void changed(); + void subkeyChanged(const QString& subkey); +}; + +} + +#endif // SOWATCH_CONFIGKEY_H |