src/include/common/spds/DeviceConfig.h

00001 /*
00002  * Funambol is a mobile platform developed by Funambol, Inc. 
00003  * Copyright (C) 2003 - 2007 Funambol, Inc.
00004  * 
00005  * This program is free software; you can redistribute it and/or modify it under
00006  * the terms of the GNU Affero General Public License version 3 as published by
00007  * the Free Software Foundation with the addition of the following permission 
00008  * added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED
00009  * WORK IN WHICH THE COPYRIGHT IS OWNED BY FUNAMBOL, FUNAMBOL DISCLAIMS THE 
00010  * WARRANTY OF NON INFRINGEMENT  OF THIRD PARTY RIGHTS.
00011  * 
00012  * This program is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00015  * details.
00016  * 
00017  * You should have received a copy of the GNU Affero General Public License 
00018  * along with this program; if not, see http://www.gnu.org/licenses or write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00020  * MA 02110-1301 USA.
00021  * 
00022  * You can contact Funambol, Inc. headquarters at 643 Bair Island Road, Suite 
00023  * 305, Redwood City, CA 94063, USA, or at email address info@funambol.com.
00024  * 
00025  * The interactive user interfaces in modified source and object code versions
00026  * of this program must display Appropriate Legal Notices, as required under
00027  * Section 5 of the GNU Affero General Public License version 3.
00028  * 
00029  * In accordance with Section 7(b) of the GNU Affero General Public License
00030  * version 3, these Appropriate Legal Notices must retain the display of the
00031  * "Powered by Funambol" logo. If the display of the logo is not reasonably 
00032  * feasible for technical reasons, the Appropriate Legal Notices must display
00033  * the words "Powered by Funambol".
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 
00045 BEGIN_NAMESPACE
00046 
00047 /*
00048  * ---------------------------- DeviceConfig class -------------------------------
00049  * This class groups all configuration properties related to the device.
00050  * Most of DeviceConfig properties are used to generate the
00051  * <DevInf> element for client capabilities.
00052  * DeviceConfig is a part of SyncManagerConfig (along with AccessConfig
00053  * and an array of SyncSourceConfig).
00054  */
00055 class DeviceConfig {
00056 
00057     private:
00058 
00059         char*         man          ;
00060         char*         mod          ;
00061         char*         oem          ;
00062         char*         fwv          ;
00063         char*         swv          ;
00064         char*         hwv          ;
00065         char*         devID        ;
00066         char*         devType      ;
00067         char*         dsV          ;
00068         bool          utc          ;
00069         bool          loSupport    ;
00070         bool          nocSupport   ;
00071         LogLevel      logLevel     ;
00072         unsigned int  maxObjSize   ;
00073         char*         devInfHash   ;
00074         // 0 success true
00075                 // 1 false
00076                 // 2 cannot determinate
00077                 int          smartSlowSync;
00078                 char*            verDTD;
00079 
00080 
00088         void set(char* * buf, const char*  v);
00089 
00090 
00091     public:
00092 
00093         DeviceConfig();
00094         DeviceConfig(DeviceConfig& s);
00095         ~DeviceConfig();
00096 
00097 
00109         const char*  getMan() const            ;
00110         void setMan(const char*  v)            ;
00111 
00112         const char*  getMod() const            ;
00113         void setMod(const char*  v)            ;
00114 
00115         const char*  getOem() const            ;
00116         void setOem(const char*  v)            ;
00117 
00118         const char*  getFwv() const            ;
00119         void setFwv(const char*  v)            ;
00120 
00121         const char*  getSwv() const            ;
00122         void setSwv(const char*  v)            ;
00123 
00124         const char*  getHwv() const            ;
00125         void setHwv(const char*  v)            ;
00126 
00127         const char*  getDevID() const          ;
00128         void setDevID(const char*  v)          ;
00129 
00130         const char*  getDevType() const        ;
00131         void setDevType(const char*  v)        ;
00132 
00133         const char*  getDsV() const            ;
00134         void setDsV(const char*  v)            ;
00135 
00136         bool getUtc() const                    ;
00137         void setUtc(bool v)                    ;
00138 
00139         bool getLoSupport() const              ;
00140         void setLoSupport(bool v)              ;
00141 
00142         bool getNocSupport() const             ;
00143         void setNocSupport(bool v)             ;
00144 
00145         LogLevel getLogLevel() const           ;
00146         void setLogLevel(LogLevel v)           ;
00147 
00148         unsigned int getMaxObjSize() const     ;
00149         void setMaxObjSize(unsigned int v)     ;
00150 
00151         const char*  getDevInfHash() const     ;
00152         void setDevInfHash(const char *v)     ;
00153 
00154         int getSmartSlowSync() const;
00155         void setSmartSlowSync(int v);
00156 
00157                 const char*  getVerDTD() const        ;
00158         void setVerDTD(const char*  v)        ;
00159 
00166         void assign(const DeviceConfig& s);
00167 
00168         /*
00169          * Assign operator
00170          */
00171         DeviceConfig& operator = (const DeviceConfig& dc) {
00172             assign(dc);
00173             return *this;
00174         }
00175 };
00176 
00177 
00178 END_NAMESPACE
00179 
00181 #endif

Generated on Wed Jan 14 17:15:36 2009 for Funambol C++ Client Library by  doxygen 1.5.2