summaryrefslogtreecommitdiff
path: root/include/service-engine
diff options
context:
space:
mode:
authorJinkun Jang <jinkun.jang@samsung.com>2013-03-13 01:51:48 +0900
committerJinkun Jang <jinkun.jang@samsung.com>2013-03-13 01:51:48 +0900
commitd6aa47559c38d7e20d6d6a7a3671fa48ed58b9eb (patch)
tree5fbc758662a7866e32ec1adcfd9149c71987549e /include/service-engine
parent8fe192a924f295972402d46141e39b86241a1441 (diff)
downloadoma-ds-agent-d6aa47559c38d7e20d6d6a7a3671fa48ed58b9eb.tar.gz
oma-ds-agent-d6aa47559c38d7e20d6d6a7a3671fa48ed58b9eb.tar.bz2
oma-ds-agent-d6aa47559c38d7e20d6d6a7a3671fa48ed58b9eb.zip
Tizen 2.1 base
Diffstat (limited to 'include/service-engine')
-rwxr-xr-xinclude/service-engine/se_account.h342
-rwxr-xr-xinclude/service-engine/se_common.h128
-rwxr-xr-xinclude/service-engine/se_error.h45
-rwxr-xr-xinclude/service-engine/se_notification.h99
-rwxr-xr-xinclude/service-engine/se_storage.h258
-rwxr-xr-xinclude/service-engine/se_sync.h234
6 files changed, 1106 insertions, 0 deletions
diff --git a/include/service-engine/se_account.h b/include/service-engine/se_account.h
new file mode 100755
index 0000000..fc6563e
--- /dev/null
+++ b/include/service-engine/se_account.h
@@ -0,0 +1,342 @@
+/*
+ * oma-ds-agent
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @SE_Account.h
+ * @version 0.1
+ * @brief This file is the header file of interface of account
+ */
+
+#ifndef SE_ACCOUNT_H_
+#define SE_ACCOUNT_H_
+
+#include <glib.h>
+#include <stdbool.h>
+#include "common/common_define.h"
+
+/**
+ * @par Description: API to add profile API
+ * This API can be used to add profile
+ * This API is part of API for UI
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, profile_dir_name(identify profile in UI)
+ * @param[in] string type, profile name
+ * @param[in] string type, server ip
+ * @param[in] string type, id
+ * @param[in] string type, password
+ * @param[in] string type, sync mode
+ * @param[in] string type, sync type
+ * @param[in] string type, interval(for periodic)
+ * @param[in] GList type, list of sync_service_s structure
+ * @param[out] int type, account id
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool add_profile(char *profile_dir_name, char *profile_name, char *addr, char *id, char *password, char *sync_mode, char *sync_type, char *interval, GList * categories, int *account_id);
+
+/**
+ * @par Description: API to add profile from csc
+ * This API can be used to add profile from csc(vconf)
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] int type, index of profile
+ *
+ * @return 1 on success
+ * 0 on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool add_profile_csc(int index);
+
+/**
+ * @par Description: API to add profile API
+ * This API can be used to add profile
+ * This API is part of API for UI
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, profile name
+ * @param[in] string type, server ip
+ * @param[in] string type, id
+ * @param[in] string type, password
+ * @param[in] GList type, list of resource_cp structure
+ * @param[out] int type, account id
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool add_profile_cp(char *profile_name, char *addr, char *id, char *password, GList * categories, int *account_id);
+
+/**
+ * @par Description: API to add profile for call log sync
+ * This API can be used to add profile
+ * This API is part of API for call log sync
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[out] int type, account_id
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool add_profile_dive(int *account_id);
+
+/**
+ * @par Description: API to edit profile API
+ * This API can be used to edit profile
+ * This API is part of API for UI
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] int type, account id
+ * @param[in] string type, profile name
+ * @param[in] string type, server ip
+ * @param[in] string type, id
+ * @param[in] string type, password
+ * @param[in] string type, sync mode
+ * @param[in] string type, sync type
+ * @param[in] string type, interval(for periodic)
+ * @param[in] GList type, list of sync_service_s structure
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool edit_profile(int account_id, char *profile_name, char *addr, char *id, char *password, char *sync_mode, char *sync_type, char *interval, GList * categories);
+
+/**
+ * @par Description: API to delete profile API
+ * This API can be used to delete profile
+ * This API is part of API for UI
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] GList type, list of account id
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool delete_profiles(GList * profiles);
+
+/**
+ * @par Description: API to delete profile for call log sync
+ * This API can be used to delete profile
+ * This API is part of API for call log sync
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool delete_profile_dive();
+
+/**
+ * @par Description: API to delete profile
+ * This API can be used to delete profile
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool delete_profile(char *access_name);
+
+/**
+ * @par Description: API to delete all profiles
+ * This API can be used to delete all profiles
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool delete_all_profiles();
+
+/**
+ * @par Description: API to get profile directory name of synchronizing account
+ * This API can be used to get profile directory name
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[out] string type, profile_dir_name(identify profile in UI)
+ * @param[out] string type, sync_type(determined by server)
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool get_synchronising_profile(char **profile_dir_name, char **sync_type);
+
+/**
+ * @par Description: API to delete all agent default table(except id_provider_tbl, id_page_tbl)
+ * This API can be used to delete all agent default table
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool delete_all_agent_default_table();
+
+#endif /* SE_ACCOUNT_H_ */
diff --git a/include/service-engine/se_common.h b/include/service-engine/se_common.h
new file mode 100755
index 0000000..108acef
--- /dev/null
+++ b/include/service-engine/se_common.h
@@ -0,0 +1,128 @@
+/*
+ * oma-ds-agent
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @SE_Common.h
+ * @version 0.1
+ * @brief This file is the header file of enumeration and define used in SE
+ */
+
+#ifndef SE_COMMON_H_
+#define SE_COMMON_H_
+
+#define DEFINE_SYNC_PROGRESS_NONE "PROGRESS_NONE"
+#define DEFINE_SYNC_INIT "INIT"
+#define DEFINE_SYNC_CONNECTING "CONNECTING"
+#define DEFINE_SYNC_AUTHENTICATED "AUTHENTICATED"
+#define DEFINE_SYNC_DONE "DONE"
+#define DEFINE_SYNC_ERROR "ERROR"
+
+#define DEFINE_ERROR_NONE "ERROR_NONE"
+#define DEFINE_ERROR_CONNECTION "CONNECTION"
+#define DEFINE_ERROR_SYNCHDR "SYNCHDR"
+#define DEFINE_ERROR_INTERNAL "INTERNAL"
+#define DEFINE_ERROR_SUSPENDED "SUSPENDED"
+#define DEFINE_ERROR_DB "DB"
+#define DEFINE_ERROR_ABORT "ABORT"
+#define DEFINE_ERROR_SERVER "SERVER"
+#define DEFINE_ERROR_MEMORY_FULL "MEMORY_FULL"
+#define DEFINE_ERROR_AUTHENTICATE "AUTHENTICATE"
+#define DEFINE_ERROR_AUTOCONFIG_NOT_SUPPORT_BY_SERVER "AUTOCONFIG_NOT_SUPPORT_BY_SERVER"
+#define DEFINE_ERROR_LOW_BATTERY "LOW_BATTERY"
+
+#define DEFINE_PROGRESS_NONE "PROGRESS_NONE"
+#define DEFINE_PROGRESS_SUCCESS "PROGRESS_SUCCESS"
+#define DEFINE_FAILED_DB "FAILED_DB"
+#define DEFINE_FAILED_DB_FORBIDDEN "FAILED_DB_FORBIDDEN"
+#define DEFINE_FAILED_DB_ITEM "FAILED_DB_ITEM"
+#define DEFINE_FAILED_DB_CONFIG "FAILED_DB_CONFIG"
+#define DEFINE_FAILED_DB_DEVICEFULL "FAILED_DB_DEVICEFULL"
+
+#define DEFINE_NOOP "NOOP"
+#define DEFINE_ADD "ADD"
+#define DEFINE_DELETE "DELETE"
+#define DEFINE_MOVE "MOVE"
+#define DEFINE_COPY "COPY"
+#define DEFINE_REPLACE "REPLACE"
+
+#define DEFINE_DBSYNC_SUCCESS "success"
+#define DEFINE_DBSYNC_STOP "stop"
+#define DEFINE_DBSYNC_FAIL "fail"
+#define DEFINE_DBSYNC_NO "No"
+
+typedef enum {
+ PROGRESS_NONE = 0,
+ PROGRESS_INIT = 1,
+ PROGRESS_CONNECTING = 2,
+ PROGRESS_AUTHENTICATED = 3,
+ PROGRESS_DONE = 4,
+ PROGRESS_ERROR = 5
+} sync_progress_e;
+
+typedef enum {
+ ERROR_NONE = 0,
+ ERROR_CONNECTION = 1,
+ ERROR_SYNCHDR = 2,
+ ERROR_INTERNAL = 3,
+ ERROR_SUSPENDED = 4,
+ ERROR_DB = 5,
+ ERROR_ABORT = 6,
+ ERROR_SERVER = 7,
+ ERROR_MEMORY_FULL = 8,
+ ERROR_AUTHENTICATE = 9,
+ ERROR_AUTOCONFIG_NOT_SUPPORT_BY_SERVER = 10,
+ ERROR_LOW_BATTERY = 11
+} sync_error_e;
+
+typedef enum {
+ SYNC_PROGRESS_NONE = 0,
+ SYNC_PROGRESS_SUCCESS,
+ SYNC_FAILED_DB,
+ SYNC_FAILED_DB_FORBIDDEN,
+ SYNC_FAILED_DB_ITEM,
+ SYNC_FAILED_DB_CONFIG,
+ SYNC_FAILED_DB_DEVICEFULL
+} sync_progress_status_e;
+
+typedef enum {
+ OPERATION_NOOP = 0,
+ OPERATION_ADD,
+ OPERATION_DELETE,
+ OPERATION_MOVE,
+ OPERATION_COPY,
+ OPERATION_REPLACE
+} operation_type_e;
+
+typedef enum {
+ COMMAND_RESULT_INIT = 0,
+ COMMAND_RESULT_OK = 200, /*[R] OK exception */
+ COMMAND_RESULT_ADDED = 201, /*[AR] Item added exception */
+ COMMAND_RESULT_DELETE_PARTIAL = 206, /*[D] Partial content exception condition */
+ COMMAND_RESULT_DELETE_WITHOUT_ARCHIVE = 210, /*[D] Delete without archive exception */
+ COMMAND_RESULT_NOT_EXIST = 211, /*[D] Item not deleted exception */
+ COMMAND_RESULT_UNAUTHRIZED = 401, /*[ARD] Unauthorized exception */
+ COMMAND_RESULT_AUTHENTICATION_REQUIRED = 407, /*[ARD] Authentication required exception */
+ COMMAND_RESULT_INCOMPLETE = 412, /*[D] Incomplete command exception */
+ COMMAND_RESULT_UNSUPPORTED_TYPE = 415, /*[A] Unsupported media type or format exception */
+ COMMAND_RESULT_ALREADY_EXIST = 418, /*[A] Already exists exception */
+ COMMAND_RESULT_DEVICE_FULL = 420, /*[AR] Device full exception */
+ COMMAND_RESULT_PARTIAL_REPLACE_NOT_ACCEPTED = 426, /*[R] Partial item not accepted */
+ COMMAND_RESULT_NOT_EMPTY = 427, /*[D] Item not empty */
+ COMMAND_RESULT_COMMAND_FAIL = 500 /*[ARD] Command failed exception */
+} command_result_e;
+
+#endif /* SE_COMMON_H_ */
diff --git a/include/service-engine/se_error.h b/include/service-engine/se_error.h
new file mode 100755
index 0000000..6a22139
--- /dev/null
+++ b/include/service-engine/se_error.h
@@ -0,0 +1,45 @@
+/*
+ * oma-ds-agent
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @SE_Error.h
+ * @version 0.1
+ * @brief This file is the header file of Error is defined
+ */
+
+#ifndef SE_ERROR_H_
+#define SE_ERROR_H_
+
+typedef enum {
+ ERROR_UNKNOWN = 0,
+ SE_INTERNAL_OK = 1,
+ SE_INTERNAL_ERROR = 2,
+ SE_INTERNAL_NO_MEMORY = 3,
+ SE_INTERNAL_NOT_DEFINED = 4,
+ SE_INTERNAL_DA_ERROR = 5,
+ SE_INTERNAL_EVENT_ERROR = 6,
+ SE_INTERNAL_ENGINE_CONTROLER_ERROR = 7,
+ SE_INTERNAL_SCHEDULER_ERROR = 8,
+ SE_INTERNAL_SA_ERROR = 9,
+ SE_INTERNAL_MISCONFIGURATION = 10,
+ SE_INTERNAL_CANCEL = 11,
+ SE_INTERNAL_LOW_BATTERY = 12,
+ SE_INTERNAL_SUSPEND = 13,
+
+} se_error_type_e;
+
+#endif /* SE_ERROR_H_ */
diff --git a/include/service-engine/se_notification.h b/include/service-engine/se_notification.h
new file mode 100755
index 0000000..4789ba5
--- /dev/null
+++ b/include/service-engine/se_notification.h
@@ -0,0 +1,99 @@
+/*
+ * oma-ds-agent
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @SE_Notification.h
+ * @version 0.1
+ * @brief This file is the header file of interface of notification to UI
+ */
+
+#ifndef SE_NOTIFICATION_H_
+#define SE_NOTIFICATION_H_
+
+#include <glib.h>
+#include "service-engine/se_error.h"
+
+/**
+ * @par Description: API to notify session process to UI
+ * This API can be used to notify session process
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, profile dir name(identify profile in UI)
+ * @param[in] string type, progress(DEFINE_SYNC_PROGRESS_NONE,
+ * DEFINE_SYNC_INIT, DEFINE_SYNC_CONNECTING, DEFINE_SYNC_AUTHENTICATED,
+ * DEFINE_SYNC_DONE, DEFINE_SYNC_ERROR)
+ * @param[in] string type, error(DEFINE_ERROR_NONE, DEFINE_ERROR_CONNECTION, DEFINE_ERROR_SYNCHDR,
+ * DEFINE_ERROR_INTERNAL, DEFINE_ERROR_SUSPENDED, DEFINE_ERROR_DB, DEFINE_ERROR_ABORT,
+ * DEFINE_ERROR_SERVER, DEFINE_ERROR_MEMORY_FULL, DEFINE_ERROR_AUTHENTICATE,
+ * DEFINE_ERROR_AUTOCONFIG_NOT_SUPPORT_BY_SERVER)
+ *
+ * @return SE_INTERNAL_OK on success
+ * SE_INTERNAL_NOT_DEFINED, SE_INTERNAL_NO_MEMORY, SE_INTERNAL_EVENT_ERROR on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+se_error_type_e send_noti_session_process(char *profile, char *progress, char *error, char *sync_type);
+
+/**
+ * @par Description: API to notify process update to UI
+ * This API can be used to notify process update
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, profile dir name(identify profile in UI)
+ * @param[in] string type, server sync type
+ * @param[in] string type, datastore name
+ * @param[in] string type, progressStatus(DEFINE_PROGRESS_NONE, DEFINE_PROGRESS_SUCCESS, DEFINE_FAILED_DB,
+ * DEFINE_FAILED_DB_FORBIDDEN, DEFINE_FAILED_DB_ITEM, DEFINE_FAILED_DB_CONFIG, DEFINE_FAILED_DB_DEVICEFULL)
+ * @param[in] string type, operationType(DEFINE_NOOP, DEFINE_ADD, DEFINE_DELETE, DEFINE_MOVE, DEFINE_COPY, DEFINE_REPLACE)
+ * @param[in] int type, whether from server or from client
+ * @param[in] int type, total number per operation
+ * @param[in] int type, synced item number per operation
+ * @param[in] int type, total number per db
+ * @param[in] int type, synced item number per db
+ *
+ * @return SE_INTERNAL_OK on success
+ * SE_INTERNAL_NOT_DEFINED, SE_INTERNAL_NO_MEMORY, SE_INTERNAL_EVENT_ERROR on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+se_error_type_e send_noti_process_update(char *profile_dir_name, char *sync_type, char *uri, char *progress_status, char *operation_type, int is_from_server, int total_per_operation, int synced_per_operation, int total_per_db, int synced_per_db);
+
+#endif /* SE_NOTIFICATION_H_ */
diff --git a/include/service-engine/se_storage.h b/include/service-engine/se_storage.h
new file mode 100755
index 0000000..ecf45d6
--- /dev/null
+++ b/include/service-engine/se_storage.h
@@ -0,0 +1,258 @@
+/*
+ * oma-ds-agent
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @SE_Storage.h
+ * @version 0.1
+ * @brief This file is the header file of interface which saves and gets sync results
+ */
+
+#ifndef SE_STORAGE_H_
+#define SE_STORAGE_H_
+
+#include "common/common_define.h"
+#include "service-engine/se_error.h"
+
+/**
+ * @par Description: API to save sync type, sync result , last sync time(each datastore)
+ * This API can be used to save sync type, sync result , last sync time at the end of synchronization process
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] int type, account id
+ * @param[in] enum type, AlertType
+ * @param[in] enum type, sync_session_result_e
+ * @param[in] int type, last sync time
+ * @param[in] int type, whether or not tn end in pkg4
+ *
+ * @return SE_INTERNAL_OK on success
+ * SE_INTERNAL_DA_ERROR on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+se_error_type_e write_profile_data(int account_id, alert_type_e alert_type, sync_session_result_e sync_session_result, int last_session_time, int only_from_client);
+
+/**
+ * @par Description: API to save sync statistics(each datastore)
+ * This API can be used to save statistics at the end of synchronization process
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] int type, account id
+ * @param[in] int type, content type(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO)
+ * @param[in] bool type whether from server or from client
+ * @param[in] sync_result_s structure
+ *
+ * @return SE_INTERNAL_OK on success
+ * SE_INTERNAL_DA_ERROR on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+se_error_type_e write_sync_statistics(int account_id, int content_type, bool is_from_server, sync_result_s * sync_result);
+
+/**
+ * @par Description: API to save sync result(each datastore)
+ * This API can be used to save sync result at the end of synchronization process
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] int type, account id
+ * @param[in] int type, content type(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO)
+ * @param[in] int type, last sync time
+ * @param[in] int type, whether or not to end in pkg4
+ * @param[in] sync_result_s structure, client
+ * @param[in] sync_result_s structure, server
+ *
+ * @return SE_INTERNAL_OK on success
+ * SE_INTERNAL_DA_ERROR on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+se_error_type_e write_sync_resource_info(int account_id, int content_type, int last_session_time, int only_from_client, sync_result_s * client_sync_result, sync_result_s * server_sync_result);
+
+/**
+ * @par Description: API to get profile data from config_tbl
+ * This API can be used to get profile data
+ * This API is part of API for UI
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] int type, account id
+ * @param[out] string type, profile name
+ * @param[out] string type, server ip
+ * @param[out] string type, id
+ * @param[out] string type, password
+ * @param[out] string type, sync mode
+ * @param[out] string type, sync type
+ * @param[out] string type, interval
+ * @param[out] int type, last_session_status
+ * @param[out] int type, last_session_time
+ *
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool get_profile_data(int account_id, char **profile_name, char **addr, char **id, char **password, char **sync_mode, char **sync_type, char **interval, int *last_session_status, int *last_session_time);
+
+/**
+ * @par Description: API to get profile datastore information(enable, source uri, target uri, id, password) from config_tbl
+ * This API can be used to get enable, source uri, target uri, id, password
+ * This API is part of API for UI
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] int type, account id
+ * @param[in] int type, content type(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO)
+ * @param[out] string type, enabled
+ * @param[out] string type, source uri
+ * @param[out] string type, target uri
+ * @param[out] string type, id
+ * @param[out] string type, password
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool get_profile_sync_category(int account_id, int content_type, int *enabled, char **src_uri, char **tgt_uri, char **id, char **password);
+
+/**
+ * @par Description: API to get profile sync statistics for each content type from config_tbl
+ * This API can be used to get profile sync statistics for each content type
+ * This API is part of API for UI
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] int type, account id
+ * @param[in] int type, content type(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO)
+ * @param[out] string type, sync result(success, fail, stop)
+ * @param[out] int type, sync time
+ * @param[out] int type, total items(server to client)
+ * @param[out] int type, add items(server to client)
+ * @param[out] int type, delete items(server to client)
+ * @param[out] int type, replace items(server to client)
+ * @param[out] int type, total items(client to server)
+ * @param[out] int type, add items(client to server)
+ * @param[out] int type, delete items(client to server)
+ * @param[out] int type, replace items(client to server)
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool get_profile_statistics(int account_id, int content_type, char **dbSynced, int *last_session_time,
+ int *server2client_total, int *server2client_nrofadd, int *server2client_nrofdelete, int *server2client_nrofreplace,
+ int *client2server_total, int *client2server_nrofadd, int *client2server_nrofdelete, int *client2server_nrofreplace);
+
+/**
+ * @par Description: API to get all profiles data from config_tbl
+ * This API can be used to get all profiles data
+ * This API is part of API for UI
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[out] GList, all profiles data
+ *
+ *
+ * @return true on success
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool get_all_profiles_data(GList ** list);
+
+#endif /* SE_STORAGE_H_ */
diff --git a/include/service-engine/se_sync.h b/include/service-engine/se_sync.h
new file mode 100755
index 0000000..7f63c5c
--- /dev/null
+++ b/include/service-engine/se_sync.h
@@ -0,0 +1,234 @@
+/*
+ * oma-ds-agent
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @SE_Sync.h
+ * @version 0.1
+ * @brief This file is the header file of interface of Service Engine
+ */
+
+#ifndef SYNCENGINE_H_
+#define SYNCENGINE_H_
+
+#include <stdbool.h>
+#include "common/common_define_internal.h"
+#include "service-engine/se_common.h"
+#include "framework/san-parser/pm_sanparser.h"
+#include "service-engine/se_error.h"
+
+/**
+ * @par Description: API to process synchronization request
+ * This API can be used to process synchronization by predefined profile information
+ * This API uses Notification and Storage API which for notifying synchronization status to UI and saving sync results to Agent DB
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] int type, account id
+ * @param[in] string type, sync mode(manual, push(SAN), periodic)
+ * @param[in] SanPackage structure, only for SAN sync mode
+
+ * @return true on success, false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+int main()
+{
+ bool ret = 0;
+ ret = synchronize(accountId, syncMode, pSanPackage);
+ if (ret == true)
+ {
+ //synchronization success
+ }
+ else
+ {
+ //synchronization fail
+ }
+
+ return 0;
+}
+ * @endcode
+ */
+bool synchronize(int account_id, char *sync_mode, san_package_s * sanpackage);
+
+/**
+ * @par Description: API to convert SyncProgress and SyncError from common error code
+ * This API can be used to convert string to be used to notify to UI for sync results
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] enum type, common_error_type_e
+ * @param[out] enum type, sync_progress_e
+ * @param[out] enum type, sync_error_e
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void convert_common_errorcode(common_error_type_e error_code, sync_progress_e * process, sync_error_e * error);
+
+/**
+ * @par Description: API to convert SyncProgress and SyncError from engine error code
+ * This API can be used to convert string to be used to notify to UI for sync results
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] enum type, se_error_type_e
+ * @param[out] enum type, sync_progress_e
+ * @param[out] enum type, sync_error_e
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void convert_engine_errorcode(se_error_type_e err, sync_progress_e * process, sync_error_e * error);
+
+/**
+ * @par Description: API to notify sync results for specific profile to UI
+ * This API can be used to notify sync results(SyncProgress, SyncError) to UI
+ * This API uses Notification which for notification module to send data using IPC
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] string type, profile_dir_name(identify profile in UI)
+ * @param[in] enum type, sync_progress_e
+ * @param[in] enum type, sync_error_e
+ * @param[in] enum type, se_error_type_e sync type
+ *
+ * @return SE_INTERNAL_OK on success
+ * SE_INTERNAL_NOT_DEFINED, SE_INTERNAL_NO_MEMORY, SE_INTERNAL_EVENT_ERROR on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+se_error_type_e session_process(char *profile_dir_name, alert_type_e server_sync_type, sync_progress_e process, sync_error_e error);
+
+/**
+ * @par Description: API to reset all synchronizing profiles(off) & construct item_tbl from service for in case
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ *
+ * @return SE_INTERNAL_OK on success
+ * SE_INTERNAL_DA_ERROR on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+se_error_type_e reset_synchronizing_profiles();
+
+/**
+ * @par Description: API to refresh from service for all contents type
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ * @param[in] int type, account id
+ *
+ * @return true on success,
+ * false on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+bool refresh_from_service_all(int account_id);
+
+/**
+ * @par Description: API to cancel connection during sync session
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par Method of function operation:
+ * @par Important notes:
+ *
+ * @return SE_INTERNAL_OK on success
+ * SE_INTERNAL_DA_ERROR on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+se_error_type_e cancel_sync_request();
+
+#endif /* SYNCENGINE_H_ */