[Internal: merge sync-agent]
[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(sync_agent_da_item_s *item);
49
50
51 /**
52  * @brief       Handling added item to service storage, update sync-agent-framework item & change log table
53  * @remarks This function is called force by Agent to set item & change log table manually
54  * @param[in] sync_agent_item item info
55  * @param[in] item_id as returned by sync_agent_changelog_add_item_new() - id of newly added item
56  * @return Operation result
57  * @retval SYNC_AGENT_DA_SUCCESS success
58  * @retval negative value error
59  */
60         sync_agent_da_return_e sync_agent_changelog_add_item_new(sync_agent_da_item_s * sync_agent_item, char **item_id);
61
62 /**
63  * @brief       Handling deleted item from service storage, update sync-agent-framework item & change log table - currently unused function
64  * @param[in]   fw_account_id sync-agent-framework account id
65  * @param[in]   fw_item_id sync-agent-framework item id
66  * @param[in]   item_type service type - service data connector plugin's id described in sync-agent-framework config file
67  * @return 1 on success, otherwise a negative error value.
68  */
69         int da_changelog_delete_item_internal(int fw_account_id, char *fw_item_id, int item_type);
70
71 /**
72  * @brief       Handling deleted item from service storage, update sync-agent-framework item & change log table
73  * @param[in]   fw_account_id sync-agent-framework account id
74  * @param[in]   fw_item_id sync-agent-framework item id
75  * @return Operation result
76  * @retval SYNC_AGENT_DA_SUCCESS success
77  * @retval negative value error
78  */
79         sync_agent_da_return_e sync_agent_changelog_delete_item_new(int fw_account_id, char *fw_item_id);
80
81 /**
82  * @brief       Handling updated item from service storage, update sync-agent-framework item & change log table - currently unused function
83  * @param[in]   fw_account_id sync-agent-framework account id
84  * @param[in]   fw_item_id sync-agent-framework item id
85  * @param[in]   item_type service type - service data connector plugin's id described in sync-agent-framework config file
86  * @return      1 on success, otherwise a negative error value.
87  */
88         int da_changelog_update_item_internal(int fw_account_id, char *fw_item_id, int item_type);
89
90 /**
91  * @brief       Handling updated item from service storage, update sync-agent-framework item & change log table
92  * @param[in]   fw_account_id sync-agent-framework account id
93  * @param[in]   fw_item_id sync-agent-framework item id
94  * @return Operation result
95  * @retval SYNC_AGENT_DA_SUCCESS success
96  * @retval negative value error
97  */
98         sync_agent_da_return_e sync_agent_changelog_update_item_new(int fw_account_id, char *fw_item_id);
99
100 /**
101  *      @}
102  */
103
104 #ifdef __cplusplus
105 }
106 #endif                          /* __cplusplus */
107 #endif                          /* CHANGELOG_H_ */