4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: JuHak Park <juhaki.park@samsung.com>,
7 * JuneHyuk Lee <junhyuk7.lee@samsung.com>,
8 * SunBong Ha <sunbong.ha@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
29 * For any sort of issue you concern as to this software,
30 * you may use following point of contact.
31 * All resources contributed on this software
32 * are orinigally written by S-Core Inc., a member of Samsung Group.
34 * SeongWon Shim <seongwon.shim@samsung.com>
40 * @brief This file is the header file of interface of Service Engine
47 #include "Common/Common_Define_Internal.h"
48 #include "ServiceEngine/SE_Common.h"
49 #include "Framework/SAN_parser/PM_SanParser.h"
50 #include "ServiceEngine/SE_Error.h"
53 * @par Description: API to process synchronization request
54 * This API can be used to process synchronization by predefined profile information
55 * This API uses Notification and Storage API which for notifying synchronization status to UI and saving sync results to Agent DB
58 * @par Typical use case:
59 * @par Method of function operation:
60 * @par Important notes:
61 * @param[in] int type, account id
62 * @param[in] string type, sync mode(manual, push(SAN), periodic)
63 * @param[in] SanPackage structure, only for SAN sync mode
65 * @return true on success, false on error
79 ret = synchronize(accountId, syncMode, pSanPackage);
82 //synchronization success
86 //synchronization fail
93 bool synchronize(int accountId, char *syncMode, SanPackage *pSanPackage);
97 * @par Description: API to convert SyncProgress and SyncError from common error code
98 * This API can be used to convert string to be used to notify to UI for sync results
101 * @par Typical use case:
102 * @par Method of function operation:
103 * @par Important notes:
104 * @param[in] enum type, Common_ErrorType
105 * @param[out] enum type, SyncProgress
106 * @param[out] enum type, SyncError
121 void convert_common_errorcode(Common_ErrorType errorCode, SyncProgress *process, SyncError *error);
125 * @par Description: API to convert SyncProgress and SyncError from engine error code
126 * This API can be used to convert string to be used to notify to UI for sync results
129 * @par Typical use case:
130 * @par Method of function operation:
131 * @par Important notes:
132 * @param[in] enum type, SE_ErrorType
133 * @param[out] enum type, SyncProgress
134 * @param[out] enum type, SyncError
149 void convert_engine_errorcode(SE_ErrorType err, SyncProgress *process, SyncError *error);
153 * @par Description: API to notify sync results for specific profile to UI
154 * This API can be used to notify sync results(SyncProgress, SyncError) to UI
155 * This API uses Notification which for notification module to send data using IPC
159 * @par Typical use case:
160 * @par Method of function operation:
161 * @par Important notes:
162 * @param[in] string type, syncDirName(identify profile in UI)
163 * @param[in] enum type, SyncProgress
164 * @param[in] enum type, SyncError
166 * @return SE_INTERNAL_OK on success
167 * SE_INTERNAL_NOT_DEFINED, SE_INTERNAL_NO_MEMORY, SE_INTERNAL_EVENT_ERROR on error
180 SE_ErrorType session_process(char *profileDirName, SyncProgress process, SyncError error);
184 * @par Description: API to reset all synchronizing profiles(off) & construct item_tbl from service for in case
187 * @par Typical use case:
188 * @par Method of function operation:
189 * @par Important notes:
191 * @return SE_INTERNAL_OK on success
192 * SE_INTERNAL_DA_ERROR on error
205 SE_ErrorType reset_synchronizing_profiles();
209 * @par Description: API to refresh from service for all contents type
212 * @par Typical use case:
213 * @par Method of function operation:
214 * @par Important notes:
215 * @param[in] int type, account id
217 * @return true on success,
231 bool refresh_from_service_all(int accountId);
234 /*FIXME cancel request to NA */
235 /*SE_ErrorType cancel_sync_request();*/
237 #endif /* SYNCENGINE_H_ */