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.
21 * @brief This file is the header file of interface of Service Engine
28 #include "common/common_define_internal.h"
29 #include "service-engine/se_common.h"
30 #include "framework/san-parser/pm_sanparser.h"
31 #include "service-engine/se_error.h"
34 * @par Description: API to process synchronization request
35 * This API can be used to process synchronization by predefined profile information
36 * This API uses Notification and Storage API which for notifying synchronization status to UI and saving sync results to Agent DB
39 * @par Typical use case:
40 * @par Method of function operation:
41 * @par Important notes:
42 * @param[in] int type, account id
43 * @param[in] string type, sync mode(manual, push(SAN), periodic)
44 * @param[in] SanPackage structure, only for SAN sync mode
46 * @return true on success, false on error
60 ret = synchronize(accountId, syncMode, pSanPackage);
63 //synchronization success
67 //synchronization fail
74 bool synchronize(int account_id, char *sync_mode, san_package_s * sanpackage);
77 * @par Description: API to convert SyncProgress and SyncError from common error code
78 * This API can be used to convert string to be used to notify to UI for sync results
81 * @par Typical use case:
82 * @par Method of function operation:
83 * @par Important notes:
84 * @param[in] enum type, common_error_type_e
85 * @param[out] enum type, sync_progress_e
86 * @param[out] enum type, sync_error_e
101 void convert_common_errorcode(common_error_type_e error_code, sync_progress_e * process, sync_error_e * error);
104 * @par Description: API to convert SyncProgress and SyncError from engine error code
105 * This API can be used to convert string to be used to notify to UI for sync results
108 * @par Typical use case:
109 * @par Method of function operation:
110 * @par Important notes:
111 * @param[in] enum type, se_error_type_e
112 * @param[out] enum type, sync_progress_e
113 * @param[out] enum type, sync_error_e
128 void convert_engine_errorcode(se_error_type_e err, sync_progress_e * process, sync_error_e * error);
131 * @par Description: API to notify sync results for specific profile to UI
132 * This API can be used to notify sync results(SyncProgress, SyncError) to UI
133 * This API uses Notification which for notification module to send data using IPC
137 * @par Typical use case:
138 * @par Method of function operation:
139 * @par Important notes:
140 * @param[in] string type, profile_dir_name(identify profile in UI)
141 * @param[in] enum type, sync_progress_e
142 * @param[in] enum type, sync_error_e
143 * @param[in] enum type, se_error_type_e sync type
145 * @return SE_INTERNAL_OK on success
146 * SE_INTERNAL_NOT_DEFINED, SE_INTERNAL_NO_MEMORY, SE_INTERNAL_EVENT_ERROR on error
159 se_error_type_e session_process(char *profile_dir_name, alert_type_e server_sync_type, sync_progress_e process, sync_error_e error);
162 * @par Description: API to reset all synchronizing profiles(off) & construct item_tbl from service for in case
165 * @par Typical use case:
166 * @par Method of function operation:
167 * @par Important notes:
169 * @return SE_INTERNAL_OK on success
170 * SE_INTERNAL_DA_ERROR on error
183 se_error_type_e reset_synchronizing_profiles();
186 * @par Description: API to refresh from service for all contents type
189 * @par Typical use case:
190 * @par Method of function operation:
191 * @par Important notes:
192 * @param[in] int type, account id
194 * @return true on success,
208 bool refresh_from_service_all(int account_id);
211 * @par Description: API to cancel connection during sync session
214 * @par Typical use case:
215 * @par Method of function operation:
216 * @par Important notes:
218 * @return SE_INTERNAL_OK on success
219 * SE_INTERNAL_DA_ERROR on error
232 se_error_type_e cancel_sync_request();
234 #endif /* SYNCENGINE_H_ */