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 ACCOUNT_INTERFACE_H_
19 #define ACCOUNT_INTERFACE_H_
23 #endif /* __cplusplus */
26 * @file account_interface.h
27 * @brief Interface list in this header will be implemented plugIn developer
28 * @remarks Implementation will operate sync-agent-framework account module
31 /** @addtogroup plugin_account Account Domain
37 * API to set account repository name
38 * @remarks Repository means mapping storage, between service account id and sync-agent-framework account id
40 * @param[in] agent_name repository name - described in fw config xml file <Agent-Key>
45 * @see sync_agent_init(const char *)
48 void sync_agent_plugin_set_account_repository_name(const char *agent_name);
51 * API to add account to platform
52 * @remarks Mapping platform account id with sync-agent-framework account id
54 * @param[in] fw_account_id sync-agent-framework account id
59 * @see acc_add_platform_account(int)
62 void sync_agent_plugin_add_platform_account(int fw_account_id);
65 * API to set mapping relationship between sync-agent-framework account id and service account id
66 * @remarks You must register non-volatile storage not memory ex) File, DataBase..
68 * @param[in] fw_account_id sync-agent-framework account id
69 * @param[in] service_type service type - service data connector plugin's id described in sync-agent-framework config xml file
70 * @param[in] service_account_id service account id
75 * @see sync_agent_construct_account_tbl_from_service()
77 void sync_agent_plugin_set_platform_account_service(int fw_account_id, int service_type, int service_account_id);
80 * API to remove mapping relationship between sync-agent-framework account id and platform account id
81 * @remarks You must remove from storage
83 * @param[in] fw_account_id sync-agent-framework account id
88 * @see acc_delete_platform_account(int)
91 void sync_agent_plugin_delete_platform_account(int fw_account_id);
94 * API to remove mapping relationship between sync-agent-framework account id and service account id
95 * @remarks You must remove from storage
97 * @param[in] fw_account_id sync-agent-framework account id
98 * @param[in] service_type service type - service data connector plugin's id described in sync-agent-framework config xml file
103 * @see sync_agent_construct_account_tbl_from_service()
106 void sync_agent_plugin_delete_platform_account_service(int fw_account_id, int service_type);
109 * API to confirm whether sync-agent-framework account id has the service account id
111 * @param[in] fw_account_id sync-agent-framework account id
112 * @param[in] service_type service type - service data connector plugin's id described in sync-agent-framework config xml file
114 * @return 1 if has, otherwise 0
119 * @see sync_agent_construct_account_tbl_from_service()
122 int sync_agent_plugin_has_platform_account_service(int fw_account_id, int service_type);
125 * API to get service account id mapped with sync-agent-framework account id
127 * @param[in] service_type service type - service data connector plugin's id described in sync-agent-framework config xml file
128 * @param[in] fw_account_id sync-agent-framework account id
130 * @return service account id if it exist mapping relationship, otherwise -100
135 * @see acc_get_service_account_id(int, int)
138 int sync_agent_plugin_get_service_account_id(int service_type, int fw_account_id);
141 * API to get sync-agent-framework account id mapped with service account id
143 * @param[in] service_type service type - service data connector plugin's id described in sync-agent-framework config xml file
144 * @param[in] service_account_id service account id
145 * @param[in] index possible mapping one service account with multiple sync-agent-framework account, so need index of sync-agent-framework account
147 * @return sync-agent-framework account id if it exist mapping relationship, otherwise -1
152 * @see acc_get_fw_account_id(int, int, int)
155 int sync_agent_plugin_get_fw_account_id(int service_type, int service_account_id, int index);
158 * API to get service account information
159 * @remarks Account information type must be defined in account plugin.
161 * @param[in] fw_account_id sync-agent-framework account id
162 * @param[in] service_type service type - service data connector plugin's id described in sync-agent-framework config xml file
163 * @param[in] account_info as returned by sync_agent_plugin_get_service_account_info()
165 * @return 1 on success, 0 on error
170 * @see acc_get_fw_account_id(int, int, int)
173 int sync_agent_plugin_get_service_account_info(int fw_account_id, int service_type, sync_agent_service_account_info_s ** account_info);
181 #endif /* __cplusplus */
182 #endif /* ACCOUNT_INTERFACE_H_ */