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 #ifndef INCL_DEVICE_CONFIG
00036 #define INCL_DEVICE_CONFIG
00037
00039 #include "base/fscapi.h"
00040 #include "spds/constants.h"
00041 #include "syncml/core/VerDTD.h"
00042 #include "base/Log.h"
00043 #include "base/globalsdef.h"
00044 #include "base/util/ArrayList.h"
00045 #include "syncml/core/DataStore.h"
00046
00047 BEGIN_NAMESPACE
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 class DeviceConfig {
00058
00059 private:
00060
00061 char* man ;
00062 char* mod ;
00063 char* oem ;
00064 char* fwv ;
00065 char* swv ;
00066 char* hwv ;
00067 char* devID ;
00068 char* devType ;
00069 char* dsV ;
00070 bool utc ;
00071 bool loSupport ;
00072 bool nocSupport ;
00073 LogLevel logLevel ;
00074 unsigned int maxObjSize ;
00075 char* devInfHash ;
00076
00077
00078 int smartSlowSync;
00079 int multipleEmailAccount;
00080
00081 char* verDTD;
00082 bool sendDevInfo;
00083
00084
00085 bool forceServerDevInfo;
00086 char* serverLastSyncURL;
00087 ArrayList* dataStores;
00088
00093 unsigned int dirty;
00094
00095
00103 void set(char* * buf, const char* v);
00104
00105 public:
00106
00107 DeviceConfig();
00108 DeviceConfig(DeviceConfig& s);
00109 ~DeviceConfig();
00110
00111
00123 const char* getMan() const ;
00124 void setMan(const char* v) ;
00125
00126 const char* getMod() const ;
00127 void setMod(const char* v) ;
00128
00129 const char* getOem() const ;
00130 void setOem(const char* v) ;
00131
00132 const char* getFwv() const ;
00133 void setFwv(const char* v) ;
00134
00135 const char* getSwv() const ;
00136 void setSwv(const char* v) ;
00137
00138 const char* getHwv() const ;
00139 void setHwv(const char* v) ;
00140
00141 const char* getDevID() const ;
00142 void setDevID(const char* v) ;
00143
00144 const char* getDevType() const ;
00145 void setDevType(const char* v) ;
00146
00147 const char* getDsV() const ;
00148 void setDsV(const char* v) ;
00149
00150 bool getUtc() const ;
00151 void setUtc(bool v) ;
00152
00153 bool getLoSupport() const ;
00154 void setLoSupport(bool v) ;
00155
00156 bool getNocSupport() const ;
00157 void setNocSupport(bool v) ;
00158
00159 LogLevel getLogLevel() const ;
00160 void setLogLevel(LogLevel v) ;
00161
00162 unsigned int getMaxObjSize() const ;
00163 void setMaxObjSize(unsigned int v) ;
00164
00165 const char* getDevInfHash() const ;
00166 void setDevInfHash(const char *v) ;
00167
00168 int getSmartSlowSync() const;
00169 void setSmartSlowSync(int v);
00170
00171 int getMultipleEmailAccount() const;
00172 void setMultipleEmailAccount(int v);
00173
00174 const char* getVerDTD() const ;
00175 void setVerDTD(const char* v) ;
00176
00177 bool getSendDevInfo() const ;
00178 void setSendDevInfo(bool) ;
00179
00180 bool getForceServerDevInfo() const ;
00181 void setForceServerDevInfo(bool) ;
00182
00183 const char* getServerLastSyncURL() const;
00184 void setServerLastSyncURL(const char *v);
00185
00192 void setDataStores(const ArrayList* dataStores);
00193
00200 void resetDataStores();
00201
00206 const ArrayList* getDataStores() const;
00207
00209 void addDataStore(DataStore* dataStore);
00210
00215 DataStore* getDataStore(const char* sourceRef);
00216
00218 unsigned int getDirty() const;
00219
00221 bool isDirty(const unsigned int flags);
00222
00224 void setDirty(const unsigned int flags);
00225
00232 void assign(const DeviceConfig& s);
00233
00234
00235
00236
00237 DeviceConfig& operator = (const DeviceConfig& dc) {
00238 assign(dc);
00239 return *this;
00240 }
00241 };
00242
00243
00244 END_NAMESPACE
00245
00247 #endif