From 93f3acd128d6b349efe14e97b12c2703ca4f81f3 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Thu, 26 Apr 2012 01:36:20 +0200 Subject: Moved the core framework to GConf & D-Bus --- libsowatch/configkey.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 libsowatch/configkey.h (limited to 'libsowatch/configkey.h') 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 +#include +#include +#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 -- cgit v1.2.3