3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 * @brief This file is the header file of interface which saves and gets sync results
27 #include "common/common_define.h"
28 #include "service-engine/se_error.h"
31 * @par Description: API to save sync type, sync result , last sync time(each datastore)
32 * This API can be used to save sync type, sync result , last sync time at the end of synchronization process
35 * @par Typical use case:
36 * @par Method of function operation:
37 * @par Important notes:
38 * @param[in] int type, account id
39 * @param[in] enum type, AlertType
40 * @param[in] enum type, sync_session_result_e
41 * @param[in] int type, last sync time
42 * @param[in] int type, whether or not tn end in pkg4
44 * @return SE_INTERNAL_OK on success
45 * SE_INTERNAL_DA_ERROR on error
58 se_error_type_e write_profile_data(int account_id, alert_type_e alert_type, sync_session_result_e sync_session_result, int last_session_time, int only_from_client);
61 * @par Description: API to save sync statistics(each datastore)
62 * This API can be used to save statistics at the end of synchronization process
65 * @par Typical use case:
66 * @par Method of function operation:
67 * @par Important notes:
68 * @param[in] int type, account id
69 * @param[in] int type, content type(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO)
70 * @param[in] bool type whether from server or from client
71 * @param[in] sync_result_s structure
73 * @return SE_INTERNAL_OK on success
74 * SE_INTERNAL_DA_ERROR on error
87 se_error_type_e write_sync_statistics(int account_id, int content_type, bool is_from_server, sync_result_s * sync_result);
90 * @par Description: API to save sync result(each datastore)
91 * This API can be used to save sync result at the end of synchronization process
94 * @par Typical use case:
95 * @par Method of function operation:
96 * @par Important notes:
97 * @param[in] int type, account id
98 * @param[in] int type, content type(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO)
99 * @param[in] int type, last sync time
100 * @param[in] int type, whether or not to end in pkg4
101 * @param[in] sync_result_s structure, client
102 * @param[in] sync_result_s structure, server
104 * @return SE_INTERNAL_OK on success
105 * SE_INTERNAL_DA_ERROR on error
118 se_error_type_e write_sync_resource_info(int account_id, int content_type, int last_session_time, int only_from_client, sync_result_s * client_sync_result, sync_result_s * server_sync_result);
121 * @par Description: API to get profile data from config_tbl
122 * This API can be used to get profile data
123 * This API is part of API for UI
126 * @par Typical use case:
127 * @par Method of function operation:
128 * @par Important notes:
129 * @param[in] int type, account id
130 * @param[out] string type, profile name
131 * @param[out] string type, server ip
132 * @param[out] string type, id
133 * @param[out] string type, password
134 * @param[out] string type, sync mode
135 * @param[out] string type, sync type
136 * @param[out] string type, interval
137 * @param[out] int type, last_session_status
138 * @param[out] int type, last_session_time
141 * @return true on success
155 bool get_profile_data(int account_id, char **profile_name, char **addr, char **id, char **password, char **sync_mode, char **sync_type, char **interval, int *last_session_status, int *last_session_time);
158 * @par Description: API to get profile datastore information(enable, source uri, target uri, id, password) from config_tbl
159 * This API can be used to get enable, source uri, target uri, id, password
160 * This API is part of API for UI
163 * @par Typical use case:
164 * @par Method of function operation:
165 * @par Important notes:
166 * @param[in] int type, account id
167 * @param[in] int type, content type(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO)
168 * @param[out] string type, enabled
169 * @param[out] string type, source uri
170 * @param[out] string type, target uri
171 * @param[out] string type, id
172 * @param[out] string type, password
174 * @return true on success
188 bool get_profile_sync_category(int account_id, int content_type, int *enabled, char **src_uri, char **tgt_uri, char **id, char **password);
191 * @par Description: API to get profile sync statistics for each content type from config_tbl
192 * This API can be used to get profile sync statistics for each content type
193 * This API is part of API for UI
196 * @par Typical use case:
197 * @par Method of function operation:
198 * @par Important notes:
199 * @param[in] int type, account id
200 * @param[in] int type, content type(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO)
201 * @param[out] string type, sync result(success, fail, stop)
202 * @param[out] int type, sync time
203 * @param[out] int type, total items(server to client)
204 * @param[out] int type, add items(server to client)
205 * @param[out] int type, delete items(server to client)
206 * @param[out] int type, replace items(server to client)
207 * @param[out] int type, total items(client to server)
208 * @param[out] int type, add items(client to server)
209 * @param[out] int type, delete items(client to server)
210 * @param[out] int type, replace items(client to server)
212 * @return true on success
226 bool get_profile_statistics(int account_id, int content_type, char **dbSynced, int *last_session_time,
227 int *server2client_total, int *server2client_nrofadd, int *server2client_nrofdelete, int *server2client_nrofreplace,
228 int *client2server_total, int *client2server_nrofadd, int *client2server_nrofdelete, int *client2server_nrofreplace);
231 * @par Description: API to get all profiles data from config_tbl
232 * This API can be used to get all profiles data
233 * This API is part of API for UI
236 * @par Typical use case:
237 * @par Method of function operation:
238 * @par Important notes:
239 * @param[out] GList, all profiles data
242 * @return true on success
256 bool get_all_profiles_data(GList ** list);
258 #endif /* SE_STORAGE_H_ */