00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef NVEMSETTINGS_H
00012 #define NVEMSETTINGS_H
00013
00014 #include <memory>
00015
00016 #include <qmap.h>
00017 #include "nhostinfo.h"
00018
00019 class nvemFTP;
00020
00024 class nvemSettings
00025 {
00026 public:
00030 static nvemSettings& instance() { return *getInstance(); }
00031
00035 static const nvemSettings& const_instance() { return instance(); }
00036
00044 QString getSetting(const QString &key, const QString &setting, const QString &def = "");
00045
00054 int getSetting(const QString &key, const QString &setting, const int &def);
00055
00062 void setSetting(const QString &key, const QString &setting, const QString &val);
00063
00071 void setSetting(const QString &key, const QString &setting, const int &val);
00072
00079 int saveSettings();
00080
00087 int loadSettings();
00088
00090 void setMainWidget(nvemFTP *widget) { main = widget; };
00091
00093 nvemFTP *mainWidget() const { return main; };
00094
00096 void setStartUrl(NHostInfo newurl) { startUrl = newurl; }
00097
00099 NHostInfo getStartUrl() const { return startUrl; }
00100
00101
00102 protected:
00104 nvemSettings();
00106 ~nvemSettings();
00107
00108 private:
00109 typedef std::auto_ptr<nvemSettings> nvemSettingsPtr;
00111 static nvemSettingsPtr& getInstance();
00113 friend class std::auto_ptr<nvemSettings>;
00114
00116 nvemSettings(const nvemSettings&);
00118 nvemSettings& operator=(const nvemSettings&);
00119
00120
00121 QMap<QString, QMap<QString, QString> > n_settings;
00122 nvemFTP *main;
00123 NHostInfo startUrl;
00124 };
00125
00126 #endif // NVEMSETTINGS_H
00127