summaryrefslogtreecommitdiff
path: root/libsowatch/gconfkey.h
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2012-04-26 01:36:20 +0200
committerJavier S. Pedro <maemo@javispedro.com>2012-04-26 01:36:20 +0200
commit93f3acd128d6b349efe14e97b12c2703ca4f81f3 (patch)
tree937f3de2307444f0c28d6d21f26f1580e789b074 /libsowatch/gconfkey.h
parent1375a26b135547fdd8e07db62acf8116a8482560 (diff)
downloadsowatch-93f3acd128d6b349efe14e97b12c2703ca4f81f3.tar.gz
sowatch-93f3acd128d6b349efe14e97b12c2703ca4f81f3.zip
Moved the core framework to GConf & D-Bus
Diffstat (limited to 'libsowatch/gconfkey.h')
-rw-r--r--libsowatch/gconfkey.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/libsowatch/gconfkey.h b/libsowatch/gconfkey.h
new file mode 100644
index 0000000..c9074ea
--- /dev/null
+++ b/libsowatch/gconfkey.h
@@ -0,0 +1,54 @@
+#ifndef SOWATCH_GCONFKEY_H
+#define SOWATCH_GCONFKEY_H
+
+#include "configkey.h"
+
+namespace sowatch
+{
+
+class SOWATCH_EXPORT GConfKey : public ConfigKey
+{
+ Q_OBJECT
+
+public:
+ GConfKey(const QString& key, QObject *parent = 0);
+ ~GConfKey();
+
+ QString key() const;
+
+ QVariant value() const;
+ void set(const QVariant& value);
+ void unset();
+ bool isSet() const;
+ bool isDir() const;
+
+ QVariant value(const QString& subkey) const;
+ QVariant value(const QString& subkey, const QVariant& def) const;
+ void set(const QString& subkey, const QVariant& value);
+ void unset(const QString& subkey);
+ bool isSet(const QString& subkey) const;
+ bool isDir(const QString& subkey) const;
+
+ QStringList dirs() const;
+ QStringList keys() const;
+
+ void recursiveUnset();
+
+ ConfigKey* getSubkey(const QString& subkey, QObject *parent = 0) const;
+
+ void notifyChanged(const QString& key);
+
+protected:
+ void connectNotify(const char *signal);
+
+private:
+ QString _key;
+ uint _notify;
+
+ QString fullpath(const QString& subkey = QString()) const;
+ QByteArray getNativeKey() const;
+};
+
+}
+
+#endif // SOWATCH_CONFIGKEY_H