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 #ifndef MMSCONFIGDATA_H_
00034 #define MMSCONFIGDATA_H_
00035
00036 #include "mmstools/mmstypes.h"
00037 #include "mmstools/mmsdbconnmgr.h"
00038
00039 using namespace std;
00040
00041
00042 class MMSConfigDataGlobal {
00043 public:
00044 string logfile;
00045 string inputmap;
00046 string prefix;
00047 string theme;
00048 string sysconfig;
00049 string data;
00050 bool stdout;
00051 int inputinterval;
00052 string firstplugin;
00053 bool shutdown;
00054 string shutdowncmd;
00055 string inputmode;
00056 string actmonaddress;
00057 unsigned int actmonport;
00058
00059 MMSConfigDataGlobal() :
00060 logfile("/tmp/mmscore"),
00061 inputmap("default"),
00062 prefix(""),
00063 theme("default"),
00064 sysconfig(""),
00065 data(""),
00066 stdout(false),
00067 inputinterval(0),
00068 firstplugin("<none>"),
00069 shutdown(false),
00070 shutdowncmd(""),
00071 inputmode(""),
00072 actmonaddress("127.0.0.1"),
00073 actmonport(9999) {}
00074 };
00075
00076 class MMSConfigDataDB {
00077 public:
00078 string dbms;
00079 string address;
00080 unsigned int port;
00081 string user;
00082 string password;
00083 string database;
00084
00085 MMSConfigDataDB(const string database = "") :
00086 dbms(DBMS_SQLITE3),
00087 address(""),
00088 port(0),
00089 user(""),
00090 password(""),
00091 database("") {}
00092 };
00093
00094 class MMSConfigDataLayer {
00095 public:
00096 MMSFBOutputType outputtype;
00097 int id;
00098 MMSFBRectangle rect;
00099 MMSFBSurfacePixelFormat pixelformat;
00100 string options;
00101 string buffermode;
00102
00103 MMSConfigDataLayer() :
00104 outputtype(MMSFB_OT_XSHM),
00105 id(0),
00106 rect(MMSFBRectangle(50,50,800,600)),
00107 pixelformat(MMSFB_PF_RGB32),
00108 options(""),
00109 buffermode("BACKSYSTEM") {}
00110 };
00111
00112 class MMSConfigDataGraphics {
00113 public:
00114 MMSFBBackend backend;
00115 MMSConfigDataLayer videolayer;
00116 MMSConfigDataLayer graphicslayer;
00117 MMSFBRectangle vrect;
00118 MMSFBRectangle touchrect;
00119 MMSFBPointerMode pointer;
00120 MMSFBSurfacePixelFormat graphicswindowpixelformat;
00121 MMSFBSurfacePixelFormat graphicssurfacepixelformat;
00122 bool extendedaccel;
00123 string allocmethod;
00124 MMSFBFullScreenMode fullscreen;
00125 int rotatescreen;
00126 bool hideapplication;
00127 bool initialload;
00128 bool debugframes;
00129 bool touchSwapX;
00130 bool touchSwapY;
00131 bool touchSwapXY;
00132
00133 MMSConfigDataGraphics() :
00134 backend(MMSFB_BE_X11),
00135 vrect(MMSFBRectangle(0,0,0,0)),
00136 touchrect(MMSFBRectangle(0,0,0,0)),
00137 pointer(MMSFB_PM_FALSE),
00138 graphicswindowpixelformat(MMSFB_PF_NONE),
00139 graphicssurfacepixelformat(MMSFB_PF_NONE),
00140 extendedaccel(true),
00141 allocmethod(""),
00142 fullscreen(MMSFB_FSM_FALSE),
00143 rotatescreen(0),
00144 hideapplication(false),
00145 initialload(false),
00146 debugframes(false),
00147 touchSwapX(false),
00148 touchSwapY(false),
00149 touchSwapXY(false) {}
00150 };
00151
00152 class MMSConfigDataLanguage {
00153 public:
00154 MMSLanguage sourcelang;
00155 MMSLanguage defaulttargetlang;
00156 bool addtranslations;
00157 string languagefiledir;
00158
00159 MMSConfigDataLanguage() :
00160 sourcelang(MMSLANG_NONE),
00161 defaulttargetlang(MMSLANG_NONE),
00162 addtranslations(false),
00163 languagefiledir("") {}
00164 };
00165
00166 class MMSConfigData {
00167 private:
00168 static MMSConfigDataGlobal global;
00169 static MMSConfigDataDB configdb, datadb;
00170 static MMSConfigDataGraphics graphics;
00171 static MMSConfigDataLanguage language;
00172
00173 public:
00174
00175 MMSConfigData(MMSConfigDataGlobal global,
00176 MMSConfigDataDB configdb,
00177 MMSConfigDataDB datadb,
00178 MMSConfigDataGraphics graphics,
00179 MMSConfigDataLanguage language);
00180
00181
00182 MMSConfigData();
00183 ~MMSConfigData();
00184
00185
00186 const string getLogfile();
00187 const string getInputMap();
00188 const string getPrefix();
00189 const string getTheme();
00190 const string getSysConfig();
00191 const string getData();
00192 const bool getStdout();
00193 const int getInputInterval();
00194 const string getFirstPlugin();
00195 const bool getShutdown();
00196 const string getShutdownCmd();
00197 const string getInputMode();
00198 const string getActMonAddress();
00199 const unsigned int getActMonPort();
00200
00201
00202 const string getConfigDBDBMS();
00203 const string getConfigDBAddress();
00204 const unsigned int getConfigDBPort();
00205 const string getConfigDBUser();
00206 const string getConfigDBPassword();
00207 const string getConfigDBDatabase();
00208 const string getDataDBDBMS();
00209 const string getDataDBAddress();
00210 const unsigned int getDataDBPort();
00211 const string getDataDBUser();
00212 const string getDataDBPassword();
00213 const string getDataDBDatabase();
00214
00215
00216 const MMSConfigDataLayer getVideoLayer();
00217 const MMSConfigDataLayer getGraphicsLayer();
00218 const MMSFBBackend getBackend();
00219 const MMSFBRectangle getVRect();
00220 const MMSFBRectangle getTouchRect();
00221 const MMSFBPointerMode getPointer();
00222 const MMSFBSurfacePixelFormat getGraphicsWindowPixelformat();
00223 const MMSFBSurfacePixelFormat getGraphicsSurfacePixelformat();
00224 const bool getExtendedAccel();
00225 const string getAllocMethod();
00226 const MMSFBFullScreenMode getFullScreen();
00227 const int getRotateScreen();
00228 const bool getHideApplication();
00229 const bool getInitialLoad();
00230 const bool getDebugFrames();
00231 const bool getTouchSwapX();
00232 const bool getTouchSwapY();
00233 const bool getTouchSwapXY();
00234
00235
00236 void setVideoLayer(MMSConfigDataLayer layer);
00237 void setGraphicsLayer(MMSConfigDataLayer layer);
00238 void setFullScreen(MMSFBFullScreenMode fsm);
00239 void setRotateScreen(int rs);
00240 void setHideApplication(bool hideapplication);
00241 void setInitialLoad(bool initialload);
00242 void setDebugFrames(bool debugframes);
00243
00244
00245 const MMSLanguage getSourceLang();
00246 const MMSLanguage getDefaultTargetLang();
00247 const bool getAddTranslations();
00248 const string getLanguagefileDir();
00249
00250 };
00251
00252 #endif
00253