summaryrefslogtreecommitdiff
path: root/include/service-engine/se_storage.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/service-engine/se_storage.h')
-rwxr-xr-xinclude/service-engine/se_storage.h258
1 files changed, 258 insertions, 0 deletions
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_ */