diff options
Diffstat (limited to 'include/common/common_define.h')
-rwxr-xr-x | include/common/common_define.h | 1191 |
1 files changed, 1191 insertions, 0 deletions
diff --git a/include/common/common_define.h b/include/common/common_define.h new file mode 100755 index 0000000..4612b39 --- /dev/null +++ b/include/common/common_define.h @@ -0,0 +1,1191 @@ +/* + * 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. + */ + +/** + * @Common_Define.h + * @version 0.1 + * @brief This file is the header file of interface for common structure + */ + +#ifndef COMMON_DEFINE_H_ +#define COMMON_DEFINE_H_ + +#include "common_define_internal.h" + +/** + * @par Description: API to create datastore_info_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] string type, target uri + * @param[in] string type, source uri + * @param[out] Status structure + * + * @return datastore_info_s on success + * NULL on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +datastore_info_s *create_datastore_info(char *target, char *source); + +/** + * @par Description: API to free list of datastore_info_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] list of datastore_info_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_datastore_infos(GList * datastore_infos); + +/** + * @par Description: API to free datastore_info_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] datastore_info_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_datastore_info(datastore_info_s * datastore_info); + +/** + * @par Description: API to set sync type in datastore_info_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] datastore_info_s structure + * @param[in] enum type, sync type + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_datastore_info_sync_type(datastore_info_s * datastore_info, alert_type_e sync_type); + +/** + * @par Description: API to set last anchor in datastore_info_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] datastore_info_s structure + * @param[in] string type, last anchor + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_datastore_info_last_anchor(datastore_info_s * datastore_info, char *last_anchor); + +/** + * @par Description: API to set next anchor in datastore_info_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] datastore_info_s structure + * @param[in] string type, next anchor + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_datastore_info_next_anchor(datastore_info_s * datastore_info, char *next_anchor); + +/** + * @par Description: API to set max_obj_size in datastore_info_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] datastore_info_s structure + * @param[in] unsigned int, max_obj_size + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_datastore_info_max_obj_size(datastore_info_s * datastore_info, unsigned int max_obj_size); + +/** + * @par Description: API to create changed_item_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] enum type, change type of item + * @param[in] string type, luid of item + * @param[out] + * + * @return changed_item_s on success + * NULL on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +changed_item_s *create_changed_item(change_type_e type, char *luid); + +/** + * @par Description: API to free changed_item_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] changed_item_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_changed_item(changed_item_s * changed_item); + +/** + * @par Description: API to set content type in changed_item_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] changed_item_s structure + * @param[in] string type, content type + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_changed_item_content_type(changed_item_s * changed_item, char *content_type); + +/** + * @par Description: API to set data in changed_item_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] changed_item_s structure + * @param[in] string type, data + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_changed_item_data(changed_item_s * changed_item, char *data); + +/** + * @par Description: API to set in changed_item_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] changed_item_s structure + * @param[in] datastore index(0=contacts, 1=calendar, 2= memo) + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_changed_item_index_of_datastore(changed_item_s * changed_item, unsigned int indexOfDatastore); + +/** + * @par Description: API to create changed_datastore_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] string type, source uri + * @param[in] string type, target uri + * @param[in] int type, has numberOfChanges or not + * @param[in] unsigned int type, if numberOfChanges is true set count else set zero + * @param[out] + * + * @return changed_datastore_s on success + * NULL on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +changed_datastore_s *create_changed_datastore(char *source, char *target, int has_number_of_changes, unsigned int number_of_changes); + +/** + * @par Description: API to free list of changed_datastore_s + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] list of changed_datastore_s + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_changed_datastores(GList * changed_datastores); + +/** + * @par Description: API to free changed_datastore_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] changed_datastore_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_changed_datastore(changed_datastore_s * changed_datastore); + +/** + * @par Description: API to set changed_item in changed_datastore_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] changed_datastore_s structure + * @param[in] list of changed_item_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_changed_datastore_changed_item(changed_datastore_s * changed_datastore, GList * changed_item); + +/** + * @par Description: API to add changed_item in changed_datastore_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] changed_datastore_s structure + * @param[in] changed_item_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void add_changed_datastore_changed_item(changed_datastore_s * changed_datastore, changed_item_s * changed_item); + +/** + * @par Description: API to create applied_status_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] string type, luid of item + * @param[in] enum type, change type( CHANGE_ADD , CHANGE_REPLACE , CHANGE_DELETE) + * @param[in] int type, status code(200....) + * @param[out] + * + * @return applied_status_s on success + * NULL on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +applied_status_s *create_applied_status(char *luid, change_type_e change_type, int status); + +/** + * @par Description: API to free list of applied_status_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] list of applied_status_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_applied_statuses(GList * applied_statuses); + +/** + * @par Description: API to free applied_status_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] applied_status_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_applied_status(applied_status_s * applied_status); + +/** + * @par Description: API to create sending_status_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] source uri + * @param[in] target uri + * @param[out] + * + * @return sending_status_s on success + * NULL on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +sending_status_s *create_sending_status(char *source, char *target); + +/** + * @par Description: API to free list of sending_status_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] list of sending_status_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_sending_statuses(GList * sending_statuses); + +/** + * @par Description: API to free sending_status_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] sending_status_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_sending_status(sending_status_s * sending_status); + +/** + * @par Description: API to add applied_status_s in sending_status_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] sending_status_s structure + * @param[in] applied_status_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void add_sending_status_applied_status(sending_status_s * sending_status, applied_status_s * applied_status); + +/** + * @par Description: API to create datastore_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] string type, target uri + * @param[in] string type, source uri + * @param[out] + * + * @return datastore_s on success + * NULL on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +datastore_s *create_datastore(char *target, char *source); + +/** + * @par Description: API to set content type infomation in datastore_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] datastore_s structure + * @param[in] int type, datastore_id(TYPE_CONTACT, TYPE_CALENDAR, TYPE_MEMO) + * @param[in] int type, folder_type_id(9, 8, 10) + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_datastore_content_type_info(datastore_s * datastore, int datastore_id, int folder_type_id); + +/** + * @par Description: API to set account information in datastore_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] datastore_s structure + * @param[in] string type, account_id + * @param[in] string type, account_pw + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_datastore_account_info(datastore_s * datastore, char *account_id, char *account_pw); + +/** + * @par Description: API to set client sync type in datastore_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] datastore_s structure + * @param[in] enum type, sync type + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_datastore_client_sync_type(datastore_s * datastore, alert_type_e sync_type); + +/** + * @par Description: API to set server sync type in datastore_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] datastore_s structure + * @param[in] enum type, sync type + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_datastore_server_sync_type(datastore_s * datastore, alert_type_e sync_type); + +/** + * @par Description: API to set client anchor in datastore_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] datastore_s structure + * @param[in] string type, last anchor + * @param[in] string type, next anchor + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_datastore_client_anchor(datastore_s * datastore, char *last_anchor, char *next_anchor); + +/** + * @par Description: API to set client anchor in datastore_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] datastore_s structure + * @param[in] string type, last anchor + * @param[in] string type, next anchor + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_datastore_server_anchor(datastore_s * datastore, char *last_anchor, char *next_anchor); + +/** + * @par Description: API to create sync_result_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] datastore_s structure + * @param[in] string type, last anchor + * @param[in] string type, next anchor + * @param[out] + * + * @return sync_result_s on success + * NULL on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +sync_result_s *create_sync_result(); + +/** + * @par Description: API to duplicate sync_result_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] sync_result_s structure + * @param[out] + * + * @return sync_result_s on success + * NULL on error + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +sync_result_s *dup_sync_result(sync_result_s * org_sync_result); + +/** + * @par Description: API to set number of total item in sync_result_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] sync_result_s structure + * @param[in] number of total item + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void set_number_of_change(sync_result_s * sync_result, unsigned int number_of_change); + +/** + * @par Description: API to set number of received item in sync_result_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] sync_result_s structure + * @param[in] number of received item + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void add_receive_count(sync_result_s * sync_result, unsigned int received_count); + +/** + * @par Description: API to set number of add item in sync_result_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] sync_result_s structure + * @param[in] number of add item + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void add_add_count(sync_result_s * sync_result, unsigned int add_cnt); + +/** + * @par Description: API to set number of replace item in sync_result_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] sync_result_s structure + * @param[in] number of replace item + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void add_replace_count(sync_result_s * sync_result, unsigned int replace_cnt); + +/** + * @par Description: API to set number of delete item in sync_result_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] sync_result_s structure + * @param[in] number of delete item + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void add_delete_count(sync_result_s * sync_result, unsigned int delete_cnt); + +/** + * @par Description: API to free PreSyncReturnObj structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] pre_sync_return_obj_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_pre_sync_return_obj(pre_sync_return_obj_s * pre_sync_return_obj); + +/** + * @par Description: API to free sync_obj_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] sync_obj_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_sync_obj(sync_obj_s * sync_obj); + +/** + * @par Description: API to free sync_return_obj_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] sync_return_obj_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_sync_return_obj(sync_return_obj_s * sync_return_obj); + +/** + * @par Description: API to free datastore_s structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] datastore_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_datastore(datastore_s * datastore); + +/** + * @par Description: API to free sync_category structure + * + * + * @par Purpose: + * @par Typical use case: + * @par Method of function operation: + * @par Important notes: + * @param[in] sync_service_s structure + * @param[out] + * + * @return + * + * @par Errors: + * + * @pre None. + * @post + * @see + * @remarks None. + * + * @par Sample Code: + * @code + * @endcode + */ +void free_sync_service(sync_service_s * category); + +#endif /* COMMON_DEFINE_H_ */ |