summaryrefslogtreecommitdiff
path: root/include/service-engine/se_storage.h
blob: 5b296114506f8baed2ab9882c98fe497e944d47e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
/*
 * oma-ds-agent
 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the License);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 *   @SE_Storage.h
 *   @version									0.1
 *   @brief										This file is the header file of interface which saves and gets sync results
 */

#ifndef SE_STORAGE_H_
#define SE_STORAGE_H_

#include "common/common_define.h"
#include "service-engine/se_error.h"

/**
 * @par Description: API to save sync type, sync result , last sync time(each datastore)
 * This API can be used to save sync type, sync result , last sync time at the end of synchronization process
 *
 * @par Purpose:
 * @par Typical use case:
 * @par Method of function operation:
 * @par Important notes:
 * @param[in]		int type, account id
 * @param[in]		enum type, AlertType
 * @param[in]		enum type, sync_session_result_e
 * @param[in]		int type, last sync time
 * @param[in]		int type, whether or not tn end in pkg4
 *
 * @return				SE_INTERNAL_OK on success
 *							SE_INTERNAL_DA_ERROR on error
 *
 * @par Errors:
 *
 * @pre None.
 * @post
 * @see
 * @remarks None.
 *
 * @par Sample Code:
 * @code
 * @endcode
 */
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);

/**
 * @par Description: API to save sync statistics(each datastore)
 * This API can be used to save statistics at the end of synchronization process
 *
 * @par Purpose:
 * @par Typical use case:
 * @par Method of function operation:
 * @par Important notes:
 * @param[in]		int type, account id
 * @param[in]		int type, content type(TYPE_CONTACT,  TYPE_CALENDAR, TYPE_MEMO)
 * @param[in]		bool type whether from server or from client
 * @param[in]		sync_result_s structure
 *
 * @return				SE_INTERNAL_OK on success
 *							SE_INTERNAL_DA_ERROR on error
 *
 * @par Errors:
 *
 * @pre None.
 * @post
 * @see
 * @remarks None.
 *
 * @par Sample Code:
 * @code
 * @endcode
 */
se_error_type_e write_sync_statistics(int account_id, int content_type, bool is_from_server, sync_result_s * sync_result);

/**
 * @par Description: API to save sync result(each datastore)
 * This API can be used to save sync result at the end of synchronization process
 *
 * @par Purpose:
 * @par Typical use case:
 * @par Method of function operation:
 * @par Important notes:
 * @param[in]		int type, account id
 * @param[in]		int type, content type(TYPE_CONTACT,  TYPE_CALENDAR, TYPE_MEMO)
 * @param[in]		int type, last sync time
 * @param[in]		int type, whether or not to end in pkg4
 * @param[in]		sync_result_s structure, client
 * @param[in]		sync_result_s structure, server
 *
 * @return				SE_INTERNAL_OK on success
 *							SE_INTERNAL_DA_ERROR on error
 *
 * @par Errors:
 *
 * @pre None.
 * @post
 * @see
 * @remarks None.
 *
 * @par Sample Code:
 * @code
 * @endcode
 */
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);

/**
 * @par Description: API to get profile data from config_tbl
 * This API can be used to get profile data
 * This API is part of API for UI
 *
 * @par Purpose:
 * @par Typical use case:
 * @par Method of function operation:
 * @par Important notes:
 * @param[in]		int type, account id
 * @param[out]		string type, profile name
 * @param[out]		string type, server ip
 * @param[out]		string type, id
 * @param[out]		string type, password
 * @param[out]		int type, sync mode
 * @param[out]		int type, sync type
 * @param[out]		int type, interval
 * @param[out]		int type, last_session_status
 * @param[out]		int type, last_session_time
 *
 *
 * @return				true on success
 *							false on error
 *
 * @par Errors:
 *
 * @pre None.
 * @post
 * @see
 * @remarks None.
 *
 * @par Sample Code:
 * @code
 * @endcode
 */
bool get_profile_data(int account_id, char **profile_name, char **addr, char **id, char **password, int *sync_mode, int *sync_type, int *interval, int *last_session_status, int *last_session_time);

/**
 * @par Description: API to get profile datastore information(enable, source uri, target uri, id, password) from config_tbl
 * This API can be used to get enable, source uri, target uri, id, password
 * This API is part of API for UI
 *
 * @par Purpose:
 * @par Typical use case:
 * @par Method of function operation:
 * @par Important notes:
 * @param[in]		int type, account id
 * @param[in]		int type, content type(TYPE_CONTACT,  TYPE_CALENDAR, TYPE_MEMO)
 * @param[out]		string type, enabled
 * @param[out]		int type, source uri
 * @param[out]		string type, target uri
 * @param[out]		string type, id
 * @param[out]		string type, password
 *
 * @return				true on success
 *							false on error
 *
 * @par Errors:
 *
 * @pre None.
 * @post
 * @see
 * @remarks None.
 *
 * @par Sample Code:
 * @code
 * @endcode
 */
bool get_profile_sync_category(int account_id, int content_type, int *enabled, int *src_uri, char **tgt_uri, char **id, char **password);

/**
 * @par Description: API to get profile sync statistics for each content type from config_tbl
 * This API can be used to get profile sync statistics for each content type
 * This API is part of API for UI
 *
 * @par Purpose:
 * @par Typical use case:
 * @par Method of function operation:
 * @par Important notes:
 * @param[in]		int type, account id
 * @param[in]		int type, content type(TYPE_CONTACT,  TYPE_CALENDAR, TYPE_MEMO)
 * @param[out]		string type, sync result(success, fail, stop)
 * @param[out]		int type, sync time
 * @param[out]		int type, total items(server to client)
 * @param[out]		int type, add items(server to client)
 * @param[out]		int type, delete items(server to client)
 * @param[out]		int type, replace items(server to client)
 * @param[out]		int type, total items(client to server)
 * @param[out]		int type, add items(client to server)
 * @param[out]		int type, delete items(client to server)
 * @param[out]		int type, replace items(client to server)
 *
 * @return				true on success
 *							false on error
 *
 * @par Errors:
 *
 * @pre None.
 * @post
 * @see
 * @remarks None.
 *
 * @par Sample Code:
 * @code
 * @endcode
 */
bool get_profile_statistics(int account_id, int content_type, char **dbSynced, int *last_session_time,
			    int *server2client_total, int *server2client_nrofadd, int *server2client_nrofdelete, int *server2client_nrofreplace,
			    int *client2server_total, int *client2server_nrofadd, int *client2server_nrofdelete, int *client2server_nrofreplace);

/**
 * @par Description: API to get all profiles data from config_tbl
 * This API can be used to get all profiles data
 * This API is part of API for UI
 *
 * @par Purpose:
 * @par Typical use case:
 * @par Method of function operation:
 * @par Important notes:
 * @param[out]		GList, all profiles data
 *
 *
 * @return				true on success
 *							false on error
 *
 * @par Errors:
 *
 * @pre None.
 * @post
 * @see
 * @remarks None.
 *
 * @par Sample Code:
 * @code
 * @endcode
 */
bool get_all_profiles_data(GList ** list);

#endif				/* SE_STORAGE_H_ */