00001
00011
00012
00013 #ifndef IMEDGINE_SETTINGS_H
00014 #define IMEDGINE_SETTINGS_H
00015
00016 #include <string>
00017 #include <QVariant>
00018
00019 class QSettings;
00020 class QString;
00021
00022 namespace imedgine {
00023
00024
00027
00028
00043
00044
00045 class Settings{
00046
00047 public:
00048
00049
00052
00053 virtual ~Settings();
00054
00055
00061
00062 static Settings* const getInstance();
00063
00064
00069
00070 void setValue(const QString& key, const QVariant& value);
00071
00072
00080
00081 void setValue(const std::string& key, const std::string& value);
00082
00083
00091
00092 void setValue(const std::string& key, const int value);
00093
00094
00102
00103 void setValue(const std::string& key, const double value);
00104
00105
00116
00117 QVariant getValue(const QString& key, const QVariant& default_value = QVariant()) const;
00118
00119
00130
00131 std::string getStringValue(const std::string& key, const std::string& default_value = "") const;
00132
00133
00144
00145 int getIntValue(const std::string& key, const int default_value = 0) const;
00146
00147
00158
00159 double getDoubleValue(const std::string& key, const double default_value = 0.0) const;
00160
00161 private:
00162
00163
00166
00167 Settings();
00168
00169
00172
00173 Settings(const Settings& src);
00174
00175 static Settings* settings_instance_;
00176
00177 QSettings* q_settings_;
00178
00179 };
00180
00181 }
00182
00183 #endif