Fix compatibility for x64 arch.
[platform/core/system/sync-agent.git] / include / plugin / data_connector_resource.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 DATA_CONNECTOR_RESOURCE_H_
19 #define DATA_CONNECTOR_RESOURCE_H_
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif                          /* __cplusplus */
24
25 /**
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
29  */
30
31 /** @addtogroup plugin_dataconnector DataConnector Domain
32  * @ingroup plugin
33  *      @{
34  */
35
36 /**
37  * Structure of Item ID Node - Linked List
38  */
39         struct sync_agent_plugin_item_node_s {
40                 char *item_id;                                                                  /**< item id */
41                 char *parent_item_id;                                                   /**< parent item id for exdate items*/
42                 struct sync_agent_plugin_item_node_s *next;             /**< next pointer */
43         };
44
45         typedef struct sync_agent_plugin_item_node_s sync_agent_plugin_item_node_s;
46
47 /**
48  * Function which is called at some plugin (calendar, contact, memo) when new item is added to the service
49  *
50  * @param[in] account_id service account id
51  * @param[in] index possible mapping one service account with multiple sync-agent-framework account, so need index of sync-agent-framework account.
52  * @param[in] item_id service item id
53  * @param[in] parent_id parent 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
57  *
58  * @return 1 on success, 0 on error
59  *
60  * @par Since:
61  *
62  *
63  * @see sync_agent_plugin_set_callback_add_item(sync_agent_add_item_cb_plugin)
64  *
65  */
66         typedef int (*sync_agent_add_item_cb_plugin) (int account_id, int index, char *item_id, char *parent_id, int item_type, char *folder_id, int folder_type);
67
68 /**
69  * Function which is called at some plugin (calendar, contact, memo) when existing item is deleted to the service
70  *
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
75  *
76  * @return 1 on success, 0 on error
77  *
78  * @par Since:
79  *
80  *
81  * @see sync_agent_plugin_set_callback_delete_item(sync_agent_del_item_cb_plugin)
82  *
83  */
84         typedef int (*sync_agent_del_item_cb_plugin) (int account_id, int index, char *item_id, int item_type);
85
86
87 /**
88  * Function which is called at some plugin (calendar, contact, memo) when existing item is updated to the service
89  *
90  * @param[in] account_id service account id
91  * @param[in] index possible mapping one service account with multiple sync-agent-framework account, so need index of sync-agent-framework account.
92  * @param[in] item_id service item id
93  * @param[in] parent_id parent service item id
94  * @param[in] item_type service type - service data connector plugin's id described in sync-agent-framework config xml file
95  *
96  * @return 1 on success, 0 on error
97  *
98  * @par Since:
99  *
100  *
101  * @see sync_agent_plugin_set_callback_update_item(sync_agent_update_item_cb_plugin)
102  *
103  */
104         typedef int (*sync_agent_update_item_cb_plugin) (int account_id, int index, char *item_id,  char *parent_id, int item_type);
105
106 /**
107  * Function which is called at some plugin (calendar, contact, memo) when need service account id list concerned of service_type
108  *
109  * @param[in] service_type service data connector plugin's id described in sync-agent-framework config xml file
110  * @param[in] cnt as returned by sync_agent_get_account_id_list_cb_plugin() - count of account id
111  *
112  * @return account_id_list on success, NULL on error or not exist
113  *
114  * @par Since:
115  *
116  *
117  * @see sync_agent_plugin_set_callback_get_account_id_list(sync_agent_get_account_id_list_cb_plugin)
118  *
119  */
120         typedef int *(*sync_agent_get_account_id_list_cb_plugin) (int service_type, int *cnt);
121
122 /**
123  * Function which is called at calendar when existing child item is deleted to the service
124  *
125  * @param[in] parent_id parent_service_id
126  *
127  * @return 1 on success, 0 on error
128  *
129  * @par Since:
130  *
131  *
132  * @see sync_agent_plugin_set_callback_delete_child_item(sync_agent_del_child_item_cb_plugin)
133  *
134  */
135         typedef int (*sync_agent_del_child_item_cb_plugin) (char *parent_id, char *child_id);
136
137 /**
138  *      @}
139  */
140
141 #ifdef __cplusplus
142 }
143 #endif                          /* __cplusplus */
144 #endif                          /* DATA_CONNECTOR_RESOURCE_H_ */