4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: JuHak Park <juhaki.park@samsung.com>,
7 * JuneHyuk Lee <junhyuk7.lee@samsung.com>,
8 * SunBong Ha <sunbong.ha@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
29 * For any sort of issue you concern as to this software,
30 * you may use following point of contact.
31 * All resources contributed on this software
32 * are orinigally written by S-Core Inc., a member of Samsung Group.
34 * SeongWon Shim <seongwon.shim@samsung.com>
38 * @Common_Define_Internal.h
40 * @brief This file is the header file of defined common structure for using between SE and SA
43 #ifndef COMMON_DEFINE_INTERNAL_H_
44 #define COMMON_DEFINE_INTERNAL_H_
52 /*#define COMMUNICATION_TYPE ENCODING_XML*/
53 #define COMMUNICATION_TYPE ENCODING_WBXML_12
55 #define TRANSPORT_TYPE 1 /*http*/
56 /*#define TRANSPORT_TYPE "FW_MOBEX"*/ /*mobex -> does not support in OMA*/
58 #define NETWORK_TIMEOUT 30
60 #define PKG_NAME "oma-ds-service"
61 #define DEFINE_PLATFORM 1
63 #define OMA_DS_MSG_PATH "/tmp/Msg"
64 #define OMA_DS_CSC_CHECK_PATH "/opt/data/oma-ds/csc_check"
66 #define ELEMENT_TEXT_VCARD "text/x-vcard"
67 #define ELEMENT_TEXT_VCARD_30 "text/vcard"
68 #define ELEMENT_TEXT_VCAL "text/x-vcalendar"
69 #define ELEMENT_TEXT_ICAL "text/calendar"
70 #define ELEMENT_TEXT_PLAIN "text/plain"
71 #define ELEMENT_TEXT_MESSAGE "text/x-vMessage"
73 #define DEFINE_ALERT_SLOW_SYNC_STR "Full"
74 #define DEFINE_ALERT_TWO_WAY_STR "Update both"
75 #define DEFINE_ALERT_ONE_WAY_FROM_CLIENT_STR "Update to server"
76 #define DEFINE_ALERT_ONE_WAY_FROM_SERVER_STR "Update to phone"
77 #define DEFINE_ALERT_REFRESH_FROM_SERVER_STR "Refresh from server"
78 #define DEFINE_ALERT_REFRESH_FROM_CLIENT_STR "Refresh from phone"
80 #define DEFINE_ALERT_SLOW_SYNC_VALUE "201"
81 #define DEFINE_ALERT_TWO_WAY_VALUE "200"
82 #define DEFINE_ALERT_ONE_WAY_FROM_CLIENT_VALUE "202"
83 #define DEFINE_ALERT_ONE_WAY_FROM_SERVER_VALUE "204"
84 #define DEFINE_ALERT_REFRESH_FROM_SERVER_VALUE "205"
85 #define DEFINE_ALERT_REFRESH_FROM_CLIENT_VALUE "203"
88 #define DEFINE_CONFIG_KEY_PROFILE_SERVER_ID "Server_id"
89 #define DEFINE_CONFIG_KEY_PROFILE_SYNC_MODE "Sync_mode"
90 #define DEFINE_CONFIG_KEY_PROFILE_SERVER_IP "Server_ip"
91 #define DEFINE_CONFIG_KEY_PROFILE_NEXT_NONCE "Next_nonce"
92 #define DEFINE_CONFIG_KEY_PROFILE_DIR_NAME "Dir_name"
93 #define DEFINE_CONFIG_KEY_PROFILE_SYNCHRONISING "Synchronising"
94 #define DEFINE_CONFIG_KEY_PROFILE_NAME "Name"
95 #define DEFINE_CONFIG_KEY_PROFILE_SYNC_TYPE "Sync_type"
96 #define DEFINE_CONFIG_KEY_PROFILE_SYNC_INTERVAL "Sync_interval"
97 #define DEFINE_CONFIG_KEY_PROFILE_CATEGORY_CONTACTS "Contacts"
98 #define DEFINE_CONFIG_KEY_PROFILE_CATEGORY_CALENDAR "Organizer"
99 #define DEFINE_CONFIG_KEY_PROFILE_CATEGORY_MEMO "Memo"
100 #define DEFINE_CONFIG_KEY_PROFILE_CATEGORY_CALLLOG "CallLog"
101 #define DEFINE_CONFIG_KEY_PROFILE_CATEGORY_SOURCE "source"
102 #define DEFINE_CONFIG_KEY_PROFILE_CATEGORY_TARGET "target"
103 #define DEFINE_CONFIG_KEY_PROFILE_CATEGORY_ID "id"
104 #define DEFINE_CONFIG_KEY_PROFILE_CATEGORY_PASSWORD "password"
105 #define DEFINE_CONFIG_KEY_PROFILE_LAST_SESSION_STATUS "Last_session_status"
106 #define DEFINE_CONFIG_KEY_PROFILE_LAST_SESSION_TIME "Last_session_time"
107 #define DEFINE_CONFIG_KEY_PROFILE_STATISTICS_DBSYNCED "dbSynced"
108 #define DEFINE_CONFIG_KEY_PROFILE_STATISTICS_LAST_TIME "last_session_time"
109 #define DEFINE_CONFIG_KEY_PROFILE_STATISTICS_TOTAL "numberOfChanges"
110 #define DEFINE_CONFIG_KEY_PROFILE_STATISTICS_NROFADD "add_count"
111 #define DEFINE_CONFIG_KEY_PROFILE_STATISTICS_NROFDELETE "delete_count"
112 #define DEFINE_CONFIG_KEY_PROFILE_STATISTICS_NROFREPLACE "replace_count"
113 #define DEFINE_CONFIG_KEY_PROFILE_STATISTICS_SERVER "server"
114 #define DEFINE_CONFIG_KEY_PROFILE_STATISTICS_CLIENT "client"
115 #define DEFINE_CONFIG_KEY_PROFILE_ALARM_ID "Alarm_id"
117 #define DEFINE_SYNC_MODE_MANUAL "Manual"
118 #define DEFINE_SYNC_MODE_PUSH "Push"
119 #define DEFINE_SYNC_MODE_PERIODIC "Periodic"
121 #define DEFINE_SOURCE_CONTACT_URI "Contacts"
122 #define DEFINE_SOURCE_CALENDAR_URI "Organizer"
123 #define DEFINE_SOURCE_MEMO_URI "Memo"
124 #define DEFINE_SOURCE_CALLLOG_URI "CallLog"
126 #define DEFINE_CALLLOG_SERVER_URL_HTTPS "https://www.xxxxx.com/sync"
127 #define DEFINE_CALLLOG_SERVER_URL_HTTP "http://www.xxxxx.com/sync"
128 #define DEFINE_CALLLOG_DEFAULT_NEXT_NONCE "pcwds"
131 SYNC_SESSION_NOT_SYNCED_YET = -1,
132 SYNC_SESSION_FAILED = 0,
133 SYNC_SESSION_SUCCEEDED = 1,
134 SYNC_SESSION_STOPPED = 2,
135 SYNC_SESSION_SYNCHRONIZING = 3
142 ALERT_SLOW_SYNC = 201,
143 ALERT_ONE_WAY_FROM_CLIENT = 202,
144 ALERT_REFRESH_FROM_CLIENT = 203,
145 ALERT_ONE_WAY_FROM_SERVER = 204,
146 ALERT_REFRESH_FROM_SERVER = 205,
147 ALERT_TWO_WAY_BY_SERVER = 206,
148 ALERT_ONE_WAY_FROM_CLIENT_BY_SERVER = 207,
149 ALERT_REFRESH_FROM_CLIENT_BY_SERVER = 208,
150 ALERT_ONE_WAY_FROM_SERVER_BY_SERVER = 209,
151 ALERT_REFRESH_FROM_SERVER_BY_SERVER = 210,
153 ALERT_NEXT_MESSAGE = 222,
154 ALERT_NO_END_OF_DATA = 223
176 COMMON_MISCONFIGURATION = 200,
177 COMMON_AUTHENTICATION_ERROR = 201,
178 COMMON_NOT_FOUND = 202,
179 COMMON_NO_MEMORY = 203,
180 COMMON_INTERNAL_ERROR = 204,
181 COMMON_SERVER_ERROR = 205,
182 COMMON_CONNECTION_ERROR = 206,
183 COMMON_AUTOCONFIG_NOT_SUPPORT_BY_SERVER = 207,
184 COMMON_BUSY_SIGNALING = 208,
190 SyncSessionResult sessionResult;
191 unsigned int numberOfChange;
192 unsigned int received_count;
193 unsigned int add_count;
194 unsigned int replace_count;
195 unsigned int delete_count;
200 * @brief Data Store information
201 * relevant information about Data Store\n
205 int datastore_id; /**< plugin_type : TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO, TYPE_CALL_LOG */
206 int folder_type_id; /**< folder type id 0 */
207 char *target; /**< target(server) URI */
208 char *source; /**< source(client) URI */
209 char *id; /**< account id */
210 char *pw; /**< account pw */
211 AlertType clientSyncType; /**< Sync Type(two-way, one-way ...) */
212 AlertType serverSyncType; /**< Sync Type(two-way, one-way ...) */
213 char *lastAnchorClient; /**< Last Anchor of datastore for clientside */
214 char *nextAnchorClient; /**< Next Anchor of datastore for clientside */
215 char *lastAnchorServer; /**< Next Anchor of datastore for serverside */
216 char *nextAnchorServer; /**< Next Anchor of datastore for serverside */
217 SyncResult *clientSyncResult;
218 SyncResult *serverSyncResult;
223 char *target; /**< target(server) URI */
224 char *source; /**< source(client) URI */
225 AlertType syncType; /**< Sync Type(two-way, one-way ...) */
226 char *lastAnchor; /**< Last Anchor of datastore for clientside */
227 char *nextAnchor; /**< Next Anchor of datastore for clientside */
228 unsigned int maxObjSize;
232 @brief Third parameter of pre_sync function
234 Output data from pre_sync function\n
235 Data that need to be passed to Service Engine from Service Adapter result of pkg2
239 GList *datastoreInfo; /**< containing DatastoreInfo structure*/
245 @brief a changed item(changelog)
249 ChangeType changeType; /**< type of changes (add, replace, delete, copy, move ..) */
250 char *luid; /**< luid of item */
251 char *content_type; /**< content type of data */
252 unsigned int indexOfDatastore;
253 char *data; /**< data */
258 @brief item that are grouped by each Data Store
262 char *source; /**< source(client) URI */
263 char *target; /**< target(server) URI */
265 unsigned int numberOfChanges;
266 int hasNumberOfChanges;
268 GList *changeItem; /**< containing ChangedItem all type */
269 GList *sentItem; /**< containing ChangedItem */
275 @brief result of applied command that from service engine or server
279 ChangeType changeType; /**< change type (add, replace, delete...) */
280 char *luid; /**< luid of item */
281 int status; /**< status of applied item */
285 char *source; /**< source(client) URI */
286 char *target; /**< target(server) URI */
287 GList *items; /**< containing ApplliedStatus struct */
291 @brief second and third parameter of sync function
295 GList *changedDatastore; /**< containing ChangedDatastore structure when it's in SyncObj it will be command that client send to server */
296 GList *sendingStatus; /**< containing SendingStatus structure when it's in SyncObj status of add, replace, delete command from server */
300 GList *changedDatastore; /**< containing ChangedDatastore structure when it's in SyncReturnObj command(add, relpace, delete) from server */
301 GList *status; /**< containing AppliedStatus structure when it's in SyncReturnObj return to engine(status of add, replace, delete command that client sent to server)*/
321 extern Datastore *datastoreinfo_per_content_type[4];
322 extern AlertType syncType;
324 #endif /* COMMON_DEFINE_INTERNAL_H_ */