Introduce QtUiStyleSettings and make highlight color configurable again
[quassel.git] / src / common / settings.h
index f2e0d38..9ad960d 100644 (file)
@@ -1,11 +1,11 @@
 /***************************************************************************
- *   Copyright (C) 2005-07 by The Quassel Team                             *
+ *   Copyright (C) 2005-08 by the Quassel Project                          *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
+ *   (at your option) version 3.                                           *
  *                                                                         *
  *   This program is distributed in the hope that it will be useful,       *
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 #ifndef _SETTINGS_H_
 #define _SETTINGS_H_
 
-#include <QtCore>
+#include <QString>
+#include <QVariant>
+#include <QSettings>
 
-class Settings {
+class Settings : private QSettings {
 
   public:
-    //Settings();
-    //~Settings();
-    static void init();
-    static void setProfile(const QString &string);
-    static QString profile();
+    virtual ~Settings();
 
-    static void setGuiValue(const QString &key, const QVariant &value);
-    static QVariant guiValue (const QString &key, const QVariant &defaultValue = QVariant());
-    static void setCoreValue(const QString &user, const QString &key, const QVariant &value);
-    static QVariant coreValue (const QString &user, const QString& key, const QVariant &defaultValue = QVariant());
+    //static void setGuiValue(QString, QVariant) {};
+    //static QVariant guiValue(QString, QVariant = QVariant()) { return QVariant(); }
 
-  private:
-    static QString curProfile;
+    enum Mode { Default, Custom };
+
+  protected:
+    Settings(QString group, QString applicationName);
+
+    void setGroup(QString group);
+
+    virtual QStringList allLocalKeys();
+    virtual QStringList localChildKeys(const QString &rootkey = QString());
+    virtual QStringList localChildGroups(const QString &rootkey = QString());
+
+    virtual void setLocalValue(const QString &key, const QVariant &data);
+    virtual QVariant localValue(const QString &key, const QVariant &def = QVariant());
+
+    virtual void removeLocalKey(const QString &key);
+
+    QString group;
 
 };
 
-//extern Settings *settings;
+
 
 #endif