sync-agent: Change the system-info api to 2.3 public api
[platform/core/system/sync-agent.git] / include / event / oma_ds_api.h
1 /*
2  * sync-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
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
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  */
17
18 #ifndef OMA_DS_API_H_
19 #define OMA_DS_API_H_
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif                          /* __cplusplus */
24
25 /** @addtogroup event
26  *      @{
27  */
28
29 /**
30  * Enumerations of error codes for OMA DS API
31  */
32         typedef enum {
33                 SYNC_AGENT_DS_FAIL = -1,        /**< Fail */
34                 SYNC_AGENT_DS_SUCCESS = 0,      /**< Successful */
35                 SYNC_AGENT_DS_SYNCHRONISING = 1 /**< Synchronising */
36         } sync_agent_ds_error_e;
37
38 /**
39  * Enumerations of service type
40  */
41         typedef enum {
42                 SYNC_AGENT_CONTACT = 0,         /**< Contact */
43                 SYNC_AGENT_CALENDAR = 1,        /**< Calendar */
44                 SYNC_AGENT_MEMO = 2,            /**< Memo */
45                 SYNC_AGENT_CALLLOG = 3          /**< Calllog */
46         } sync_agent_ds_service_type_e;
47
48 /**
49  * Enumerations of sync mode
50  */
51         typedef enum {
52                 SYNC_AGENT_SYNC_MODE_MANUAL = 0,                /**< Manual */
53                 SYNC_AGENT_SYNC_MODE_PERIODIC = 1,      /**< Periodic */
54                 SYNC_AGENT_SYNC_MODE_PUSH = 2                   /**< Push */
55         } sync_agent_ds_sync_mode_e;
56
57 /**
58  * Enumerations of sync type
59  */
60         typedef enum {
61                 SYNC_AGENT_SYNC_TYPE_FULL_SYNC = 0,                                             /**< Full */
62                 SYNC_AGENT_SYNC_TYPE_UPDATE_BOTH = 1,                                   /**< Update both */
63                 SYNC_AGENT_SYNC_TYPE_UPDATE_TO_SERVER = 2,                      /**< Update to server */
64                 SYNC_AGENT_SYNC_TYPE_UPDATE_TO_PHONE = 3,                               /**< Update to phone */
65                 SYNC_AGENT_SYNC_TYPE_REFRESH_FROM_SERVER = 4,           /**< Refresh from server */
66                 SYNC_AGENT_SYNC_TYPE_REFRESH_FROM_PHONE = 5                     /**< Refresh from phone */
67         } sync_agent_ds_sync_type_e;
68
69 /**
70  * Enumerations of sync interval
71  */
72         typedef enum {
73                 SYNC_AGENT_SYNC_INTERVAL_NONE = 0,                                      /**< None */
74                 SYNC_AGENT_SYNC_INTERVAL_5_MINUTES = 1,                                 /**< 5 minutes */
75                 SYNC_AGENT_SYNC_INTERVAL_15_MINUTES = 2,                                /**< 15 minutes */
76                 SYNC_AGENT_SYNC_INTERVAL_1_HOUR = 3,                                            /**< 1 hour */
77                 SYNC_AGENT_SYNC_INTERVAL_4_HOURS = 4,                                   /**< 4 hours */
78                 SYNC_AGENT_SYNC_INTERVAL_12_HOURS = 5,                                  /**< 12 hours */
79                 SYNC_AGENT_SYNC_INTERVAL_1_DAY = 6,                                             /**< 1 day */
80                 SYNC_AGENT_SYNC_INTERVAL_1_WEEK = 7,                                            /**< 1 week */
81                 SYNC_AGENT_SYNC_INTERVAL_1_MONTH = 8                                    /**< 1 month */
82         } sync_agent_ds_sync_interval_e;
83
84 /**
85  * Enumerations of src uri
86  */
87         typedef enum {
88                 SYNC_AGENT_SRC_URI_CONTACT = 0,                                         /**< Contacts */
89                 SYNC_AGENT_SRC_URI_CALENDAR = 1                                 /**< Calendar */
90         } sync_agent_ds_src_uri_e;
91
92 /**
93  * Enumerations of sync callback
94  */
95         typedef enum {
96                 SYNC_AGENT_DS_SYNC_SESSION = 1, /**< Sync session */
97                 SYNC_AGENT_DS_SYNC_PROCESS = 2  /**< Sync process */
98         } sync_agent_ds_sync_callback_e;
99
100 /**
101  * @brief       Structure of OMA DS Server information instance
102  */
103         typedef struct {
104                 char *addr;                                     /**< Server ip */
105                 char *id;                                       /**< Id */
106                 char *password;                         /**< Password */
107         } sync_agent_ds_server_info;
108
109 /**
110  * @brief       Structure of OMA DS Sync information instance
111  */
112         typedef struct {
113                 sync_agent_ds_sync_mode_e sync_mode;            /**< Sync mode */
114                 sync_agent_ds_sync_type_e sync_type;            /**< Sync type */
115                 sync_agent_ds_sync_interval_e interval;                 /**< Interval */
116         } sync_agent_ds_sync_info;
117
118 /**
119  * @brief       Structure of OMA DS Service information instance
120  */
121         typedef struct {
122                 sync_agent_ds_service_type_e service_type;      /**< Service type */
123                 int enabled;                                                            /**< Enable or not */
124                 sync_agent_ds_src_uri_e src_uri;                                                                /**< Source uri */
125                 char *tgt_uri;                                                          /**< Target uri */
126                 char *id;                                                                       /**< Id */
127                 char *password;                                                         /**< password */
128         } sync_agent_ds_service_info;
129
130 /**
131  * @brief       Structure of OMA DS Profile information instance
132  */
133         typedef struct {
134                 int profile_id;                                                                 /**< Profile id */
135                 char *profile_dir_name;                                         /**< Profile dir name */
136                 char *profile_name;                                                     /**< Profile name */
137                 sync_agent_ds_server_info server_info;          /**< Server information */
138                 sync_agent_ds_sync_info sync_info;                      /**< Sync information */
139                 GList *service_list;                                            /**< Service list */
140                 int last_sync_status;                                           /**< Last sync status */
141                 int last_sync_time;                                                     /**< Last sync time */
142         } sync_agent_ds_profile_info;
143
144 /**
145  * @brief       Structure of OMA DS Statistics information instance
146  */
147         typedef struct {
148                 char *dbsynced;                                                         /**< Sync result(success, fail, stop) */
149                 int last_session_time;                                          /**< Sync time */
150                 int server2client_total;                                        /**< Total items(server to client) */
151                 int server2client_nrofadd;                                      /**< Add items(server to client) */
152                 int server2client_nrofdelete;                           /**< Delete items(server to client) */
153                 int server2client_nrofreplace;                          /**< Replace items(server to client) */
154                 int client2server_total;                                        /**< Total items(client to server) */
155                 int client2server_nrofadd;                                      /**< Add items(client to server) */
156                 int client2server_nrofdelete;                           /**< Delete items(client to server) */
157                 int client2server_nrofreplace;                          /**< Replace items(client to server) */
158         } sync_agent_ds_statistics_info;
159
160 /**
161  * @brief       profile info handler
162  */
163         typedef void *ds_profile_h;
164
165 /**
166  * @brief initialize OMA DS
167  * @par Usage:
168  * @code
169  *
170  * sync_agent_ds_error_e ds_err = sync_agent_ds_init();
171  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
172  *      ...
173  * }
174  *
175  *      ...
176  *
177  * @endcode
178  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
179  * @see sync_agent_ds_deinit
180  */
181         sync_agent_ds_error_e sync_agent_ds_init();
182
183 /**
184  * @brief create profile info
185  * @par Usage:
186  * @code
187  *
188  * ds_profile_h profile_h = NULL;
189  *
190  * ds_err = sync_agent_ds_create_profile_info(&profile_h);
191  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
192  *      ...
193  * }
194  *
195  *      ...
196  *
197  * @endcode
198  * @param[out]  profile_h        profile info initialized
199  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
200  * @see sync_agent_ds_free_profile_info
201  */
202         sync_agent_ds_error_e sync_agent_ds_create_profile_info(ds_profile_h * profile_h);
203
204 /**
205  * @brief set profile name into profile info
206  * @par Usage:
207  * @code
208  *
209  * ds_profile_h profile_h = NULL;
210  * char *profile_dir_name = "Sync1";
211  *
212  * sync_agent_ds_error_e ds_err = sync_agent_ds_create_profile_info(&profile_h);
213  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
214  *      ...
215  * }
216  *
217  *      ...
218  *
219  * ds_err = sync_agent_ds_set_profile_dir_name(profile_h, profile_dir_name);
220  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
221  *      ...
222  * }
223  *
224  *      ...
225  *
226  * @endcode
227  * @param[in]   profile_h                       profile info initialized
228  * @param[in]   profile_dir_name        profile dir name
229  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
230  */
231         sync_agent_ds_error_e sync_agent_ds_set_profile_dir_name(ds_profile_h profile_h, char *profile_dir_name);
232
233 /**
234  * @brief set profile name into profile info
235  * @par Usage:
236  * @code
237  *
238  * ds_profile_h profile_h = NULL;
239  * char *profile_name = "profile name";
240  *
241  * sync_agent_ds_error_e ds_err = sync_agent_ds_create_profile_info(&profile_h);
242  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
243  *      ...
244  * }
245  *
246  *      ...
247  *
248  * ds_err = sync_agent_ds_set_profile_name(profile_h, profile_name);
249  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
250  *      ...
251  * }
252  *
253  *      ...
254  *
255  * @endcode
256  * @param[in]   profile_h                       profile info initialized
257  * @param[in]   profile_name            profile name
258  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
259  */
260         sync_agent_ds_error_e sync_agent_ds_set_profile_name(ds_profile_h profile_h, char *profile_name);
261
262 /**
263  * @brief set server information into profile info
264  * @par Usage:
265  * @code
266  *
267  * ds_profile_h profile_h = NULL;
268  * char *addr = "http://xxx.xxx.xxx";
269  * char *id = "id";
270  * char *password = "password";
271  *
272  * sync_agent_ds_error_e ds_err = sync_agent_ds_create_profile_info(&profile_h);
273  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
274  *      ...
275  * }
276  *
277  *      ...
278  *
279  * ds_err = sync_agent_ds_set_server_info(profile_h, addr, id, password);
280  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
281  *      ...
282  * }
283  *
284  *      ...
285  *
286  * @endcode
287  * @param[in]   profile_h               profile info initialized
288  * @param[in]   addr                    server ip address
289  * @param[in]   id                              account id
290  * @param[in]   password                account password
291  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
292  */
293         sync_agent_ds_error_e sync_agent_ds_set_server_info(ds_profile_h profile_h, char *addr, char *id, char *password);
294
295 /**
296  * @brief set sync information into profile info
297  * @par Usage:
298  * @code
299  *
300  * ds_profile_h profile_h = NULL;
301  * sync_agent_ds_sync_mode_e sync_mode = SYNC_AGENT_SYNC_MODE_PERIODIC;
302  * sync_agent_ds_sync_type_e sync_type = SYNC_AGENT_SYNC_TYPE_UPDATE_BOTH;
303  * sync_agent_ds_sync_interval_e interval = SYNC_AGENT_SYNC_INTERVAL_1_HOUR;
304  *
305  * sync_agent_ds_error_e ds_err = sync_agent_ds_create_profile_info(&profile_h);
306  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
307  *      ...
308  * }
309  *
310  *      ...
311  *
312  * ds_err = sync_agent_ds_set_sync_info(profile_h, sync_mode, sync_type, interval);
313  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
314  *      ...
315  * }
316  *
317  *      ...
318  *
319  * @endcode
320  * @param[in]   profile_h               profile info initialized
321  * @param[in]   sync_mode               sync mode(sync_agent_ds_sync_mode_e value)
322  * @param[in]   sync_type               sync type(sync_agent_ds_sync_type_e value)
323  * @param[in]   interval                        interval(sync_agent_ds_sync_interval_e)
324  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
325  */
326         sync_agent_ds_error_e sync_agent_ds_set_sync_info(ds_profile_h profile_h, sync_agent_ds_sync_mode_e sync_mode, sync_agent_ds_sync_type_e sync_type, sync_agent_ds_sync_interval_e interval);
327
328 /**
329  * @brief set service information into profile info
330  * @par Usage:
331  * @code
332  *
333  * ds_profile_h profile_h = NULL;
334  * sync_agent_ds_service_type_e service_type = SYNC_AGENT_CONTACT;
335  * int enabled = 1;
336  * char *src_uri = "Contacts";
337  * char *tgt_uri = "card";
338  * char *id = "id";
339  * char *password = "password";
340  *
341  * sync_agent_ds_error_e ds_err = sync_agent_ds_create_profile_info(&profile_h);
342  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
343  *      ...
344  * }
345  *
346  *      ...
347  *
348  * ds_err = sync_agent_ds_set_sync_category(profile_h, service_type, enabled, src_uri, tgt_uri, id, password);
349  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
350  *      ...
351  * }
352  *
353  *      ...
354  *
355  * @endcode
356  * @param[in]   profile_h               profile info initialized
357  * @param[in]   service_type    service type(SYNC_AGENT_CONTACT, SYNC_AGENT_CALENDAR, SYNC_AGENT_MEMO,  SYNC_AGENT_CALLLOG)
358  * @param[in]   enabled                 enable or not( 1 =  enable, 0 = prevent)
359  * @param[in]   src_uri                 source uri (sync_agent_ds_src_uri_e)
360  * @param[in]   tgt_uri                 target uri
361  * @param[in]   id                              id
362  * @param[in]   password                password
363  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
364  */
365         sync_agent_ds_error_e sync_agent_ds_set_sync_service_info(ds_profile_h profile_h, sync_agent_ds_service_type_e service_type, int enabled, sync_agent_ds_src_uri_e src_uri, char *tgt_uri, char *id, char *password);
366
367 /**
368  * @brief get profile id, profile id from profile info
369  * @par Usage:
370  * @code
371  *
372  * ds_profile_h profile_h = NULL;
373  * int profile_id = 0;
374  * GList **profile_list = NULL;
375  *
376  * sync_agent_ds_error_e ds_err = sync_agent_ds_get_all_profile(&profile_list);
377  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
378  *      ...
379  * }
380  *
381  * for (iter = profile_list; iter != NULL; iter = g_list_next(iter)) {
382  *              profile_h = (ds_profile_h)iter->data;
383  *      ...
384  *
385  * ds_err = sync_agent_ds_get_profile_id(profile_h, &profile_id);
386  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
387  *      ...
388  * }
389  *
390  *      ...
391  *
392  * @endcode
393  * @param[in]   profile_h                       profile info
394  * @param[out]  profile_id      profile_id
395  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
396  * @see sync_agent_ds_get_profile
397  */
398         sync_agent_ds_error_e sync_agent_ds_get_profile_id(ds_profile_h profile_h, int *profile_id);
399
400 /**
401  * @brief get profile dir name, profile dir name from profile info
402  * @par Usage:
403  * @code
404  *
405  * ds_profile_h profile_h = NULL;
406  * int profile_id = 1;
407  * char *get_profile_dir_name = NULL;
408  *
409  * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
410  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
411  *      ...
412  * }
413  *
414  *      ...
415  *
416  * ds_err = sync_agent_ds_get_profile_dir_name(profile_h, &get_profile_dir_name);
417  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
418  *      ...
419  * }
420  *
421  *      ...
422  *
423  * @endcode
424  * @param[in]   profile_h                       profile info
425  * @param[out]  profile_dir_name        profile dir name
426  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
427  * @see sync_agent_ds_get_profile
428  */
429         sync_agent_ds_error_e sync_agent_ds_get_profile_dir_name(ds_profile_h profile_h, char **profile_dir_name);
430
431 /**
432  * @brief get profile dir name, profile name from profile info
433  * @par Usage:
434  * @code
435  *
436  * ds_profile_h profile_h = NULL;
437  * int profile_id = 1;
438  * char *profile_name = NULL;
439  *
440  * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
441  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
442  *      ...
443  * }
444  *
445  *      ...
446  *
447  * ds_err = sync_agent_ds_get_profile_name(profile_h, &profile_name);
448  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
449  *      ...
450  * }
451  *
452  *      ...
453  *
454  * @endcode
455  * @param[in]   profile_h                       profile info
456  * @param[out]  profile_name            profile name
457  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
458  * @see sync_agent_ds_get_profile
459  */
460         sync_agent_ds_error_e sync_agent_ds_get_profile_name(ds_profile_h profile_h, char **profile_name);
461
462 /**
463  * @brief get profile server information from profile info
464  * @par Usage:
465  * @code
466  *
467  * ds_profile_h profile_h = NULL;
468  * int profile_id = 1;
469  * sync_agent_ds_server_info server_info = {NULL};
470  *
471  * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
472  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
473  *      ...
474  * }
475  *
476  *      ...
477  *
478  * ds_err = sync_agent_ds_get_server_info(profile_h, &server_info);
479  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
480  *      ...
481  * }
482  *
483  *      ...
484  *
485  * @endcode
486  * @param[in]   profile_h                       profile info
487  * @param[out]  server_info                     server info structure
488  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
489  * @see sync_agent_ds_get_profile
490  */
491         sync_agent_ds_error_e sync_agent_ds_get_server_info(ds_profile_h profile_h, sync_agent_ds_server_info * server_info);
492
493 /**
494  * @brief get profile sync information from profile info
495  * @par Usage:
496  * @code
497  *
498  * ds_profile_h profile_h = NULL;
499  * int profile_id = 1;
500  * sync_agent_ds_sync_info sync_info = {NULL};
501  *
502  * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
503  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
504  *      ...
505  * }
506  *
507  *      ...
508  *
509  * ds_err = sync_agent_ds_get_sync_info(profile_h, &sync_info);
510  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
511  *      ...
512  * }
513  *
514  *      ...
515  *
516  * @endcode
517  * @param[in]   profile_h                       profile info
518  * @param[out]  sync_info                       sync info structure
519  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
520  * @see sync_agent_ds_get_profile
521  */
522         sync_agent_ds_error_e sync_agent_ds_get_sync_info(ds_profile_h profile_h, sync_agent_ds_sync_info * sync_info);
523
524 /**
525  * @brief get profile service information list from profile info
526  * @par Usage:
527  * @code
528  *
529  * ds_profile_h profile_h = NULL;
530  * int profile_id = 1;
531  * GList service_list = NULL;
532  *
533  * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
534  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
535  *      ...
536  * }
537  *
538  *      ...
539  *
540  * ds_err = sync_agent_ds_get_sync_category_info(profile_h, &service_list);
541  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
542  *      ...
543  * }
544  *
545  *      ...
546  *
547  * @endcode
548  * @param[in]   profile_h                               profile info
549  * @param[out]  service_list                    list of service_info structure
550  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
551  * @see sync_agent_ds_get_profile
552  */
553         sync_agent_ds_error_e sync_agent_ds_get_sync_service_info(ds_profile_h profile_h, GList ** service_list);
554
555 /**
556  * @brief get profile last sync status, last sync time from profile info
557  * @par Usage:
558  * @code
559  *
560  * ds_profile_h profile_h = NULL;
561  * int profile_id = 1;
562  * int last_sync_status = 0;
563  * int last_sync_time = 0;
564  *
565  * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
566  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
567  *      ...
568  * }
569  *
570  *      ...
571  *
572  * ds_err = sync_agent_ds_get_last_sync_info(profile_h, &last_sync_status, &last_sync_time);
573  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
574  *      ...
575  * }
576  *
577  *      ...
578  *
579  * @endcode
580  * @param[in]   profile_h                               profile info
581  * @param[out]  last_sync_status                last sync status
582  * @param[out]  last_sync_time                  last sync time
583  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
584  * @see sync_agent_ds_get_profile
585  */
586         sync_agent_ds_error_e sync_agent_ds_get_last_sync_info(ds_profile_h profile_h, int *last_sync_status, int *last_sync_time);
587
588 /**
589  * @brief get statistics info list from profile info
590  * @par Usage:
591  * @code
592  *
593  * ds_profile_h profile_h = NULL;
594  * int profile_id = 1;
595  * GList *statistics_list = NULL;
596  *
597  * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_id, &profile_h);
598  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
599  *      ...
600  * }
601  *
602  *      ...
603  *
604  * ds_err = sync_agent_ds_get_sync_statistics(profile_h, &statistics_list);
605  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
606  *      ...
607  * }
608  *
609  *      ...
610  *
611  * @endcode
612  * @param[in]   profile_h                               profile info
613  * @param[out]  statistics_list                 list of statistics info structure
614  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
615  * @see sync_agent_ds_get_profile
616  */
617         sync_agent_ds_error_e sync_agent_ds_get_sync_statistics(ds_profile_h profile_h, GList ** statistics_list);
618
619 /**
620  * @brief add profile
621  * @par Usage:
622  * @code
623  *
624  * ds_profile_h profile_h = NULL;
625  * char *profile_name = "profile name";
626  *
627  * char *addr = "http://xxx.xxx.xxx";
628  * char *id = "id";
629  * char *password = "password";
630  *
631  * char *sync_mode = "Periodic";
632  * char *sync_type = "Update both";
633  * char *interval = "1 hour";
634  *
635  * sync_agent_ds_service_type_e service_type = SYNC_AGENT_CONTACT;
636  * int enabled = 1;
637  * char *src_uri = "Contacts";
638  * char *tgt_uri = "card";
639  * char *id = "id";
640  * char *password = "password";
641  *
642  * int profile_id = 0;
643  *
644  * sync_agent_ds_error_e ds_err = sync_agent_ds_create_profile_info(&profile_h);
645  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
646  *      ...
647  * }
648  *
649  *
650  * ds_err = sync_agent_ds_set_profile_name(profile_h, profile_name);
651  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
652  *      ...
653  * }
654  *
655  *
656  * ds_err = sync_agent_ds_set_server_info(profile_h, addr, id, password);
657  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
658  *      ...
659  * }
660  *
661  *
662  * ds_err = sync_agent_ds_set_sync_info(profile_h, sync_mode, sync_type, interval);
663  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
664  *      ...
665  * }
666  *
667  *
668  * ds_err = sync_agent_ds_set_sync_category(profile_h, service_type, enabled, src_uri, tgt_uri, id, password);
669  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
670  *      ...
671  * }
672  *
673  *
674  * ds_err = sync_agent_ds_add_profile(profile_h, &profile_id);
675  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
676  *      ...
677  * }
678  *
679  *
680  * @endcode
681  * @param[in]   profile_h               profile info
682  * @param[out]  profile_id              profile id
683  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
684  * @see sync_agent_ds_create_profile_info, sync_agent_ds_set_profile_name, sync_agent_ds_set_server_info, sync_agent_ds_set_sync_info, sync_agent_ds_set_sync_category
685  */
686         sync_agent_ds_error_e sync_agent_ds_add_profile(ds_profile_h profile_h, int *profile_id);
687
688 /**
689  * @brief get profile info
690  * @par Usage:
691  * @code
692  *
693  * ds_profile_h profile_h = NULL;
694  * char * profile_dir_name = "Sync1";
695  *
696  * sync_agent_ds_error_e ds_err = sync_agent_ds_get_profile(profile_dir_name, &profile_h);
697  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
698  *      ...
699  * }
700  *
701  * @endcode
702  * @param[in]   profile_id              profile id
703  * @param[out]  profile_h               profile info
704  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
705  * @see sync_agent_ds_free_profile_info
706  */
707         sync_agent_ds_error_e sync_agent_ds_get_profile(int profile_id, ds_profile_h * profile_h);
708
709 /**
710  * @brief get all profiles info
711  * @par Usage:
712  * @code
713  *
714  * ds_profile_h profile_h = NULL;
715  * GList **profile_list = NULL;
716  *
717  * sync_agent_ds_error_e ds_err = sync_agent_ds_get_all_profile(&profile_list);
718  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
719  *      ...
720  * }
721  *
722  * @endcode
723  * @param[out]  profile_list            list of profile info
724  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
725  * @see sync_agent_ds_free_profile_info
726  */
727         sync_agent_ds_error_e sync_agent_ds_get_all_profile(GList ** profile_list);
728
729 /**
730  * @brief update profile
731  * @par Usage:
732  * @code
733  *
734  * ds_profile_h profile_h = NULL;
735  * char *profile_dir_name = "Sync1";
736  * char *profile_name = "updated profile name";
737  *
738  * char *addr = "http://xxx.xxx.xxx";
739  * char *id = "id";
740  * char *password = "password";
741  *
742  * char *sync_mode = "Periodic";
743  * char *sync_type = "Update both";
744  * char *interval = "1 hour";
745  *
746  * sync_agent_ds_service_type_e service_type = SYNC_AGENT_CONTACT;
747  * int enabled = 1;
748  * char *src_uri = "Contacts";
749  * char *tgt_uri = "card";
750  * char *id = "id";
751  * char *password = "password";
752  *
753  * sync_agent_ds_error_e ds_err = sync_agent_ds_create_profile_info(&profile_h);
754  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
755  *      ...
756  * }
757  *
758  *
759  * ds_err = sync_agent_ds_set_profile_name(profile_h, profile_dir_name, profile_name);
760  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
761  *      ...
762  * }
763  *
764  *
765  * ds_err = sync_agent_ds_set_server_info(profile_h, addr, id, password);
766  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
767  *      ...
768  * }
769  *
770  *
771  * ds_err = sync_agent_ds_set_sync_info(profile_h, sync_mode, sync_type, interval);
772  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
773  *      ...
774  * }
775  *
776  *
777  * ds_err = sync_agent_ds_set_sync_category(profile_h, service_type, enabled, src_uri, tgt_uri, id, password);
778  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
779  *      ...
780  * }
781  *
782  *
783  * ds_err = sync_agent_ds_update_profile(profile_h);
784  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
785  *      ...
786  * }
787  *
788  * @endcode
789  * @param[in]   profile_h               profile info
790  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
791  * @see sync_agent_ds_create_profile_info, sync_agent_ds_set_profile_name, sync_agent_ds_set_server_info, sync_agent_ds_set_sync_info, sync_agent_ds_set_sync_category
792  */
793         sync_agent_ds_error_e sync_agent_ds_update_profile(ds_profile_h profile_h);
794
795 /**
796  * @brief delete profile
797  * @par Usage:
798  * @code
799  *
800  * sync_agent_ds_error_e ds_err = SYNC_AGENT_DS_FAIL;
801  * ds_profile_h profile_h = NULL;
802  * char *profileDirName = "Sync1";
803  *
804  * ds_err = sync_agent_ds_create_profile_info(&profile_h);
805  * if (result == SYNC_AGENT_DS_FAIL) {
806  *      ...
807  * }
808  *
809  * ds_err = sync_agent_ds_set_profile_name(profile_h, profileDirName, NULL);
810  * if (result == SYNC_AGENT_DS_FAIL) {
811  *      ...
812  * }
813  *
814  *
815  * ds_err = sync_agent_ds_delete_profile(profile_h);
816  * if (result == SYNC_AGENT_DS_FAIL) {
817  *      ...
818  * }
819  *
820  * @endcode
821  * @param[in]   profile_h               profile info
822  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
823  * @see sync_agent_ds_create_profile_info, sync_agent_ds_set_profile_name
824  */
825         sync_agent_ds_error_e sync_agent_ds_delete_profile(ds_profile_h profile_h);
826
827 /**
828  * @brief start sync
829  * @par Usage:
830  * @code
831  *
832  * sync_agent_ds_error_e ds_err = SYNC_AGENT_DS_FAIL;
833  * ds_profile_h profile_h = NULL;
834  * char *profileDirName = "Sync1";
835  *
836  * ds_err = sync_agent_ds_create_profile_info(&profile_h);
837  * if (result == SYNC_AGENT_DS_FAIL) {
838  *      ...
839  * }
840  *
841  * ds_err = sync_agent_ds_set_profile_name(profile_h, profileDirName, NULL);
842  * if (result == SYNC_AGENT_DS_FAIL) {
843  *      ...
844  * }
845  *
846  *
847  * ds_err = sync_agent_ds_start_sync(profile_h);
848  * if (result == SYNC_AGENT_DS_FAIL) {
849  *      ...
850  * }
851  *
852  * @endcode
853  * @param[in]   profile_h               profile info
854  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
855  * @see sync_agent_ds_create_profile_info, sync_agent_ds_set_profile_name
856  */
857         sync_agent_ds_error_e sync_agent_ds_start_sync(ds_profile_h profile_h);
858
859 /**
860  * @brief stop sync
861  * @par Usage:
862  * @code
863  *
864  * sync_agent_ds_error_e ds_err = SYNC_AGENT_DS_FAIL;
865  * ds_profile_h profile_h = NULL;
866  * char *profileDirName = "Sync1";
867  *
868  * ds_err = sync_agent_ds_create_profile_info(&profile_h);
869  * if (result == SYNC_AGENT_DS_FAIL) {
870  *      ...
871  * }
872  *
873  * ds_err = sync_agent_ds_set_profile_name(profile_h, profileDirName, NULL);
874  * if (result == SYNC_AGENT_DS_FAIL) {
875  *      ...
876  * }
877  *
878  *
879  * ds_err = sync_agent_ds_stop_sync(profile_h);
880  * if (result == SYNC_AGENT_DS_FAIL) {
881  *      ...
882  * }
883  *
884  * @endcode
885  * @param[in]   profile_h               profile info
886  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
887  * @see sync_agent_ds_create_profile_info, sync_agent_ds_set_profile_name
888  */
889         sync_agent_ds_error_e sync_agent_ds_stop_sync(ds_profile_h profile_h);
890
891 /**
892  * @brief free profile info
893  * @par Usage:
894  * @code
895  *
896  * sync_agent_ds_error_e ds_err = SYNC_AGENT_DS_FAIL;
897  * ds_profile_h profile_h = NULL;
898  *
899  * ds_err = sync_agent_ds_create_profile_info(&profile_h);
900  * if (result == SYNC_AGENT_DS_FAIL) {
901  *      ...
902  * }
903  *
904  * sync_agent_ds_free_profile_info(profile_h);
905  *
906  * @endcode
907  * @param[in]   profile_h               profile info
908  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
909  * @see sync_agent_ds_create_profile_info, sync_agent_ds_get_profile, sync_agent_ds_get_all_profile
910  */
911         void
912          sync_agent_ds_free_profile_info(ds_profile_h profile_h);
913
914 /**
915  * @brief deinitialize OMA DS
916  * @par Usage:
917  * @code
918  *
919  * sync_agent_ds_error_e ds_err = sync_agent_ds_init();
920  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
921  *      ...
922  * }
923  *
924  *
925  * ds_err = sync_agent_ds_deinit();
926  * if(ds_err != SYNC_AGENT_DS_SUCCESS) {
927  *      ...
928  * }
929  *
930  * @endcode
931  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
932  * @see sync_agent_ds_init
933  */
934         sync_agent_ds_error_e sync_agent_ds_deinit();
935
936 /**
937  * @brief deinitialize OMA DS
938  * @par Usage:
939  * @code
940  *
941  * sync_agent_ds_error_e ds_err = SYNC_AGENT_DS_SUCCESS;
942  *
943  * ds_err = sync_agent_ds_set_noti_callback(SYNC_AGENT_DS_SYNC_SESSION, _session_process_noti_cb, NULL);
944  * if (ds_err != SYNC_AGENT_DS_SUCCESS) {
945  *      _DEBUG_ERROR("sync_agent_ds_set_noti_callback() failed!!");
946  *      return -1;
947  * }
948  *
949  * ds_err = sync_agent_ds_set_noti_callback(SYNC_AGENT_DS_SYNC_PROCESS, _process_update_noti_cb, NULL);
950  * if (ds_err != SYNC_AGENT_DS_SUCCESS) {
951  *      _DEBUG_ERROR("sync_agent_ds_set_noti_callback() failed!!");
952  *      return -1;
953  * }
954  *
955  * @endcode
956  * @param[in]   type            noti callback type (sync_agent_ds_sync_callback_e)
957  * @param[in]   callback        noti callback function
958  * @param[in]   data            data
959  * @return SYNC_AGENT_DS_SUCCESS on success, SYNC_AGENT_DS_FAIL on fail
960  */
961         sync_agent_ds_error_e sync_agent_ds_set_noti_callback(sync_agent_ds_sync_callback_e type, sync_agent_noti_cb callback, void *data);
962
963 /**
964  *      @}
965  */
966
967 #ifdef __cplusplus
968 }
969 #endif                          /* __cplusplus */
970 #endif                          /* OMA_DS_API_H_ */