Tizen 2.1 base
[platform/core/system/sync-agent.git] / src / framework / data-adapter / changelog.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 CHANGELOG_H_
19 #define CHANGELOG_H_
20
21 #include "error.h"
22 #include "common.h"
23 #include "common_internal.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif                          /* __cplusplus */
28
29 /**
30  * @file                changelog.h
31  * @brief       Support to process changed service item, effect to F/W item, change log table.
32  */
33
34 /** @addtogroup data_adapter
35  *      @{
36  */
37
38 /**
39  * @brief       Handling added item to service storage, update sync-agent-framework item & change log table - currently unused function
40  * @remarks This function is called force by Agent to set item & change log table manually
41  * @param[in]   fw_account_id sync-agent-framework account id
42  * @param[in]   fw_item_id sync-agent-framework item id
43  * @param[in]   service_item_id service item id
44  * @param[in]   item_type service type - service data connector plugin's id described in sync-agent-framework config file
45  * @param[in]   fw_folder_id sync-agent-framework folder id
46  * @return 1 on success, otherwise a negative error value
47  */
48         int da_changelog_add_item_internal(int fw_account_id, char *fw_item_id, char *service_item_id, int item_type, char *fw_folder_id);
49
50 /**
51  * @brief       Handling added item to service storage, update sync-agent-framework item & change log table
52  * @remarks This function is called force by Agent to set item & change log table manually
53  * @param[in] sync_agent_item item info
54  * @param[in] item_id as returned by sync_agent_changelog_add_item_new() - id of newly added item
55  * @return Operation result
56  * @retval SYNC_AGENT_DA_SUCCESS success
57  * @retval negative value error
58  */
59         sync_agent_da_return_e sync_agent_changelog_add_item_new(sync_agent_da_item_s * sync_agent_item, char **item_id);
60
61 /**
62  * @brief       Handling deleted item from service storage, update sync-agent-framework item & change log table - currently unused function
63  * @param[in]   fw_account_id sync-agent-framework account id
64  * @param[in]   fw_item_id sync-agent-framework item id
65  * @param[in]   item_type service type - service data connector plugin's id described in sync-agent-framework config file
66  * @return 1 on success, otherwise a negative error value.
67  */
68         int da_changelog_delete_item_internal(int fw_account_id, char *fw_item_id, int item_type);
69
70 /**
71  * @brief       Handling deleted item from service storage, update sync-agent-framework item & change log table
72  * @param[in]   fw_account_id sync-agent-framework account id
73  * @param[in]   fw_item_id sync-agent-framework item id
74  * @return Operation result
75  * @retval SYNC_AGENT_DA_SUCCESS success
76  * @retval negative value error
77  */
78         sync_agent_da_return_e sync_agent_changelog_delete_item_new(int fw_account_id, char *fw_item_id);
79
80 /**
81  * @brief       Handling updated item from service storage, update sync-agent-framework item & change log table - currently unused function
82  * @param[in]   fw_account_id sync-agent-framework account id
83  * @param[in]   fw_item_id sync-agent-framework item id
84  * @param[in]   item_type service type - service data connector plugin's id described in sync-agent-framework config file
85  * @return      1 on success, otherwise a negative error value.
86  */
87         int da_changelog_update_item_internal(int fw_account_id, char *fw_item_id, int item_type);
88
89 /**
90  * @brief       Handling updated item from service storage, update sync-agent-framework item & change log table
91  * @param[in]   fw_account_id sync-agent-framework account id
92  * @param[in]   fw_item_id sync-agent-framework item id
93  * @return Operation result
94  * @retval SYNC_AGENT_DA_SUCCESS success
95  * @retval negative value error
96  */
97         sync_agent_da_return_e sync_agent_changelog_update_item_new(int fw_account_id, char *fw_item_id);
98
99 /**
100  *      @}
101  */
102
103 #ifdef __cplusplus
104 }
105 #endif                          /* __cplusplus */
106 #endif                          /* CHANGELOG_H_ */