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_RESOURCE_H_
19 #define DATA_CONNECTOR_RESOURCE_H_
23 #endif /* __cplusplus */
26 * @file data_connector_resource.h
27 * @brief Item id list container & callback functions for item change notification
28 * @remarks Implementation will operate sync-agent-framework data-adapter module
31 /** @addtogroup plugin_dataconnector DataConnector Domain
37 * Structure of Item ID Node - Linked List
39 struct sync_agent_plugin_item_node_s {
42 struct sync_agent_plugin_item_node_s *next;
46 typedef struct sync_agent_plugin_item_node_s sync_agent_plugin_item_node_s;
49 * Function which is called at some plugin (calendar, contact, memo) when new item is added to the service
51 * @param[in] account_id service account id
52 * @param[in] index possible mapping one service account with multiple sync-agent-framework account, so need index of sync-agent-framework account.
53 * @param[in] item_id service item id
54 * @param[in] item_type service type - service data connector plugin's id described in sync-agent-framework config xml file
55 * @param[in] folder_id service folder id
56 * @param[in] folder_type folder type defined in data-connector plugin
58 * @return 1 on success, 0 on error
63 * @see sync_agent_plugin_set_callback_add_item(sync_agent_add_item_cb_plugin)
66 typedef int (*sync_agent_add_item_cb_plugin) (int account_id, int index, char *item_id, int item_type, char *folder_id, int folder_type);
69 * Function which is called at some plugin (calendar, contact, memo) when existing item is deleted to the service
71 * @param[in] account_id service account id
72 * @param[in] index possible mapping one service account with multiple sync-agent-framework account, so need index of sync-agent-framework account.
73 * @param[in] item_id service item id
74 * @param[in] item_type service type - service data connector plugin's id described in sync-agent-framework config xml file
76 * @return 1 on success, 0 on error
81 * @see sync_agent_plugin_set_callback_delete_item(sync_agent_del_item_cb_plugin)
84 typedef int (*sync_agent_del_item_cb_plugin) (int account_id, int index, char *item_id, int item_type);
87 * Function which is called at some plugin (calendar, contact, memo) when existing item is updated to the service
89 * @param[in] account_id service account id
90 * @param[in] index possible mapping one service account with multiple sync-agent-framework account, so need index of sync-agent-framework account.
91 * @param[in] item_id service item id
92 * @param[in] item_type service type - service data connector plugin's id described in sync-agent-framework config xml file
94 * @return 1 on success, 0 on error
99 * @see sync_agent_plugin_set_callback_update_item(sync_agent_update_item_cb_plugin)
102 typedef int (*sync_agent_update_item_cb_plugin) (int account_id, int index, char *item_id, int item_type);
105 * Function which is called at some plugin (calendar, contact, memo) when need service account id list concerned of service_type
107 * @param[in] service_type service data connector plugin's id described in sync-agent-framework config xml file
108 * @param[in] cnt as returned by sync_agent_get_account_id_list_cb_plugin() - count of account id
110 * @return account_id_list on success, NULL on error or not exist
115 * @see sync_agent_plugin_set_callback_get_account_id_list(sync_agent_get_account_id_list_cb_plugin)
118 typedef int *(*sync_agent_get_account_id_list_cb_plugin) (int service_type, int *cnt);
126 #endif /* __cplusplus */
127 #endif /* DATA_CONNECTOR_RESOURCE_H_ */