Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00055 #ifndef __PREFERENCESMANAGER_HPP__
00056 #define __PREFERENCESMANAGER_HPP__
00057
00058 #include <openfluid/dllexport.hpp>
00059
00060 #include <map>
00061 #include <iostream>
00062 #include <glibmm/keyfile.h>
00063
00064 namespace openfluid { namespace guicommon {
00065
00066
00067
00068
00069
00070 class DLLEXPORT PreferencesManager
00071 {
00072 private:
00073
00074 static PreferencesManager* mp_Instance;
00075
00076 static std::string m_FileName;
00077
00078 Glib::KeyFile* mp_KFile;
00079
00080 PreferencesManager();
00081
00082 void setDefaultValues();
00083
00084 void loadKeyFile();
00085
00086 public:
00087
00088 typedef std::map<std::string, std::string> MarketPlaces_t;
00089
00090 static PreferencesManager* getInstance();
00091
00092 ~PreferencesManager();
00093
00094 bool save();
00095
00096
00097
00098
00099
00100 static void setFileName(Glib::ustring AbsoluteFileName);
00101 std::string getFileName();
00102
00103 bool isValidKey(std::string Group, std::string Key);
00104
00105 void setLang(Glib::ustring Lang);
00106 Glib::ustring getLang();
00107
00108 void setRecentMax(unsigned int RecentMax);
00109 int getRecentMax();
00110
00111 bool
00112 addRecentProject(std::string ProjectPath, std::string ProjectName = "");
00113 void clearRecentProjects();
00114 std::vector<std::pair<std::string, std::string> > getRecentProjects();
00115
00116 void setWorkdir(Glib::ustring Workdir);
00117 Glib::ustring getWorkdir();
00118
00119 void setExtraPlugPaths(std::vector<Glib::ustring> ExtraPlugPaths);
00120 void addExtraPlugPath(Glib::ustring Path);
00121 void removeExtraPlugPath(Glib::ustring Path);
00122 std::vector<std::string> getExtraPlugPaths();
00123
00124 void setExtraExtensionPaths(std::vector<Glib::ustring> ExtraExtPaths);
00125 void addExtraExtensionPath(Glib::ustring Path);
00126 void removeExtraExtensionPath(Glib::ustring Path);
00127 std::vector<std::string> getExtraExtensionPaths();
00128
00129 void setDeltaT(unsigned int DeltaT);
00130 int getDeltaT();
00131
00132 void setBegin(std::string Begin);
00133 std::string getBegin();
00134
00135 void setEnd(std::string End);
00136 std::string getEnd();
00137
00138 void setOutFilesBufferInKB(unsigned int Buffer);
00139 int getOutFilesBufferInKB();
00140
00141 bool
00142 addMarketplace(Glib::ustring PlaceName, Glib::ustring PlaceUrl);
00143 void removeMarketplace(Glib::ustring PlaceName);
00144 MarketPlaces_t getMarketplaces();
00145
00146 std::string getPluginValue(std::string PluginName, std::string Key);
00147 void setPluginValue(std::string PluginName, std::string Key,
00148 std::string Value);
00149
00150 };
00151
00152 } }
00153
00154 #endif