src/include/common/spds/constants.h

00001 /*
00002  * Copyright (C) 2003-2007 Funambol
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018 
00019 
00020 
00021 #ifndef INCL_SPDS_CONSTANTS
00022 #define INCL_SPDS_CONSTANTS
00023 
00025 #include "base/fscapi.h"
00026 
00027 #define DIM_SOURCE_NAME      128
00028 #define DIM_SOURCE_URI        64
00029 #define DIM_KEY              256
00030 #define DIM_MIME_TYPE         64
00031 #define DIM_USERNAME         100
00032 #define DIM_PASSWORD         100
00033 #define DIM_DEVICE_ID         50
00034 #define DIM_SERVERNAME       100
00035 #define DIM_SYNC_MODES_LIST   64
00036 #define DIM_SYNC_MODE         16
00037 #define DIM_ANCHOR            32
00038 
00039 #define ERR_REPRESENTATION  700
00040 
00041 typedef enum SyncMode{
00042         SYNC_NONE                          = 000,
00043         SYNC_TWO_WAY                       = 200,
00044         SYNC_SLOW                          = 201,
00045         SYNC_ONE_WAY_FROM_CLIENT           = 202,
00046         SYNC_REFRESH_FROM_CLIENT           = 203,
00047         SYNC_ONE_WAY_FROM_SERVER           = 204,
00048         SYNC_REFRESH_FROM_SERVER           = 205,
00049         SYNC_TWO_WAY_BY_SERVER             = 206,
00050         SYNC_ONE_WAY_FROM_CLIENT_BY_SERVER = 207,
00051         SYNC_REFRESH_FROM_CLIENT_BY_SERVER = 208,
00052         SYNC_ONE_WAY_FROM_SERVER_BY_SERVER = 209,
00053         SYNC_REFRESH_FROM_SERVER_BY_SERVER = 210,
00054         //---Funambol extension-----------------
00055         SYNC_ADDR_CHANGE_NOTIFICATION      = 745
00056 } SyncMode;
00057 
00058 #define CONTEXT_SPDS_SYNCML  "/spds/syncml"
00059 #define CONTEXT_SPDS_SOURCES "/spds/sources"
00060 #define CONTEXT_CONN         "/Conn"
00061 #define CONTEXT_AUTH         "/Auth"
00062 #define CONTEXT_DEV_INFO     "/DevInfo"
00063 #define CONTEXT_DEV_DETAIL   "/DevDetail"
00064 #define CONTEXT_EXT          "/Ext"
00065 
00066 //-------------------------------------------------------
00067 // Status codes
00068 
00069 #define IN_PROGRESS                                   101
00070 #define OK                                            200
00071 #define ITEM_ADDED                                    201
00072 #define ACCEPTED_FOR_PROCESSING                       202
00073 #define NONAUTHORITATIVE_RESPONSE                     203
00074 #define NO_CONTENT                                    204
00075 #define RESET_CONTENT                                 205
00076 #define PARTIAL_CONTENT                               206
00077 #define CONFLICT_RESOLVED_WITH_MERGE                  207
00078 #define CONFLICT_RESOLVED_WITH_CLIENT_COMMAND_WINNING 208
00079 #define CONFLICT_RESOLVED_WITH_DUPLICATE              209
00080 #define DELETE_WITHOUT_ARCHIVE                        210
00081 #define ITEM_NOT_DELETED                              211
00082 #define AUTHENTICATION_ACCEPTED                       212
00083 #define CHUNKED_ITEM_ACCEPTED                         213
00084 #define OPERATION_CANCELLED_OK                        214
00085 #define NOT_EXECUTED                                  215
00086 #define ATOMIC_ROLLBACK_OK                            216
00087 #define MULTIPLE_CHOICES                              300
00088 #define MOVED_PERMANENTLY                             301
00089 #define FOUND                                         302
00090 #define SEE_ANOTHER_URI                               303
00091 #define NOT_MODIFIED                                  304
00092 #define USE_PROXY                                     305
00093 #define BAD_REQUEST                                   400
00094 #define INVALID_CREDENTIALS                           401
00095 #define PAYMENT_REQUIRED                              402
00096 #define FORBIDDEN                                     403
00097 #define NOT_FOUND                                     404
00098 #define COMMAND_NOT_ALLOWED                           405
00099 #define OPTIONAL_FEATURE_NOT_SUPPORTED                406
00100 #define MISSING_CREDENTIALS                           407
00101 #define REQUEST_TIMEOUT                               408
00102 #define UPDATE_CONFLICT                               409
00103 #define GONE                                          410
00104 #define SIZE_REQUIRED                                 411
00105 #define INCOMPLETE_COMMAND                            412
00106 #define REQUESTED_ENTITY_TOO_LARGE                    413
00107 #define URI_TOO_LONG                                  414
00108 #define UNSUPPORTED_MEDIA_TYPE                        415
00109 #define REQUESTED_SIZE_TOO_BIG                        416
00110 #define RETRY_LATER                                   417
00111 #define ALREADY_EXISTS                                418
00112 #define CONFLICT_RESOLVED_WITH_SERVER_DATA            419
00113 #define DEVICE_FULL                                   420
00114 #define UNKNOWN_SEARCH_GRAMMAR                        421
00115 #define BAD_CGI_SCRIPT                                422
00116 #define SOFT_DELETE_CONFLICT                          423
00117 #define OBJECT_SIZE_MISMATCH                          424
00118 #define PERMISSION_DENIED                             425
00119 #define COMMAND_FAILED                                500
00120 #define COMMAND_NOT_IMPLEMENTED                       501
00121 #define BAD_GATEWAY                                   502
00122 #define SERVICE_UNAVAILABLE                           503
00123 #define GATEWAY_TIMEOUT                               504
00124 #define VERSION_NOT_SUPPORTED                         505
00125 #define PROCESSING_ERROR                              506
00126 #define ATOMIC_FAILED                                 507
00127 #define REFRESH_REQUIRED                              508
00128 #define RECIPIENT_EXCEPTION_RESERVED1                 509
00129 #define DATASTORE_FAILURE                             510
00130 #define SERVER_FAILURE                                511
00131 #define SYNCHRONIZATION_FAILED                        512
00132 #define PROTOCOL_VERSION_NOT_SUPPORTED                513
00133 #define OPERATION_CANCELLED                           514
00134 #define ATOMIC_ROLLBACK_FAILED                        516
00135 #define ATOMIC_RESPONSE_TOO_LARGE_TO_FIT              517
00136 
00137 // ------------------------------------------------------
00138 
00139 //-------------------------------------------------------
00140 // Commands
00141 
00142 #define COMMAND_ADD     "Add"
00143 #define COMMAND_DELETE  "Delete"
00144 #define COMMAND_GET     "Get"
00145 #define COMMAND_PUT     "Put"
00146 #define COMMAND_REPLACE "Replace"
00147 #define COMMAND_RESULTS "Results"
00148 #define COMMAND_STATUS  "Status"
00149 #define COMMAND_SYNC    "Sync"
00150 
00151 //-------------------------------------------------------
00152 
00153 #ifndef NULL
00154     #define NULL 0x00
00155 #endif
00156 
00157 
00158 char*  retSyncMode(SyncMode) EXTRA_SECTION_01;
00159 
00161 #endif

Generated on Fri Apr 27 12:29:18 2007 for Funambol C++ Client Library by  doxygen 1.5.2