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 00036 #ifndef INCL_SYNC_ITEM_STATUS 00037 #define INCL_SYNC_ITEM_STATUS 00038 00040 #include "base/fscapi.h" 00041 #include "base/constants.h" 00042 #include "base/util/ArrayElement.h" 00043 #include "spds/constants.h" 00044 00045 00046 class SyncItemStatus : public ArrayElement { 00047 00048 private: 00049 00050 int cmdID ; 00051 int msgRef; 00052 int cmdRef; 00053 char* cmd ; 00054 char* key ; 00055 int data ; 00056 00057 public: 00058 /* 00059 * Default constructor 00060 */ 00061 SyncItemStatus(); 00062 00063 /* 00064 * Constructs a new SyncItemStatus identified by the given key. The key must 00065 * not be longer than DIM_KEY_SYNC_ITEM_STATUS (see SPDS Constants). 00066 * 00067 * @param key - the key 00068 */ 00069 SyncItemStatus(char* key); 00070 00071 ~SyncItemStatus(); 00072 00073 /* 00074 * Returns the SyncItemStatus's key. If key is NULL, the internal buffer is 00075 * returned; if key is not NULL, the value is copied in the caller 00076 * allocated buffer and the given buffer pointer is returned. 00077 */ 00078 const char* getKey(); 00079 00080 /* 00081 * Changes the SyncItemStatus key. The key must not be longer than DIM_KEY_SYNC_ITEM_STATUS 00082 * (see SPDS Constants). 00083 * 00084 * @param key - the key 00085 */ 00086 void setKey(const char* key); 00087 00088 /* 00089 * Returns the SyncItemStatus's command name. If cmd is NULL, the internal buffer is 00090 * returned; if cmd is not NULL, the value is copied in the caller 00091 * allocated buffer and the given buffer pointer is returned. 00092 */ 00093 const char* getCmd(); 00094 00095 /* 00096 * Changes the SyncItemStatus cmd. The cmd must not be longer than DIM_COMMAND_SYNC_ITEM_STATUS 00097 * (see SPDS Constants). 00098 * 00099 * @param cmd - the cmd 00100 */ 00101 void setCmd(const char* cmd); 00102 00103 00104 /* 00105 * Sets the SyncItemStatus data. The passed data are copied into an 00106 * internal variable. 00107 */ 00108 void setData(int data); 00109 00110 /* 00111 * Returns the SyncItemStatus data variable. 00112 */ 00113 int getData(); 00114 00115 00116 /* 00117 * Sets the SyncItemStatus command ID. The passed data are copied into an 00118 * internal variable. 00119 */ 00120 void setCmdID(int cmdId); 00121 00122 /* 00123 * Returns the SyncItemStatus command ID variable. 00124 */ 00125 int getCmdID(); 00126 00127 /* 00128 * Sets the SyncItemStatus message referring. The passed data are copied into an 00129 * internal variable. 00130 */ 00131 void setMsgRef(int msgRef); 00132 00133 /* 00134 * Returns the SyncItemStatus message referring variable. 00135 */ 00136 int getMsgRef(); 00137 00138 /* 00139 * Sets the SyncItemStatus command referring. The passed data are copied into an 00140 * internal variable. 00141 */ 00142 void setCmdRef(int cmdRef); 00143 00144 /* 00145 * Returns the SyncItemStatus command referring variable. 00146 */ 00147 int getCmdRef(); 00148 00154 ArrayElement* clone(); 00155 00156 }; 00157 00159 #endif