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.
18 #ifndef DATA_CONNECTOR_PLUGIN_H_
19 #define DATA_CONNECTOR_PLUGIN_H_
25 #include "plugin/data_connector_resource.h"
26 #include "data-adapter/error.h"
29 * @file data_connector_plugin.h
30 * @brief Provides function pointer manipulate operation for data connector module
33 /** @addtogroup plugin
38 * @brief Maximum number of data-connector plugin
40 #define PLUGIN_MAX_DATA_CONNECTOR 20
43 * @brief Prototype of plugin function for connecting(open) to the service
44 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
46 typedef sync_agent_da_return_e(*plugin_open_service_cb) (void);
49 * @brief Prototype of plugin function for disconnecting(close) to the service
50 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
52 typedef sync_agent_da_return_e(*plugin_close_service_cb) (void);
55 * @brief Prototype of plugin function for starting transaction for service storage
56 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
58 typedef sync_agent_da_return_e(*plugin_begin_transaction_cb) (void);
61 * @brief Prototype of plugin function for ending transaction for service storage
62 * @param[in] is_success flag to decide commit/rollback (1:commit, 0:rollback)
63 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
65 typedef sync_agent_da_return_e(*plugin_end_transaction_cb) (int is_success);
68 * @brief Prototype of plugin function for inserting item into service storage
69 * @param[in] account_id service account id
70 * @param[in] folder_id service folder id
71 * @param[in] data data to add to the service
72 * @param[in] item_id as returned by plugin_add_item_cb - success : id of the newly item added to the service, error : NULL
73 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
75 typedef sync_agent_da_return_e(*plugin_add_item_cb) (int account_id, char *folder_id, void *data, char **item_id);
78 * @brief Prototype of plugin function for inserting item into service storage
79 * @param[in] account_id service account id
80 * @param[in] folder_id service folder id
81 * @param[in] data data to add to the service
82 * @param[in] item_id as returned by plugin_add_item_cb - success : id of the newly item added to the service, error : NULL
83 * @param[in] item_id_count count of item_id
84 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
86 typedef sync_agent_da_return_e(*plugin_add_bulk_item_cb) (int account_id, char *folder_id, void *data, int **item_id, int *item_id_count);
89 * @brief Prototype of plugin function for updating item from service storage
90 * @param[in] account_id service account id
91 * @param[in] folder_id service folder id
92 * @param[in] item_id service item id
93 * @param[in] data data to update to the service
94 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
96 typedef sync_agent_da_return_e(*plugin_update_item_cb) (int account_id, char *folder_id, char *item_id, void *data);
99 * @brief Prototype of plugin function for updating item from service storage
100 * @param[in] data data to update to the service
101 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
103 typedef sync_agent_da_return_e(*plugin_update_bulk_item_cb) (void *data);
106 * @brief Prototype of plugin function for deleting item from service storage
107 * @param[in] account_id service account id
108 * @param[in] folder_id service folder id
109 * @param[in] item_id service id of item expected to be deleted
110 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
112 typedef sync_agent_da_return_e(*plugin_delete_item_cb) (int account_id, char *folder_id, char *item_id);
115 * @brief Prototype of plugin function for deleting item from service storage
116 * @param[in] item_id service id of item expected to be deleted
117 * @param[in] count count of service item id expected to be deleted
118 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
120 typedef sync_agent_da_return_e(*plugin_delete_bulk_item_cb) (int *item_id, int count);
123 * @brief Prototype of plugin function for deleting all items from service storage
124 * @param[in] account_id service account id
125 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
127 typedef sync_agent_da_return_e(*plugin_delete_all_items_cb) (int account_id);
130 * @brief Prototype of plugin function for getting item from service storage
131 * @param[in] account_id service account id
132 * @param[in] folder_id service folder id
133 * @param[in] item_id expected to get service item id
134 * @param[in] data as returned by plugin_get_item_cb - success : item info, error : NULL
135 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
137 typedef sync_agent_da_return_e(*plugin_get_item_cb) (int account_id, char *folder_id, char *item_id, void **data);
140 * @brief Prototype of plugin function for inserting folder into service storage
141 * @param[in] account_id service account id
142 * @param[in] folder_name folder name
143 * @param[in] folder_type folder type
144 * @param[in] folder_id as returned by plugin_add_folder_cb - success : id of the newly folder added to the service, fail : NULL
145 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
147 typedef sync_agent_da_return_e(*plugin_add_folder_cb) (int account_id, const char *folder_name, int folder_type, char **folder_id);
150 * @brief Prototype of plugin function for deleting folder from service storage
151 * @param[in] account_id service account id
152 * @param[in] folder_id service folder id
153 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
155 typedef sync_agent_da_return_e(*plugin_delete_folder_cb) (int account_id, const char *folder_id);
158 * @brief Prototype of plugin function for getting folder info from service storage
159 * @param[in] account_id service account id
160 * @param[in] folder_id service folder id
161 * @param[in] folder_name as returned by plugin_get_folder_cb - success : folder name, fail : NULL
162 * @param[in] folder_type as returned by plugin_get_folder_cb - success : folder type, fail : -1
163 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
165 typedef sync_agent_da_return_e(*plugin_get_folder_cb) (int account_id, const char *folder_id, char **folder_name, int *folder_type);
168 * @brief Prototype of plugin function for executing data into service
169 * @param[in] account_id service account id
170 * @param[in] execute_key execute key
171 * @param[in] execute_values execute values
172 * @param[in] result as returned by plugin_execute_cb - extension result info
173 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
175 typedef sync_agent_da_return_e(*plugin_execute_cb) (int account_id, const char *execute_key, void *execute_values, void **result);
178 * @brief Prototype of plugin function for getting item used count
179 * @return current_item_count on success, negative value on error
181 typedef int (*plugin_get_used_item_count_cb) (void);
184 * @brief Prototype of plugin function for getting item used count
185 * @return calendar exdate_item_count on success, negative value on error
187 typedef int (*plugin_get_deleted_exdate_item_count) (void);
190 * @brief Prototype of plugin function for checking whether exdate item exist
191 * @return calendar exdate_item_count on success, negative value on error
193 typedef int (*plugin_is_exist_exdate_item) (const char *fw_parent_id, const char *child_vcalendar);
196 * @brief Prototype of plugin function for updating the exdate parent item
199 typedef void (*plugin_construct_exdate_parent_item) (char *parent_service_id);
203 * @brief Prototype of plugin function for getting item used count for folder
204 * @param[in] account_id service account id
205 * @param[in] folder_id service folder id
206 * @return current_item_count on success, negative value on error
208 typedef int (*plugin_get_used_count_for_folder_cb) (int account_id, const char *folder_id);
211 * @brief Prototype of plugin function for writing data store items to file
212 * @param[in] account_id service account id
213 * @param[in] file_path written file path
214 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
216 typedef sync_agent_da_return_e(*plugin_backup_service_items_to_file_cb) (int account_id, char **file_path);
219 * @brief Prototype of plugin function for adding file-written item to data store
220 * @param[in] account_id service account id
221 * @param[in] file_path file path
222 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
224 typedef sync_agent_da_return_e(*plugin_restore_service_items_from_file_cb) (int account_id, const char *file_path);
227 * @brief Prototype of plugin function for getting folder id list of a account
228 * @param[in] account_id service account id
229 * @param[in] folder_count as returned by plugin_get_folder_id_list_cb - success : folder count, fail or not exist : 0
230 * @param[in] folder_type_list as returned by plugin_get_folder_id_list_cb - success : list, fail or not exist : NULL
231 * @return folder_id_list on success, NULL on error or not exist
233 typedef char **(*plugin_get_folder_id_list_cb) (int account_id, int *folder_count, int **folder_type_list);
236 * @brief Prototype of plugin function for getting all account id list that service has currently
237 * @param[in] count as returned by plugin_get_account_id_list_cb - success : count of account id, fail or not exist : 0
238 * @return account_id_list on success, NULL on fail or not exist
240 typedef int *(*plugin_get_account_id_list_cb) (int *count);
243 * @brief Prototype of plugin function for getting added item list after specific point
244 * @param[in] account_id service account id
245 * @param[in] folder_id service folder id
246 * @param[in] chage_point specific point
247 * @param[in] change_count as returned by plugin_get_changed_item_for_folder_add_cb - success : added item count, fail or not exist : NULL
248 * @return added_item_info_list (if exist) on success, NULL on error or not exist
250 typedef sync_agent_plugin_item_node_s *(*plugin_get_changed_item_for_folder_add_cb) (int account_id, const char *folder_id, int chage_point, int *change_count);
253 * @brief Prototype of plugin function for getting deleted item list after specific point
254 * @param[in] account_id service account id
255 * @param[in] folder_id service folder id
256 * @param[in] chage_point specific point
257 * @param[in] change_count as returned by plugin_get_changed_item_for_folder_delete_cb - success : deleted item count, fail or not exist : NULL
258 * @return deleted_item_info_list (if exist) on success, NULL on error or not exist
260 typedef sync_agent_plugin_item_node_s *(*plugin_get_changed_item_for_folder_delete_cb) (int account_id, const char *folder_id, int chage_point, int *change_count);
263 * @brief Prototype of plugin function for getting updated item list after specific point
264 * @param[in] account_id service account id
265 * @param[in] folder_id service folder id
266 * @param[in] chage_point specific point
267 * @param[in] change_count as returned by plugin_get_changed_item_for_folder_update_cb - success : updated item count, fail or not exist : NULL
268 * @return updated_item_info_list (if exist) on success, NULL on error or not exist
270 typedef sync_agent_plugin_item_node_s *(*plugin_get_changed_item_for_folder_update_cb) (int account_id, const char *folder_id, int chage_point, int *change_count);
273 * @brief Prototype of plugin function for getting last storage change point information
274 * @return last storage changing point information on success, 0 on error
276 typedef int (*plugin_get_last_change_point_cb) (void);
279 * @brief Prototype of plugin function for checking notification for the storage change
280 * @param[in] filter_flag user data
282 typedef void (*plugin_start_listening_change_noti_cb) (void *filter_flag);
285 * @brief Prototype of plugin function for setting callback function to handle added item to storage
286 * @param[in] callback callback function - this function is provided from sync-agent-framework
288 typedef void (*plugin_set_callback_add_item_cb) (sync_agent_add_item_cb_plugin callback);
291 * @brief Prototype of plugin function for setting callback function to handle deleted item to storage
292 * @param[in] callback callback function - this function is provided from sync-agent-framework
294 typedef void (*plugin_set_callback_delete_item_cb) (sync_agent_del_item_cb_plugin callback);
297 * @brief Prototype of plugin function for setting callback function to handle updated item to storage
298 * @param[in] callback callback function - this function is provided from sync-agent-framework
300 typedef void (*plugin_set_callback_update_item_cb) (sync_agent_update_item_cb_plugin callback);
303 * @brief Prototype of plugin function for setting callback function to get service account id list mapped sync-agent-framework account id
304 * @param[in] callback callback function - this function is provided from sync-agent-framework
306 typedef void (*plugin_set_callback_get_account_id_list_cb) (sync_agent_get_account_id_list_cb_plugin callback);
309 * @brief Prototype of plugin function for setting callback function to handle child item delete from storage
310 * @param[in] callback callback function - this function is provided from sync-agent-framework
312 typedef void (*plugin_set_callback_delete_child_item_cb) (sync_agent_del_child_item_cb_plugin callback);
315 /********************* Get Meta Info ******************/
318 * @brief Prototype of plugin function for getting max item count per folder
319 * @param[in] folder_type folder type provided plugin
320 * @return max item count on success, -1 on error
322 typedef int (*plugin_get_max_item_count_cb) (int folder_type);
325 * @brief Prototype of plugin function for getting service data's available field length
326 * @param[in] field_name field_name provided data-connector plugin
327 * @param[in] child_field_name child field name provided data-connector plugin
330 typedef int (*plugin_get_max_field_length_cb) (int field_name, int child_field_name);
333 * @brief Prototype of plugin function for getting service data's available field count
334 * @param[in] field_name field_name provided data-connector plugin
335 * @param[in] child_field_name child field name provided data-connector plugin
338 typedef int (*plugin_get_max_field_count_cb) (int field_name, int child_field_name);
341 * @brief Prototype of plugin function for getting service data's available field value's domain
342 * @param[in] field_name field name provided data-connector plugin
343 * @param[in] child_field_name child field name provided data-connector plugin
344 * @param[in] str_val as returned by plugin_get_field_value_cb - when domain value is string
345 * @param[in] num_val1 returned by plugin_get_field_value_cb - when domain value is integer (ex minimum value)
346 * @param[in] num_val2 as returned by plugin_get_field_value_cb - when domain value is integer (ex maximum value)
347 * @return 1 on success, -1 on error
349 typedef int (*plugin_get_field_value_cb) (int field_name, int child_field_name, char **str_val, int *num_val1, int *num_val2);
352 * @brief Prototype of plugin function for getting service data's available field count
353 * @param[in] feature feature provided data-connector plugin
354 * @return 1 : support, 0 : not support on success, -1 on error
356 typedef int (*plugin_get_is_support_feature_cb) (int feature);
359 * @brief Prototype of plugin function for get max name length of sim contact
360 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
362 typedef int (*plugin_get_info_sim_contact_max_name_length_cb) (void);
365 * @brief Prototype of plugin function for get max number length of sim contact
366 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
368 typedef int (*plugin_get_info_sim_contact_max_number_length_cb) (void);
371 * @brief Prototype of plugin function for get max email length of sim contact
372 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
374 typedef int (*plugin_get_info_sim_contact_max_email_length_cb) (void);
377 * @brief Prototype of plugin function for get empty count of sim contact
378 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
380 typedef int (*plugin_get_info_sim_contact_empty_count_cb) (void);
383 * @brief Prototype of plugin function for get empty number count of sim contact
384 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
386 typedef int (*plugin_get_info_sim_contact_empty_number_count_cb) (void);
389 * @brief Prototype of plugin function for get empty email count of sim contact
390 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
392 typedef int (*plugin_get_info_sim_contact_empty_email_count_cb) (void);
395 * @brief Prototype of plugin function for get addressbook id of sim contact
396 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
398 typedef int (*plugin_get_info_sim_contact_addressbook_id_cb) (void);
401 * @brief Prototype of plugin function for get item id of sim contact
402 * @param[out] item id of sim contact provided data-connector plugin
403 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
405 typedef sync_agent_da_return_e(*plugin_get_info_sim_contact_item_id_cb) (int sim_addressbook_id, GList **item_id);
408 * @brief Prototype of plugin function for get data of sim contact
409 * @param[out] item id of sim contact provided data-connector plugin
410 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
412 typedef sync_agent_da_return_e(*plugin_get_info_sim_contact_item_cb) (int item_id, char **data);
415 * @brief Prototype of plugin function for add sim contact
416 * @param[out] item id of sim contact provided data-connector plugin
417 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
419 typedef sync_agent_da_return_e(*plugin_add_sim_contact_item_cb) (int sim_addressbook_id, int **item_id, char *data);
422 * @brief Prototype of plugin function for write sim contact
423 * @param[out] item id of sim contact provided data-connector plugin
424 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
426 typedef sync_agent_da_return_e(*plugin_write_sim_contact_item_cb) (int item_id, char *data);
429 * @brief Prototype of plugin function for delete sim contact
430 * @param[out] item id of sim contact provided data-connector plugin
431 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
433 typedef sync_agent_da_return_e(*plugin_delete_sim_contact_item_cb) (int item_id);
436 * @brief Prototype of plugin function for add item
437 * @return SYNC_AGENT_DA_SUCCESS on success, otherwise error
439 typedef sync_agent_da_return_e(*plugin_add_async_item_cb) (GList *data, int count);
442 * @brief Structure for data-connector plugin function pointer set
445 plugin_open_service_cb func_open_service; /**< function pointer of plugin_open_service_cb */
446 plugin_close_service_cb func_close_service; /**< function pointer of plugin_close_service_cb */
447 plugin_begin_transaction_cb func_begin_transaction; /**< function pointer of plugin_begin_transaction_cb */
448 plugin_end_transaction_cb func_end_transaction; /**< function pointer of plugin_end_transaction_cb */
449 plugin_add_item_cb func_add_item; /**< function pointer of plugin_add_item_cb */
450 plugin_add_bulk_item_cb func_add_bulk_item; /**< function pointer of plugin_add_bulk_item_cb */
451 plugin_update_item_cb func_update_item; /**< function pointer of plugin_update_item_cb */
452 plugin_update_bulk_item_cb func_update_bulk_item; /**< function pointer of plugin_update_item_bulk_cb */
453 plugin_delete_item_cb func_delete_item; /**< function pointer of plugin_delete_item_cb */
454 plugin_delete_bulk_item_cb func_delete_bulk_item; /**< function pointer of plugin_delete_bulk_item_cb */
455 plugin_delete_all_items_cb func_delete_all_items; /**< function pointer of plugin_delete_all_items_cb */
456 plugin_get_item_cb func_get_item; /**< function pointer of plugin_get_item_cb */
457 plugin_add_folder_cb func_add_folder; /**< function pointer of plugin_add_folder_cb */
458 plugin_delete_folder_cb func_delete_folder; /**< function pointer of plugin_delete_folder_cb */
459 plugin_get_folder_cb func_get_folder; /**< function pointer of plugin_get_folder_cb */
460 plugin_execute_cb func_execute; /**< function pointer of plugin_execute_cb */
461 plugin_get_used_item_count_cb func_get_used_item_cnt; /**< function pointer of plugin_get_used_item_count_cb */
462 plugin_get_deleted_exdate_item_count func_get_deleted_exdate_item_cnt; /**< function pointer of plugin_get_deleted_exdate_item_count_cb */
463 plugin_is_exist_exdate_item func_is_exist_exdate_item; /**< function pointer of plugin_is_exist_exdate_item */
464 plugin_construct_exdate_parent_item func_construct_exdate_parent_item; /**< function pointer of plugin_construct_exdate_parent_item */
465 plugin_get_used_count_for_folder_cb func_get_used_cnt_for_folder; /**< function pointer of plugin_get_used_count_for_folder_cb */
466 plugin_backup_service_items_to_file_cb func_backup_service_items_to_file; /**< function pointer of plugin_backup_service_items_to_file_cb */
467 plugin_restore_service_items_from_file_cb func_restore_service_items_from_file; /**< function pointer of plugin_restore_service_items_from_file_cb */
468 plugin_get_folder_id_list_cb func_get_folder_id_list; /**< function pointer of plugin_get_folder_id_list_cb */
469 plugin_get_account_id_list_cb func_get_account_id_list; /**< function pointer of plugin_get_account_id_list_cb */
470 plugin_get_changed_item_for_folder_add_cb func_get_chaned_item_for_folder_add; /**< function pointer of plugin_get_changed_item_for_folder_add_cb */
471 plugin_get_changed_item_for_folder_delete_cb func_get_chaned_item_for_folder_delete; /**< function pointer of plugin_get_changed_item_for_folder_delete_cb */
472 plugin_get_changed_item_for_folder_update_cb func_get_chaned_item_for_folder_update; /**< function pointer of plugin_get_changed_item_for_folder_update_cb */
473 plugin_get_last_change_point_cb func_get_last_change_point; /**< function pointer of plugin_get_last_change_point_cb */
474 plugin_start_listening_change_noti_cb func_start_listening_change_noti; /**< function pointer of plugin_start_listening_change_noti_cb */
475 plugin_set_callback_add_item_cb func_set_callback_add_item; /**< function pointer of plugin_set_callback_add_item_cb */
476 plugin_set_callback_delete_item_cb func_set_callback_delete_item; /**< function pointer of plugin_set_callback_delete_item_cb */
477 plugin_set_callback_delete_child_item_cb func_set_callback_delete_child_item; /**< function pointer of plugin_set_callback_delete_item_cb */
478 plugin_set_callback_update_item_cb func_set_callback_update_item; /**< function pointer of plugin_set_callback_update_item_cb */
479 plugin_set_callback_get_account_id_list_cb func_set_callback_get_account_id_list; /**< function pointer of plugin_set_callback_get_account_id_list_cb */
480 plugin_get_max_item_count_cb func_get_max_item_count; /**< function pointer of plugin_get_max_item_count_cb */
481 plugin_get_max_field_length_cb func_get_max_field_length; /**< function pointer of plugin_get_max_field_length_cb */
482 plugin_get_max_field_count_cb func_get_max_field_count; /**< function pointer of plugin_get_max_field_count_cb */
483 plugin_get_field_value_cb func_get_field_value; /**< function pointer of plugin_get_field_value_cb */
484 plugin_get_is_support_feature_cb func_get_is_support_feature; /**< function pointer of plugin_get_is_support_feature_cb */
485 plugin_get_info_sim_contact_max_name_length_cb func_get_info_sim_contact_max_name_length; /**< function pointer of plugin_get_info_sim_contact_max_name_length_cb */
486 plugin_get_info_sim_contact_max_number_length_cb func_get_info_sim_contact_max_number_length; /**< function pointer of plugin_get_info_sim_contact_max_number_length_cb */
487 plugin_get_info_sim_contact_max_email_length_cb func_get_info_sim_contact_max_email_length; /**< function pointer of plugin_get_info_sim_contact_max_email_length_cb */
488 plugin_get_info_sim_contact_empty_count_cb func_get_info_sim_contact_empty_count; /**< function pointer of plugin_get_info_sim_contact_empty_count_cb */
489 plugin_get_info_sim_contact_empty_number_count_cb func_get_info_sim_contact_empty_number_count; /**< function pointer of plugin_get_info_sim_contact_empty_number_count_cb */
490 plugin_get_info_sim_contact_empty_email_count_cb func_get_info_sim_contact_empty_email_count; /**< function pointer of plugin_get_info_sim_contact_empty_email_count_cb */
491 plugin_get_info_sim_contact_addressbook_id_cb func_get_info_sim_contact_addressbook_id; /**< function pointer of plugin_get_info_sim_contact_addressbook_id_cb */
492 plugin_get_info_sim_contact_item_id_cb func_get_info_sim_contact_item_id; /**< function pointer of plugin_get_info_sim_contact_item_id_cb */
493 plugin_get_info_sim_contact_item_cb func_get_info_sim_contact_item; /**< function pointer of plugin_get_info_sim_contact_item_cb */
494 plugin_add_sim_contact_item_cb func_add_sim_contact_item; /**< function pointer of plugin_add_sim_contact_item_cb */
495 plugin_write_sim_contact_item_cb func_write_sim_contact_item; /**< function pointer of plugin_write_sim_contact_item_cb */
496 plugin_delete_sim_contact_item_cb func_delete_sim_contact_item; /**< function pointer of plugin_delete_sim_contact_item_cb */
497 plugin_add_async_item_cb func_add_async_item; /**< function pointer of plugin_add_async_item_cb */
498 } plugin_data_connector_func_set_s;
501 * @brief Structure for data-connector plugin management
504 plugin_info_s plugin_info; /**< plugin info */
505 plugin_data_connector_func_set_s func_set; /**< data-connector plugin function pointer set */
506 int data_converter_id; /**< data converter id */
507 int handle_change_noti; /**< whether to use change noti feature - described in framework initialization config file /<tagHandle-ChangeNoti> */
508 int use_main_loop; /**< whether to use main loop */
509 } plugin_data_connector_s;
512 * @brief Get data-connector plugin function pointer set
513 * @param[in] plugin_handle handle of data-connector plugin (result of dlopen for data-connector plugin)
514 * @param[in] error_code as returned by plugin_get_data_connector_func_set() - plugin error
515 * @return plugin_data_connector_func_set_s instance
517 plugin_data_connector_func_set_s plugin_get_data_connector_func_set(void *plugin_handle, plugin_error_e * error_code);
520 * @brief Register data-connector plugin instance to the data-connector plugin repository being maintained as a singleton
521 * @param[in] plugin plugin_data_connector_s instance
522 * @return PLUGIN_SUCCESS on success, otherwise on error
524 plugin_error_e plugin_register_plugin_data_connector(plugin_data_connector_s plugin);
527 * @brief Clear data-connector plugin repository being maintained as a singleton
529 void plugin_clear_plugin_data_connector();
532 * @brief Get data-connector plugin repository
533 * @param[in] count as returned by plugin_get_data_connector_plugin_repository() - the number of data-connector plugin
534 * @return data-connector plugin repository being maintained as a singleton
536 const plugin_data_connector_s *plugin_get_data_connector_plugin_repository(int *count);
539 * @brief Get data-converter plugin id related with specific data-connector plugin
540 * @param[in] dc_plugin_id data-connector plugin id
541 * @return data-converter plugin id (positive value) on success, -1 on error
543 int plugin_get_data_converter_plugin_id(int dc_plugin_id);
546 * @brief Get list of data-connector plugin id
547 * @param[in] count as returned by plugin_get_data_connector_plugin_id_list() - the number of data-connector plugin
548 * @return list of data-connector plugin id on success, NULL on error
550 int *plugin_get_data_connector_plugin_id_list(int *count);
553 * @brief Get function pointer of plugin_open_service_cb
554 * @param[in] plugin_id data-connector plugin id
555 * @return function pointer of plugin_open_service_cb on success, NULL on error
557 plugin_open_service_cb plugin_get_function_open_service(int plugin_id);
560 * @brief Get function pointer of plugin_close_service_cb
561 * @param[in] plugin_id data-connector plugin id
562 * @return function pointer of plugin_close_service_cb on success, NULL on error
564 plugin_close_service_cb plugin_get_function_close_service(int plugin_id);
567 * @brief Get function pointer of plugin_begin_transaction_cb
568 * @param[in] plugin_id data-connector plugin id
569 * @return function pointer of plugin_begin_transaction_cb on success, NULL on error
571 plugin_begin_transaction_cb plugin_get_function_begin_transaction(int plugin_id);
574 * @brief Get function pointer of plugin_end_transaction_cb
575 * @param[in] plugin_id data-connector plugin id
576 * @return function pointer of plugin_end_transaction_cb on success, NULL on error
578 plugin_end_transaction_cb plugin_get_function_end_transaction(int plugin_id);
581 * @brief Get function pointer of plugin_add_item_cb
582 * @param[in] plugin_id data-connector plugin id
583 * @return function pointer of plugin_add_item_cb on success, NULL on error
585 plugin_add_item_cb plugin_get_function_add_item(int plugin_id);
588 * @brief Get function pointer of plugin_add_bulk_item_cb
589 * @param[in] plugin_id data-connector plugin id
590 * @return function pointer of plugin_add_bulk_item_cb on success, NULL on error
592 plugin_add_bulk_item_cb plugin_get_function_add_bulk_item(int plugin_id);
595 * @brief Get function pointer of plugin_update_item_cb
596 * @param[in] plugin_id data-connector plugin id
597 * @return function pointer of plugin_update_item_cb on success, NULL on error
599 plugin_update_item_cb plugin_get_function_update_item(int plugin_id);
602 * @brief Get function pointer of plugin_update_bulk_item_cb
603 * @param[in] plugin_id data-connector plugin id
604 * @return function pointer of plugin_update_item_cb on success, NULL on error
606 plugin_update_bulk_item_cb plugin_get_function_update_bulk_item(int plugin_id);
609 * @brief Get function pointer of plugin_delete_item_cb
610 * @param[in] plugin_id data-connector plugin id
611 * @return function pointer of plugin_delete_item_cb on success, NULL on error
613 plugin_delete_item_cb plugin_get_function_del_item(int plugin_id);
616 * @brief Get function pointer of plugin_delete_bulk_item_cb
617 * @param[in] plugin_id data-connector plugin id
618 * @return function pointer of plugin_delete_bulk_item_cb on success, NULL on error
620 plugin_delete_bulk_item_cb plugin_get_function_del_bulk_item(int plugin_id);
623 * @brief Get function pointer of plugin_delete_all_items_cb
624 * @param[in] plugin_id data-connector plugin id
625 * @return function pointer of plugin_delete_all_items_cb on success, NULL on error
627 plugin_delete_all_items_cb plugin_get_function_del_all_items(int plugin_id);
630 * @brief Get function pointer of plugin_get_item_cb
631 * @param[in] plugin_id data-connector plugin id
632 * @return function pointer of plugin_get_item_cb on success, NULL on error
634 plugin_get_item_cb plugin_get_function_get_item(int plugin_id);
637 * @brief Get function pointer of plugin_add_folder_cb
638 * @param[in] plugin_id data-connector plugin id
639 * @return function pointer of plugin_add_folder_cb on success, NULL on error
641 plugin_add_folder_cb plugin_get_function_add_folder(int plugin_id);
644 * @brief Get function pointer of plugin_delete_folder_cb
645 * @param[in] plugin_id data-connector plugin id
646 * @return function pointer of plugin_delete_folder_cb on success, NULL on error
648 plugin_delete_folder_cb plugin_get_function_delete_folder(int plugin_id);
651 * @brief Get function pointer of plugin_get_folder_cb
652 * @param[in] plugin_id data-connector plugin id
653 * @return function pointer of plugin_get_folder_cb on success, NULL on error
655 plugin_get_folder_cb plugin_get_function_get_folder(int plugin_id);
658 * @brief Get function pointer of plugin_execute_cb
659 * @param[in] plugin_id data-connector plugin id
660 * @return function pointer of plugin_execute_cb on success, NULL on error
662 plugin_execute_cb plugin_get_function_execute(int plugin_id);
665 * @brief Get function pointer of plugin_get_used_item_count_cb
666 * @param[in] plugin_id data-connector plugin id
667 * @return function pointer of plugin_get_used_item_count_cb on success, NULL on error
669 plugin_get_used_item_count_cb plugin_get_function_get_used_item_count(int plugin_id);
672 * @brief Get function pointer of plugin_get_deleted_exdate_item_count_cb
673 * @param[in] plugin_id data-connector plugin id
674 * @return function pointer of plugin_get_deleted_exdate_item_count_cb on success, NULL on error
676 plugin_get_deleted_exdate_item_count plugin_get_function_get_deleted_exdate_item_count(int plugin_id);
679 * @brief Get function pointer of plugin_function_is_exist_exdate_item
680 * @param[in] plugin_id data-connector plugin id
681 * @return function pointer of plugin_function_is_exist_exdate_item on success, NULL on error
683 plugin_is_exist_exdate_item plugin_function_is_exist_exdate_item(int plugin_id);
686 * @brief Get function pointer of plugin_function_construct_exdate_parent_item
687 * @param[in] plugin_id data-connector plugin id
688 * @return function pointer of plugin_function_construct_exdate_parent_item on success, NULL on error
690 plugin_construct_exdate_parent_item plugin_function_construct_exdate_parent_item(int plugin_id);
694 * @brief Get function pointer of plugin_get_used_count_for_folder_cb
695 * @param[in] plugin_id data-connector plugin id
696 * @return function pointer of plugin_get_used_count_for_folder_cb on success, NULL on error
698 plugin_get_used_count_for_folder_cb plugin_get_function_get_used_count_for_folder(int plugin_id);
701 * @brief Get function pointer of plugin_get_folder_id_list_cb
702 * @param[in] plugin_id data-connector plugin id
703 * @return function pointer of plugin_get_folder_id_list_cb on success, NULL on error
705 plugin_get_folder_id_list_cb plugin_get_function_get_folder_id_list(int plugin_id);
708 * @brief Get function pointer of plugin_get_account_id_list_cb
709 * @param[in] plugin_id data-connector plugin id
710 * @return function pointer of plugin_get_account_id_list_cb on success, NULL on error
712 plugin_get_account_id_list_cb plugin_get_function_get_account_id_list(int plugin_id);
715 * @brief Get function pointer of plugin_backup_service_items_to_file_cb
716 * @param[in] plugin_id data-connector plugin id
717 * @return function pointer of plugin_backup_service_items_to_file_cb on success, NULL on error
719 plugin_backup_service_items_to_file_cb plugin_get_function_backup_service_items_to_file(int plugin_id);
722 * @brief Get function pointer of plugin_restore_service_items_from_file_cb
723 * @param[in] plugin_id data-connector plugin id
724 * @return function pointer of plugin_restore_service_items_from_file_cb on success, NULL on error
726 plugin_restore_service_items_from_file_cb plugin_get_function_restore_service_items_from_file(int plugin_id);
729 * @brief Get function pointer of plugin_get_changed_item_for_folder_add_cb
730 * @param[in] plugin_id data-connector plugin id
731 * @return function pointer of plugin_get_changed_item_for_folder_add_cb on success, NULL on error
733 plugin_get_changed_item_for_folder_add_cb plugin_get_function_get_changed_item_for_folder_add(int plugin_id);
736 * @brief Get function pointer of plugin_get_changed_item_for_folder_delete_cb
737 * @param[in] plugin_id data-connector plugin id
738 * @return function pointer of plugin_get_changed_item_for_folder_delete_cb on success, NULL on error
740 plugin_get_changed_item_for_folder_delete_cb plugin_get_function_get_changed_item_for_folder_delete(int plugin_id);
743 * @brief Get function pointer of plugin_get_changed_item_for_folder_update_cb
744 * @param[in] plugin_id data-connector plugin id
745 * @return function pointer of plugin_get_changed_item_for_folder_update_cb on success, NULL on error
747 plugin_get_changed_item_for_folder_update_cb plugin_get_function_get_changed_item_for_folder_update(int plugin_id);
750 * @brief Get function pointer of plugin_get_last_change_point_cb
751 * @param[in] plugin_id data-connector plugin id
752 * @return function pointer of plugin_get_last_change_point_cb on success, NULL on error
754 plugin_get_last_change_point_cb plugin_get_function_get_last_change_point(int plugin_id);
757 * @brief Get function pointer of plugin_start_listening_change_noti_cb
758 * @param[in] plugin_id data-connector plugin id
759 * @return function pointer of plugin_start_listening_change_noti_cb on success, NULL on error
761 plugin_start_listening_change_noti_cb plugin_get_function_start_listening_change_noti(int plugin_id);
764 * @brief Get function pointer of plugin_set_callback_add_item_cb
765 * @param[in] plugin_id data-connector plugin id
766 * @return function pointer of plugin_set_callback_add_item_cb on success, NULL on error
768 plugin_set_callback_add_item_cb plugin_get_function_set_callback_add_item(int plugin_id);
771 * @brief Get function pointer of plugin_set_callback_delete_item_cb
772 * @param[in] plugin_id data-connector plugin id
773 * @return function pointer of plugin_set_callback_delete_item_cb on success, NULL on error
775 plugin_set_callback_delete_item_cb plugin_get_function_set_callback_delete_item(int plugin_id);
778 * @brief Get function pointer of plugin_set_callback_delete_child_item_cb
779 * @param[in] plugin_id data-connector plugin id
780 * @return function pointer of plugin_set_callback_delete_child_item_cb on success, NULL on error
782 plugin_set_callback_delete_child_item_cb plugin_get_function_set_callback_delete_child_item(int plugin_id);
786 * @brief Get function pointer of plugin_set_callback_update_item_cb
787 * @param[in] plugin_id data-connector plugin id
788 * @return function pointer of plugin_set_callback_update_item_cb on success, NULL on error
790 plugin_set_callback_update_item_cb plugin_get_function_data_connector_set_callback_update_item(int plugin_id);
793 * @brief Get function pointer of plugin_set_callback_get_account_id_list_cb
794 * @param[in] plugin_id data-connector plugin id
795 * @return function pointer of plugin_set_callback_get_account_id_list_cb on success, NULL on error
797 plugin_set_callback_get_account_id_list_cb plugin_get_function_set_callback_get_account_id_list(int plugin_id);
800 * @brief Get function pointer of plugin_get_max_item_count_cb
801 * @param[in] plugin_id data-connector plugin id
802 * @return function pointer of plugin_get_max_item_count_cb on success, NULL on error
804 plugin_get_max_item_count_cb plugin_get_function_get_max_item_count(int plugin_id);
807 * @brief Get function pointer of plugin_get_max_field_length_cb
808 * @param[in] plugin_id data-connector plugin id
809 * @return function pointer of plugin_get_max_field_length_cb on success, NULL on error
811 plugin_get_max_field_length_cb plugin_get_function_get_max_field_length(int plugin_id);
814 * @brief Get function pointer of plugin_get_max_field_count_cb
815 * @param[in] plugin_id data-connector plugin id
816 * @return function pointer of plugin_get_max_field_count_cb on success, NULL on error
818 plugin_get_max_field_count_cb plugin_get_function_get_max_field_count(int plugin_id);
821 * @brief Get function pointer of plugin_get_field_value_cb
822 * @param[in] plugin_id data-connector plugin id
823 * @return function pointer of plugin_get_field_value_cb on success, NULL on error
825 plugin_get_field_value_cb plugin_get_function_get_field_value(int plugin_id);
828 * @brief Get function pointer of plugin_get_is_support_feature_cb
829 * @param[in] plugin_id data-connector plugin id
830 * @return function pointer of plugin_get_is_support_feature_cb on success, NULL on error
832 plugin_get_is_support_feature_cb plugin_get_function_get_is_support_feature(int plugin_id);
835 * @brief Get function pointer of plugin_get_info_sim_contact_max_name_length_cb
836 * @param[in] plugin_id data-connector plugin id
837 * @return function pointer of plugin_get_info_sim_contact_max_name_length_cb on success, NULL on error
839 plugin_get_info_sim_contact_max_name_length_cb plugin_get_function_get_info_sim_contact_max_name_length(int plugin_id);
842 * @brief Get function pointer of plugin_get_info_sim_contact_max_number_length_cb
843 * @param[in] plugin_id data-connector plugin id
844 * @return function pointer of plugin_get_info_sim_contact_max_number_length_cb on success, NULL on error
846 plugin_get_info_sim_contact_max_number_length_cb plugin_get_function_get_info_sim_contact_max_number_length(int plugin_id);
849 * @brief Get function pointer of plugin_get_info_sim_contact_max_email_length_cb
850 * @param[in] plugin_id data-connector plugin id
851 * @return function pointer of plugin_get_info_sim_contact_max_email_length_cb on success, NULL on error
853 plugin_get_info_sim_contact_max_email_length_cb plugin_get_function_get_info_sim_contact_max_email_length(int plugin_id);
856 * @brief Get function pointer of plugin_get_info_sim_contact_empty_count_cb
857 * @param[in] plugin_id data-connector plugin id
858 * @return function pointer of plugin_get_info_sim_contact_empty_count_cb on success, NULL on error
860 plugin_get_info_sim_contact_empty_count_cb plugin_get_function_get_info_sim_contact_empty_count(int plugin_id);
863 * @brief Get function pointer of plugin_get_info_sim_contact_empty_number_count_cb
864 * @param[in] plugin_id data-connector plugin id
865 * @return function pointer of plugin_get_info_sim_contact_empty_number_count_cb on success, NULL on error
867 plugin_get_info_sim_contact_empty_number_count_cb plugin_get_function_get_info_sim_contact_empty_number_count(int plugin_id);
870 * @brief Get function pointer of plugin_get_info_sim_contact_empty_email_count_cb
871 * @param[in] plugin_id data-connector plugin id
872 * @return function pointer of plugin_get_info_sim_contact_empty_email_count_cb on success, NULL on error
874 plugin_get_info_sim_contact_empty_email_count_cb plugin_get_function_get_info_sim_contact_empty_email_count(int plugin_id);
877 * @brief Get function pointer of plugin_get_info_sim_contact_addressbook_id_cb
878 * @param[in] plugin_id data-connector plugin id
879 * @return function pointer of plugin_get_info_sim_contact_addressbook_id_cb on success, NULL on error
881 plugin_get_info_sim_contact_addressbook_id_cb plugin_get_function_get_info_sim_contact_addressbook_id(int plugin_id);
884 * @brief Get function pointer of plugin_get_info_sim_contact_item_id_cb
885 * @param[in] plugin_id data-connector plugin id
886 * @return function pointer of plugin_get_info_sim_contact_item_id_cb on success, NULL on error
888 plugin_get_info_sim_contact_item_id_cb plugin_get_function_get_info_sim_contact_item_id(int plugin_id);
891 * @brief Get function pointer of plugin_get_info_sim_contact_item_cb
892 * @param[in] plugin_id data-connector plugin id
893 * @return function pointer of plugin_get_info_sim_contact_item_cb on success, NULL on error
895 plugin_get_info_sim_contact_item_cb plugin_get_function_get_info_sim_contact_item(int plugin_id);
898 * @brief Get function pointer of plugin_add_sim_contact_item_cb
899 * @param[in] plugin_id data-connector plugin id
900 * @return function pointer of plugin_add_sim_contact_item_cb on success, NULL on error
902 plugin_add_sim_contact_item_cb plugin_get_function_add_sim_contact_item(int plugin_id);
905 * @brief Get function pointer of plugin_write_sim_contact_item_cb
906 * @param[in] plugin_id data-connector plugin id
907 * @return function pointer of plugin_write_sim_contact_item_cb on success, NULL on error
909 plugin_write_sim_contact_item_cb plugin_get_function_write_sim_contact_item(int plugin_id);
912 * @brief Get function pointer of plugin_delete_sim_contact_item_cb
913 * @param[in] plugin_id data-connector plugin id
914 * @return function pointer of plugin_delete_sim_contact_item_cb on success, NULL on error
916 plugin_delete_sim_contact_item_cb plugin_get_function_delete_sim_contact_item(int plugin_id);
919 * @brief Get function pointer of plugin_add_async_item_cb
920 * @param[in] plugin_id data-connector plugin id
921 * @return function pointer of plugin_add_async_item_cb on success, NULL on error
923 plugin_add_async_item_cb plugin_get_function_add_async_item(int plugin_id);
929 #endif /* DATA_CONNECTOR_PLUGIN_H_ */