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>
40 * @brief This file is the header file of interface which saves and gets sync results
47 #include "Common/Common_Define.h"
48 #include "ServiceEngine/SE_Error.h"
51 * @par Description: API to save sync type, sync result , last sync time(each datastore)
52 * This API can be used to save sync type, sync result , last sync time at the end of synchronization process
55 * @par Typical use case:
56 * @par Method of function operation:
57 * @par Important notes:
58 * @param[in] int type, account id
59 * @param[in] enum type, AlertType
60 * @param[in] enum type, SyncSessionResult
61 * @param[in] int time, last sync time
63 * @return SE_INTERNAL_OK on success
64 * SE_INTERNAL_DA_ERROR on error
77 SE_ErrorType write_profile_data(int accountId, AlertType alertType, SyncSessionResult syncSessionResult, int lastSessionTime);
81 * @par Description: API to save sync statistics(each datastore)
82 * This API can be used to save statistics at the end of synchronization process
85 * @par Typical use case:
86 * @par Method of function operation:
87 * @par Important notes:
88 * @param[in] int type, account id
89 * @param[in] int type, content type(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO)
90 * @param[in] bool type whether from server or from client
91 * @param[in] SyncResult structure
93 * @return SE_INTERNAL_OK on success
94 * SE_INTERNAL_DA_ERROR on error
107 SE_ErrorType write_sync_statistics(int accountId, int content_type, bool isFromServer, SyncResult *pSyncResult);
111 * @par Description: API to save sync result(each datastore)
112 * This API can be used to save sync result at the end of synchronization process
115 * @par Typical use case:
116 * @par Method of function operation:
117 * @par Important notes:
118 * @param[in] int type, account id
119 * @param[in] enum type, AlertType
120 * @param[in] int type, content type(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO)
121 * @param[in] int type, last sync time
122 * @param[in] SyncResult structure, client
123 * @param[in] SyncResult structure, server
125 * @return SE_INTERNAL_OK on success
126 * SE_INTERNAL_DA_ERROR on error
139 SE_ErrorType write_sync_resource_info(int accountId, AlertType alertType,
140 int content_type , int lastSessionTime, SyncResult *clientSyncResult, SyncResult *serverSyncResult);
144 * @par Description: API to get profile name from config_tbl
145 * This API can be used to get profile name
146 * This API is part of API for UI
149 * @par Typical use case:
150 * @par Method of function operation:
151 * @par Important notes:
152 * @param[in] int type, account id
153 * @param[out] string type, profile name
155 * @return true on success
169 bool get_profile_name(int accountId, char **profileName);
172 * @par Description: API to get profile server information(server ip, id, password) from config_tbl
173 * This API can be used to get server ip, id, password
174 * This API is part of API for UI
177 * @par Typical use case:
178 * @par Method of function operation:
179 * @par Important notes:
180 * @param[in] int type, account id
181 * @param[out] string type, server ip
182 * @param[out] string type, id
183 * @param[out] string type, password
185 * @return true on success
199 bool get_profile_server_info(int accountId, char **addr, char **id, char **password);
202 * @par Description: API to get profile sync mode, type, interval from config_tbl
203 * This API can be used to get sync mode, sync type, interval
204 * This API is part of API for UI
207 * @par Typical use case:
208 * @par Method of function operation:
209 * @par Important notes:
210 * @param[in] int type, account id
211 * @param[out] string type, sync mode
212 * @param[out] string type, sync type
213 * @param[out] string type, interval
215 * @return true on success
229 bool get_profile_sync_mode(int accountId, char **syncMode, char **syncType, char **interval);
232 * @par Description: API to get profile datastore information(enable, source uri, target uri, id, password) from config_tbl
233 * This API can be used to get enable, source uri, target uri, id, password
234 * This API is part of API for UI
237 * @par Typical use case:
238 * @par Method of function operation:
239 * @par Important notes:
240 * @param[in] int type, account id
241 * @param[in] int type, content type(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO)
242 * @param[out] string type, enabled
243 * @param[out] string type, source uri
244 * @param[out] string type, target uri
245 * @param[out] string type, id
246 * @param[out] string type, password
248 * @return true on success
262 bool get_profile_sync_category(int accountId, int contentType,
263 int *enabled, char **srcURI, char **tgtURI, char **id, char **password);
266 * @par Description: API to get profile sync results(sync status, sync time) from config_tbl
267 * This API can be used to get profile sync results(sync status, sync time)
268 * This API is part of API for UI
271 * @par Typical use case:
272 * @par Method of function operation:
273 * @par Important notes:
274 * @param[in] int type, account id
275 * @param[out] int type, lastSessionStatus
276 * @param[out] int type, lastSessionTime
278 * @return true on success
292 bool get_last_session_info(int accountId, int *lastSessionStatus, int *lastSessionTime);
296 * @par Description: API to get profile sync statistics for each content type from config_tbl
297 * This API can be used to get profile sync statistics for each content type
298 * This API is part of API for UI
301 * @par Typical use case:
302 * @par Method of function operation:
303 * @par Important notes:
304 * @param[in] int type, account id
305 * @param[in] int type, content type(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO)
306 * @param[out] string type, sync result(success, fail, stop)
307 * @param[out] int type, sync time
308 * @param[out] int type, total items(server to client)
309 * @param[out] int type, add items(server to client)
310 * @param[out] int type, delete items(server to client)
311 * @param[out] int type, replace items(server to client)
312 * @param[out] int type, total items(client to server)
313 * @param[out] int type, add items(client to server)
314 * @param[out] int type, delete items(client to server)
315 * @param[out] int type, replace items(client to server)
317 * @return true on success
331 bool get_profile_statistics(int accountId, int contentType, char **dbSynced, int *lastSessionTime,
332 int *server2Client_Total, int *server2Client_NrOfAdd, int *server2Client_NrOfDelete, int *server2Client_NrOfReplace,
333 int *client2Server_Total, int *client2Server_NrOfAdd, int *client2Server_NrOfDelete, int *client2Server_NrOfReplace);
336 #endif /* SE_STORAGE_H_ */