Architecture changed to allow easier addition of new phone books. Norwegian phonebook...
[jenirok] / src / common / settings.h
index 51bdf6c..c732299 100644 (file)
 #define SETTINGS_H
 
 #include <QtCore/QString>
-#include <QCoreApplication>
+#include <QtCore/QList>
+#include <QtGui/QApplication>
 
 class Settings;
 
 class Settings
 {
-       Q_DECLARE_TR_FUNCTIONS(Settings)
+    Q_DECLARE_TR_FUNCTIONS(Settings)
 
 public:
-       static Settings* instance();
-       bool set(QString const& name, QString const& value);
-       QString get(QString const& name);
-       QString getDefaultValue(QString const& name);
-       bool reset();
+
+    enum ConnectionType {ALWAYS_ASK, WLAN, GPRS, ANY};
+
+    struct Language
+    {
+        QString name;
+        QString id;
+    };
+
+    static Settings* instance();
+    static void getLanguages(QList<Language>& languages);
+    ~Settings();
+    static void close();
+    void startEdit();
+    void endEdit();
+    void loadLanguage(QApplication& app);
+    bool set(QString const& name, QString const& value);
+    QString get(QString const& name);
+    QString getDefaultValue(QString const& name);
+    ConnectionType getConnectionType();
+    bool reset();
 
 private:
-       Settings();
-       static Settings* instance_;
+    Settings();
+    static Settings* instance_;
+    bool editing_;
 
 };