summaryrefslogtreecommitdiff
path: root/email-api/include
diff options
context:
space:
mode:
Diffstat (limited to 'email-api/include')
-rwxr-xr-xemail-api/include/email-api-account.h826
-rwxr-xr-xemail-api/include/email-api-etc.h80
-rwxr-xr-xemail-api/include/email-api-init.h348
-rwxr-xr-xemail-api/include/email-api-mail.h3296
-rwxr-xr-xemail-api/include/email-api-mailbox.h695
-rwxr-xr-xemail-api/include/email-api-network.h763
-rwxr-xr-xemail-api/include/email-api-rule.h436
-rwxr-xr-xemail-api/include/email-api-smime.h53
-rwxr-xr-xemail-api/include/email-api.h150
9 files changed, 3141 insertions, 3506 deletions
diff --git a/email-api/include/email-api-account.h b/email-api/include/email-api-account.h
index 49c68e6..f201782 100755
--- a/email-api/include/email-api-account.h
+++ b/email-api/include/email-api-account.h
@@ -1,415 +1,411 @@
-/*
-* email-service
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
-*
-* 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.
-*
-*/
-
-
-#ifndef __EMAIL_API_ACCOUNT_H__
-#define __EMAIL_API_ACCOUNT_H__
-
-#include "email-types.h"
-
-/**
-* @defgroup EMAIL_SERVICE Email Service
-* @{
-*/
-
-
-/**
-* @ingroup EMAIL_SERVICE
-* @defgroup EMAIL_API_ACCOUNT Email Account API
-* @{
-*/
-
-/**
- *
- * This file contains the data structures and interfaces needed for application,
- * to interact with email-service.
- * @file email-api-account.h
- * @author Kyuho Jo <kyuho.jo@samsung.com>
- * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
- * @version 0.1
- * @brief This file contains the data structures and interfaces of Accounts provided by
- * email-service .
- *
-* @{
-
-* @code
-* #include "emf_mapi_account.h"
-* bool
-* other_app_invoke_uniform_api_sample(int* error_code)
-* {
-* emf_account_t *account = NULL;
-* emf_account_t *new_account = NULL;
-*
-* account = malloc(sizeof(emf_account_t));
-* memset(account, 0x00, sizeof(emf_account_t));
-*
-* account->account_bind_type = 1;
-* account->retrieval_mode = 1;
-* account->use_security = 1;
-* account->sending_server_type = EMF_SERVER_TYPE_SMTP;
-* account->sending_port_num = EMF_SMTP_PORT;
-* account->sending_auth = 1;
-* account->flag1 = 2;
-* account->account_bind_type = 1;
-* account->account_name = strdup("gmail");
-* account->display_name = strdup("Tom");
-* account->email_addr = strdup("tom@gmail.com");
-* account->reply_to_addr = strdup("tom@gmail.com");
-* account->return_addr = strdup("tom@gmail.com");
-* account->receiving_server_type = EMF_SERVER_TYPE_POP3;
-* account->receiving_server_addr = strdup("pop3.gmail.com");
-* account->port_num = 995;
-* account->use_security = 1;
-* account->retrieval_mode = EMF_IMAP4_RETRIEVAL_MODE_ALL;
-* account->user_name = strdup("tom");
-* account->password = strdup("password");
-* account->sending_server_type = EMF_SERVER_TYPE_SMTP;
-* account->sending_server_addr = strdup("smtp.gmail.com");
-* account->sending_port_num = 587;
-* account->sending_security = 0x02;
-* account->sending_auth = 1;
-* account->sending_user = strdup("tom@gmail.com");
-* account->sending_password = strdup("password");
-* account->pop_before_smtp = 0;
-* account->apop = 0;
-* account->flag1 = 2;
-* account->flag2 = 1;
-* account->preset_account = 1;
-* account->logo_icon_path = strdup("Logo Icon Path");
-* account->target_storage = 0;
-* account->options.priority = 3;
-* account->options.keep_local_copy = 0;
-* account->options.req_delivery_receipt = 0;
-* account->options.req_read_receipt = 0;
-* account->options.download_limit = 0;
-* account->options.block_address = 0;
-* account->options.block_subject = 0;
-* account->options.display_name_from = strdup("Display name from");
-* account->options.reply_with_body = 0;
-* account->options.forward_with_files = 0;
-* account->options.add_myname_card = 0;
-* account->options.add_signature = 0;
-* account->options.signature= strdup("Signature");
-* account->check_interval = 0;
-* // Add account
-* if(EMF_ERROR_NONE != email_add_account(account))
-* //failure
-* //else
-* {
-* //success
-* if(account_id)
-* *account_id = account->account_id;
-* }
-* if(EMF_ERROR_NONE != email_validate_account(account_id,&account_handle))
-* //failure
-* else
-* //success
-* if(EMF_ERROR_NONE != email_delete_account(account_id))
-* //failure
-* else
-* //success
-* new_account = malloc(sizeof(emf_account_t));
-* memset(new_account, 0x00, sizeof(emf_account_t));
-* new_account->flag1 = 1;
-* new_account->account_name = strdup("samsung001");
-* new_account->display_name = strdup("Tom001");
-* new_account->options.keep_local_copy = 1;
-* new_account->check_interval = 55;
-* // Update account
-* if(EMF_ERROR_NONE != email_update_account(acount_id,new_account))
-* //failure
-* else
-* //success
-* // Get account
-* if(EMF_ERROR_NONE != email_get_account(account_id,GET_FULL_DATA,&account))
-* //failure
-* else
-* //success
-* // Get list of accounts
-* if(EMF_ERROR_NONE != email_get_account_list(&account_list,&count))
-* //failure
-* else
-* //success
-* // free account
-* email_free_account(&account, 1);
-* }
- *
- * @endcode
- * @}
- */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
- * @open
- * @fn email_add_account(emf_account_t* account)
- * @brief Create a new email account.This function is invoked when user wants to add new email account
- *
- * @param[in] account Specifies the structure pointer of account.
- * @exception none
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @see emf_account_t
- * @remarks N/A
- */
-EXPORT_API int email_add_account(emf_account_t* account);
-
-/**
- * @open
- * @fn email_delete_account(int account_id)
- * @brief Delete a email account.This function is invoked when user wants to delete an existing email account
- *
- * @param[in] account_id Specifies the account ID.
- * @exception #EMF_ERROR_INVALID_PARAM -Invalid argument
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @see
- * @remarks N/A
- */
-EXPORT_API int email_delete_account(int account_id);
-
-/**
- * @open
- * @fn email_update_account(int account_id, emf_account_t* new_account)
- * @brief Change the information of a email account.This function is getting invoked when user wants to change some information of existing email account.
- *
- * @param[in] account_id Specifies the orignal account ID.
- * @param[in] new_account Specifies the information of new account.
- * @param[in] with_validation If this is 1, email-service will validate the account before updating. If this is 0, email-service will update the account without validation.
- * @exception #EMF_ERROR_INVALID_PARAM -Invalid argument
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @see emf_account_t
- * @remarks N/A
- */
-EXPORT_API int email_update_account(int account_id, emf_account_t* new_account);
-
-/**
- * @open
- * @fn email_update_account_with_validation(int account_id, emf_account_t* new_account)
- * @brief Change the information of a email account.This function is getting invoked when user wants to change some information of existing email account.
- *
- * @param[in] account_id Specifies the orignal account ID.
- * @param[in] new_account Specifies the information of new account.
- * @param[in] with_validation If this is 1, email-service will validate the account before updating. If this is 0, email-service will update the account without validation.
- * @exception #EMF_ERROR_INVALID_PARAM -Invalid argument
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @see emf_account_t
- * @remarks N/A
- */
-EXPORT_API int email_update_account_with_validation(int account_id, emf_account_t* new_account);
-
-/**
- * @open
- * @fn email_get_account(int account_id, int pulloption, emf_account_t** account)
- * @brief Get an email account by ID. This function is getting invoked when user wants to get the account informantion based on account id and option (GET_FULL_DATA/WITHOUT_OPTION/ONLY_OPTION).<br>
- * Memory for account information will be allocated to 3rd param(account). The allocated memory should be freed by email_free_account().
- *
- * @param[in] account_id Specifies the account ID.This function is invoked when user
- * @param[in] pulloption Option to specify to get full details or partial, see definition of EMF_ACC_GET_OPT_XXX
- * @param[out] account The returned account is saved here.
- * @exception #EMF_ERR_INVALID_PARAM -Invalid argument
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @see emf_account_t
- * @remarks N/A
- */
-
-EXPORT_API int email_get_account(int account_id, int pulloption, emf_account_t** account);
-
-/**
- * @open
- * @fn email_get_account_list(emf_account_t** account_list, int* count);
- * @brief Get Account List.This function is getting invoked when user wants to get all account information based on the count of accounts provided by user.<br>
- * Memory for account information will be allocated to 3rd param(account). The allocated memory should be freed by email_free_account().
- *
- * @param[in] account_list Specifies the structure pointer of account.
- * @param[out] count Specifies the count of accounts.
- * @exception #EMF_ERR_INVALID_PARAM -Invalid argument
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @see emf_account_t
- * @remarks N/A
- */
-EXPORT_API int email_get_account_list(emf_account_t** account_list, int* count);
-
- /**
- * @open
- * @fn email_free_account(emf_account_t** account_list, int count);
- * @brief Free allocated memory.This function is getting invoked when user wants to delete all account information.
- *
- * @param[in] account_list Specifies the structure pointer of account.
- * @param[out] count Specifies the count of accounts.
- * @exception #EMF_ERR_INVALID_PARAM -Invalid argument
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @see emf_account_t
- * @remarks N/A
- */
-EXPORT_API int email_free_account(emf_account_t** account_list, int count);
-
-
-/**
- * @open
- * @fn email_validate_account(int account_id, unsigned* handle)
- * @brief Validate account.This function is getting invoked after adding one account to validate it.If account is not validated then user should retry once again to add the account .
- *
- * @param[in] account_id Specifies the account Id to validate.
- * @param[out] handle Specifies the sending handle.
- * @remarks N/A
- * @exception #EMF_ERR_INVALID_PARAM -Invalid argument
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @see none
- * @remarks N/A
- */
-EXPORT_API int email_validate_account(int account_id, unsigned* handle);
-
-/**
- * @open
- * @fn email_add_account_with_validation(emf_account_t* account, unsigned* handle)
- * @brief Add an account when the account is validated. This function is getting invoked when user want to validate an account. If account is not validated then user should retry once again to add the account.<br>
- * Validation is executed without saving an account to DB
- *
- * @param[in] account Specifies the structure pointer of account.
- * @param[out] handle Specifies the sending handle.
- * @remarks N/A
- * @return This function returns true on success or false on failure.
- */
-EXPORT_API int email_add_account_with_validation(emf_account_t* account, unsigned* handle);
-
-
-/**
- * @open
- * @fn email_backup_accounts_into_secure_storage(const char *file_name)
- * @brief Back up information of all accounts into secure storage.
- * This function is getting invoked when user want to backup account information safely.
- *
- * @param[in] file_name Specifies the file name in secure storage
- * @remarks N/A
- * @return This function returns true on success or false on failure.
- */
-EXPORT_API int email_backup_accounts_into_secure_storage(const char *file_name);
-
-/**
- * @open
- * @fn email_restore_accounts_from_secure_storage(const char *file_name)
- * @brief Restore accounts from stored file in secure storage.
- * This function is getting invoked when user want to restore accounts.
- *
- * @param[in] file_name Specifies the file name in secure storage
- * @remarks N/A
- * @return This function returns true on success or false on failure.
- */
-EXPORT_API int email_restore_accounts_from_secure_storage(const char * file_name);
-
-/**
- * @open
- * @fn email_get_password_length_of_account(const int account_id, int *password_length)
- * @brief Get password length of an account.
- * This function is getting invoked when user want to know the length of an account.
- *
- * @param[in] account_id Specifies the account id
- * @param[out] handle Specifies the password length.
- * @remarks N/A
- * @return This function returns true on success or false on failure.
- */
-EXPORT_API int email_get_password_length_of_account(const int account_id, int *password_length);
-
-
-/**
- * @open
- * @fn email_query_server_info(const char* domain_name, emf_server_info_t **result_server_info)
- * @brief Query email server information.
- * This function is getting invoked when user want to get email server information.
- *
- * @param[in] domain_name Specifies the domain name of server
- * @param[out] result_server_info Specifies the information of email server.
- * @remarks N/A
- * @return This function returns true on success or false on failure.
- */
-EXPORT_API int email_query_server_info(const char* domain_name, emf_server_info_t **result_server_info);
-
-/**
- * @open
- * @fn email_free_server_info(emf_server_info_t **result_server_info)
- * @brief Free emf_server_info_t.
- * This function is getting invoked when user want to free emf_server_info_t.
- *
- * @param[in] result_server_info Specifies the pointer of in secure storage
- * @remarks N/A
- * @return This function returns true on success or false on failure.
- */
-EXPORT_API int email_free_server_info(emf_server_info_t **result_server_info);
-
-/**
- * @open
- * @fn email_update_notification_bar(int account_id)
- * @brief Update notifications on notification bar.
- * This function is getting invoked when user want to update notification bar.
- *
- * @param[in] account_id Specifies the id of account.
- * @remarks N/A
- * @return This function returns true on success or false on failure.
- */
-EXPORT_API int email_update_notification_bar(int account_id);
-
-/**
- * @open
- * @fn email_clear_all_notification_bar()
- * @brief Clear all notification on notification bar.
- * This function is getting invoked when user want to clear notification bar.
- *
- * @remarks N/A
- * @return This function returns true on success or false on failure.
- */
-EXPORT_API int email_clear_all_notification_bar();
-
-
-/**
- * @open
- * @fn email_save_default_account_id()
- * @brief Save default account id to vconf storage.
- * This function is getting invoked when user want to save default account id.
- *
- * @remarks N/A
- * @return This function returns true on success or false on failure.
- */
-EXPORT_API int email_save_default_account_id(int input_account_id);
-
-/**
- * @open
- * @fn email_load_default_account_id()
- * @brief Load default account id to vconf storage.
- * This function is getting invoked when user want to load default account id.
- *
- * @remarks N/A
- * @return This function returns true on success or false on failure.
- */
-EXPORT_API int email_load_default_account_id(int *output_account_id);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-/**
-* @} @}
-*/
-
-#endif /* __EMAIL_API_ACCOUNT_H__ */
-
-
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* 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.
+*
+*/
+
+
+#ifndef __EMAIL_API_ACCOUNT_H__
+#define __EMAIL_API_ACCOUNT_H__
+
+#include "email-types.h"
+
+/**
+* @defgroup EMAIL_SERVICE Email Service
+* @{
+*/
+
+
+/**
+* @ingroup EMAIL_SERVICE
+* @defgroup EMAIL_API_ACCOUNT Email Account API
+* @{
+*/
+
+/**
+ *
+ * This file contains the data structures and interfaces needed for application,
+ * to interact with email-service.
+ * @file email-api-account.h
+ * @author Kyuho Jo <kyuho.jo@samsung.com>
+ * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
+ * @version 0.1
+ * @brief This file contains the data structures and interfaces of Accounts provided by
+ * email-service .
+ *
+* @{
+
+* @code
+* #include "email-api-account.h"
+* bool
+* other_app_invoke_uniform_api_sample(int* error_code)
+* {
+* email_account_t *account = NULL;
+* email_account_t *new_account = NULL;
+*
+* account = malloc(sizeof(email_account_t));
+* memset(account, 0x00, sizeof(email_account_t));
+*
+* account->retrieval_mode = 1;
+* account->incoming_server_secure_connection = 1;
+* account->outgoing_server_type = EMAIL_SERVER_TYPE_SMTP;
+* account->outgoing_server_port_number = EMAIL_SMTP_PORT;
+* account->outgoing_server_need_authentication = 1;
+* account->account_name = strdup("gmail");
+* account->display_name = strdup("Tom");
+* account->user_email_address = strdup("tom@gmail.com");
+* account->reply_to_addr = strdup("tom@gmail.com");
+* account->return_addr = strdup("tom@gmail.com");
+* account->incoming_server_type = EMAIL_SERVER_TYPE_POP3;
+* account->incoming_server_address = strdup("pop3.gmail.com");
+* account->incoming_server_port_number = 995;
+* account->incoming_server_secure_connection = 1;
+* account->retrieval_mode = EMAIL_IMAP4_RETRIEVAL_MODE_ALL;
+* account->incoming_server_user_name = strdup("tom");
+* account->password = strdup("password");
+* account->outgoing_server_type = EMAIL_SERVER_TYPE_SMTP;
+* account->outgoing_server_address = strdup("smtp.gmail.com");
+* account->outgoing_server_port_number = 587;
+* account->outgoing_server_secure_connection = 0x02;
+* account->outgoing_server_need_authentication = 1;
+* account->outgoing_server_user_name = strdup("tom@gmail.com");
+* account->sending_password = strdup("password");
+* account->pop_before_smtp = 0;
+* account->incoming_server_requires_apop = 0;
+* account->flag1 = 2;
+* account->flag2 = 1;
+* account->is_preset_account = 1;
+* account->logo_icon_path = strdup("Logo Icon Path");
+* account->options.priority = 3;
+* account->options.keep_local_copy = 0;
+* account->options.req_delivery_receipt = 0;
+* account->options.req_read_receipt = 0;
+* account->options.download_limit = 0;
+* account->options.block_address = 0;
+* account->options.block_subject = 0;
+* account->options.display_name_from = strdup("Display name from");
+* account->options.reply_with_body = 0;
+* account->options.forward_with_files = 0;
+* account->options.add_myname_card = 0;
+* account->options.add_signature = 0;
+* account->options.signature= strdup("Signature");
+* account->check_interval = 0;
+* // Add account
+* if(EMAIL_ERROR_NONE != email_add_account(account))
+* //failure
+* //else
+* {
+* //success
+* if(account_id)
+* *account_id = account->account_id;
+* }
+* if(EMAIL_ERROR_NONE != email_validate_account(account_id,&account_handle))
+* //failure
+* else
+* //success
+* if(EMAIL_ERROR_NONE != email_delete_account(account_id))
+* //failure
+* else
+* //success
+* new_account = malloc(sizeof(email_account_t));
+* memset(new_account, 0x00, sizeof(email_account_t));
+* new_account->flag1 = 1;
+* new_account->account_name = strdup("samsung001");
+* new_account->display_name = strdup("Tom001");
+* new_account->options.keep_local_copy = 1;
+* new_account->check_interval = 55;
+* // Update account
+* if(EMAIL_ERROR_NONE != email_update_account(acount_id,new_account))
+* //failure
+* else
+* //success
+* // Get account
+* if(EMAIL_ERROR_NONE != email_get_account(account_id,GET_FULL_DATA,&account))
+* //failure
+* else
+* //success
+* // Get list of accounts
+* if(EMAIL_ERROR_NONE != email_get_account_list(&account_list,&count))
+* //failure
+* else
+* //success
+* // free account
+* email_free_account(&account, 1);
+* }
+ *
+ * @endcode
+ * @}
+ */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @open
+ * @fn email_add_account(email_account_t* account)
+ * @brief Create a new email account.This function is invoked when user wants to add new email account
+ *
+ * @param[in] account Specifies the structure pointer of account.
+ * @exception none
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @see email_account_t
+ * @remarks N/A
+ */
+EXPORT_API int email_add_account(email_account_t* account);
+
+/**
+ * @open
+ * @fn email_delete_account(int account_id)
+ * @brief Delete a email account.This function is invoked when user wants to delete an existing email account
+ *
+ * @param[in] account_id Specifies the account ID.
+ * @exception #EMAIL_ERROR_INVALID_PARAM -Invalid argument
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @see
+ * @remarks N/A
+ */
+EXPORT_API int email_delete_account(int account_id);
+
+/**
+ * @open
+ * @fn email_update_account(int account_id, email_account_t* new_account)
+ * @brief Change the information of a email account.This function is getting invoked when user wants to change some information of existing email account.
+ *
+ * @param[in] account_id Specifies the orignal account ID.
+ * @param[in] new_account Specifies the information of new account.
+ * @param[in] with_validation If this is 1, email-service will validate the account before updating. If this is 0, email-service will update the account without validation.
+ * @exception #EMAIL_ERROR_INVALID_PARAM -Invalid argument
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @see email_account_t
+ * @remarks N/A
+ */
+EXPORT_API int email_update_account(int account_id, email_account_t* new_account);
+
+/**
+ * @open
+ * @fn email_update_account_with_validation(int account_id, email_account_t* new_account)
+ * @brief Change the information of a email account.This function is getting invoked when user wants to change some information of existing email account.
+ *
+ * @param[in] account_id Specifies the orignal account ID.
+ * @param[in] new_account Specifies the information of new account.
+ * @param[in] with_validation If this is 1, email-service will validate the account before updating. If this is 0, email-service will update the account without validation.
+ * @exception #EMAIL_ERROR_INVALID_PARAM -Invalid argument
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @see email_account_t
+ * @remarks N/A
+ */
+EXPORT_API int email_update_account_with_validation(int account_id, email_account_t* new_account);
+
+/**
+ * @open
+ * @fn email_get_account(int account_id, int pulloption, email_account_t** account)
+ * @brief Get an email account by ID. This function is getting invoked when user wants to get the account informantion based on account id and option (GET_FULL_DATA/WITHOUT_OPTION/ONLY_OPTION).<br>
+ * Memory for account information will be allocated to 3rd param(account). The allocated memory should be freed by email_free_account().
+ *
+ * @param[in] account_id Specifies the account ID.This function is invoked when user
+ * @param[in] pulloption Option to specify to get full details or partial, see definition of EMAIL_ACC_GET_OPT_XXX
+ * @param[out] account The returned account is saved here.
+ * @exception #EMAIL_ERR_INVALID_PARAM -Invalid argument
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @see email_account_t
+ * @remarks N/A
+ */
+
+EXPORT_API int email_get_account(int account_id, int pulloption, email_account_t** account);
+
+/**
+ * @open
+ * @fn email_get_account_list(email_account_t** account_list, int* count);
+ * @brief Get Account List.This function is getting invoked when user wants to get all account information based on the count of accounts provided by user.<br>
+ * Memory for account information will be allocated to 3rd param(account). The allocated memory should be freed by email_free_account().
+ *
+ * @param[in] account_list Specifies the structure pointer of account.
+ * @param[out] count Specifies the count of accounts.
+ * @exception #EMAIL_ERR_INVALID_PARAM -Invalid argument
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @see email_account_t
+ * @remarks N/A
+ */
+EXPORT_API int email_get_account_list(email_account_t** account_list, int* count);
+
+ /**
+ * @open
+ * @fn email_free_account(email_account_t** account_list, int count);
+ * @brief Free allocated memory.This function is getting invoked when user wants to delete all account information.
+ *
+ * @param[in] account_list Specifies the structure pointer of account.
+ * @param[out] count Specifies the count of accounts.
+ * @exception #EMAIL_ERR_INVALID_PARAM -Invalid argument
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @see email_account_t
+ * @remarks N/A
+ */
+EXPORT_API int email_free_account(email_account_t** account_list, int count);
+
+
+/**
+ * @open
+ * @fn email_validate_account(int account_id, unsigned* handle)
+ * @brief Validate account.This function is getting invoked after adding one account to validate it.If account is not validated then user should retry once again to add the account .
+ *
+ * @param[in] account_id Specifies the account Id to validate.
+ * @param[out] handle Specifies the sending handle.
+ * @remarks N/A
+ * @exception #EMAIL_ERR_INVALID_PARAM -Invalid argument
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @see none
+ * @remarks N/A
+ */
+EXPORT_API int email_validate_account(int account_id, unsigned* handle);
+
+/**
+ * @open
+ * @fn email_add_account_with_validation(email_account_t* account, unsigned* handle)
+ * @brief Add an account when the account is validated. This function is getting invoked when user want to validate an account. If account is not validated then user should retry once again to add the account.<br>
+ * Validation is executed without saving an account to DB
+ *
+ * @param[in] account Specifies the structure pointer of account.
+ * @param[out] handle Specifies the sending handle.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int email_add_account_with_validation(email_account_t* account, unsigned* handle);
+
+
+/**
+ * @open
+ * @fn email_backup_accounts_into_secure_storage(const char *file_name)
+ * @brief Back up information of all accounts into secure storage.
+ * This function is getting invoked when user want to backup account information safely.
+ *
+ * @param[in] file_name Specifies the file name in secure storage
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int email_backup_accounts_into_secure_storage(const char *file_name);
+
+/**
+ * @open
+ * @fn email_restore_accounts_from_secure_storage(const char *file_name)
+ * @brief Restore accounts from stored file in secure storage.
+ * This function is getting invoked when user want to restore accounts.
+ *
+ * @param[in] file_name Specifies the file name in secure storage
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int email_restore_accounts_from_secure_storage(const char * file_name);
+
+/**
+ * @open
+ * @fn email_get_password_length_of_account(const int account_id, int *password_length)
+ * @brief Get password length of an account.
+ * This function is getting invoked when user want to know the length of an account.
+ *
+ * @param[in] account_id Specifies the account id
+ * @param[out] handle Specifies the password length.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int email_get_password_length_of_account(const int account_id, int *password_length);
+
+
+/**
+ * @open
+ * @fn email_query_server_info(const char* domain_name, email_server_info_t **result_server_info)
+ * @brief Query email server information.
+ * This function is getting invoked when user want to get email server information.
+ *
+ * @param[in] domain_name Specifies the domain name of server
+ * @param[out] result_server_info Specifies the information of email server.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int email_query_server_info(const char* domain_name, email_server_info_t **result_server_info);
+
+/**
+ * @open
+ * @fn email_free_server_info(email_server_info_t **result_server_info)
+ * @brief Free email_server_info_t.
+ * This function is getting invoked when user want to free email_server_info_t.
+ *
+ * @param[in] result_server_info Specifies the pointer of in secure storage
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int email_free_server_info(email_server_info_t **result_server_info);
+
+/**
+ * @open
+ * @fn email_update_notification_bar(int account_id)
+ * @brief Update notifications on notification bar.
+ * This function is getting invoked when user want to update notification bar.
+ *
+ * @param[in] account_id Specifies the id of account.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int email_update_notification_bar(int account_id);
+
+/**
+ * @open
+ * @fn email_clear_all_notification_bar()
+ * @brief Clear all notification on notification bar.
+ * This function is getting invoked when user want to clear notification bar.
+ *
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int email_clear_all_notification_bar();
+
+
+/**
+ * @open
+ * @fn email_save_default_account_id()
+ * @brief Save default account id to vconf storage.
+ * This function is getting invoked when user want to save default account id.
+ *
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int email_save_default_account_id(int input_account_id);
+
+/**
+ * @open
+ * @fn email_load_default_account_id()
+ * @brief Load default account id to vconf storage.
+ * This function is getting invoked when user want to load default account id.
+ *
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int email_load_default_account_id(int *output_account_id);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/**
+* @} @}
+*/
+
+#endif /* __EMAIL_API_ACCOUNT_H__ */
+
+
diff --git a/email-api/include/email-api-etc.h b/email-api/include/email-api-etc.h
new file mode 100755
index 0000000..4123636
--- /dev/null
+++ b/email-api/include/email-api-etc.h
@@ -0,0 +1,80 @@
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* 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.
+*
+*/
+
+/**
+* @defgroup EMAIL_SERVICE Email Service
+* @{
+*/
+
+/**
+* @ingroup EMAIL_SERVICE
+* @defgroup EMAIL_API_ETC Email API
+* @{
+*/
+
+/**
+ *
+ * This file contains the data structures and interfaces needed for application,
+ * to interact with email-service.
+ * @file email-api-etc.h
+ * @author Kyuho Jo <kyuho.jo@samsung.com>
+ * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
+ * @version 0.1
+ * @brief This file contains the data structures and interfaces of Accounts provided by
+ * email-service .
+ */
+
+#ifndef __EMAIL_API_ETC_H__
+#define __EMAIL_API_ETC_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include "email-types.h"
+
+/**
+
+ * @open
+ * @fn email_show_user_message(void)
+ * @brief This function show user message.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @exception none
+ * @see email_action_t
+ * @remarks N/A
+ */
+EXPORT_API int email_show_user_message(int id, email_action_t action, int error_code);
+
+EXPORT_API int email_open_eml_file(char *eml_file_path, email_mail_data_t **output_mail_data, email_attachment_data_t **output_attachment_data, int *output_attachment_count);
+
+EXPORT_API int email_delete_eml_data(email_mail_data_t *input_mail_data);
+
+EXPORT_API int email_get_mime_entity(char *mime_path, char **mime_entity);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __EMAIL_API_ETC_H__ */
+
+/**
+* @} @}
+*/
diff --git a/email-api/include/email-api-init.h b/email-api/include/email-api-init.h
index cd4e00c..63fa085 100755
--- a/email-api/include/email-api-init.h
+++ b/email-api/include/email-api-init.h
@@ -1,174 +1,174 @@
-/*
-* email-service
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
-*
-* 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.
-*
-*/
-
-
-#ifndef __EMAIL_API_INTI_H__
-#define __EMAIL_API_INTI_H__
-
-#include "email-types.h"
-
-/**
-* @defgroup EMAIL_SERVICE Email Service
-* @{
-*/
-
-
-/**
-* @ingroup EMAIL_SERVICE
-* @defgroup EMAIL_API_INIT Email Initialization API
-* @{
-*/
-
-/**
- *
- * This file contains the data structures and interfaces needed for application,
- * to interact with email-service.
- * @file email-api-init.h
- * @author Kyuho Jo <kyuho.jo@samsung.com>
- * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
- * @version 0.1
- * @brief This file contains the data structures and interfaces of Email FW Initialization provided by
- * email-service .
- *@{
- *@code
- *
- * #include "emf_mapi_init.h"
- *
- * bool
- * other_app_invoke_uniform_api_sample(int* error_code)
- * {
- * int err = EMF_ERROR_NONE;
- *
- * // Open connections to email-service and DB
- * // The connections will be maintain throughout application's execution
- * if(EMF_ERROR_NONE == email_service_begin())
- * {
- * If(EMF_ERROR_NONE != email_open_db())
- * {
- * return false;
- * }
- *
- * // Execute email_init_storage() if and only if there is no db file.
- * // This fuction will create db file and tables for email service
- * If(EMF_ERROR_NONE !=email_init_storage())
- * {
- * return false;
- * }
- * }
- *
- * ......
- *
- * // Work with calling MAPI functions
- *
- * ......
- *
- * // Close the connections to email-service and DB after all email job is finished. (ex. close an email application)
- * // DO NOT have to call these funtions until the connections is not needed any more.
- * err =email_close_db();
- * err =email_service_end();
- * }
- *
- * @endcode
- * @}
- */
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
-
- * @open
- * @fn email_init_storage(void)
- * @brief Create all table for email. Exposed to External Application- core team.Creates all Email DB tables [ EXTERNAL]
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure
- * @exception none
- * @see none
- * @remarks N/A
- */
-EXPORT_API int email_init_storage(void);
-
-/**
-
- * @open
- * @fn email_open_db(void)
- * @brief This function Open the email DB and register busy handler
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @exception none
- * @see none
- * @remarks N/A
- */
-EXPORT_API int email_open_db(void);
-
-
-/**
-
- * @open
- * @fn email_close_db(void)
- * @brief This function closes the connection of the email DB
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @exception none
- * @see none
- * @remarks N/A
- */
-EXPORT_API int email_close_db(void);
-
-/**
-
- * @open
- * @fn email_service_begin(void)
- * @brief Does the IPC Proxy Initialization by the Application which used the Email FW API's
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @exception none
- * @see none
- * @remarks N/A
- */
-EXPORT_API int email_service_begin(void);
-
-/**
-
- * @open
- * @fn email_service_end(void)
- * @brief This function does the IPC Proxy Finaization by the Application which used the Email FW API's
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @exception none
- * @see none
- * @remarks N/A
- */
-EXPORT_API int email_service_end(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-/**
-* @} @}
-*/
-
-
-#endif /* __EMAIL_API_INTI_H__ */
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* 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.
+*
+*/
+
+
+#ifndef __EMAIL_API_INTI_H__
+#define __EMAIL_API_INTI_H__
+
+#include "email-types.h"
+
+/**
+* @defgroup EMAIL_SERVICE Email Service
+* @{
+*/
+
+
+/**
+* @ingroup EMAIL_SERVICE
+* @defgroup EMAIL_API_INIT Email Initialization API
+* @{
+*/
+
+/**
+ *
+ * This file contains the data structures and interfaces needed for application,
+ * to interact with email-service.
+ * @file email-api-init.h
+ * @author Kyuho Jo <kyuho.jo@samsung.com>
+ * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
+ * @version 0.1
+ * @brief This file contains the data structures and interfaces of Email FW Initialization provided by
+ * email-service .
+ *@{
+ *@code
+ *
+ * #include "email-api-init.h"
+ *
+ * bool
+ * other_app_invoke_uniform_api_sample(int* error_code)
+ * {
+ * int err = EMAIL_ERROR_NONE;
+ *
+ * // Open connections to email-service and DB
+ * // The connections will be maintain throughout application's execution
+ * if(EMAIL_ERROR_NONE == email_service_begin())
+ * {
+ * If(EMAIL_ERROR_NONE != email_open_db())
+ * {
+ * return false;
+ * }
+ *
+ * // Execute email_init_storage() if and only if there is no db file.
+ * // This fuction will create db file and tables for email service
+ * If(EMAIL_ERROR_NONE !=email_init_storage())
+ * {
+ * return false;
+ * }
+ * }
+ *
+ * ......
+ *
+ * // Work with calling MAPI functions
+ *
+ * ......
+ *
+ * // Close the connections to email-service and DB after all email job is finished. (ex. close an email application)
+ * // DO NOT have to call these funtions until the connections is not needed any more.
+ * err =email_close_db();
+ * err =email_service_end();
+ * }
+ *
+ * @endcode
+ * @}
+ */
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+
+ * @open
+ * @fn email_init_storage(void)
+ * @brief Create all table for email. Exposed to External Application- core team.Creates all Email DB tables [ EXTERNAL]
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure
+ * @exception none
+ * @see none
+ * @remarks N/A
+ */
+EXPORT_API int email_init_storage(void);
+
+/**
+
+ * @open
+ * @fn email_open_db(void)
+ * @brief This function Open the email DB and register busy handler
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @exception none
+ * @see none
+ * @remarks N/A
+ */
+EXPORT_API int email_open_db(void);
+
+
+/**
+
+ * @open
+ * @fn email_close_db(void)
+ * @brief This function closes the connection of the email DB
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @exception none
+ * @see none
+ * @remarks N/A
+ */
+EXPORT_API int email_close_db(void);
+
+/**
+
+ * @open
+ * @fn email_service_begin(void)
+ * @brief Does the IPC Proxy Initialization by the Application which used the Email FW API's
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @exception none
+ * @see none
+ * @remarks N/A
+ */
+EXPORT_API int email_service_begin(void);
+
+/**
+
+ * @open
+ * @fn email_service_end(void)
+ * @brief This function does the IPC Proxy Finaization by the Application which used the Email FW API's
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @exception none
+ * @see none
+ * @remarks N/A
+ */
+EXPORT_API int email_service_end(void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/**
+* @} @}
+*/
+
+
+#endif /* __EMAIL_API_INTI_H__ */
diff --git a/email-api/include/email-api-mail.h b/email-api/include/email-api-mail.h
index e6d4048..8b3b227 100755
--- a/email-api/include/email-api-mail.h
+++ b/email-api/include/email-api-mail.h
@@ -1,1869 +1,1427 @@
-/*
-* email-service
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
-*
-* 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.
-*
-*/
-
-
-#ifndef __EMAIL_API_MESSAGE_H__
-#define __EMAIL_API_MESSAGE_H__
-
-#include "email-types.h"
-
-#include <time.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-/**
-* @defgroup EMAIL_SERVICE Email Service
-* @{
-*/
-
-
-/**
-* @ingroup EMAIL_SERVICE
-* @defgroup EMAIL_API_MAIL Email Mail API
-* @{
-*/
-
-/**
- *
- * This file contains the data structures and interfaces needed for application,
- * to interact with email-service.
- * @file email-api-mail.h
- * @author Kyuho Jo <kyuho.jo@samsung.com>
- * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
- * @version 0.1
- * @brief This file contains the data structures and interfaces of Messages provided by
- * email-service .
- */
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
- * @open
- * @fn email_add_mail(emf_mail_data_t *input_mail_data, emf_attachment_data_t *input_attachment_data_list, int input_attachment_count, emf_meeting_request_t* input_meeting_request, int input_from_eas)
- * @brief Save a mail. This function is invoked when user wants to add a mail.
- * If the option from_eas is 1 then this will save the message on server as well as on locally.
- * If the receiving_server_type is EMF_SERVER_TYPE_POP3 then from_eas value will be 0
- * If the receiving_server_type is EMF_SERVER_TYPE_IMAP4 then from_eas value will be 1/0
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] input_mail_data Specifies the saving mail.
- * @param[in] input_attachment_data_list Specifies the mailbox structure for saving email.
- * @param[in] input_attachment_count Specifies if the mail comes from composer.
- * @param[in] input_meeting_request Specifies if the mail comes from composer.
- * @param[in] input_from_eas Specifies if the mail will be saved on server.
-
- * @exception none
- * @see emf_mail_data_t and emf_mailbox_t
- * @remarks N/A
- * @code
- * #include "email-api-mail.h"
- * int _test_add_mail ()
- * {
- * int i = 0;
- * int account_id = 0;
- * int from_eas = 0;
- * int attachment_count = 0;
- * int err = EMF_ERROR_NONE;
- * char arg[50] = { 0 , };
- * char *body_file_path = "/opt/data/email/.emfdata/tmp/mail.txt";
- * emf_mailbox_t *mailbox_data = NULL;
- * emf_mail_data_t *test_mail_data = NULL;
- * emf_attachment_data_t *attachment_data = NULL;
- * emf_meeting_request_t *meeting_req = NULL;
- * FILE *body_file;
- *
- * printf("\n > Enter account id : ");
- * scanf("%d", &account_id);
- *
- *
- * memset(arg, 0x00, 50);
- * printf("\n > Enter mailbox name : ");
- * scanf("%s", arg);
- *
- * email_get_mailbox_by_name(account_id, arg, &mailbox_data);
- *
- * test_mail_data = malloc(sizeof(emf_mail_data_t));
- * memset(test_mail_data, 0x00, sizeof(emf_mail_data_t));
- *
- * printf("\n From EAS? [0/1]> ");
- * scanf("%d", &from_eas);
- *
- * test_mail_data->account_id = account_id;
- * test_mail_data->save_status = 1;
- * test_mail_data->flags_seen_field = 1;
- * test_mail_data->file_path_plain = strdup(body_file_path);
- * test_mail_data->mailbox_name = strdup(mailbox_data->name);
- * test_mail_data->mailbox_type = mailbox_data->mailbox_type;
- * test_mail_data->full_address_from = strdup("<test1@test.com>");
- * test_mail_data->full_address_to = strdup("<test2@test.com>");
- * test_mail_data->full_address_cc = strdup("<test3@test.com>");
- * test_mail_data->full_address_bcc = strdup("<test4@test.com>");
- * test_mail_data->subject = strdup("Meeting request mail");
- *
- * body_file = fopen(body_file_path, "w");
- *
- * for(i = 0; i < 500; i++)
- * fprintf(body_file, "X2 X2 X2 X2 X2 X2 X2");
- * fflush(body_file);
- * fclose(body_file);
- *
- * printf(" > Attach file? [0/1] : ");
- * scanf("%d",&attachment_count);
- *
- * if ( attachment_count ) {
- * memset(arg, 0x00, 50);
- * printf("\n > Enter attachment name : ");
- * scanf("%s", arg);
- *
- * attachment_data = malloc(sizeof(emf_attachment_data_t));
- *
- * attachment_data->attachment_name = strdup(arg);
- *
- * memset(arg, 0x00, 50);
- * printf("\n > Enter attachment absolute path : ");
- * scanf("%s",arg);
- *
- * attachment_data->attachment_path = strdup(arg);
- * attachment_data->save_status = 1;
- * test_mail_data->attachment_count = attachment_count;
- * }
- *
- * printf("\n > Meeting Request? [0: no, 1: yes (request from server), 2: yes (response from local)]");
- * scanf("%d", &(test_mail_data->meeting_request_status));
- *
- * if ( test_mail_data->meeting_request_status == 1
- * || test_mail_data->meeting_request_status == 2 ) {
- * time_t current_time;
- * meeting_req = malloc(sizeof(emf_meeting_request_t));
- * memset(meeting_req, 0x00, sizeof(emf_meeting_request_t));
- *
- * meeting_req->meeting_response = 1;
- * current_time = time(NULL);
- * gmtime_r(&current_time, &(meeting_req->start_time));
- * gmtime_r(&current_time, &(meeting_req->end_time));
- * meeting_req->location = malloc(strlen("Seoul") + 1);
- * memset(meeting_req->location, 0x00, strlen("Seoul") + 1);
- * strcpy(meeting_req->location, "Seoul");
- * strcpy(meeting_req->global_object_id, "abcdef12345");
- *
- * meeting_req->time_zone.offset_from_GMT = 9;
- * strcpy(meeting_req->time_zone.standard_name, "STANDARD_NAME");
- * gmtime_r(&current_time, &(meeting_req->time_zone.standard_time_start_date));
- * meeting_req->time_zone.standard_bias = 3;
- *
- * strcpy(meeting_req->time_zone.daylight_name, "DAYLIGHT_NAME");
- * gmtime_r(&current_time, &(meeting_req->time_zone.daylight_time_start_date));
- * meeting_req->time_zone.daylight_bias = 7;
- *
- * }
- *
- * if((err = email_add_mail(test_mail_data, attachment_data, attachment_count, meeting_req, from_eas)) != EMF_ERROR_NONE)
- * printf("email_add_mail failed. [%d]\n", err);
- * else
- * printf("email_add_mail success.\n");
- *
- * if(attachment_data)
- * email_free_attachment_data(&attachment_data, attachment_count);
- *
- * if(meeting_req)
- * email_free_meeting_request(&meeting_req, 1);
- *
- * email_free_mail_data(&test_mail_data, 1);
- * email_free_mailbox(&mailbox_data, 1);
- *
- * printf("saved mail id = [%d]\n", test_mail_data->mail_id);
- *
- * return 0;
- * }
- * @endcode
- */
-EXPORT_API int email_add_mail(emf_mail_data_t *input_mail_data, emf_attachment_data_t *input_attachment_data_list, int input_attachment_count, emf_meeting_request_t* input_meeting_request, int input_from_eas);
-
- /**
- * @open
- * @fn email_add_read_receipt(int input_read_mail_id, unsigned *output_handle)
- * @brief Add a read receipt mail. This function is invoked when user receives a mail with read report enable and wants to send a read report for the same.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] input_read_mail_id Specifies the id of mail which has been read.
- * @param[out] output_receipt_mail_id Specifies the receipt mail id .
- * @exception none
- * @see
- * @remarks N/A
- */
-EXPORT_API int email_add_read_receipt(int input_read_mail_id, int *output_receipt_mail_id);
-
-/**
- * @open
- * @fn email_update_mail(emf_mail_data_t *input_mail_data, emf_attachment_data_t *input_attachment_data_list, int input_attachment_count, emf_meeting_request_t* input_meeting_request, int input_from_composer)
- * @brief Update a existing email information. This function is invoked when user wants to change some existing email information with new email information.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] input_mail_data Specifies the mail ID.
- * @param[in] input_attachment_data_list Specifies the pointer of attachment data.
- * @param[in] input_attachment_count Specifies the number of attachment data.
- * @param[in] input_meeting_request Specifies the meeting request data.
- * @param[in] input_from_eas Specifies whether sync server.
-
- * @exception none
- * @see emf_mail_data_t
- * @code
- * #include "email-api-account.h"
- * int email_test_update_mail()
- * {
- * int mail_id = 0;
- * int err = EMF_ERROR_NONE;
- * int test_attachment_data_count = 0;
- * char arg[50];
- * emf_mail_data_t *test_mail_data = NULL;
- * emf_attachment_data_t *test_attachment_data_list = NULL;
- * emf_meeting_request_t *meeting_req = NULL;
- *
- * printf("\n > Enter mail id : ");
- * scanf("%d", &mail_id);
- *
- * email_get_mail_data(mail_id, &test_mail_data);
- *
- * printf("\n > Enter Subject: ");
- * scanf("%s", arg);
- *
- * test_mail_data->subject= strdup(arg);
- *
- *
- *
- * if (test_mail_data->attachment_count > 0) {
- * if ( (err = email_get_attachment_data_list(mail_id, &test_attachment_data_list, &test_attachment_data_count)) != EMF_ERROR_NONE ) {
- * printf("email_get_meeting_request() failed [%d]\n", err);
- * return -1;
- * }
- * }
- *
- * if ( test_mail_data->meeting_request_status == EMF_MAIL_TYPE_MEETING_REQUEST
- * || test_mail_data->meeting_request_status == EMF_MAIL_TYPE_MEETING_RESPONSE
- * || test_mail_data->meeting_request_status == EMF_MAIL_TYPE_MEETING_ORIGINATINGREQUEST) {
- *
- * if ( (err = email_get_meeting_request(mail_id, &meeting_req)) != EMF_ERROR_NONE ) {
- * printf("email_get_meeting_request() failed [%d]\n", err);
- * return -1;
- * }
- *
- * printf("\n > Enter meeting response: ");
- * scanf("%d", (int*)&(meeting_req->meeting_response));
- * }
- *
- * if ( (err = email_update_mail(test_mail_data, test_attachment_data_list, test_attachment_data_count, meeting_req, 0)) != EMF_ERROR_NONE)
- * printf("email_update_mail failed.[%d]\n", err);
- * else
- * printf("email_update_mail success\n");
- *
- * if(test_mail_data)
- * email_free_mail_data(&test_mail_data, 1);
- *
- * if(test_attachment_data_list)
- * email_free_attachment_data(&test_attachment_data_list, test_attachment_data_count);
- *
- * if(meeting_req)
- * email_free_meeting_request(&meeting_req, 1);
- *
- * return 0;
- * }
-
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_update_mail(emf_mail_data_t *input_mail_data, emf_attachment_data_t *input_attachment_data_list, int input_attachment_count, emf_meeting_request_t* input_meeting_request, int input_from_eas);
-
-/**
- * @open
- * @fn email_count_message(emf_mailbox_t* mailbox, int* total, int* unseen)
- * @brief Get mail count from mailbox.This function is invoked when user wants to know how many toatl mails and out of that
- * how many unseen mails are there in a given mailbox.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mailbox Specifies the pointer of mailbox structure.
- * @param[out] total Total email count is saved here.
- * @param[out] unseen Unread email count is saved here.
- * @exception none
- * @see emf_mailbox_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_count_message()
- * {
- * emf_mailbox_t mailbox;
- * int account_id = 0;
- * int total = 0;
- * int unseen = 0;
- *
- * memset(&mailbox, 0x00, sizeof(emf_mailbox_t));
- * printf("\n > Enter account_id (0 means all accounts) : ");
- * scanf("%d", &account_id);
- * if(account_id == 0)
- * {
- * mailbox.name = NULL;
- * }
- * else
- * {
- * printf("\n > Enter maibox name: ");
- * mailbox.name = strdup("SENTBOX");
- * }
- * mailbox.account_id = account_id;
- * if(EMF_ERROR_NONE == email_count_message(&mailbox, &total, &unseen))
- * printf("\n Total: %d, Unseen: %d \n", total, unseen);
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_count_message(emf_mailbox_t* mailbox, int* total, int* unseen);
-
-
-/**
- * @open
- * @fn email_delete_message(emf_mailbox_t* mailbox, int *mail_ids, int num, int from_server)
- * @brief Delete a mail or multiple mails.Based on from_server value this function will delte a mail or multiple mails from server or loaclly.
- * @param[in] mailbox Reserved.
- * If the receiving_server_type is EMF_SERVER_TYPE_POP3 then from_server value will be 0
- * If the receiving_server_type is EMF_SERVER_TYPE_IMAP4 then from_server value will be 1/0
- *
- * @param[in] mail_ids[] Specifies the arrary of mail id.
- * @param[in] num Specifies the number of mail id.
- * @param[in] from_server Specifies whether mails are deleted from server.
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @exception none
- * @see emf_mailbox_t
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_delete_all_messages_in_mailbox()
- * {
- * int count, i, mail_id=0, account_id =0;
- * emf_mailbox_t mbox = {0};
- *
- * printf("\n > Enter Account_id: ");
- * scanf("%d",&account_id);
- * printf("\n > Enter Mail_id: ");
- * scanf("%d",&mail_id);
- * printf("\n > Enter Mailbox name: ");
- * mbox.account_id = account_id;
- * mbox.name = strdup("INBOX");
- * if(EMF_ERROR_NONE == email_delete_message(&mbox, &mail_id, 1, 1))
- * printf("\n email_delete_message success");
- * else
- * printf("\n email_delete_message failed");
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_delete_message(emf_mailbox_t* mailbox, int *mail_ids, int num, int from_server);
-
-
-/**
- * @open
- * @fn email_delete_all_message_in_mailbox(emf_mailbox_t* mailbox, int from_server)
- * @brief Delete all mail from a mailbox.
- * If the receiving_server_type is EMF_SERVER_TYPE_POP3 then from_server value will be 0
- * If the receiving_server_type is EMF_SERVER_TYPE_IMAP4 then from_server value will be 1/0
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mailbox Specifies the structure of mailbox.
- * @param[in] from_server Specifies whether mails are also deleted from server.
- * @exception none
- * @see emf_mailbox_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_delete_all_messages_in_mailbox()
- * {
- * int count, account_id =0;
- * emf_mailbox_t mbox = {0};
- *
- * printf("\n > Enter Account_id: ");
- * scanf("%d",&account_id);
- * printf("\n > Enter Mailbox name: ");
- * mbox.account_id = account_id;
- * mbox.name = strdup("INBOX");
- *
- * if (EMF_ERROR_NONE != email_delete_all_message_in_mailbox(&mbox, 0))
- * printf("email_delete_all_message_in_mailbox failed");
- * else
- * printf("email_delete_all_message_in_mailbox Success");
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_delete_all_message_in_mailbox(emf_mailbox_t* mailbox, int from_server);
-
-
-
-/**
- * @open
- * @fn email_clear_mail_data()
- * @brief delete email data from storage. This API will be used by the Settings Application
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @exception none
- * @see none
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_clear_mail_data()
- * {
- * if(EMF_ERROR_NONE == email_clear_mail_data())
- * //success
- * else
- * //failure
- *
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_clear_mail_data();
-
-
-/**
- * @open
- * @fn email_add_attachment( emf_mailbox_t* mailbox, int mail_id, emf_attachment_info_t* attachment)
- * @brief Append a attachment to email.This function is invoked when user wants to add attachment to existing mail.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mail_id Specifies the mail ID.
- * @param[in] attachment Specifies the structure of attachment.
- * @exception none
- * @see emf_mailbox_t and emf_attachment_info_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_mail_add_attachment()
- * {
- * int account_id = 0;
- * int mail_id = 0;
- * emf_mailbox_t mbox;
- * emf_attachment_info_t attachment;
- *
- * printf("\n > Enter Mail Id: ");
- * scanf("%d", &mail_id);
- * printf("\n > Enter Account_id: ");
- * scanf("%d",&account_id);
- * memset(&mbox, 0x00, sizeof(emf_attachment_info_t));
- * mbox.account_id = account_id;
- * mbox.name = strdup("INBOX");
- * memset(&attachment, 0x00, sizeof(emf_attachment_info_t));
- * printf("\n > Enter attachment name: ");
- * attachment.name = strdup("Test");
- * printf("\n > Enter attachment absolute path: ");
- * attachment.savename = strdup("/tmp/test.txt");
- * attachment.next = NULL;
- * if(EMF_ERROR_NONE != email_add_attachment( &mbox, mail_id, &attachment))
- * printf("email_add_attachment failed\n");
- * else
- * printf(email_add_attachment success\n");
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_add_attachment( emf_mailbox_t* mailbox, int mail_id, emf_attachment_info_t* attachment);
-
-
-/**
- * @open
- * @fn email_delete_attachment(emf_mailbox_t * mailbox, int mail_id, const char * attachment_id)
- * @brief delete a attachment from email.This function is invoked when user wants to delete a attachment from existing mailbased on mail Id and attachment Id
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mailbox Specifies the structure of mailbox.
- * @param[in] mail_id Specifies the mail ID.
- * @param[in] attachment_id Specifies the attachment id.
- * @exception none
- * @see emf_mailbox_t
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_mail_delete_attachment()
- * {
- * int account_id = 0;
- * int mail_id = 0;
- * char *attchment_id;
- * emf_mailbox_t mbox;
- *
- * mail_id = 1; // mail id in the DB
- * mbox.account_id = 1; // account id in the DB
- * mbox.name = strdup("INBOX"); // mailbox name
- * attachment_id = strdup("1"); // the first attachment item in a attachment list
- *
- * if(EMF_ERROR_NONE != email_delete_attachment(&mbox,mail_id,attachment_id))
- * //failure
- * else
- * //success
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_delete_attachment(emf_mailbox_t * mailbox, int mail_id, const char *attachment_id);
-
-
-/* -----------------------------------------------------------
- Mail Search API
- -----------------------------------------------------------*/
-
-/**
- * @open
- * @fn email_query_mails(char *conditional_clause_string, emf_mail_data_t** mail_list, int *result_count)
- * @brief Query the mail list information from DB based on the mailbox name.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] conditional_clause_string Specifies the where clause string.
- * @param[in/out] mail_list Specifies the pointer to the structure emf_mail_data_t.
- * @param[in/out] result_count Specifies the number of mails returned.
- * @exception None
- * @see emf_mail_list_item_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_query_mail()
- * {
- * emf_mail_data_t *mail_list = NULL;
- * char conditional_clause_string[500];
- * int result_count = 0;
- *
- * memset(mailbox_name, 0x00, 10);
- * printf("\n > Enter where clause: ");
- * scanf("%s", conditional_clause_string);
- *
- *
- * if (EMF_ERROR_NONE != email_query_mails(conditional_clause_string, &mail_list, &result_count))
- * printf("email_query_message_ex failed \n");
- * else {
- * printf("Success\n");
- * //do something
- * free(mail_list);
- * }
- *
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_query_mails(char *conditional_clause_string, emf_mail_data_t** mail_list, int *result_count);
-
-/**
- * @open
- * @fn email_query_message_ex(char *conditional_clause_string, emf_mail_list_item_t** mail_list, int *result_count)
- * @brief Query the mail list information from DB based on the mailbox name.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] conditional_clause_string Specifies the where clause string.
- * @param[in/out] mail_list Specifies the pointer to the structure emf_mail_list_item_t.
- * @param[in/out] result_count Specifies the number of mails returned.
- * @exception None
- * @see emf_mail_list_item_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_query_mail()
- * {
- * emf_mail_list_item_t *mail_list = NULL;
- * char conditional_clause_string[500];
- * int result_count = 0;
- *
- * memset(mailbox_name, 0x00, 10);
- * printf("\n > Enter where clause: ");
- * scanf("%s", conditional_clause_string);
- *
- *
- * if (EMF_ERROR_NONE != email_query_message_ex(conditional_clause_string, &mail_list, &result_count))
- * printf("email_query_message_ex failed \n");
- * else {
- * printf("Success\n");
- * //do something
- * free(mail_list);
- * }
- *
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_query_message_ex(char *conditional_clause_string, emf_mail_list_item_t** mail_list, int *result_count);
-
-
-/**
- * @open
- * @fn email_get_attachment_info(emf_mailbox_t* mailbox, int mail_id, const char* attachment_id, emf_attachment_info_t** attachment)
- * @brief Get a mail attachment.This function is invoked when user wants to get the attachment information based on attachment id for the specified mail Id.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mailbox Reserved.
- * @param[in] mail_id Specifies the mail ID.
- * @param[in] attachment_id Specifies the buffer that a attachment ID been saved.
- * @param[out] attachment The returned attachment is save here.
- * @exception none
- * @see emf_mailbox_t and emf_mail_attachment_info_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_mail_get_attachment_info()
- * {
- * emf_mailbox_t mailbox;
- * emf_mail_attachment_info_t *mail_attach_info = NULL;
- * int mail_id = 0,account_id = 0;
- * char arg[10];
- * int err = EMF_ERROR_NONE;
- *
- * memset(&mailbox, 0x00, sizeof(emf_mailbox_t));
- *
- * printf("\n > Enter Mail Id: ");
- * scanf("%d", &mail_id);
- * printf("\n > Enter account Id: ");
- * scanf("%d", &account_id);
- * printf("> attachment Id\n");
- * scanf("%s",arg);
- * mailbox.account_id = account_id;
- * if (EMF_ERROR_NONE != email_get_attachment_info(&mailbox, mail_id, &mail_attach_info))
- * printf("email_get_attachment_info failed\n");
- * else
- * {
- * printf("email_get_attachment_info SUCCESS\n");
- * //do something
- * email_free_attachment_info(&mail_attach_info,1);
- * }
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_get_attachment_info(emf_mailbox_t* mailbox, int mail_id, const char* attachment_id, emf_attachment_info_t** attachment);
-
-EXPORT_API int email_get_attachment_data_list(int input_mail_id, emf_attachment_data_t **output_attachment_data, int *output_attachment_count);
-
-/**
- * @open
- * @fn email_free_attachment_info(emf_attachment_info_t** atch_info)
- * @brief Free allocated memroy for email attachment.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] atch_info Specifies the pointer of mail attachment structure pointer.
- * @exception none
- * @see emf_mail_attachment_info_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_mail_free_attachment_info()
- * {
- * emf_mailbox_t mailbox;
- * emf_mail_attachment_info_t *mail_attach_info = NULL;
- * int mail_id = 0,account_id = 0;
- * char arg[10];
- * int err = EMF_ERROR_NONE;
- *
- * memset(&mailbox, 0x00, sizeof(emf_mailbox_t));
- *
- * printf("\n > Enter Mail Id: ");
- * scanf("%d", &mail_id);
- * printf("\n > Enter account Id: ");
- * scanf("%d", &account_id);
- * printf("> attachment Id\n");
- * scanf("%s",arg);
- * mailbox.account_id = account_id;
- * if (EMF_ERROR_NONE != email_get_attachment_info(&mailbox, mail_id, &mail_attach_info))
- * printf("email_get_attachment_info failed\n");
- * else
- * {
- * printf("email_get_attachment_info SUCCESS\n");
- * //do something
- * email_free_attachment_info(&mail_attach_info,1);
- * }
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_free_attachment_info(emf_attachment_info_t** atch_info);
-
-EXPORT_API int email_free_attachment_data(emf_attachment_data_t **attachment_data_list, int attachment_data_count);
-
-/**
- * @open
- * @fn email_get_mail_data(int input_mail_id, emf_mail_data_t **output_mail_data)
- * @brief Get a mail by its mail id. This function is invoked when user wants to get a mail based on mail id existing in DB.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] input_mail_id specifies the mail id.
- * @param[out] output_mail_data The returned mail is save here.
- * @exception none
- * @see emf_mail_data_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_get_mail_data()
- * {
- * emf_mail_data_t *mail = NULL;
- * int mail_id = 0 ;
- * int err = EMF_ERROR_NONE;
- *
- * printf("\n > Enter mail id: ");
- * scanf("%d", &mail_id);
- *
- * if (EMF_ERROR_NONE != email_get_mail_data(mail_id, &mail))
- * printf("email_get_mail_data failed\n");
- * else
- * {
- * printf("email_get_mail_data SUCCESS\n");
- * //do something
- * email_free_mail_data(&mail,1);
- * }
- * }
- * @endcode
- * @remarks N/A
- */
-
-EXPORT_API int email_get_mail_data(int input_mail_id, emf_mail_data_t **output_mail_data);
-
-
-/* -----------------------------------------------------------
- Mail Flag API
- -----------------------------------------------------------*/
-
-/**
- * @open
- * @fn email_modify_mail_flag(int mail_id, emf_mail_flag_t new_flag, int onserver)
- * @brief Change email flag.[ Seen,Deleted,flagged,answered,recent,draft,has_attachment,reserved_1]
- * If the receiving_server_type is EMF_SERVER_TYPE_POP3 then from_server value will be 0
- * If the receiving_server_type is EMF_SERVER_TYPE_IMAP4 then from_server value will be 1/0
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mail_id Specifies the mail ID.
- * @param[in] new_flag Specifies the new email flag.
- * @param[in] onserver Specifies whether mail Flag updation in server
- * @exception none
- * @see emf_mail_flag_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_modify_mail_flag()
- * {
- * emf_mail_flag_t newflag;
- * int mail_id = 0;
- * int err = EMF_ERROR_NONE;
- *
- * memset(&newflag, 0x00, sizeof(emf_mail_flag_t));
- * newflag.seen = 1;
- * newflag.answered = 0;
- * newflag.sticky = 1;
- *
- * printf("\n > Enter Mail Id: ");
- * scanf("%d", &mail_id);
- * if (EMF_ERROR_NONE != email_modify_mail_flag(mail_id, newflag, 1))
- * printf("email_modify_mail_flag failed\n");
- * else
- * {
- * printf("email_modify_mail_flag SUCCESS\n");
- * //do something
- *
- * }
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_modify_mail_flag(int mail_id, emf_mail_flag_t new_flag, int onserver);
-
-/**
- * @open
- * @fn email_set_flags_field(int *mail_ids, int num, emf_flags_field_type field_type, int value, int onserver)
- * @brief Change email flags field.
- * If the receiving_server_type is EMF_SERVER_TYPE_POP3 then from_server value will be 0
- * If the receiving_server_type is EMF_SERVER_TYPE_IMAP4 then from_server value will be 1/0
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies account ID.
- * @param[in] mail_ids Specifies the array of mail ID.
- * @param[in] num Specifies the number of mail ID.
- * @param[in] field_type Specifies the field type what you want to set. Refer emf_flags_field_type.
- * @param[in] value Specifies the value what you want to set.
- * @param[in] onserver Specifies whether mail Flag updation in server
- * @exception none
- * @see none
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_set_flags_field()
- * {
- * int mail_id = 0;
- * int err = EMF_ERROR_NONE;
- *
- * printf("\n > Enter Mail Id: ");
- * scanf("%d", &mail_id);
- * if (EMF_ERROR_NONE != email_set_flags_field(&mail_id, EMFF_LAGS_SEEN_FIELD, 1, 0))
- * printf("email_set_flags_field failed\n");
- * else
- * {
- * printf("email_set_flags_field SUCCESS\n");
- * //do something
- * }
- * }
- * @endcode
- * @remarks N/A
- */
-
-EXPORT_API int email_set_flags_field(int account_id, int *mail_ids, int num, emf_flags_field_type field_type, int value, int onserver);
-
-/**
- * @open
- * @fn email_modify_extra_mail_flag(int mail_id, emf_extra_flag_t new_flag)
- * @brief Change email extra flag.[priority,Delivery report status, Drm, Protection etc]
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mail_id Specifies the mail ID.
- * @param[in] new_flag Specifies the new email extra flag.
- * @exception none
- * @see emf_extra_flag_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_modify_extra_mail_flag()
- * {
- * emf_extra_flag_t newflag;
- * int mail_id = 0;
- * int err = EMF_ERROR_NONE;
- *
- * memset(&newflag, 0x00, sizeof(emf_extra_flag_t));
- *
- * printf("\n > Enter Mail Id: ");
- * scanf("%d", &mail_id);
- *
- * if(EMF_ERROR_NONE != email_modify_extra_mail_flag(mail_id, newflag))
- * printf("email_modify_extra_mail_flag failed");
- * else
- * printf("email_modify_extra_mail_flag success");
- *
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_modify_extra_mail_flag(int mail_id, emf_extra_flag_t new_flag);
-
-
-
-/* -----------------------------------------------------------
- Mail Move API
- -----------------------------------------------------------*/
-
-/**
- * @open
- * @fn email_move_mail_to_mailbox(int *mail_ids, int num, emf_mailbox_t* new_mailbox)
- * @brief Move a email to another mailbox.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mail_id Specifies the array of mail ID.
- * @param[in] num Specifies the count of mail IDs.
- * @param[in] new_mailbox Specifies the mailbox structure for moving email.
- * @exception none
- * @see emf_mailbox_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_move_mail_to_mailbox()
- * {
- * int mail_id = 1;
- * int account_id =0;
- * emf_mailbox_t mbox;
- * char arg[10];
- * int err = EMF_ERROR_NONE;
- * int i = 0;
- *
- * printf("\n > Enter Account_id: ");
- * scanf("%d",&account_id);
- *
- * memset(&mbox, 0x00, sizeof(emf_mailbox_t));
- *
- * mbox.account_id = account_id;
- * mbox.name = strdup("Test");
- * if(EMF_ERROR_NONE == email_move_mail_to_mailbox(mail_id, 1, &mbox))
- * printf("Success\n");
- *
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_move_mail_to_mailbox(int *mail_ids, int num, emf_mailbox_t* new_mailbox);
-
-
-/**
- * @open
- * @fn email_move_all_mails_to_mailbox(emf_mailbox_t* src_mailbox, emf_mailbox_t* new_mailbox)
- * @brief Move all email to another mailbox.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] src_mailbox Specifies the source mailbox structure for moving email.
- * @param[in] new_mailbox Specifies the destination mailbox structure for moving email.
- * @exception none
- * @see emf_mailbox_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_move_all_mails_to_mailbox()
- * {
- * emf_mailbox_t src_mailbox;
- * emf_mailbox_t dest_mailbox;
- * int total_count;
- * int err = EMF_ERROR_NONE;
- * char temp[128];
- *
- * memset(&src_mailbox, 0x00, sizeof(emf_mailbox_t));
- * memset(&dest_mailbox, 0x00, sizeof(emf_mailbox_t));
- *
- * // input mailbox information : need account_id and name (src & dest)
- * printf("src mail account id(0: All account)> ");
- * scanf("%d", &src_mailbox.account_id);
- * printf("src mailbox_name(0 : NULL)> ");
- * src_mailbox = strdup("INBOX");
- * // Destination mailbox
- * printf("dest mail account id> ");
- * scanf("%d", &dest_mailbox.account_id);
- * printf("dest_mailbox_name(0 : NULL)> ");
- * dest_mailbox = strdup("INBOX");
- *
- * ( EMF_ERROR_NONE == email_move_all_mails_to_mailbox(&src_mailbox, &dest_mailbox))
- * {
- * printf(" fail email_move_all_mails_to_mailbox: \n");
- * }
- * else
- * //success
- * if ( src_mailbox)
- * {
- * free(src_mailbox);
- * }
- * if ( dest_mailbox )
- * {
- * free(dest_mailbox);
- * }
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_move_all_mails_to_mailbox(emf_mailbox_t* src_mailbox, emf_mailbox_t* new_mailbox);
-
-
-/**
- * @open
- * @fn email_count_message_with_draft_flag(emf_mailbox_t* mailbox, int* total)
- * @brief Get mail count from mailbox having draft flag.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mailbox Specifies the pointer of mailbox structure.
- * @param[out] total Total email count is saved with draft flag enabled.
- * @exception none
- * @see emf_mailbox_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_count_message_with_draft_flag()
- * {
- * emf_mailbox_t mailbox;
- * int total_count;
- * int err = EMF_ERROR_NONE;
- *
- * memset(&mailbox, 0x00, sizeof(emf_mailbox_t));
- * // input mailbox information : need account_id and name
- * printf("mail account id(0: All account)> ");
- * scanf("%d", &mailbox.account_id);
- * mailbox.name = strdup("Inbox");
- * if ( EMF_ERROR_NONE != email_count_message_with_draft_flag(&mailbox, &total_count))
- * {
- * printf(" fail email_count_message_with_draft_flag:\n);
- * }
- * else
- * {
- * printf(" success email_count_message_with_draft_flag:\n);
- * }
- * if ( mailbox.name )
- * {
- * free(mailbox.name);
- * }
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_count_message_with_draft_flag(emf_mailbox_t* mailbox, int* total);
-
-
-/**
- * @open
- * @fn email_count_message_on_sending(emf_mailbox_t* mailbox, int* total)
- * @brief Get the number of mails which are being sent in specific mailbox.This function gives the list of mails having on sending status for a given mailbox.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mailbox Specifies the pointer of mailbox structure.
- * @param[out] total Total email count is saved with draft flag enabled.
- * @exception none
- * @see emf_mailbox_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_count_message_on_sending()
- * {
- * emf_mailbox_t mailbox;
- * int total_count;
- * int err = EMF_ERROR_NONE;
- *
- * memset(&mailbox, 0x00, sizeof(emf_mailbox_t));
- * // input mailbox information : need account_id and name
- * printf("mail account id(0: All account)> ");
- * scanf("%d", &mailbox.account_id);
- * mailbox.name = strdup("Draft");
- * if (EMF_ERROR_NONE != email_count_message_on_sending(&mailbox, &total_count))
- * {
- * printf(" fail email_count_message_on_sending: \n");
- * }
- * else
- * {
- * printf(" success email_count_message_on_sending:\n");
- * }
- * if ( mailbox.name )
- * {
- * free(mailbox.name);
- * }
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_count_message_on_sending(emf_mailbox_t* mailbox, int* total);
-
-/**
- * @open
- * @fn email_free_mail_data(emf_mail_data_t** mail_list, int count)
- * @brief Free allocated memroy for emails.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mail_list Specifies the pointer of mail structure pointer.
- * @param[in] count Specifies the count of mails.
- * @exception none
- * @see emf_mail_data_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_free_mail()
- * {
- * emf_mail_data_t *mail;
- *
- * //fill the mail structure
- * //count - number of mail structure user want to free
- * if(EMF_ERROR_NONE == email_free_mail_data(&mail,count))
- * //success
- * else
- * //failure
- *
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_free_mail_data(emf_mail_data_t** mail_list, int count);
-
-/**
- * @open
- * @fn email_get_mails(int account_id , const char *mailbox_name, int thread_id, int start_index, int limit_count, emf_sort_type_t sorting, emf_mail_data_t** mail_list, int* result_count)
- * @brief Get the Mail List information from DB based on the mailbox name.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the account ID
- * @param[in] mailbox_name Specifies the mailbox name
- * @param[in] thread_id Specifies the thread id. It can be EMF_LIST_TYPE_THREAD, EMF_LIST_TYPE_NORMAL or thread id.
- * @param[in] start_index Specifies start index for LIMIT clause of SQL query.
- * @param[in] limit_count Specifies limit count for LIMIT clause of SQL query.
- * @param[in] sorting Specifies the sorting type.
- * @param[in/out] mail_list Specifies the pointer to the structure emf_mail_data_t.
- * @param[in/out] result_count Specifies the number of mails returned.
- * @exception none
- * @see emf_mail_data_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_get_mail()
- * {
- * emf_mail_data_t *mail_list = NULL;
- * char mailbox_name[50];
- * int result_count = 0;
- * int account_id = 0;
- * int err_code = EMF_ERROR_NONE;
- *
- * memset(mailbox_name, 0x00, 10);
- * printf("\n > Enter Mailbox name: ");
- * scanf("%s", mailbox_name);
- *
- * printf("\n > Enter Account_id: ");
- * scanf("%d",&account_id);
- *
- * if (EMF_ERROR_NONE != email_get_mails(account_id, mailbox_name, EMF_LIST_TYPE_NORMAL, 0, 100, EMF_SORT_DATETIME_HIGH, &mail_list, &result_count)) {
- * printf("email_get_mails failed \n");
- * }
- * else {
- * printf("Success\n");
- * //do something
- * free(mail_list);
- * }
- *
- * }
- * @endcode
- * @remarks N/A
- */
-
-EXPORT_API int email_get_mails(int account_id , const char *mailbox_name, int thread_id, int start_index, int limit_count, emf_sort_type_t sorting, emf_mail_data_t** mail_list, int* result_count);
-
-/**
- * @open
- * @fn email_get_mail_list_ex(int account_id , const char *mailbox_name, int thread_id, int start_index, int limit_count, emf_sort_type_t sorting, emf_mail_list_item_t** mail_list, int* result_count)
- * @brief Get the Mail List information from DB based on the mailbox name.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the account ID
- * @param[in] mailbox_name Specifies the mailbox name
- * @param[in] thread_id Specifies the thread id. It can be EMF_LIST_TYPE_THREAD, EMF_LIST_TYPE_NORMAL or thread id.
- * @param[in] start_index Specifies start index for LIMIT clause of SQL query.
- * @param[in] limit_count Specifies limit count for LIMIT clause of SQL query.
- * @param[in] sorting Specifies the sorting type.
- * @param[in/out] mail_list Specifies the pointer to the structure emf_mail_list_item_t.
- * @param[in/out] result_count Specifies the number of mails returned.
- * @exception none
- * @see emf_mail_list_item_t
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_get_mail()
- * {
- * emf_mail_list_item_t *mail_list = NULL;
- * char mailbox_name[50];
- * int result_count = 0;
- * int account_id = 0;
- * int err_code = EMF_ERROR_NONE;
- *
- * memset(mailbox_name, 0x00, 10);
- * printf("\n > Enter Mailbox name: ");
- * scanf("%s", mailbox_name);
- *
- * printf("\n > Enter Account_id: ");
- * scanf("%d",&account_id);
- *
- * if (EMF_ERROR_NONE != email_get_mail_list_ex(account_id, mailbox_name, EMF_LIST_TYPE_NORMAL, 0, 100, EMF_SORT_DATETIME_HIGH, &mail_list, &result_count))
- * {
- * printf("email_get_mail_list failed \n");
- * }
- * else
- * {
- * printf("Success\n");
- * //do something
- * free(mail_list);
- * }
- *
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_get_mail_list_ex(int account_id , const char *mailbox_name, int thread_id, int start_index, int limit_count, emf_sort_type_t sorting, emf_mail_list_item_t** mail_list, int* result_count);
-
-/**
- * @open
- * @fn email_find_mail(int account_id , const char *mailbox_name, int thread_id,
- int search_type, char *search_value, int start_index, int limit_count, emf_sort_type_t sorting, emf_mail_list_item_t** mail_list, int* result_count)
- * @brief Get the Searched Mail List information from the DB based on the mailbox name account_id, type and value of searching.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the Account ID
- * @param[in] mailbox_name Specifies the Mailbox Name
- * @param[in] thread_id Specifies the thread_id. If thread_id = EMF_LIST_TYPE_NORMAL, search a mail without regarding thread. The case of thread_id > 0 is for getting mail list of specific thread.
- * @param[in] search_type Specifies the searching type(EMF_SEARCH_FILTER_SUBJECT, EMF_SEARCH_FILTER_SENDER, EMF_SEARCH_FILTER_RECIPIENT, EMF_SEARCH_FILTER_ALL)
- * @param[in] search_value Specifies the value to use for searching. (ex : Subject, email address, display name)
- * @param[in] start_index Specifies the first mail index of searched mail. This function will return mails whose index in the result list are from start_index to start_index + limit_count. The first start index is 0.
- * @param[in] limit_count Specifies the max number of returned mails.
- * @param[in] sorting Specifies the sorting order. see emf_sort_type_t
- * @param[in/out] mail_list Specifies the Pointer to the structure emf_mail_list_item_t.
- * @param[in/out] result_count Specifies the Number of searched Mails
- * @exception none
- * @see emf_sort_type_t, emf_mail_list_item_t
- * @code
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_find_mail(int account_id , const char *mailbox_name, int thread_id,
- int search_type, char *search_value,
- int start_index, int limit_count, emf_sort_type_t sorting, emf_mail_list_item_t** mail_list, int* result_count);
-
-/**
- * @open
- * @fn email_get_mail_by_address(int account_id , const char *mailbox_name, emf_email_address_list_t* addr_list,
- int start_index, int limit_count, emf_sort_type_t sorting, emf_mail_list_item_t** mail_list, int* result_count)
- * @brief Get the Mail List information from the DB based on the mailbox name account_id and sender address.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the Account ID
- * @param[in] mailbox_name Specifies the Mailbox Name
- * @param[in] addr_list Specifies the addresses of senders. see emf_email_address_list_t
- * @param[in] start_index Specifies the first mail index of searched mail. This function will return mails whose index in the result list are from start_index to start_index + limit_count
- * @param[in] limit_count Specifies the max number of returned mails.
- * @param[in] search_type Specifies the search type.
- * @param[in] search_value Specifies the search value.
- * @param[in] sorting Specifies the sorting order. see emf_sort_type_t
- * @param[in/out] mail_list Specifies the Pointer to the structure emf_mail_list_item_t.
- * @param[in/out] result_count Specifies the Number of searched Mails
- * @exception none
- * @see emf_email_address_list_t, emf_sort_type_t, emf_mail_list_item_t
- * @code
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_get_mail_by_address(int account_id , const char *mailbox_name, emf_email_address_list_t* addr_list,
- int start_index, int limit_count, int search_type, const char *search_value, emf_sort_type_t sorting, emf_mail_list_item_t** mail_list, int* result_count);
-
-/**
- * @open
- * @fn email_get_thread_information_by_thread_id(int thread_id, emf_mail_data_t** thread_info)
- * @brief Get the thread information for specific thread from DB based on the mailbox name.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] thread_id Specifies the thread_id
- * @param[in/out] thread_info Specifies the Pointer to the structure emf_mail_data_t.
- * @exception none
- * @see emf_mail_data_t
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_get_thread_information()
- * {
- * emf_mail_data_t *thread_info = NULL;
- * int thread_id = 0;
- * int err_code = EMF_ERROR_NONE;
- *
- * printf("\n > Enter thread_id: ");
- * scanf("%d",&thread_id);
- *
- * if ( EMF_ERROR_NONE != email_get_thread_information_by_thread_id(thread_id, &thread_info))
- * {
- * printf("email_get_thread_information_by_thread_id failed :\n"); *
- * }
- * else
- * {
- * printf("Success\n");
- * //do something
- * }
- *
- * }
- * @endcode
- * @remarks N/A
- */
-
-
-EXPORT_API int email_get_thread_information_by_thread_id(int thread_id, emf_mail_data_t** thread_info);
-
-/**
- * @open
- * @fn email_get_thread_information_ex(int thread_id, emf_mail_list_item_t** thread_info)
- * @brief Get the Mail List information for specific thread from DB based on the mailbox name.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] thread_id Specifies the thread_id
- * @param[in/out] thread_info Specifies the Pointer to the structure emf_mail_list_item_t.
- * @exception none
- * @see emf_mail_list_item_t
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_get_thread_information_ex()
- * {
- * emf_mail_list_item_t *thread_info = NULL;
- * int thread_id = 0;
- * int err_code = EMF_ERROR_NONE;
- *
- * printf("\n > Enter thread_id: ");
- * scanf("%d",&thread_id);
- *
- * if ( EMF_ERROR_NONE != email_get_thread_information_ex(thread_id, &thread_info))
- * {
- * printf("email_get_mail_list_of_thread failed :\n"); *
- * }
- * else
- * {
- * printf("Success\n");
- * //do something
- * }
- *
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_get_thread_information_ex(int thread_id, emf_mail_list_item_t** thread_info);
-
-/**
- * @open
- * @fn email_get_mail_flag(int account_id, int mail_id, emf_mail_flag_t* mail_flag)
- * @brief Get the Mail Flag information based on the account id and Mail Id.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the Account ID
- * @param[in] mail_id Specifies the Mail id for which Flag details need to be fetched
- * @param[in/out] mail_flag Specifies the Pointer to the structure emf_mail_flag_t.
- * @exception none
- * @see emf_mail_flag_t
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_get_mail_flag()
- * {
- * emf_mail_flag_t *mail_flag = NULL;
- * int account_id = 0;
- * int mail_id = 0;
- * int err_code = EMF_ERROR_NONE;
- *
- * printf("\n > Enter account_id: ");
- * scanf("%d",&account_id);
- * printf("\n > Enter mail_id: ");
- * scanf("%d",&mail_id);
- *
- * if ( EMF_ERROR_NONE != email_get_mail_flag(account_id,mail_id, &mail_flag))
- * {
- * printf("email_get_mail_flag failed :\n");
- * }
- * else
- * {
- * printf("Success\n");
- * //do something
- * }
- *
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_get_mail_flag(int account_id, int mail_id, emf_mail_flag_t* mail_flag);
-
-/**
- * @open
- * @fn email_retry_send_mail( int mail_id, int timeout_in_sec)
- * @brief Retry mail send
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mail_id Specifies the mail id for the mail to resend
- * @param[in] timeout_in_sec Specifies the timeout value in seconds
- * @exception none
- * @see none
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_retry_send_mail()
- * {
- * int mail_id = 1;
- * int timeout_in_sec = 2;
- *
- * if(EMF_ERROR_NONE == email_retry_send_mail(mail_id,timeout_in_sec))
- * //success
- * else
- * //failure
- *
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_retry_send_mail( int mail_id, int timeout_in_sec);
-
-
-/**
- * @open
- * @fn email_create_db_full()
- * @brief Create DB full
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @exception none
- * @see none
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_create_db_full()
- * {
- *
- * if(EMF_ERROR_NONE == email_create_db_full())
- * //success
- * else
- * //failure
- *
- * }
- * @endcode
- * @remarks N/A
- */
-
-EXPORT_API int email_create_db_full();
-
-/**
- * @open
- * @fn email_get_mailbox_name_by_mail_id(int mail_id, char **pMailbox_name)
- * @brief get mailBox naem by mailID
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mail_id Specifies the mailID
- * @param[out] pMailbox_name Specifies the mailbox name
- * @exception none
- * @see none
-
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_get_mailbox_name_by_mail_id()
- * {
- * char *mailbox_name =NULL;
- * int mail_id = 10;
- *
- *
- * if(EMF_ERROR_NONE == email_get_mailbox_name_by_mail_id(mail_id,&mailbox_name))
- * //success
- * else
- * //failure
- *
- * }
- * @endcode
- * @remarks N/A
- */
-
-EXPORT_API int email_get_mailbox_name_by_mail_id(int mail_id, char **pMailbox_name);
-
-/**
- * @open
- * @fn email_cancel_send_mail( int mail_id)
- * @brief Callback function for cm popup. We set the status as EMF_MAIL_STATUS_SEND_CANCELED
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mail_id Specifies the mailID
- * @exception none
- * @see none
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_cancel_send_mail()
- * {
- * int mail_id = 10;
- *
- *
- * if(EMF_ERROR_NONE == email_cancel_send_mail(mail_id,))
- * //success
- * else
- * //failure
- *
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_cancel_send_mail( int mail_id) ;
-
-
-/**
- * @open
- * @fn email_count_message_all_mailboxes(emf_mailbox_t* mailbox, int* total, int* unseen)
- * @brief Get the Total count and Unread count of all mailboxes
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mailbox Specifies the mailbox structure
- * @param[out] total Specifies the total count
- * @param[out] seen Specifies the unseen mail count
- * @exception none
- * @see emf_mailbox_t
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_count_message_all_mailboxes()
- * {
- * emf_mailbox_t mailbox;
- * int total =0;
- * int unseen = 0;
- *
- * memset(&mailbox,0x00,sizeof(emf_mailbox_t));
- * mailbox.account_id = 0;
- * mailbox.name = strdup("INBOX");
- *
- * if(EMF_ERROR_NONE == email_count_message_all_mailboxes(&mailbox,&total,&unseen))
- * //success
- * else
- * //failure
- *
- * }
- * @endcode
- * @remarks N/A
- */
-
-EXPORT_API int email_count_message_all_mailboxes(emf_mailbox_t* mailbox, int* total, int* unseen);
-
-
-/* sowmya.kr@samsung.com, 01282010 - Changes to get latest unread mail id for given account */
-/**
- * @open
- * @fn email_get_latest_unread_mail_id(int account_id, int *pMailID)
- * @brief Gets the latest unread MailId for given account. If account_id passed is -1, returns latest unread mail Id.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the account id for which latest unread mail has to be fetched
- * @param[out] pMailID Specifies the latest unread mail
- * @exception none
- * @see none
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_get_latest_unread_mail_id()
- * {
- * int mail_id = 0,account_id = 0;
- * int err = EMF_ERROR_NONE;
- *
- *
- * printf("Enter account Id to get latest unread mail Id,<-1 to get latest irrespective of account id> ");
- * scanf("%d", &account_id);
- *
- *
- * if ( EMF_ERROR_NONE != email_get_latest_unread_mail_id(account_id, &mail_id) )
- * {
- * printf(" fail email_get_latest_unread_mail_id: err[%d]\n", err);
- * }
- * else
- * {
- * printf(" success email_get_latest_unread_mail_id: Latest unread mail id : %d\n", mail_id);
- * }
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_get_latest_unread_mail_id(int account_id, int *pMailID);
-
-/**
- * @open
- * @fn email_get_max_mail_count(int *Count)
- * @brief Gets the max count of mails which can be supported by email-service
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[out] Count max count of mails which can be supported by email-service
- * @exception none
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_get_max_mail_count()
- * {
- * int max_count = -1;
- *
- * if(EMF_ERROR_NONE == email_get_max_mail_count(&max_count))
- * printf("\n\t>>>>> email_get_max_mail_count() return [%d]\n\n", max_count);
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_get_max_mail_count(int *Count);
-
-
- /**
- * @open
- * @fn email_get_disk_space_usage(unsigned long *total_size)
- * @brief Gets the total disk usage of emails in KB.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[out] total_size total disk usage of emails
- * @exception none
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_get_disk_space_usage()
- * {
- * unsigned long total_size = 0;
- *
- * if ( EMF_ERROR_NONE != email_get_disk_space_usage(&total_size))
- * printf("email_get_disk_space_usage failed err : %d\n",err_code);
- * else
- * printf("email_get_disk_space_usage SUCCESS, total disk usage in KB : %ld \n", total_size);
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_get_disk_space_usage(unsigned long *total_size);
-
-
-EXPORT_API int email_get_recipients_list(int account_id, const char *mailbox_name, emf_sender_list_t **sender_list);
-/**
- * @open
- * @fn email_get_sender_list(int account_id, const char *mailbox_name, int search_type, char *search_value, emf_sort_type_t sorting, emf_sender_list_t** sender_list, int *sender_count)
- * @brief Get the sender list with the total number of sender's mails and the number of sender's unread mails.
- * This is used to show email address and display name of each sender with the number of mails (unread and total).
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the account id to get the list. If this is 0, a sender list of "All Account" will be returned.
- * @param[in] mailbox_name Specifies the mailbox name to get the list. If this is NULL, a sender list of "All Mailbox" will be returned.
- * @param[in] search_type Specifies the search type
- * @param[in] search_value Specifies the search value
- * @param[in] sorting Specifies the sorting order.
- * @param[out] sender_list Specifies the Pointer to the structure emf_sender_list_t. Memory for a new sender list will be allocated to this. Call email_free_sender_list() to free the memory allocated to this.
- * @param[out] sender_count Specifies the number of senders in a sender list.
- * @exception none
- * @see emf_sort_type_t, emf_sender_list_t, email_free_sender_list()
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_get_sender_list()
- * {
- * emf_sender_list_t *sender_list = NULL;
- * int sender_count = 0;
- * int account_id = 0;
- * int sorting = 0;
- * int err_code = EMF_ERROR_NONE;
- *
- * account_id = 0; // For All accounts
- * mailbox_name = NULL; // For All mail boxes
- * sorting = EMF_SORT_DATETIME_HIGH;
- *
- *
- * if ( EMF_ERROR_NONE != (err_code = email_get_sender_list(account_id, mailbox_name, EMF_SEARCH_FILTER_NONE, NULL, sorting, &sender_list, &sender_count)) )
- * {
- * printf("email_get_sender_list failed :\n"); *
- * return false;
- * }
- * else
- * {
- * printf("Success\n");
- * //do something
- * }
- *
- * // Free sender list
- * if ( sender_list )
- * {
- * email_free_sender_list(&sender_list, sender_count);
- * }
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_get_sender_list(int account_id, const char *mailbox_name, int search_type, const char *search_value, emf_sort_type_t sorting, emf_sender_list_t** sender_list, int *sender_count);
-
-/**
- * @open
- * @fn email_get_sender_list_ex(int account_id, const char *mailbox_name, int start_index, int limit_count, emf_sort_type_t sorting, emf_sender_list_t** sender_list, int *sender_count)
- * @brief Get the sender list with the total number of sender's mails and the number of sender's unread mails.
- * This is used to show email address and display name of each sender with the number of mails (unread and total).
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the account id to get the list. If this is 0, a sender list of "All Account" will be returned.
- * @param[in] mailbox_name Specifies the mailbox name to get the list. If this is NULL, a sender list of "All Mailbox" will be returned.
- * @param[in] start_index Specifies the start index in the sender list. This function will return a partial sender list from start_index to (start_index + limit_count - 1) in the sender list. negative value means "from the first sender". start_index is zero-based value.
- * @param[in] limit_count Specifies the max number of sender list. negative value means "All senders from the start_index in sender list"
- * @param[in] sorting Specifies the sorting order.
- * @param[out] sender_list Specifies the Pointer to the structure emf_sender_list_t. Memory for a new sender list will be allocated to this. Call email_free_sender_list() to free the memory allocated to this.
- * @param[out] sender_count Specifies the number of senders in a sender list.
- * @exception none
- * @see emf_sort_type_t, emf_sender_list_t, email_free_sender_list()
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_get_sender_list()
- * {
- * emf_sender_list_t *sender_list = NULL;
- * int sender_count = 0;
- * int account_id = 0;
- * int start_index = 10; // from the 11th sender in sender list
- * int limit_count = 5; // to the (11 + 5)th sender in sender list
- * int sorting = 0;
- * int err_code = EMF_ERROR_NONE;
- *
- * account_id = 0; // For All accounts
- * mailbox_name = NULL; // For All mail boxes
- * sorting = EMF_SORT_DATETIME_HIGH;
- *
- *
- * if ( EMF_ERROR_NONE != (err_code = email_get_sender_list_ex(account_id, mailbox_name, start_index, limit_count, sorting, &sender_list, &sender_count)) )
- * {
- * printf("email_get_sender_list_ex failed :\n"); *
- * return false;
- * }
- * else
- * {
- * printf("Success\n");
- * //do something
- * }
- *
- * // Free sender list
- * if ( sender_list )
- * {
- * email_free_sender_list(&sender_list, sender_count);
- * }
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_get_sender_list_ex(int account_id, const char *mailbox_name, int start_index, int limit_count, emf_sort_type_t sorting, emf_sender_list_t** sender_list, int *sender_count);
-
-
-/**
- * @open
- * @fn email_free_sender_list(emf_sender_list_t **sender_list, int count)
- * @brief Free the sender list allocated by email_get_sender_list(). This function will free the memory which is allocated to sender_list itself.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] sender_list Specifies the Pointer to the structure emf_sender_list_t to be freed.
- * @param[in] count Specifies the number of senders in a sender list.
- * @exception none
- * @see emf_sender_list_t, email_get_sender_list()
- */
-EXPORT_API int email_free_sender_list(emf_sender_list_t **sender_list, int count);
-
-
-/**
- * @open
- * @fn email_get_address_info_list(int mail_id, emf_address_info_list_t** address_info_list)
- * @brief Get the address info list. The address info list contains from, to, cc, bcc addresses and their display name, contact id and etc. (see emf_address_info_list_t)
- * Each GList (from, to, cc, bcc) is the list of emf_address_info_t data.
- * "data" variable of GList structure contains emf_address_info_t data. <br>
- * To get emf_address_info_t data from GList, Use type casting from GList node.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mail_id Specifies the mail id to get the list.
- * @param[out] address_info_list Specifies the Pointer to the structure emf_address_info_list_t. Memory for a new address info list will be allocated to this. Call email_free_address_info_list() to free the memory allocated to this.
- * @exception none
- * @see emf_address_info_list_t, emf_address_info_t, email_free_address_info_list()
- * @code
- * #include "email-api-account.h"
- * bool
- * _api_sample_get_address_info_list()
- * {
- * emf_address_info_list_t *p_address_info_list= NULL;
- * emf_address_info_t *p_address_info = NULL;
- * int mai_id;
- * int err_code = EMF_ERROR_NONE;
- *
- * mail_id = 1;
- *
- * if ( EMF_ERROR_NONE != (err_code = email_get_address_info_list(mail_id, &p_address_info_list)) )
- * {
- * printf("email_get_address_info_list failed :\n"); *
- * return false;
- * }
- * else
- * {
- * printf("Success\n");
- * //do something with p_address_info_list
- * GList *list = p_address_info_list->from;
- * GList *node = g_list_first(list);
- * while ( node != NULL )
- * {
- * p_address_info = (emf_address_info_t*)node->data;
- * printf("%d, %s, %s, %d\n", p_address_info->address_type, p_address_info->address, p_address_info->display_name, p_address_info->contact_id);
- *
- * node = g_list_next(node);
- * }
- * }
- *
- * // Free sender list
- * if ( p_address_info_list )
- * {
- * email_free_address_info_list(&p_address_info_list);
- * }
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_get_address_info_list(int mail_id, emf_address_info_list_t** address_info_list);
-
-/**
- * @open
- * @fn email_free_address_info_list(emf_address_info_list_t **address_info_list)
- * @brief Free the address info list allocated by email_get_address_info_list(). This function will free the memory which is allocated to address_info_list itself.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] address_info_list Specifies the Pointer to the structure emf_address_info_list_t to be freed.
- * @exception none
- * @see emf_address_info_list_t, email_get_address_info_list()
- */
-EXPORT_API int email_free_address_info_list(emf_address_info_list_t **address_info_list);
-
-/**
- * @open
- * @fn email_get_structure(const char*encoded_string, void **struct_var, emf_convert_struct_type_e type)
- * @brief This function returns the structure of the type which is indicated by 'type' variable. This function will allocate new memory to 'struct_var' for structure.<br>
- * Some notifications such as NOTI_DOWNLOAD_NEW_MAIL are published with string parameter. The string contains various values that might be divided by delimiter.<br>
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] encoded_string Specifies the Pointer to the string from notification.
- * @param[out] struct_var Specifies the Pointer to the structure to be returned. If success, new memory for structure will be allocated.
- * @param[in] type Specifies the converting type. see emf_convert_struct_type_e
- * @exception none
- * @see emf_convert_struct_type_e
- */
-EXPORT_API int email_get_structure(const char*encoded_string, void **struct_var, emf_convert_struct_type_e type);
-
-/**
- * @open
- * @fn email_get_meeting_request(int mail_id, emf_meeting_request_t **meeting_req)
- * @brief Get the information of meeting request. The information of meeting request is based on Mail Id. <br>
- * The information of meeting request is corresponding to only one mail.
- * For this reason, the information of meeting request can be added by using email_add_message_with_meeting_request() with a matched mail information.
- *
- * @return This function returns EMF_ERROR_NONE on success. This function returns EMF_ERROR_DATA_NOT_FOUND if there isn't a matched mail. Otherwise it returns error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mail_id Specifies the Mail id for which meeting request details need to be fetched
- * @param[in/out] meeting_req Specifies the Pointer to the structure emf_meeting_request_t.
- * @exception none
- * @see emf_meeting_request_t
- */
-EXPORT_API int email_get_meeting_request(int mail_id, emf_meeting_request_t **meeting_req);
-
-
-/**
- * @open
- * @fn email_free_meeting_request(emf_meeting_request_t** meeting_req, int count)
- * @brief Free the meeting request allocated by email_get_meeting_request() or alloacted to add. This function will free the memory which is allocated to meeting_req (= *meeting_req) itself.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] emf_meeting_request_t Specifies the Pointer to the structure emf_meeting_request_t to be freed.
- * @param[in] count Specifies the number of elements in meeting_req array. this is usually 1.
- * @exception none
- * @see emf_meeting_request_t, email_get_meeting_request()
- */
-EXPORT_API int email_free_meeting_request(emf_meeting_request_t** meeting_req, int count);
-
-EXPORT_API int email_move_thread_to_mailbox(int thread_id, char *target_mailbox_name, int move_always_flag);
-
-EXPORT_API int email_delete_thread(int thread_id, int delete_always_flag);
-
-EXPORT_API int email_modify_seen_flag_of_thread(int thread_id, int seen_flag, int on_server);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-/**
-* @} @}
-*/
-
-
-#endif /* __EMAIL_API_MESSAGE_H__ */
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* 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.
+*
+*/
+
+
+#ifndef __EMAIL_API_MAIL_H__
+#define __EMAIL_API_MAIL_H__
+
+#include "email-types.h"
+
+#include <time.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+/**
+* @defgroup EMAIL_SERVICE Email Service
+* @{
+*/
+
+
+/**
+* @ingroup EMAIL_SERVICE
+* @defgroup EMAIL_API_MAIL Email Mail API
+* @{
+*/
+
+/**
+ *
+ * This file contains the data structures and interfaces needed for application,
+ * to interact with email-service.
+ * @file email-api-mail.h
+ * @author Kyuho Jo <kyuho.jo@samsung.com>
+ * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
+ * @version 0.1
+ * @brief This file contains the data structures and interfaces of Messages provided by
+ * email-service .
+ */
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @open
+ * @fn email_add_mail(email_mail_data_t *input_mail_data, email_attachment_data_t *input_attachment_data_list, int input_attachment_count, email_meeting_request_t* input_meeting_request, int input_from_eas)
+ * @brief Save a mail. This function is invoked when user wants to add a mail.
+ * If the option from_eas is 1 then this will save the message on server as well as on locally.
+ * If the incoming_server_type is EMAIL_SERVER_TYPE_POP3 then from_eas value will be 0
+ * If the incoming_server_type is EMAIL_SERVER_TYPE_IMAP4 then from_eas value will be 1/0
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_mail_data Specifies the saving mail.
+ * @param[in] input_attachment_data_list Specifies the mailbox structure for saving email.
+ * @param[in] input_attachment_count Specifies if the mail comes from composer.
+ * @param[in] input_meeting_request Specifies if the mail comes from composer.
+ * @param[in] input_from_eas Specifies if the mail will be saved on server.
+
+ * @exception none
+ * @see email_mail_data_t and email_mailbox_t
+ * @remarks N/A
+ * @code
+ * #include "email-api-mail.h"
+ * int _test_add_mail ()
+ * {
+ * int i = 0;
+ * int account_id = 0;
+ * int from_eas = 0;
+ * int attachment_count = 0;
+ * int err = EMAIL_ERROR_NONE;
+ * char arg[50] = { 0 , };
+ * char *body_file_path = "/opt/data/email/.emfdata/tmp/mail.txt";
+ * email_mailbox_t *mailbox_data = NULL;
+ * email_mail_data_t *test_mail_data = NULL;
+ * email_attachment_data_t *attachment_data = NULL;
+ * email_meeting_request_t *meeting_req = NULL;
+ * FILE *body_file;
+ *
+ * printf("\n > Enter account id : ");
+ * scanf("%d", &account_id);
+ *
+ *
+ * memset(arg, 0x00, 50);
+ * printf("\n > Enter mailbox name : ");
+ * scanf("%s", arg);
+ *
+ * email_get_mailbox_by_name(account_id, arg, &mailbox_data);
+ *
+ * test_mail_data = malloc(sizeof(email_mail_data_t));
+ * memset(test_mail_data, 0x00, sizeof(email_mail_data_t));
+ *
+ * printf("\n From EAS? [0/1]> ");
+ * scanf("%d", &from_eas);
+ *
+ * test_mail_data->account_id = account_id;
+ * test_mail_data->save_status = 1;
+ * test_mail_data->flags_seen_field = 1;
+ * test_mail_data->file_path_plain = strdup(body_file_path);
+ * test_mail_data->mailbox_id = mailbox_data->mailbox_id;
+ * test_mail_data->mailbox_type = mailbox_data->mailbox_type;
+ * test_mail_data->full_address_from = strdup("<test1@test.com>");
+ * test_mail_data->full_address_to = strdup("<test2@test.com>");
+ * test_mail_data->full_address_cc = strdup("<test3@test.com>");
+ * test_mail_data->full_address_bcc = strdup("<test4@test.com>");
+ * test_mail_data->subject = strdup("Meeting request mail");
+ *
+ * body_file = fopen(body_file_path, "w");
+ *
+ * for(i = 0; i < 500; i++)
+ * fprintf(body_file, "X2 X2 X2 X2 X2 X2 X2");
+ * fflush(body_file);
+ * fclose(body_file);
+ *
+ * printf(" > Attach file? [0/1] : ");
+ * scanf("%d",&attachment_count);
+ *
+ * if ( attachment_count ) {
+ * memset(arg, 0x00, 50);
+ * printf("\n > Enter attachment name : ");
+ * scanf("%s", arg);
+ *
+ * attachment_data = malloc(sizeof(email_attachment_data_t));
+ *
+ * attachment_data->attachment_name = strdup(arg);
+ *
+ * memset(arg, 0x00, 50);
+ * printf("\n > Enter attachment absolute path : ");
+ * scanf("%s",arg);
+ *
+ * attachment_data->attachment_path = strdup(arg);
+ * attachment_data->save_status = 1;
+ * test_mail_data->attachment_count = attachment_count;
+ * }
+ *
+ * printf("\n > Meeting Request? [0: no, 1: yes (request from server), 2: yes (response from local)]");
+ * scanf("%d", &(test_mail_data->meeting_request_status));
+ *
+ * if ( test_mail_data->meeting_request_status == 1
+ * || test_mail_data->meeting_request_status == 2 ) {
+ * time_t current_time;
+ * meeting_req = malloc(sizeof(email_meeting_request_t));
+ * memset(meeting_req, 0x00, sizeof(email_meeting_request_t));
+ *
+ * meeting_req->meeting_response = 1;
+ * current_time = time(NULL);
+ * gmtime_r(&current_time, &(meeting_req->start_time));
+ * gmtime_r(&current_time, &(meeting_req->end_time));
+ * meeting_req->location = malloc(strlen("Seoul") + 1);
+ * memset(meeting_req->location, 0x00, strlen("Seoul") + 1);
+ * strcpy(meeting_req->location, "Seoul");
+ * strcpy(meeting_req->global_object_id, "abcdef12345");
+ *
+ * meeting_req->time_zone.offset_from_GMT = 9;
+ * strcpy(meeting_req->time_zone.standard_name, "STANDARD_NAME");
+ * gmtime_r(&current_time, &(meeting_req->time_zone.standard_time_start_date));
+ * meeting_req->time_zone.standard_bias = 3;
+ *
+ * strcpy(meeting_req->time_zone.daylight_name, "DAYLIGHT_NAME");
+ * gmtime_r(&current_time, &(meeting_req->time_zone.daylight_time_start_date));
+ * meeting_req->time_zone.daylight_bias = 7;
+ *
+ * }
+ *
+ * if((err = email_add_mail(test_mail_data, attachment_data, attachment_count, meeting_req, from_eas)) != EMAIL_ERROR_NONE)
+ * printf("email_add_mail failed. [%d]\n", err);
+ * else
+ * printf("email_add_mail success.\n");
+ *
+ * if(attachment_data)
+ * email_free_attachment_data(&attachment_data, attachment_count);
+ *
+ * if(meeting_req)
+ * email_free_meeting_request(&meeting_req, 1);
+ *
+ * email_free_mail_data(&test_mail_data, 1);
+ * email_free_mailbox(&mailbox_data, 1);
+ *
+ * printf("saved mail id = [%d]\n", test_mail_data->mail_id);
+ *
+ * return 0;
+ * }
+ * @endcode
+ */
+EXPORT_API int email_add_mail(email_mail_data_t *input_mail_data, email_attachment_data_t *input_attachment_data_list, int input_attachment_count, email_meeting_request_t* input_meeting_request, int input_from_eas);
+
+ /**
+ * @open
+ * @fn email_add_read_receipt(int input_read_mail_id, unsigned *output_handle)
+ * @brief Add a read receipt mail. This function is invoked when user receives a mail with read report enable and wants to send a read report for the same.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_read_mail_id Specifies the id of mail which has been read.
+ * @param[out] output_receipt_mail_id Specifies the receipt mail id .
+ * @exception none
+ * @see
+ * @remarks N/A
+ */
+EXPORT_API int email_add_read_receipt(int input_read_mail_id, int *output_receipt_mail_id);
+
+/**
+ * @open
+ * @fn email_update_mail(email_mail_data_t *input_mail_data, email_attachment_data_t *input_attachment_data_list, int input_attachment_count, email_meeting_request_t* input_meeting_request, int input_from_composer)
+ * @brief Update a existing email information. This function is invoked when user wants to change some existing email information with new email information.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_mail_data Specifies the mail ID.
+ * @param[in] input_attachment_data_list Specifies the pointer of attachment data.
+ * @param[in] input_attachment_count Specifies the number of attachment data.
+ * @param[in] input_meeting_request Specifies the meeting request data.
+ * @param[in] input_from_eas Specifies whether sync server.
+
+ * @exception none
+ * @see email_mail_data_t
+ * @code
+ * #include "email-api-account.h"
+ * int email_test_update_mail()
+ * {
+ * int mail_id = 0;
+ * int err = EMAIL_ERROR_NONE;
+ * int test_attachment_data_count = 0;
+ * char arg[50];
+ * email_mail_data_t *test_mail_data = NULL;
+ * email_attachment_data_t *test_attachment_data_list = NULL;
+ * email_meeting_request_t *meeting_req = NULL;
+ *
+ * printf("\n > Enter mail id : ");
+ * scanf("%d", &mail_id);
+ *
+ * email_get_mail_data(mail_id, &test_mail_data);
+ *
+ * printf("\n > Enter Subject: ");
+ * scanf("%s", arg);
+ *
+ * test_mail_data->subject= strdup(arg);
+ *
+ *
+ *
+ * if (test_mail_data->attachment_count > 0) {
+ * if ( (err = email_get_attachment_data_list(mail_id, &test_attachment_data_list, &test_attachment_data_count)) != EMAIL_ERROR_NONE ) {
+ * printf("email_get_meeting_request() failed [%d]\n", err);
+ * return -1;
+ * }
+ * }
+ *
+ * if ( test_mail_data->meeting_request_status == EMAIL_MAIL_TYPE_MEETING_REQUEST
+ * || test_mail_data->meeting_request_status == EMAIL_MAIL_TYPE_MEETING_RESPONSE
+ * || test_mail_data->meeting_request_status == EMAIL_MAIL_TYPE_MEETING_ORIGINATINGREQUEST) {
+ *
+ * if ( (err = email_get_meeting_request(mail_id, &meeting_req)) != EMAIL_ERROR_NONE ) {
+ * printf("email_get_meeting_request() failed [%d]\n", err);
+ * return -1;
+ * }
+ *
+ * printf("\n > Enter meeting response: ");
+ * scanf("%d", (int*)&(meeting_req->meeting_response));
+ * }
+ *
+ * if ( (err = email_update_mail(test_mail_data, test_attachment_data_list, test_attachment_data_count, meeting_req, 0)) != EMAIL_ERROR_NONE)
+ * printf("email_update_mail failed.[%d]\n", err);
+ * else
+ * printf("email_update_mail success\n");
+ *
+ * if(test_mail_data)
+ * email_free_mail_data(&test_mail_data, 1);
+ *
+ * if(test_attachment_data_list)
+ * email_free_attachment_data(&test_attachment_data_list, test_attachment_data_count);
+ *
+ * if(meeting_req)
+ * email_free_meeting_request(&meeting_req, 1);
+ *
+ * return 0;
+ * }
+
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_update_mail(email_mail_data_t *input_mail_data, email_attachment_data_t *input_attachment_data_list, int input_attachment_count, email_meeting_request_t* input_meeting_request, int input_from_eas);
+
+/**
+ * @open
+ * @fn email_count_mail(email_mailbox_t* mailbox, int* total, int* unseen)
+ * @brief Get mail count from mailbox.This function is invoked when user wants to know how many toatl mails and out of that
+ * how many unseen mails are there in a given mailbox.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mailbox Specifies the pointer of mailbox structure.
+ * @param[out] total Total email count is saved here.
+ * @param[out] unseen Unread email count is saved here.
+ * @exception none
+ * @see email_mailbox_t
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_count_mail()
+ * {
+ * int total = 0;
+ * int unseen = 0;
+ * email_list_filter_t *filter_list = NULL;
+ * int err = EMAIL_ERROR_NONE;
+ * int i = 0;
+ * filter_list = malloc(sizeof(email_list_filter_t) * 3);
+ * memset(filter_list, 0 , sizeof(email_list_filter_t) * 3);
+ *
+ * filter_list[0].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_RULE;
+ * filter_list[0].list_filter_item.rule.target_attribute = EMAIL_MAIL_ATTRIBUTE_SUBJECT;
+ * filter_list[0].list_filter_item.rule.rule_type = EMAIL_LIST_FILTER_RULE_INCLUDE;
+ * filter_list[0].list_filter_item.rule.key_value.string_type_value = strdup("RE");
+ * filter_list[0].list_filter_item.rule.case_sensitivity = false;
+ *
+ * filter_list[1].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_OPERATOR;
+ * filter_list[1].list_filter_item.operator_type = EMAIL_LIST_FILTER_OPERATOR_OR;
+ *
+ * filter_list[2].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_RULE;
+ * filter_list[2].list_filter_item.rule.target_attribute = EMAIL_MAIL_ATTRIBUTE_TO;
+ * filter_list[2].list_filter_item.rule.rule_type = EMAIL_LIST_FILTER_RULE_INCLUDE;
+ * filter_list[2].list_filter_item.rule.key_value.string_type_value = strdup("RE");
+ * filter_list[2].list_filter_item.rule.case_sensitivity = false;
+ *
+ * if(EMAIL_ERROR_NONE == email_count_mail(filter_list, 3, &total, &unseen))
+ * printf("\n Total: %d, Unseen: %d \n", total, unseen);
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_count_mail(email_list_filter_t *input_filter_list, int input_filter_count, int *output_total_mail_count, int *output_unseen_mail_count);
+
+/**
+ * @open
+ * @fn email_get_max_mail_count(int *Count)
+ * @brief Gets the max count of mails which can be supported by email-service
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[out] Count max count of mails which can be supported by email-service
+ * @exception none
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_get_max_mail_count()
+ * {
+ * int max_count = -1;
+ *
+ * if(EMAIL_ERROR_NONE == email_get_max_mail_count(&max_count))
+ * printf("\n\t>>>>> email_get_max_mail_count() return [%d]\n\n", max_count);
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_get_max_mail_count(int *count);
+
+/**
+ * @open
+ * @fn email_delete_mail(email_mailbox_t* mailbox, int *mail_ids, int num, int from_server)
+ * @brief Delete a mail or multiple mails.Based on from_server value this function will delte a mail or multiple mails from server or loaclly.
+ * @param[in] mailbox Reserved.
+ * If the incoming_server_type is EMAIL_SERVER_TYPE_POP3 then from_server value will be 0
+ * If the incoming_server_type is EMAIL_SERVER_TYPE_IMAP4 then from_server value will be 1/0
+ *
+ * @param[in] mail_ids[] Specifies the arrary of mail id.
+ * @param[in] num Specifies the number of mail id.
+ * @param[in] from_server Specifies whether mails are deleted from server.
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @exception none
+ * @see email_mailbox_t
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_delete_mail()
+ * {
+ * int count, i, mail_id=0, mailbox_id =0;
+ *
+ * printf("\n > Enter Mail_id: ");
+ * scanf("%d",&mail_id);
+ * printf("\n > Enter Mailbox ID: ");
+ * scanf("%d",&mailbox_id);
+ * if(EMAIL_ERROR_NONE == email_delete_mail(mailbox_id, &mail_id, 1, 1))
+ * printf("\n email_delete_mail success");
+ * else
+ * printf("\n email_delete_mail failed");
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_delete_mail(int input_mailbox_id, int *input_mail_ids, int input_num, int input_from_server);
+
+
+/**
+ * @open
+ * @fn email_delete_all_mails_in_mailbox(int input_mailbox_id, int input_from_server)
+ * @brief Delete all mail from a mailbox.
+ * If the incoming_server_type is EMAIL_SERVER_TYPE_POP3 then from_server value will be 0
+ * If the incoming_server_type is EMAIL_SERVER_TYPE_IMAP4 then from_server value will be 1/0
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mailbox Specifies the structure of mailbox.
+ * @param[in] from_server Specifies whether mails are also deleted from server.
+ * @exception none
+ * @see email_mailbox_t
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_delete_all_mails_in_mailbox()
+ * {
+ * int count, mailbox_id =0;
+ *
+ * printf("\n > Enter mailbox_id: ");
+ * scanf("%d",&mailbox_id);
+ *
+ * if (EMAIL_ERROR_NONE != email_delete_all_mails_in_mailbox(mailbox_id, 0))
+ * printf("email_delete_all_mails_in_mailbox failed");
+ * else
+ * printf("email_delete_all_mails_in_mailbox Success");
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_delete_all_mails_in_mailbox(int input_mailbox_id, int input_from_server);
+
+/**
+ * @open
+ * @fn email_clear_mail_data()
+ * @brief delete email data from storage. This API will be used by the Settings Application
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @exception none
+ * @see none
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_clear_mail_data()
+ * {
+ * if(EMAIL_ERROR_NONE == email_clear_mail_data())
+ * //success
+ * else
+ * //failure
+ *
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_clear_mail_data();
+
+
+/**
+ * @open
+ * @fn email_add_attachment(int mail_id, email_attachment_data_t* attachment)
+ * @brief Append a attachment to email.This function is invoked when user wants to add attachment to existing mail.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] attachment Specifies the structure of attachment.
+ * @exception none
+ * @see email_attachment_data_t
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_mail_add_attachment()
+ * {
+ * int mail_id = 0;
+ * email_attachment_data_t attachment;
+ *
+ * printf("\n > Enter Mail Id: ");
+ * scanf("%d", &mail_id);
+ * memset(&attachment, 0x00, sizeof(email_attachment_data_t));
+ * printf("\n > Enter attachment name: ");
+ * attachment.name = strdup("Test");
+ * printf("\n > Enter attachment absolute path: ");
+ * attachment.savename = strdup("/tmp/test.txt");
+ * attachment.next = NULL;
+ * if(EMAIL_ERROR_NONE != email_add_attachment(mail_id, &attachment))
+ * printf("email_add_attachment failed\n");
+ * else
+ * printf(email_add_attachment success\n");
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_add_attachment(int mail_id, email_attachment_data_t* attachment);
+
+
+/**
+ * @open
+ * @fn email_delete_attachment(int mail_id, const char * attachment_id)
+ * @brief delete a attachment from email.This function is invoked when user wants to delete a attachment from existing mailbased on mail Id and attachment Id
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] attachment_id Specifies the attachment id.
+ * @exception none
+ * @see email_mailbox_t
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_mail_delete_attachment()
+ * {
+ *
+ * if(EMAIL_ERROR_NONE != email_delete_attachment(1))
+ * //failure
+ * else
+ * //success
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_delete_attachment(int attachment_id);
+
+/**
+ * @open
+ * @fn email_get_attachment_data(int mail_id, const char* attachment_id, email_attachment_data_t** attachment)
+ * @brief Get a mail attachment.This function is invoked when user wants to get the attachment information based on attachment id for the specified mail Id.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] attachment_id Specifies the buffer that a attachment ID been saved.
+ * @param[out] attachment The returned attachment is save here.
+ * @exception none
+ * @see email_mailbox_t and email_mail_attachment_info_t
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_mail_get_attachment_info()
+ * {
+ * email_mail_attachment_info_t *mail_attach_info = NULL;
+ * int mail_id = 0;
+ * char arg[10];
+ * int err = EMAIL_ERROR_NONE;
+ *
+ *
+ * printf("\n > Enter Mail Id: ");
+ * scanf("%d", &mail_id);
+ * printf("> attachment Id\n");
+ * scanf("%s",arg);
+ * if (EMAIL_ERROR_NONE != email_get_attachment_data(mail_id, &mail_attach_info))
+ * printf("email_get_attachment_data failed\n");
+ * else
+ * {
+ * printf("email_get_attachment_data SUCCESS\n");
+ * //do something
+ * email_free_attachment_data(&mail_attach_info,1);
+ * }
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_get_attachment_data(int attachment_id, email_attachment_data_t** attachment);
+
+EXPORT_API int email_get_attachment_data_list(int input_mail_id, email_attachment_data_t **output_attachment_data, int *output_attachment_count);
+
+/**
+ * @open
+ * @fn email_free_attachment_data(email_attachment_data_t **attachment_data_list, int attachment_data_count)
+ * @brief Free allocated memroy for email attachment.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] atch_info Specifies the pointer of mail attachment structure pointer.
+ * @exception none
+ * @see email_mail_attachment_info_t
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_mail_free_attachment_info()
+ * {
+ * email_mailbox_t mailbox;
+ * email_mail_attachment_info_t *mail_attach_info = NULL;
+ * int mail_id = 0,account_id = 0;
+ * char arg[10];
+ * int err = EMAIL_ERROR_NONE;
+ *
+ * memset(&mailbox, 0x00, sizeof(email_mailbox_t));
+ *
+ * printf("\n > Enter Mail Id: ");
+ * scanf("%d", &mail_id);
+ * printf("\n > Enter account Id: ");
+ * scanf("%d", &account_id);
+ * printf("> attachment Id\n");
+ * scanf("%s",arg);
+ * mailbox.account_id = account_id;
+ * if (EMAIL_ERROR_NONE != email_get_attachment_data(&mailbox, mail_id, &mail_attach_info))
+ * printf("email_get_attachment_data failed\n");
+ * else
+ * {
+ * printf("email_get_attachment_data SUCCESS\n");
+ * //do something
+ * email_free_attachment_info(&mail_attach_info,1);
+ * }
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_free_attachment_data(email_attachment_data_t **attachment_data_list, int attachment_data_count);
+
+/* -----------------------------------------------------------
+ Mail Information API
+ -----------------------------------------------------------*/
+
+
+/**
+ * @open
+ * @fn email_query_mails(char *conditional_clause_string, email_mail_data_t** mail_list, int *result_count)
+ * @brief Query the mail list information from DB based on the mailbox name.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] conditional_clause_string Specifies the where clause string.
+ * @param[in/out] mail_list Specifies the pointer to the structure email_mail_data_t.
+ * @param[in/out] result_count Specifies the number of mails returned.
+ * @exception None
+ * @see email_mail_list_item_t
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_query_mail()
+ * {
+ * email_mail_data_t *mail_list = NULL;
+ * char conditional_clause_string[500];
+ * int result_count = 0;
+ *
+ * memset(conditional_clause_string, 0x00, 10);
+ * printf("\n > Enter where clause: ");
+ * scanf("%s", conditional_clause_string);
+ *
+ *
+ * if (EMAIL_ERROR_NONE != email_query_mails(conditional_clause_string, &mail_list, &result_count))
+ * printf("email_query_mails failed \n");
+ * else {
+ * printf("Success\n");
+ * //do something
+ * free(mail_list);
+ * }
+ *
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_query_mails(char *conditional_clause_string, email_mail_data_t** mail_list, int *result_count);
+
+/**
+ * @open
+ * @fn email_query_mail_list(char *input_conditional_clause_string, email_mail_list_item_t** output_mail_list, int *output_result_count)
+ * @brief Query the mail list information from DB.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_conditional_clause_string Specifies the where clause string.
+ * @param[in/out] output_mail_list Specifies the pointer to the structure email_mail_list_item_t.
+ * @param[in/out] output_result_count Specifies the number of mails returned.
+ * @exception None
+ * @see email_mail_list_item_t
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_query_mail_list()
+ * {
+ * email_mail_list_item_t *mail_list = NULL;
+ * char conditional_clause_string[500];
+ * int result_count = 0;
+ *
+ * memset(conditional_clause_string, 0x00, 10);
+ * printf("\n > Enter where clause: ");
+ * scanf("%s", conditional_clause_string);
+ *
+ *
+ * if (EMAIL_ERROR_NONE != email_query_mail_list(conditional_clause_string, &mail_list, &result_count))
+ * printf("email_query_mail_list failed \n");
+ * else {
+ * printf("Success\n");
+ * //do something
+ * free(mail_list);
+ * }
+ *
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_query_mail_list(char *input_conditional_clause_string, email_mail_list_item_t** output_mail_list, int *output_result_count);
+
+/**
+ * @open
+ * @fn email_get_mail_data(int input_mail_id, email_mail_data_t **output_mail_data)
+ * @brief Get a mail by its mail id. This function is invoked when user wants to get a mail based on mail id existing in DB.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_mail_id specifies the mail id.
+ * @param[out] output_mail_data The returned mail is save here.
+ * @exception none
+ * @see email_mail_data_t
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_get_mail_data()
+ * {
+ * email_mail_data_t *mail = NULL;
+ * int mail_id = 0 ;
+ * int err = EMAIL_ERROR_NONE;
+ *
+ * printf("\n > Enter mail id: ");
+ * scanf("%d", &mail_id);
+ *
+ * if (EMAIL_ERROR_NONE != email_get_mail_data(mail_id, &mail))
+ * printf("email_get_mail_data failed\n");
+ * else
+ * {
+ * printf("email_get_mail_data SUCCESS\n");
+ * //do something
+ * email_free_mail_data(&mail,1);
+ * }
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+
+EXPORT_API int email_get_mail_data(int input_mail_id, email_mail_data_t **output_mail_data);
+
+
+/**
+ * @open
+ * @fn email_free_mail_data(email_mail_data_t** mail_list, int count)
+ * @brief Free allocated memroy for emails.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mail_list Specifies the pointer of mail structure pointer.
+ * @param[in] count Specifies the count of mails.
+ * @exception none
+ * @see email_mail_data_t
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_free_mail()
+ * {
+ * email_mail_data_t *mail;
+ *
+ * //fill the mail structure
+ * //count - number of mail structure user want to free
+ * if(EMAIL_ERROR_NONE == email_free_mail_data(&mail,count))
+ * //success
+ * else
+ * //failure
+ *
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_free_mail_data(email_mail_data_t** mail_list, int count);
+
+/* -----------------------------------------------------------
+ Mail Flag API
+ -----------------------------------------------------------*/
+
+/**
+ * @open
+ * @fn email_set_flags_field(int *mail_ids, int num, email_flags_field_type field_type, int value, int onserver)
+ * @brief Change email flags field.
+ * If the incoming_server_type is EMAIL_SERVER_TYPE_POP3 then from_server value will be 0
+ * If the incoming_server_type is EMAIL_SERVER_TYPE_IMAP4 then from_server value will be 1/0
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] account_id Specifies account ID.
+ * @param[in] mail_ids Specifies the array of mail ID.
+ * @param[in] num Specifies the number of mail ID.
+ * @param[in] field_type Specifies the field type what you want to set. Refer email_flags_field_type.
+ * @param[in] value Specifies the value what you want to set.
+ * @param[in] onserver Specifies whether mail Flag updation in server
+ * @exception none
+ * @see none
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_set_flags_field()
+ * {
+ * int account_id = 0;
+ * int mail_id = 0;
+ * int err = EMAIL_ERROR_NONE;
+ *
+ * printf("\n > Enter account id: ");
+ * scanf("%d", &account_id);
+ *
+ * printf("\n > Enter mail id: ");
+ * scanf("%d", &mail_id);
+ * if (EMAIL_ERROR_NONE != email_set_flags_field(&account_id, &mail_id, EMAIL_FLAGS_SEEN_FIELD, 1, 0))
+ * printf("email_set_flags_field failed\n");
+ * else
+ * {
+ * printf("email_set_flags_field succeed\n");
+ * //do something
+ * }
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+
+EXPORT_API int email_set_flags_field(int account_id, int *mail_ids, int num, email_flags_field_type field_type, int value, int onserver);
+
+/* -----------------------------------------------------------
+ Mail Move API
+ -----------------------------------------------------------*/
+
+/**
+ * @open
+ * @fn email_move_mail_to_mailbox(int *mail_ids, int num, int input_target_mailbox_id)
+ * @brief Move a email to another mailbox.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mail_id Specifies the array of mail ID.
+ * @param[in] num Specifies the count of mail IDs.
+ * @param[in] input_target_mailbox_id Specifies the mailbox ID for moving email.
+ * @exception none
+ * @see email_mailbox_t
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_move_mail_to_mailbox()
+ * {
+ * int mail_id = 0;
+ * int mailbox_id = 0;
+ * int err = EMAIL_ERROR_NONE;
+
+ * printf("\n > Enter mail_id: ");
+ * scanf("%d",&mail_id);
+ *
+ * printf("\n > Enter target mailbox_id: ");
+ * scanf("%d",&mailbox_id);
+ *
+ * if(EMAIL_ERROR_NONE == email_move_mail_to_mailbox(&mail_id, 1, mailbox_id))
+ * printf("Success\n");
+ *
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_move_mail_to_mailbox(int *mail_ids, int num, int input_target_mailbox_id);
+
+
+/**
+ * @open
+ * @fn email_move_all_mails_to_mailbox(int input_source_mailbox_id, int input_target_mailbox_id)
+ * @brief Move all email to another mailbox.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_source_mailbox_id Specifies the source mailbox ID for moving email.
+ * @param[in] input_target_mailbox_id Specifies the destination mailbox ID for moving email.
+ * @exception none
+ * @see email_mailbox_t
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_move_all_mails_to_mailbox()
+ * {
+ * int src_mailbox_id;
+ * int dst_mailbox_id;
+ * int total_count;
+ * int err = EMAIL_ERROR_NONE;
+ * char temp[128];
+ *
+ *
+ * // input mailbox information : need account_id and name (src & dest)
+ * printf("src mail maibox id> ");
+ * scanf("%d", &src_mailbox_id);
+ *
+ * // Destination mailbox
+ * printf("dest mailbox id> ");
+ * scanf("%d", &dst_mailbox_id);
+ *
+ * if( EMAIL_ERROR_NONE == email_move_all_mails_to_mailbox(src_mailbox_id, dst_mailbox_id))
+ * {
+ * printf(" fail email_move_all_mails_to_mailbox: \n");
+ * }
+ * else
+ * //success
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_move_all_mails_to_mailbox(int input_source_mailbox_id, int input_target_mailbox_id);
+
+
+/**
+ * @open
+ * @fn email_get_mail_list_ex(email_list_filter_t *input_filter_list, int input_filter_count, email_list_sorting_rule_t *input_sorting_rule_list, int input_sorting_rule_count, int input_start_index, int input_limit_count, email_mail_list_item_t** output_mail_list, int *output_result_count)
+ * @brief Get the Mail List information from DB.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_filter_list Specifies the filter list
+ * @param[in] input_filter_count Specifies the number of filter
+ * @param[in] input_sorting_rule_list Specifies the sorting rule list.
+ * @param[in] input_sorting_rule_count Specifies the number of sorting rule
+ * @param[in] input_start_index Specifies start index for LIMIT clause of SQL query.
+ * @param[in] input_limit_count Specifies limit count for LIMIT clause of SQL query.
+ * @param[in/out] output_mail_list Specifies the pointer to the structure email_mail_list_item_t.
+ * @param[in/out] output_result_count Specifies the number of mails returned.
+ * @exception none
+ * @see email_mail_list_item_t
+ * @code
+ * email_list_filter_t *filter_list = NULL;
+ * email_list_sorting_rule_t *sorting_rule_list = NULL;
+ * email_mail_list_item_t *result_mail_list = NULL;
+ * int result_mail_count = 0;
+ * int err = EMAIL_ERROR_NONE;
+ * int i = 0;
+ * filter_list = malloc(sizeof(email_list_filter_t) * 9);
+ * memset(filter_list, 0 , sizeof(email_list_filter_t) * 9);
+ *
+ * filter_list[0].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_RULE;
+ * filter_list[0].list_filter_item.rule.target_attribute = EMAIL_MAIL_ATTRIBUTE_SUBJECT;
+ * filter_list[0].list_filter_item.rule.rule_type = EMAIL_LIST_FILTER_RULE_INCLUDE;
+ * filter_list[0].list_filter_item.rule.key_value.string_type_value = strdup("RE");
+ * filter_list[0].list_filter_item.rule.case_sensitivity = false;
+ *
+ * filter_list[1].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_OPERATOR;
+ * filter_list[1].list_filter_item.operator_type = EMAIL_LIST_FILTER_OPERATOR_OR;
+ *
+ * filter_list[2].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_RULE;
+ * filter_list[2].list_filter_item.rule.target_attribute = EMAIL_MAIL_ATTRIBUTE_TO;
+ * filter_list[2].list_filter_item.rule.rule_type = EMAIL_LIST_FILTER_RULE_INCLUDE;
+ * filter_list[2].list_filter_item.rule.key_value.string_type_value = strdup("RE");
+ * filter_list[2].list_filter_item.rule.case_sensitivity = false;
+ *
+ * filter_list[3].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_OPERATOR;
+ * filter_list[3].list_filter_item.operator_type = EMAIL_LIST_FILTER_OPERATOR_OR;
+ *
+ * filter_list[4].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_RULE;
+ * filter_list[4].list_filter_item.rule.target_attribute = EMAIL_MAIL_ATTRIBUTE_CC;
+ * filter_list[4].list_filter_item.rule.rule_type = EMAIL_LIST_FILTER_RULE_INCLUDE;
+ * filter_list[4].list_filter_item.rule.key_value.string_type_value = strdup("RE");
+ * filter_list[4].list_filter_item.rule.case_sensitivity = false;
+ *
+ * filter_list[5].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_OPERATOR;
+ * filter_list[5].list_filter_item.operator_type = EMAIL_LIST_FILTER_OPERATOR_OR;
+ *
+ * filter_list[6].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_RULE;
+ * filter_list[6].list_filter_item.rule.target_attribute = EMAIL_MAIL_ATTRIBUTE_BCC;
+ * filter_list[6].list_filter_item.rule.rule_type = EMAIL_LIST_FILTER_RULE_INCLUDE;
+ * filter_list[6].list_filter_item.rule.key_value.string_type_value = strdup("RE");
+ * filter_list[6].list_filter_item.rule.case_sensitivity = false;
+ *
+ * filter_list[7].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_OPERATOR;
+ * filter_list[7].list_filter_item.operator_type = EMAIL_LIST_FILTER_OPERATOR_OR;
+ *
+ * filter_list[8].list_filter_item_type = EMAIL_LIST_FILTER_ITEM_RULE;
+ * filter_list[8].list_filter_item.rule.target_attribute = EMAIL_MAIL_ATTRIBUTE_FROM;
+ * filter_list[8].list_filter_item.rule.rule_type = EMAIL_LIST_FILTER_RULE_INCLUDE;
+ * filter_list[8].list_filter_item.rule.key_value.string_type_value = strdup("RE");
+ * filter_list[8].list_filter_item.rule.case_sensitivity = false;
+ *
+ * sorting_rule_list = malloc(sizeof(email_list_sorting_rule_t) * 2);
+ * memset(sorting_rule_list, 0 , sizeof(email_list_sorting_rule_t) * 2);
+ *
+ * sorting_rule_list[0].target_attribute = EMAIL_MAIL_ATTRIBUTE_FLAGS_SEEN_FIELD;
+ * sorting_rule_list[0].sort_order = EMAIL_SORT_ORDER_ASCEND;
+ *
+ * sorting_rule_list[1].target_attribute = EMAIL_MAIL_ATTRIBUTE_DATE_TIME;
+ * sorting_rule_list[1].sort_order = EMAIL_SORT_ORDER_ASCEND;
+ *
+ * err = email_get_mail_list_ex(filter_list, 9, sorting_rule_list, 2, -1, -1, &result_mail_list, &result_mail_count);
+ *
+ * if(err == EMAIL_ERROR_NONE) {
+ * printf("email_get_mail_list_ex succeed.\n");
+ *
+ * for(i = 0; i < result_mail_count; i++) {
+ * printf("mail_id [%d], subject [%s], from [%s]\n", result_mail_list[i].mail_id, result_mail_list[i].subject, result_mail_list[i].from);
+ * }
+ * }
+ * else {
+ * printf("email_get_mail_list_ex failed.\n");
+ * }
+ *
+ * email_free_list_filter(&filter_list, 9);
+ *
+ * return FALSE;
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_get_mail_list_ex(email_list_filter_t *input_filter_list, int input_filter_count, email_list_sorting_rule_t *input_sorting_rule_list, int input_sorting_rule_count, int input_start_index, int input_limit_count, email_mail_list_item_t** output_mail_list, int *output_result_count);
+
+EXPORT_API int email_free_list_filter(email_list_filter_t **input_filter_list, int input_filter_count);
+
+/**
+ * @open
+ * @fn email_get_mails(int account_id , int mailbox_id, int thread_id, int start_index, int limit_count, email_sort_type_t sorting, email_mail_data_t** mail_list, int* result_count)
+ * @brief Get the Mail List information from DB based on the mailbox name.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] account_id Specifies the account ID
+ * @param[in] mailbox_id Specifies the mailbox id
+ * @param[in] thread_id Specifies the thread id. It can be EMAIL_LIST_TYPE_THREAD, EMAIL_LIST_TYPE_NORMAL or thread id.
+ * @param[in] start_index Specifies start index for LIMIT clause of SQL query.
+ * @param[in] limit_count Specifies limit count for LIMIT clause of SQL query.
+ * @param[in] sorting Specifies the sorting type.
+ * @param[in/out] mail_list Specifies the pointer to the structure email_mail_data_t.
+ * @param[in/out] result_count Specifies the number of mails returned.
+ * @exception none
+ * @see email_mail_data_t
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_get_mail()
+ * {
+ * email_mail_data_t *mail_list = NULL;
+ * int mailbox_id;
+ * int result_count = 0;
+ * int account_id = 0;
+ * int err_code = EMAIL_ERROR_NONE;
+ *
+ * printf("\n > Enter Mailbox id: ");
+ * scanf("%d", mailbox_id);
+ *
+ * printf("\n > Enter Account_id: ");
+ * scanf("%d",&account_id);
+ *
+ * if (EMAIL_ERROR_NONE != email_get_mails(account_id, mailbox_id, EMAIL_LIST_TYPE_NORMAL, 0, 100, EMAIL_SORT_DATETIME_HIGH, &mail_list, &result_count)) {
+ * printf("email_get_mails failed \n");
+ * }
+ * else {
+ * printf("Success\n");
+ * //do something
+ * free(mail_list);
+ * }
+ *
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+
+EXPORT_API int email_get_mails(int account_id , int mailbox_id, int thread_id, int start_index, int limit_count, email_sort_type_t sorting, email_mail_data_t** mail_list, int* result_count);
+
+/**
+ * @open
+ * @fn email_get_mail_list(int account_id, int mailbox_id, int thread_id, int start_index, int limit_count, email_sort_type_t sorting, email_mail_list_item_t** mail_list, int* result_count)
+ * @brief Get the Mail List information from DB based on the mailbox name.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] account_id Specifies the account id
+ * @param[in] mailbox_id Specifies the mailbox id
+ * @param[in] thread_id Specifies the thread id. It can be EMAIL_LIST_TYPE_THREAD, EMAIL_LIST_TYPE_NORMAL or thread id.
+ * @param[in] start_index Specifies start index for LIMIT clause of SQL query.
+ * @param[in] limit_count Specifies limit count for LIMIT clause of SQL query.
+ * @param[in] sorting Specifies the sorting type.
+ * @param[in/out] mail_list Specifies the pointer to the structure email_mail_list_item_t.
+ * @param[in/out] result_count Specifies the number of mails returned.
+ * @exception none
+ * @see email_mail_list_item_t
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_get_mail()
+ * {
+ * email_mail_list_item_t *mail_list = NULL;
+ * int mailbox_id;
+ * int result_count = 0;
+ * int account_id = 0;
+ * int err_code = EMAIL_ERROR_NONE;
+ *
+ * printf("\n > Enter Mailbox id: ");
+ * scanf("%d", mailbox_id);
+ *
+ * printf("\n > Enter Account_id: ");
+ * scanf("%d",&account_id);
+ *
+ * if (EMAIL_ERROR_NONE != email_get_mail_list(account_id, mailbox_id, EMAIL_LIST_TYPE_NORMAL, 0, 100, EMAIL_SORT_DATETIME_HIGH, &mail_list, &result_count))
+ * {
+ * printf("email_get_mail_list_ex failed \n");
+ * }
+ * else
+ * {
+ * printf("Success\n");
+ * //do something
+ * free(mail_list);
+ * }
+ *
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_get_mail_list(int account_id, int mailbox_id, int thread_id, int start_index, int limit_count, email_sort_type_t sorting, email_mail_list_item_t** mail_list, int* result_count);
+
+/**
+ * @open
+ * @fn email_get_mail_by_address(int account_id, int mailbox_id, email_email_address_list_t* addr_list,
+ int start_index, int limit_count, email_sort_type_t sorting, email_mail_list_item_t** mail_list, int* result_count)
+ * @brief Get the Mail List information from the DB based on the mailbox name account_id and sender address.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] account_id Specifies the Account ID
+ * @param[in] mailbox_id Specifies the Mailbox ID
+ * @param[in] addr_list Specifies the addresses of senders. see email_email_address_list_t
+ * @param[in] start_index Specifies the first mail index of searched mail. This function will return mails whose index in the result list are from start_index to start_index + limit_count
+ * @param[in] limit_count Specifies the max number of returned mails.
+ * @param[in] search_type Specifies the search type.
+ * @param[in] search_value Specifies the search value.
+ * @param[in] sorting Specifies the sorting order. see email_sort_type_t
+ * @param[in/out] mail_list Specifies the Pointer to the structure email_mail_list_item_t.
+ * @param[in/out] result_count Specifies the Number of searched Mails
+ * @exception none
+ * @see email_email_address_list_t, email_sort_type_t, email_mail_list_item_t
+ * @code
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_get_mail_by_address(int account_id , int mailbox_id, email_email_address_list_t* addr_list,
+ int start_index, int limit_count, int search_type, const char *search_value, email_sort_type_t sorting, email_mail_list_item_t** mail_list, int* result_count);
+
+/**
+ * @open
+ * @fn email_get_thread_information_by_thread_id(int thread_id, email_mail_data_t** thread_info)
+ * @brief Get the thread information for specific thread from DB based on the mailbox name.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] thread_id Specifies the thread_id
+ * @param[in/out] thread_info Specifies the Pointer to the structure email_mail_data_t.
+ * @exception none
+ * @see email_mail_data_t
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_get_thread_information()
+ * {
+ * email_mail_data_t *thread_info = NULL;
+ * int thread_id = 0;
+ * int err_code = EMAIL_ERROR_NONE;
+ *
+ * printf("\n > Enter thread_id: ");
+ * scanf("%d",&thread_id);
+ *
+ * if ( EMAIL_ERROR_NONE != email_get_thread_information_by_thread_id(thread_id, &thread_info))
+ * {
+ * printf("email_get_thread_information_by_thread_id failed :\n"); *
+ * }
+ * else
+ * {
+ * printf("Success\n");
+ * //do something
+ * }
+ *
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+
+
+EXPORT_API int email_get_thread_information_by_thread_id(int thread_id, email_mail_data_t** thread_info);
+
+/**
+ * @open
+ * @fn email_get_thread_information_ex(int thread_id, email_mail_list_item_t** thread_info)
+ * @brief Get the Mail List information for specific thread from DB based on the mailbox name.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] thread_id Specifies the thread_id
+ * @param[in/out] thread_info Specifies the Pointer to the structure email_mail_list_item_t.
+ * @exception none
+ * @see email_mail_list_item_t
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_get_thread_information_ex()
+ * {
+ * email_mail_list_item_t *thread_info = NULL;
+ * int thread_id = 0;
+ * int err_code = EMAIL_ERROR_NONE;
+ *
+ * printf("\n > Enter thread_id: ");
+ * scanf("%d",&thread_id);
+ *
+ * if ( EMAIL_ERROR_NONE != email_get_thread_information_ex(thread_id, &thread_info))
+ * {
+ * printf("email_get_mail_list_of_thread failed :\n"); *
+ * }
+ * else
+ * {
+ * printf("Success\n");
+ * //do something
+ * }
+ *
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_get_thread_information_ex(int thread_id, email_mail_list_item_t** thread_info);
+
+
+
+/**
+ * @open
+ * @fn email_retry_sending_mail( int mail_id, int timeout_in_sec)
+ * @brief Retry mail send
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mail_id Specifies the mail id for the mail to resend
+ * @param[in] timeout_in_sec Specifies the timeout value in seconds
+ * @exception none
+ * @see none
+
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_retry_send_mail()
+ * {
+ * int mail_id = 1;
+ * int timeout_in_sec = 2;
+ *
+ * if(EMAIL_ERROR_NONE == email_retry_sending_mail(mail_id,timeout_in_sec))
+ * //success
+ * else
+ * //failure
+ *
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_retry_sending_mail(int mail_id, int timeout_in_sec);
+
+EXPORT_API int email_create_db_full();
+
+/**
+ * @open
+ * @fn email_cancel_sending_mail( int mail_id)
+ * @brief Callback function for cm popup. We set the status as EMAIL_MAIL_STATUS_SEND_CANCELED
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mail_id Specifies the mailID
+ * @exception none
+ * @see none
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_cancel_send_mail()
+ * {
+ * int mail_id = 10;
+ *
+ *
+ * if(EMAIL_ERROR_NONE == email_cancel_sending_mail(mail_id,))
+ * //success
+ * else
+ * //failure
+ *
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_cancel_sending_mail(int mail_id) ;
+
+ /**
+ * @open
+ * @fn email_get_disk_space_usage(unsigned long *total_size)
+ * @brief Gets the total disk usage of emails in KB.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[out] total_size total disk usage of emails
+ * @exception none
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_get_disk_space_usage()
+ * {
+ * unsigned long total_size = 0;
+ *
+ * if ( EMAIL_ERROR_NONE != email_get_disk_space_usage(&total_size))
+ * printf("email_get_disk_space_usage failed err : %d\n",err_code);
+ * else
+ * printf("email_get_disk_space_usage SUCCESS, total disk usage in KB : %ld \n", total_size);
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_get_disk_space_usage(unsigned long *total_size);
+
+/**
+ * @open
+ * @fn email_get_address_info_list(int mail_id, email_address_info_list_t** address_info_list)
+ * @brief Get the address info list. The address info list contains from, to, cc, bcc addresses and their display name, contact id and etc. (see email_address_info_list_t)
+ * Each GList (from, to, cc, bcc) is the list of email_address_info_t data.
+ * "data" variable of GList structure contains email_address_info_t data. <br>
+ * To get email_address_info_t data from GList, Use type casting from GList node.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mail_id Specifies the mail id to get the list.
+ * @param[out] address_info_list Specifies the Pointer to the structure email_address_info_list_t. Memory for a new address info list will be allocated to this. Call email_free_address_info_list() to free the memory allocated to this.
+ * @exception none
+ * @see email_address_info_list_t, email_address_info_t, email_free_address_info_list()
+ * @code
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_get_address_info_list()
+ * {
+ * email_address_info_list_t *p_address_info_list= NULL;
+ * email_address_info_t *p_address_info = NULL;
+ * int mai_id;
+ * int err_code = EMAIL_ERROR_NONE;
+ *
+ * mail_id = 1;
+ *
+ * if ( EMAIL_ERROR_NONE != (err_code = email_get_address_info_list(mail_id, &p_address_info_list)) )
+ * {
+ * printf("email_get_address_info_list failed :\n"); *
+ * return false;
+ * }
+ * else
+ * {
+ * printf("Success\n");
+ * //do something with p_address_info_list
+ * GList *list = p_address_info_list->from;
+ * GList *node = g_list_first(list);
+ * while ( node != NULL )
+ * {
+ * p_address_info = (email_address_info_t*)node->data;
+ * printf("%d, %s, %s, %d\n", p_address_info->address_type, p_address_info->address, p_address_info->display_name, p_address_info->contact_id);
+ *
+ * node = g_list_next(node);
+ * }
+ * }
+ *
+ * // Free sender list
+ * if ( p_address_info_list )
+ * {
+ * email_free_address_info_list(&p_address_info_list);
+ * }
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_get_address_info_list(int mail_id, email_address_info_list_t** address_info_list);
+
+/**
+ * @open
+ * @fn email_free_address_info_list(email_address_info_list_t **address_info_list)
+ * @brief Free the address info list allocated by email_get_address_info_list(). This function will free the memory which is allocated to address_info_list itself.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] address_info_list Specifies the Pointer to the structure email_address_info_list_t to be freed.
+ * @exception none
+ * @see email_address_info_list_t, email_get_address_info_list()
+ */
+EXPORT_API int email_free_address_info_list(email_address_info_list_t **address_info_list);
+
+/**
+ * @open
+ * @fn email_get_structure(const char*encoded_string, void **struct_var, email_convert_struct_type_e type)
+ * @brief This function returns the structure of the type which is indicated by 'type' variable. This function will allocate new memory to 'struct_var' for structure.<br>
+ * Some notifications such as NOTI_DOWNLOAD_NEW_MAIL are published with string parameter. The string contains various values that might be divided by delimiter.<br>
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] encoded_string Specifies the Pointer to the string from notification.
+ * @param[out] struct_var Specifies the Pointer to the structure to be returned. If success, new memory for structure will be allocated.
+ * @param[in] type Specifies the converting type. see email_convert_struct_type_e
+ * @exception none
+ * @see email_convert_struct_type_e
+ */
+EXPORT_API int email_get_structure(const char*encoded_string, void **struct_var, email_convert_struct_type_e type);
+
+/**
+ * @open
+ * @fn email_get_meeting_request(int mail_id, email_meeting_request_t **meeting_req)
+ * @brief Get the information of meeting request. The information of meeting request is based on Mail Id. <br>
+ * The information of meeting request is corresponding to only one mail.
+ * For this reason, the information of meeting request can be added by using email_add_message_with_meeting_request() with a matched mail information.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success. This function returns EMAIL_ERROR_DATA_NOT_FOUND if there isn't a matched mail. Otherwise it returns error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mail_id Specifies the Mail id for which meeting request details need to be fetched
+ * @param[in/out] meeting_req Specifies the Pointer to the structure email_meeting_request_t.
+ * @exception none
+ * @see email_meeting_request_t
+ */
+EXPORT_API int email_get_meeting_request(int mail_id, email_meeting_request_t **meeting_req);
+
+
+/**
+ * @open
+ * @fn email_free_meeting_request(email_meeting_request_t** meeting_req, int count)
+ * @brief Free the meeting request allocated by email_get_meeting_request() or alloacted to add. This function will free the memory which is allocated to meeting_req (= *meeting_req) itself.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] email_meeting_request_t Specifies the Pointer to the structure email_meeting_request_t to be freed.
+ * @param[in] count Specifies the number of elements in meeting_req array. this is usually 1.
+ * @exception none
+ * @see email_meeting_request_t, email_get_meeting_request()
+ */
+EXPORT_API int email_free_meeting_request(email_meeting_request_t** meeting_req, int count);
+
+EXPORT_API int email_move_thread_to_mailbox(int thread_id, int target_mailbox_id, int move_always_flag);
+
+EXPORT_API int email_delete_thread(int thread_id, int delete_always_flag);
+
+EXPORT_API int email_modify_seen_flag_of_thread(int thread_id, int seen_flag, int on_server);
+
+EXPORT_API int email_expunge_mails_deleted_flagged(int input_mailbox_id, int input_on_server, unsigned *output_handle);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/**
+* @} @}
+*/
+
+
+#endif /* __EMAIL_API_MAIL_H__ */
diff --git a/email-api/include/email-api-mailbox.h b/email-api/include/email-api-mailbox.h
index a1a23b6..62a57f7 100755
--- a/email-api/include/email-api-mailbox.h
+++ b/email-api/include/email-api-mailbox.h
@@ -1,353 +1,342 @@
-/*
-* email-service
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
-*
-* 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.
-*
-*/
-
-
-#ifndef __EMAIL_API_MAILBOX_H__
-#define __EMAIL_API_MAILBOX_H__
-
-#include "email-types.h"
-
-/**
-* @defgroup EMAIL_SERVICE Email Service
-* @{
-*/
-
-
-/**
-* @ingroup EMAIL_SERVICE
-* @defgroup EMAIL_API_MAILBOX Email Mailbox API
-* @{
-*/
-
-/**
- *
- * This file contains the data structures and interfaces needed for application,
- * to interact with email-service.
- * @file email-api-mailbox.h
- * @author Kyuho Jo <kyuho.jo@samsung.com>
- * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
- * @version 0.1
- * @brief This file contains the data structures and interfaces of mailbox provided by
- * email-service .
- * @{
- * @code
- *
- * #include "email_api_mailbox.h"
- *
- * bool other_app_invoke_uniform_api_sample(int *error_code)
- * {
- * emf_mailbox_t mbox;
- * emf_mailbox_t *new_mailbox =NULL;
- * emf_mailbox_t *mailbox_list = NULL;
- * int count = 0;
- * int mailbox_type;
- * unsigned handle = 0;
- * char *pMaiboxName;
- * char *pParentMailbox;
- *
- * memset(&mbox,0x00,sizeof(emf_mailbox_t));
- * mbox.name = strdup("test");
- * mbox.alias = strdup("Personal");
- * mbox.account_id = 1;
- * printf("Enter local_yn(1/0)");
- * scanf("%d",&local_yn);
- * mbox.local=local_yn;
- * mbox.mailbox_type = 7;
- *
- * //create new mailbox
- *
- * if(EMF_ERR_NONE != email_add_mailbox(&mbox,local_yn,&handle))
- * printf("email_add_mailbox failed\n");
- * else
- * printf("email_add_mailbox success");
- *
- * //update mailbox
- * new_mailbox = malloc(sizeof(emf_mailbox_t));
- * memset(new_mailbox,0x00,sizeof(emf_mailbox_t));
- *
- * new_mailbox->name = strdup("PersonalUse");
- *
- * if(EMF_ERROR_NONE != email_update_mailbox(&mbox,new_mailbox))
- * printf("email_update_mailbox failed\n");
- * else
- * printf("email_update_mailbox success\n");
- * //delete mailbox
- *
- * if(EMF_ERROR_NONE != email_delete_mailbox(mbox,local_yn,&handle))
- * printf("email_delete_mailbox failed\n");
- * else
- * printf("email_delete_mailbox success\n");
- *
- * //free mailbox
- * email_free_mailbox("new_mailbox,1");
- *
- * //Get mailbox list
- * if(EMF_ERROR_NONE != email_get_mailbox_list(account_id,local_yn,&mailbox_list,&count))
- * //failure
- * else
- * //success
- *
- * //Get mailbox by name
- * pMailboxName = strdup("test");
- * if(EMF_ERROR_NONE != email_get_mailbox_by_name(account_id,pMailboxName,&mailbox_list))
- * //failure
- * else
- * //success
- *
- * //Get child mailbox list
- * pParentMailbox = strdup("test");
- * if(EMF_ERROR_NONE != email_get_child_mailbox_list(account_id, paerent_mailbox,&mailbox_list,&count))
- * //failure
- * else
- * //success
- *
- * //Get mailbox by mailbox_type
- * printf("Enter mailbox_type\n");
- * scanf("%d",&mailbox_type);
- * if(EMF_ERROR_NONE != email_get_mailbox_by_mailbox_type(account_id,mailbox_type,&mailbox_list))
- * //failure
- * else
- * //success
- *
- * }
- *
- * @endcode
- * @}
- */
-
-
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif /* __cplusplus */
-
-
-/**
-
- * @open
- * @fn EXPORT_API int email_add_mailbox(emf_mailbox_t* new_mailbox, int on_server, unsigned* handle)
- * @brief Create a new mailbox or mailbox.This function is invoked when user wants to create a new mailbox for the specified account.
- * If On_server is true then it will create the mailbox on server as well as in local also.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code(refer to EMF_ERROR_XXX) on failure.
- * @param[in] new_mailbox Specifies the pointer of creating mailbox information.
-* @param[in] on_server Specifies the creating mailbox information on server.
- * @param[out] handle Specifies the sending handle.
- * @exception none
- * @see emf_mailbox_t
- * @remarks N/A
- */
-EXPORT_API int email_add_mailbox(emf_mailbox_t* new_mailbox, int on_server, unsigned* handle);
-
-
-/**
-
- * @open
- * @fn EXPORT_API int email_delete_mailbox(emf_mailbox_t* mailbox, int on_server, unsigned* handle)
- * @brief Delete a mailbox or mailbox.This function deletes the existing mailbox for specified account based on the option on_server.
- * If the on_server is true then it deletes mailbox from server as well as locally.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code(refer to EMF_ERROR_XXX) on failure.
- * @param[in] mailbox Specifies the pointer of deleting mailbox information.
- * @param[in] on_server Specifies the creating mailbox information on server.
- * @param[out] handle Specifies the sending handle.
- * @exception #EMF_ERROR_INVALID_PARAM -Invaid argument
- * @see emf_mailbox_t
- * @remarks N/A
- */
-EXPORT_API int email_delete_mailbox(emf_mailbox_t* mailbox, int on_server, unsigned* handle);
-
-
-/**
-
- * @fn EXPORT_API int email_update_mailbox(emf_mailbox_t* old_mailbox, emf_mailbox_t* new_mailbox)
- * @brief Change mailbox or mailbox information.This function is invoked when user wants to change the existing mail box information.
- * This supports ONLY updating mailbox_type in local db. This can be used to match a specific mail box and a specific mailbox_type.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code(refer to EMF_ERROR_XXX) on failure.
- * @param[in] old_mailbox Specifies the information of previous mailbox. <br>mandatory field : account_id, name
- * @param[in] new_mailbox Specifies the information of new mailbox. <br
- * @exception #EMF_ERROR_INVALID_PARAM -Invaid argument
- * @see emf_mailbox_t, emf_mailbox_type_e
- * @remarks N/A
- */
-EXPORT_API int email_update_mailbox(emf_mailbox_t* old_mailbox, emf_mailbox_t* new_mailbox);
-
-/**
-
- * @open
- * @fn email_get_mailbox_list(int account_id, int mailbox_sync_type, emf_mailbox_t** mailbox_list, int* count)
- * @brief Get all mailboxes from account.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code(refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the account ID.
- * @param[in] mailbox_sync_type Specifies the sync type.
- * @param[out] mailbox_list Specifies the pointer of mailbox structure pointer.(possibly NULL)
- * @param[out] count The mailbox count is saved here.(possibly 0)
- * @exception none
- * @see emf_mailbox_t
-
- * @code
- * #include "email-api-mailbox.h"
- * bool
- * _api_sample_get_mailbox_list()
- * {
- * int account_id =0,count = 0;
- * int mailbox_sync_type;
- * int error_code = EMF_ERROR_NONE;
- * emf_mailbox_t *mailbox_list=NULL;
- *
- * printf("\n > Enter account id: ");
- * scanf("%d", &account_id);
- * printf("\n > Enter mailbox_sync_type: ");
- * scanf("%d", &mailbox_sync_type);
- *
- * if((EMF_ERROR_NONE != email_get_mailbox_list(account_id, mailbox_sync_type, &mailbox_list, &count)))
- * {
- * printf(" Error\n");
- * }
- * else
- * {
- * printf("Success\n");
- * email_free_mailbox(&mailbox_list,count);
- * }
- * }
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_get_mailbox_list(int account_id, int mailbox_sync_type, emf_mailbox_t** mailbox_list, int* count);
-
-EXPORT_API int email_get_mailbox_list_ex(int account_id, int mailbox_sync_type, int with_count, emf_mailbox_t** mailbox_list, int* count);
-
-/**
-
- * @open
- * @fn EXPORT_API int email_get_mailbox_by_name(int account_id, const char *pMailboxName, emf_mailbox_t **pMailbox);
- * @brief Get the mailbox information by name.This function gets the mailbox by given mailbox name for a specified account.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code(refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the information of account Id.
- * @param[in] pMailboxName Specifies the mailbox name.
- * @param[out] pMailbox Specifies the information of mailbox
- * @exception none
- * @see emf_mailbox_t
- * @remarks N/A
- */
-
-EXPORT_API int email_get_mailbox_by_name(int account_id, const char *pMailboxName, emf_mailbox_t **pMailbox);
-
-// Belows are for A Project
-
-/**
-
- * @open
- * @fn email_get_child_mailbox_list(int account_id, char *parent_mailbox, emf_mailbox_t** mailbox_list, int* count)
- * @brief Get all sub mailboxes for given parent mailbox.This function gives all the child mailbox list for a given parent mailbox for specified account.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code(refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the account ID.
- * @param[in] parent_mailbox Specifies the parent mailbox
- * @param[out] mailbox_list Specifies the pointer of mailbox structure pointer.(possibly NULL)
- * @param[out] count The mailbox count
- * @exception #EMF_ERROR_INVALID_PARAM -Invalid argument
- * @see emf_mailbox_t
- * @remarks N/A
- * @return This function returns true on success or false on failure.
- */
-EXPORT_API int email_get_child_mailbox_list(int account_id, const char *parent_mailbox, emf_mailbox_t** mailbox_list, int* count);
-
-
-/**
- * @open
- * @fn email_get_mailbox_by_mailbox_type(int account_id, emf_mailbox_type_e mailbox_type, emf_mailbox_t** mailbox)
- * @brief Get mailbox by mailbox_type.This function is invoked when user wants to know the mailbox information by mailbox_type for the given account.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code(refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the account ID.
- * @param[in] mailbox_type Specifies the mailbox type.
- * @param[out] mailbox Specifies the pointer of mailbox structure pointer.(possibly NULL)
- * @exception none
- * @see emf_mailbox_t
- * @remarks N/A
- */
-EXPORT_API int email_get_mailbox_by_mailbox_type(int account_id, emf_mailbox_type_e mailbox_type, emf_mailbox_t** mailbox);
-
-/**
- * @open
- * @fn email_set_mail_slot_size(int account_id, char* mailbox_name, int new_slot_size, unsigned* handle)
- * @brief Set mail slot size.This function is invoked when user wants to set the size of mail slot.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code(refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the account ID.
- * @param[in] mailbox_name Specifies the mailbox name.
- * @param[in] new_slot_size Specifies the mail slot size.
- * @exception none
- * @see emf_mailbox_t
- * @remarks N/A
- */
-EXPORT_API int email_set_mail_slot_size(int account_id, char* mailbox_name, int new_slot_size/*, unsigned* handle*/);
-
-/**
- * @open
- * @fn email_free_mailbox(emf_mailbox_t** mailbox_list, int count)
- * @brief Free allocated memory for mailbox information.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mailbox_list Specifies the pointer for searching mailbox structure pointer.
- * @param[in] count Specifies the count of mailboxes.
- * @exception none
- * @see emf_mailbox_t
-
- * @code
- * #include "email-api-mailbox.h"
- * bool
- * _api_sample_free_mailbox_info()
- * {
- * emf_mailbox_t *mailbox;
- *
- * //fill the mailbox structure
- * //count - number of mailbox structure user want to free
- * if(EMF_ERROR_NONE == email_free_mailbox(&mailbox,count))
- * //success
- * else
- * //failure
- *
- * }
- * @endcode
- * @remarks N/A
- */
-
-EXPORT_API int email_free_mailbox(emf_mailbox_t** mailbox_list, int count);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-/**
-* @} @}
-*/
-
-
-
-#endif /* __EMAIL_API_MAILBOX_H__ */
-
-
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* 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.
+*
+*/
+
+
+#ifndef __EMAIL_API_MAILBOX_H__
+#define __EMAIL_API_MAILBOX_H__
+
+#include "email-types.h"
+
+/**
+* @defgroup EMAIL_SERVICE Email Service
+* @{
+*/
+
+
+/**
+* @ingroup EMAIL_SERVICE
+* @defgroup EMAIL_API_MAILBOX Email Mailbox API
+* @{
+*/
+
+/**
+ *
+ * This file contains the data structures and interfaces needed for application,
+ * to interact with email-service.
+ * @file email-api-mailbox.h
+ * @author Kyuho Jo <kyuho.jo@samsung.com>
+ * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
+ * @version 0.1
+ * @brief This file contains the data structures and interfaces of mailbox provided by
+ * email-service .
+ * @{
+ * @code
+ *
+ * #include "email_api_mailbox.h"
+ *
+ * bool other_app_invoke_uniform_api_sample(int *error_code)
+ * {
+ * email_mailbox_t mailbox;
+ * email_mailbox_t *new_mailbox =NULL;
+ * email_mailbox_t *mailbox_list = NULL;
+ * int count = 0;
+ * int mailbox_type;
+ * unsigned handle = 0;
+ * char *pMaiboxName;
+ * char *pParentMailbox;
+ *
+ * memset(&mailbox,0x00,sizeof(email_mailbox_t));
+ * mailbox.mailbox_name = strdup("test");
+ * mailbox.alias = strdup("Personal");
+ * mailbox.account_id = 1;
+ * printf("Enter local_yn(1/0)");
+ * scanf("%d",&local_yn);
+ * mailbox.local=local_yn;
+ * mailbox.mailbox_type = 7;
+ *
+ * //create new mailbox
+ *
+ * if(EMAIL_ERR_NONE != email_add_mailbox(&mailbox,local_yn,&handle))
+ * printf("email_add_mailbox failed\n");
+ * else
+ * printf("email_add_mailbox success");
+ *
+ * //delete mailbox
+ *
+ * if(EMAIL_ERROR_NONE != email_delete_mailbox(mailbox,local_yn,&handle))
+ * printf("email_delete_mailbox failed\n");
+ * else
+ * printf("email_delete_mailbox success\n");
+ *
+ * //free mailbox
+ * email_free_mailbox("new_mailbox,1");
+ *
+ * //Get mailbox list
+ * if(EMAIL_ERROR_NONE != email_get_mailbox_list(account_id,local_yn,&mailbox_list,&count))
+ * //failure
+ * else
+ * //success
+ *
+ * //Get mailbox by name
+ * pMailboxName = strdup("test");
+ * if(EMAIL_ERROR_NONE != email_get_mailbox_by_name(account_id,pMailboxName,&mailbox_list))
+ * //failure
+ * else
+ * //success
+ *
+ * //Get child mailbox list
+ * pParentMailbox = strdup("test");
+ * if(EMAIL_ERROR_NONE != email_get_child_mailbox_list(account_id, paerent_mailbox,&mailbox_list,&count))
+ * //failure
+ * else
+ * //success
+ *
+ * //Get mailbox by mailbox_type
+ * printf("Enter mailbox_type\n");
+ * scanf("%d",&mailbox_type);
+ * if(EMAIL_ERROR_NONE != email_get_mailbox_by_mailbox_type(account_id,mailbox_type,&mailbox_list))
+ * //failure
+ * else
+ * //success
+ *
+ * }
+ *
+ * @endcode
+ * @}
+ */
+
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+
+/**
+ * @open
+ * @fn int email_add_mailbox(email_mailbox_t* new_mailbox, int on_server, unsigned* handle)
+ * @brief Create a new mailbox or mailbox.This function is invoked when user wants to create a new mailbox for the specified account.
+ * If On_server is true then it will create the mailbox on server as well as in local also.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code(refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] new_mailbox Specifies the pointer of creating mailbox information.
+* @param[in] on_server Specifies the creating mailbox on server.
+ * @param[out] handle Specifies the sending handle.
+ * @exception none
+ * @see email_mailbox_t
+ * @remarks N/A
+ */
+EXPORT_API int email_add_mailbox(email_mailbox_t *new_mailbox, int on_server, unsigned* handle);
+
+/**
+ * @fn int email_rename_mailbox(int input_mailbox_id, char *input_mailbox_name, char *input_mailbox_alias)
+ * @brief Change mailbox name. This function is invoked when user wants to change the name of existing mail box.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code(refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_mailbox_id Specifies the id of the mailbox.
+ * @param[in] input_mailbox_name Specifies the name of the mailbox.
+ * @param[in] input_mailbox_alias Specifies the alias of the mailbox.
+ * @param[in] input_on_server Specifies the moving mailbox on server.
+ * @param[out] output_handle Specifies the handle to manage tasks.
+ *
+ * @exception see email-errors.h
+ * @see email_mailbox_t, email_mailbox_type_e
+ * @remarks N/A
+ */
+EXPORT_API int email_rename_mailbox(int input_mailbox_id, char *input_mailbox_name, char *input_mailbox_alias, int input_on_server, unsigned *output_handle);
+
+/**
+ * @open
+ * @fn int email_delete_mailbox(int input_mailbox_id, int input_on_server, unsigned* output_handle)
+ * @brief Delete a mailbox or mailbox.This function deletes the existing mailbox for specified account based on the option on_server.
+ * If the on_server is true then it deletes mailbox from server as well as locally.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code(refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_mailbox_id Specifies the id of target mailbox .
+ * @param[in] input_on_server Specifies the deleting mailbox on server.
+ * @param[out] output_handle Specifies the sending handle.
+ * @exception see email-errors.h
+ * @see email_mailbox_t
+ * @remarks N/A
+ */
+EXPORT_API int email_delete_mailbox(int input_mailbox_id, int input_on_server, unsigned* output_handle);
+
+/**
+ * @fn int email_set_mailbox_type(int input_mailbox_id, email_mailbox_type_e input_mailbox_type)
+ * @brief Change the mailbox type. This function is invoked when user wants to change the mailbox type.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code(refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_mailbox_id Specifies the id of the mailbox.
+ * @param[in] input_mailbox_type Specifies the mailbox type.
+ * @exception see email-errors.h
+ * @see email_mailbox_type_e
+ * @remarks N/A
+ */
+EXPORT_API int email_set_mailbox_type(int input_mailbox_id, email_mailbox_type_e input_mailbox_type);
+
+/**
+
+ * @open
+ * @fn email_get_mailbox_list(int account_id, int mailbox_sync_type, email_mailbox_t** mailbox_list, int* count)
+ * @brief Get all mailboxes from account.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code(refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] account_id Specifies the account ID.
+ * @param[in] mailbox_sync_type Specifies the sync type.
+ * @param[out] mailbox_list Specifies the pointer of mailbox structure pointer.(possibly NULL)
+ * @param[out] count The mailbox count is saved here.(possibly 0)
+ * @exception none
+ * @see email_mailbox_t
+
+ * @code
+ * #include "email-api-mailbox.h"
+ * bool
+ * _api_sample_get_mailbox_list()
+ * {
+ * int account_id =0,count = 0;
+ * int mailbox_sync_type;
+ * int error_code = EMAIL_ERROR_NONE;
+ * email_mailbox_t *mailbox_list=NULL;
+ *
+ * printf("\n > Enter account id: ");
+ * scanf("%d", &account_id);
+ * printf("\n > Enter mailbox_sync_type: ");
+ * scanf("%d", &mailbox_sync_type);
+ *
+ * if((EMAIL_ERROR_NONE != email_get_mailbox_list(account_id, mailbox_sync_type, &mailbox_list, &count)))
+ * {
+ * printf(" Error\n");
+ * }
+ * else
+ * {
+ * printf("Success\n");
+ * email_free_mailbox(&mailbox_list,count);
+ * }
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_get_mailbox_list(int account_id, int mailbox_sync_type, email_mailbox_t** mailbox_list, int* count);
+
+EXPORT_API int email_get_mailbox_list_ex(int account_id, int mailbox_sync_type, int with_count, email_mailbox_t** mailbox_list, int* count);
+
+/**
+ * @open
+ * @fn email_get_mailbox_by_mailbox_type(int account_id, email_mailbox_type_e mailbox_type, email_mailbox_t** mailbox)
+ * @brief Get mailbox by mailbox_type.This function is invoked when user wants to know the mailbox information by mailbox_type for the given account.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code(refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] account_id Specifies the account ID.
+ * @param[in] mailbox_type Specifies the mailbox type.
+ * @param[out] mailbox Specifies the pointer of mailbox structure pointer.(possibly NULL)
+ * @exception none
+ * @see email_mailbox_t
+ * @remarks N/A
+ */
+EXPORT_API int email_get_mailbox_by_mailbox_type(int account_id, email_mailbox_type_e mailbox_type, email_mailbox_t** mailbox);
+
+/**
+ * @open
+ * @fn email_get_mailbox_by_mailbox_id(int input_mailbox_id, email_mailbox_t** output_mailbox)
+ * @brief Get mailbox by mailbox_id. This function is invoked when user wants to know the mailbox information by mailbox id.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code(refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_mailbox_id Specifies the mailbox id.
+ * @param[out] output_mailbox Specifies the pointer of mailbox structure pointer.(possibly NULL)
+ * @exception none
+ * @see email_mailbox_t
+ * @remarks N/A
+ */
+EXPORT_API int email_get_mailbox_by_mailbox_id(int input_mailbox_id, email_mailbox_t** output_mailbox);
+
+/**
+ * @open
+ * @fn email_set_mail_slot_size(int input_account_id, int input_mailbox_id, int input_new_slot_size)
+ * @brief Set mail slot size.This function is invoked when user wants to set the size of mail slot.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code(refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_account_id Specifies the account ID.
+ * @param[in] input_mailbox_id Specifies the mailbox id.
+ * @param[in] input_new_slot_size Specifies the mail slot size.
+ * @exception none
+ * @see email_mailbox_t
+ * @remarks N/A
+ */
+EXPORT_API int email_set_mail_slot_size(int input_account_id, int input_mailbox_id, int input_new_slot_size);
+
+/**
+ * @open
+ * @fn email_stamp_sync_time_of_mailbox(int input_mailbox_id)
+ * @brief Stamp sync time of mailbox. This function is invoked when user wants to set the sync time of the mailbox.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code(refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_mailbox_id Specifies the mailbox id.
+ * @exception none
+ * @see email_mailbox_t
+ * @remarks N/A
+ */
+EXPORT_API int email_stamp_sync_time_of_mailbox(int input_mailbox_id);
+
+
+/**
+ * @open
+ * @fn email_free_mailbox(email_mailbox_t** mailbox_list, int count)
+ * @brief Free allocated memory for mailbox information.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mailbox_list Specifies the pointer for searching mailbox structure pointer.
+ * @param[in] count Specifies the count of mailboxes.
+ * @exception none
+ * @see email_mailbox_t
+
+ * @code
+ * #include "email-api-mailbox.h"
+ * bool
+ * _api_sample_free_mailbox_info()
+ * {
+ * email_mailbox_t *mailbox;
+ *
+ * //fill the mailbox structure
+ * //count - number of mailbox structure user want to free
+ * if(EMAIL_ERROR_NONE == email_free_mailbox(&mailbox,count))
+ * //success
+ * else
+ * //failure
+ *
+ * }
+ * @endcode
+ * @remarks N/A
+ */
+
+EXPORT_API int email_free_mailbox(email_mailbox_t** mailbox_list, int count);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/**
+* @} @}
+*/
+
+#endif /* __EMAIL_API_MAILBOX_H__ */
+
+
diff --git a/email-api/include/email-api-network.h b/email-api/include/email-api-network.h
index 462e66b..c13c037 100755
--- a/email-api/include/email-api-network.h
+++ b/email-api/include/email-api-network.h
@@ -1,403 +1,360 @@
-/*
-* email-service
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
-*
-* 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.
-*
-*/
-
-
-#ifndef __EMAIL_API_NETWORK_H__
-#define __EMAIL_API_NETWORK_H__
-
-#include "email-types.h"
-
-/**
-* @defgroup EMAIL_SERVICE Email Service
-* @{
-*/
-
-/**
-* @ingroup EMAIL_SERVICE
-* @defgroup EMAIL_API_NETWORK Email Network API
-* @{
-*/
-
-/**
- *
- * This file contains the data structures and interfaces needed for application,
- * to interact with email-service.
- * @file email-api-network.h
- * @author Kyuho Jo <kyuho.jo@samsung.com>
- * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
- * @version 0.1
- * @brief This file contains the data structures and interfaces of Network related Functionality provided by
- * email-service .
- *
- * @{
-
- * @code
-
- * #include "email-api.h"
- *
- * bool
- * other_app_invoke_uniform_api_sample(int* error_code)
- * {
- *
- * // Send a mail
- * emf_mailbox_t mbox;
- * emf_attachment_info_t attachment;
- * emf_option_t option;
- * int account_id = 1;
- * int err = EMF_ERROR_NONE;
- * int mail_id = 0;
- * char arg[50]; //Input attachment number need to be download
- * emf_event_status_type_t status;
- * int action = -1;
- * int on_sending = 0;
- * int on_receiving = 0;
- *
-* printf("Enter mailbox name\n");
- * scanf("%s",&mbox.mailbox_name);
- * printf("Enter mail id\n");
- * scanf("%d",&mail_id);
- * option.keep_local_copy = 1;
- *
- * if(EMF_ERROR_NONE == email_send_mail(&mbox, mail_id, &option, &handle))
- * //success
- * else
- * //failure
- *
- * // Download header of new emails from mail server
- * unsigned handle = 0;
- *
- * memset(&mbox, 0x00, sizeof(emf_mailbox_t));
- *
- * mbox.account_id = account_id;
- * mbox.name = strdup("INBOX");
- * if(EMF_ERROR_NONE == email_sync_header (&mbox,&handle))
- * //success
- * else
- * //failure
- *
- * //Sync mail header for all accounts
- * if(EMF_ERROR_NONE == email_sync_header_for_all_account(&handle))
- * //success
- * else
- * //failure
- *
- * //Download email body from server
- *
- * memset(&mbox, 0x00, sizeof(emf_mailbox_t));
- * mbox.account_id = account_id;
- * mbox.name = strdup("INBOX");
- * if(EMF_ERROR_NONE == email_download_body (&mbox,mail_id,0,&handle))
- * //success
- * else
- * //failure
- *
- * //Download a email nth-attachment from server
- * prinf("Enter attachment number\n");
- * scanf("%s",arg);
- * memset(&mbox, 0x00, sizeof(emf_mailbox_t));
- * mbox.name = strdup("INBOX");
- * mbox.account_id = account_id;
- * if(EMF_ERROR_NONE == email_download_attachment(&mailbox,mail_id,arg,&handle))
- * //success
- * else
- * //failure
- *
- * //Cancel job
- * if(EMF_ERROR_NONE == email_cancel_job(account_id,handle))//canceling download email nth attachment from server job.
- * //so this handle contains the value return by the email_download_attachment()
- * //success
- * else
- * //failure
- * //Get pending job listfor an account
- *
- * printf( " Enter Action \n SEND_MAIL = 0 \n SYNC_HEADER = 1 \n" \
- * " DOWNLOAD_BODY,= 2 \n DOWNLOAD_ATTACHMENT = 3 \n" \
- * " DELETE_MAIL = 4 \n SEARCH_MAIL = 5 \n SAVE_MAIL = 6 \n" \
- * " NUM = 7 \n");
- * scanf("%d",&action);
- * if(EMF_ERROR_NONE == email_get_pending_job(action,account_id,mail_id,&status))
- * //success
- * else
- * //error
- *
- * //Get Network status
- * if(EMF_ERROR_NONE == email_get_network_status(&sending,&receiving))
- * //success
- * else
- * //failure
- *
- * //Send read report
- * if(EMF_ERROR_NONE == email_send_report(mail ,&handle))
- * //success
- * else
- * //failure
- * //Save and send
- *
- * mbox.account_id = account_id;
- * mbox.name = strdup("DRAFTBOX");
- *
- * if(EMF_ERROR_NONE == email_add_message(mail,&mbox,1))
- * {
- * if(EMF_ERROR_NONE == email_send_saved(account_id,&option,&handle))
- * //success
- * else
- * //failure
- * }
- * //Get Imap mailbox list
- * printf("\n > Enter server name:\n");
- * scanf("%s",arg);
- * if(EMF_ERROR_NONE == email_get_imap_mailbox_list(account_id , arg , &handle))
- * //success
- * else
- * //failure
- *
- * //sync local activity
- * if(EMF_ERROR_NONE == email_sync_local_activity(account_id))
- * //success
- * else
- * //failure
- * }
- *
- * @endcode
- * @}
-
- */
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
- * @open
- * @fn email_send_mail( emf_mailbox_t* mailbox, int mail_id, emf_option_t* sending_option, unsigned* handle)
- * @brief Send a mail.This function is invoked when user wants to send a composed mail.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mailbox Specifies the mailbox to consist a sending email.
- * @param[in] mail_id Specifies the mail ID.
- * @param[in] sending_option Specifies the sending option.
- * @param[out] handle Specifies the sending handle.
- * @exception none
- * @see emf_mailbox_t and emf_option_t
- * @remarks N/A
- */
-EXPORT_API int email_send_mail( emf_mailbox_t* mailbox,
- int mail_id,
- emf_option_t* sending_option,
- unsigned* handle);
-
-
-/**
- * @open
- * @fn email_sync_header(emf_mailbox_t* mailbox, unsigned* handle)
- * @brief Download header of new emails from mail server.This function is invoked when user wants to download only header of new mails.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mailbox Specifies the structure of mailbox.
- * @param[out] handle Specifies the handle for stopping downloading.
- * @exception none
- * @see emf_mailbox_t
- * @remarks N/A
- */
-EXPORT_API int email_sync_header(emf_mailbox_t* mailbox, unsigned* handle);
-
-
-/**
- * @open
- * @fn email_sync_header_for_all_account(unsigned* handle)
- * @brief Download header of new emails from mail server for all emails.This function is invoked when user wants to download header of new mails for all accounts.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[out] handle Specifies the handle for stopping downloading.
- * @exception none
- * @see none
- * @remarks N/A
- */
-EXPORT_API int email_sync_header_for_all_account(unsigned* handle);
-
-
-/**
- * @open
- * @fn email_download_body(emf_mailbox_t* mailbox, int mail_id, int with_attachment, unsigned* handle)
- * @brief Download email body from server.This function is invoked when user wants to download email body with/without attachment based on the option with_attachment
- * from the server.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mailbox Specifies the structure of mailbox.
- * @param[in] mail_id Specifies the mail ID.
- * @param[in] with_attachment Specifies the whether attachment is there or not.
- * @param[out] handle Specifies the handle for stopping downloading.
- * @exception none
- * @see emf_mailbox_t
- * @remarks N/A
- */
-EXPORT_API int email_download_body(emf_mailbox_t* mailbox, int mail_id, int with_attachment, unsigned* handle);
-
-
-
-
-
-
-/**
- * @open
- * @fn email_download_attachment(emf_mailbox_t* mailbox, int mail_id, char* nth, unsigned* handle);
- * @brief Download a email nth-attachment from server.This function is invoked if user wants to download only specific attachment of a mail whose body is already downloaded.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] mailbox Reserved.
- * @param[in] mail_id Specifies the mail ID.
- * @param[in] nth Specifies the buffer that a attachment number been saved. the minimum number is "1".
- * @param[out] handle Specifies the handle for stopping downloading.
- * @exception none
- * @see emf_mailbox_t
- * @remarks N/A
- */
-EXPORT_API int email_download_attachment(emf_mailbox_t* mailbox,
- int mail_id,
- const char* nth,
- unsigned* handle);
-
-
-/**
- * @open
- * @fn email_cancel_job(int account_id, int handle);
- * @brief cancel the ongoing job.This function is invoked if user wants to cancel any ongoing job of a specified account.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the account ID.
- * @param[in] handle Specifies the handle for stopping the operation.
- * @exception none
- * @see none
- * @remarks N/A
- */
-
-EXPORT_API int email_cancel_job(int account_id, int handle);
-
-
-/**
- * @open
- * @fn email_get_pending_job(emf_action_t action, int account_id, int mail_id, emf_event_status_type_t * status);
- * @brief get pending job list.This function is invoked if user wants to get the pending job list with status information .
- * Based on action item of a mail is for a specific account this will give all pending job list.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the action of the job.
- * @param[in] account_id Specifies the account ID.
- * @param[in] mail_id Specifies the mail ID.
- * @param[out]status Specifies the status of the job.
- * @exception none
- * @see emf_action_t and emf_event_status_type_t
- * @remarks N/A
- */
-EXPORT_API int email_get_pending_job(emf_action_t action, int account_id, int mail_id, emf_event_status_type_t * status);
-
-
-/**
- * @open
- * @fn email_get_network_status(int* on_sending, int* on_receiving)
- * @brief This function gives the current network status.This gives the information to the user whether sending operation is in progress or receiving operation.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[out] on_sending True if sending is in progress.
- * @param[out] on_receiving True if receivng is in progress.
- * @exception none
- * @see none
- * @remarks N/A
- */
-EXPORT_API int email_get_network_status(int* on_sending, int* on_receiving);
-
-/**
- * @open
- * @fn email_send_saved(int account_id, emf_option_t* sending_option, unsigned* handle)
- * @brief Send all mails to been saved in Offline-mode.This function is invoked when user wants to send an email and after saving it.
- * This will save the email in draft mailbox and then sends.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the account ID.
- * @param[in] sending_option Specifies the sending option.
- * @param[out] handle Specifies the handle for stopping sending.
- * @exception none
- * @see emf_option_t
- * @remarks N/A
- */
-EXPORT_API int email_send_saved(int account_id, emf_option_t* sending_option, unsigned* handle);
-
-/**
- * @open
- * @fn email_get_imap_mailbox_list(int account_id, char* mailbox, unsigned* handle)
- * @brief fetch all the mailbox names from server and store the non-existing mailboxes in DB.This function is invoked when user wants to download all server mailboxes from IMAP server
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the account ID.
- * @param[in] mailbox Specifies the mailbox name.
- * @param[out] handle Specifies the handle for stopping Network operation.
- * @exception none
- * @see none
- * @remarks N/A
- */
-EXPORT_API int email_get_imap_mailbox_list(int account_id, const char* mailbox, unsigned* handle);
-
-
-
-/**
- * @open
- * @fn email_sync_local_activity(int account_id)
- * @brief sync local activity
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the account ID.
- * @exception none
- * @see none
- * @remarks N/A
- */
-EXPORT_API int email_sync_local_activity(int account_id);
-
-
-/**
- * @open
- * @fn email_search_mail_on_server(int account_id, const char *mailbox_name, int search_type, char *search_value)
- * @brief Search the mails on server.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] account_id Specifies the Account ID
- * @param[in] mailbox_name Specifies the Mailbox Name
- * @param[in] search_type Specifies the searching type(EMF_SEARCH_FILTER_SUBJECT, EMF_SEARCH_FILTER_SENDER, EMF_SEARCH_FILTER_RECIPIENT, EMF_SEARCH_FILTER_ALL)
- * @param[in] search_value Specifies the value to use for searching. (ex : Subject, email address, display name)
- * @exception none
- * @see
- * @code
- * @endcode
- * @remarks N/A
- */
-EXPORT_API int email_search_mail_on_server(int input_account_id, const char *input_mailbox_name, email_search_filter_t *input_search_filter_list, int input_search_filter_count, unsigned *output_handle);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-/**
-* @}
-*/
-
-
-#endif /* __EMAIL_API_NETWORK_H__ */
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* 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.
+*
+*/
+
+
+#ifndef __EMAIL_API_NETWORK_H__
+#define __EMAIL_API_NETWORK_H__
+
+#include "email-types.h"
+
+/**
+* @defgroup EMAIL_SERVICE Email Service
+* @{
+*/
+
+/**
+* @ingroup EMAIL_SERVICE
+* @defgroup EMAIL_API_NETWORK Email Network API
+* @{
+*/
+
+/**
+ *
+ * This file contains the data structures and interfaces needed for application,
+ * to interact with email-service.
+ * @file email-api-network.h
+ * @author Kyuho Jo <kyuho.jo@samsung.com>
+ * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
+ * @version 0.1
+ * @brief This file contains the data structures and interfaces of Network related Functionality provided by
+ * email-service .
+ *
+ * @{
+
+ * @code
+
+ * #include "email-api.h"
+ *
+ * bool
+ * other_app_invoke_uniform_api_sample(int* error_code)
+ * {
+ *
+ * // Send a mail
+ * email_attachment_data_t attachment;
+ * email_option_t option;
+ * int account_id = 1;
+ * int mailbox_id = 0;
+ * int attachment_id = 0;
+ * int err = EMAIL_ERROR_NONE;
+ * int mail_id = 0;
+ * int action = -1;
+ *
+ * printf("Enter mail id\n");
+ * scanf("%d",&mail_id);
+ * option.keep_local_copy = 1;
+ *
+ * if(EMAIL_ERROR_NONE == email_send_mail(mail_id, &option, &handle))
+ * //success
+ * else
+ * //failure
+ *
+ * // Download header of new emails from mail server
+ * unsigned handle = 0;
+ *
+ * mailbox.account_id = account_id;
+ * printf("Enter mailbox id\n");
+ * scanf("%d",&mailbox_id);
+ * if(EMAIL_ERROR_NONE == email_sync_header (account_id, mailbox_id, &handle))
+ * //success
+ * else
+ * //failure
+ *
+ * //Sync mail header for all accounts
+ * if(EMAIL_ERROR_NONE == email_sync_header_for_all_account(&handle))
+ * //success
+ * else
+ * //failure
+ *
+ * //Download email body from server
+ *
+ * if(EMAIL_ERROR_NONE == email_download_body (mail_id,0,&handle))
+ * //success
+ * else
+ * //failure
+ *
+ * //Download a email nth-attachment from server
+ * prinf("Enter attachment number\n");
+ * scanf("%d",&attachment_id);
+ * if(EMAIL_ERROR_NONE == email_download_attachment(mail_id, attachment_id, &handle))
+ * //success
+ * else
+ * //failure
+ *
+ * //Cancel job
+ * if(EMAIL_ERROR_NONE == email_cancel_job(account_id,handle))//canceling download email nth attachment from server job.
+ * //so this handle contains the value return by the email_download_attachment()
+ * //success
+ * else
+ * //failure
+ * //Get pending job listfor an account
+ *
+ * printf( " Enter Action \n SEND_MAIL = 0 \n SYNC_HEADER = 1 \n" \
+ * " DOWNLOAD_BODY,= 2 \n DOWNLOAD_ATTACHMENT = 3 \n" \
+ * " DELETE_MAIL = 4 \n SEARCH_MAIL = 5 \n SAVE_MAIL = 6 \n" \
+ * " NUM = 7 \n");
+ * scanf("%d",&action);
+ * if(EMAIL_ERROR_NONE == email_get_pending_job(action,account_id,mail_id,&status))
+ * //success
+ * else
+ * //error
+ *
+ * //Get Network status
+ * if(EMAIL_ERROR_NONE == email_get_network_status(&sending,&receiving))
+ * //success
+ * else
+ * //failure
+ *
+ * //Send read report
+ * if(EMAIL_ERROR_NONE == email_send_report(mail ,&handle))
+ * //success
+ * else
+ * //failure
+ * //Save and send
+ *
+ *
+ * if(EMAIL_ERROR_NONE == email_add_mail(mail,NULL,0, NULL, 0))
+ * {
+ * if(EMAIL_ERROR_NONE == email_send_saved(account_id,&option,&handle))
+ * //success
+ * else
+ * //failure
+ * }
+ * //Get Imap mailbox list
+ * if(EMAIL_ERROR_NONE == email_sync_imap_mailbox_list(account_id, &handle))
+ * //success
+ * else
+ * //failure
+ *
+ * }
+ *
+ * @endcode
+ * @}
+
+ */
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @open
+ * @fn email_send_mail(int mail_id, email_option_t* sending_option, unsigned* handle)
+ * @brief Send a mail.This function is invoked when user wants to send a composed mail.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] sending_option Specifies the sending option.
+ * @param[out] handle Specifies the sending handle.
+ * @exception none
+ * @see email_mailbox_t and email_option_t
+ * @remarks N/A
+ */
+EXPORT_API int email_send_mail(int mail_id, email_option_t* sending_option, unsigned* handle);
+
+
+/**
+ * @open
+ * @fn email_sync_header(int input_account_id, int input_mailbox_id, unsigned* handle)
+ * @brief Download header of new emails from mail server.This function is invoked when user wants to download only header of new mails.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_account_id Specifies the account ID.
+ * @param[in] input_mailbox_id Specifies the mailbox ID.
+ * @param[out] handle Specifies the handle for stopping downloading.
+ * @exception none
+ * @see email_mailbox_t
+ * @remarks N/A
+ */
+EXPORT_API int email_sync_header(int input_account_id, int input_mailbox_id, unsigned* handle);
+
+
+/**
+ * @open
+ * @fn email_sync_header_for_all_account(unsigned* handle)
+ * @brief Download header of new emails from mail server for all emails.This function is invoked when user wants to download header of new mails for all accounts.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[out] handle Specifies the handle for stopping downloading.
+ * @exception none
+ * @see none
+ * @remarks N/A
+ */
+EXPORT_API int email_sync_header_for_all_account(unsigned* handle);
+
+
+/**
+ * @open
+ * @fn email_download_body(int mail_id, int with_attachment, unsigned* handle)
+ * @brief Download email body from server.This function is invoked when user wants to download email body with/without attachment based on the option with_attachment
+ * from the server.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] with_attachment Specifies the whether attachment is there or not.
+ * @param[out] handle Specifies the handle for stopping downloading.
+ * @exception none
+ * @see email_mailbox_t
+ * @remarks N/A
+ */
+EXPORT_API int email_download_body(int mail_id, int with_attachment, unsigned* handle);
+
+
+
+
+
+
+/**
+ * @open
+ * @fn email_download_attachment(int mail_id, const char* nth, unsigned* handle);
+ * @brief Download a email nth-attachment from server.This function is invoked if user wants to download only specific attachment of a mail whose body is already downloaded.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] nth Specifies the attachment number been saved. the minimum number is "1".
+ * @param[out] handle Specifies the handle for stopping downloading.
+ * @exception none
+ * @see email_mailbox_t
+ * @remarks N/A
+ */
+EXPORT_API int email_download_attachment(int mail_id, int nth, unsigned* handle);
+
+
+/**
+ * @open
+ * @fn email_cancel_job(int account_id, int handle);
+ * @brief cancel the ongoing job.This function is invoked if user wants to cancel any ongoing job of a specified account.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] input_account_id Specifies the account ID.
+ * @param[in] input_handle Specifies the handle for stopping the operation.
+ * @param[in] input_cancel_type Specifies the type of cancellation.
+ * @exception none
+ * @see none
+ * @remarks N/A
+ */
+
+EXPORT_API int email_cancel_job(int input_account_id, int input_handle, email_cancelation_type input_cancel_type);
+
+
+/**
+ * @open
+ * @fn email_get_pending_job(email_action_t action, int account_id, int mail_id, email_event_status_type_t * status);
+ * @brief get pending job list.This function is invoked if user wants to get the pending job list with status information .
+ * Based on action item of a mail is for a specific account this will give all pending job list.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] account_id Specifies the action of the job.
+ * @param[in] account_id Specifies the account ID.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[out]status Specifies the status of the job.
+ * @exception none
+ * @see email_action_t and email_event_status_type_t
+ * @remarks N/A
+ */
+EXPORT_API int email_get_pending_job(email_action_t action, int account_id, int mail_id, email_event_status_type_t * status);
+
+
+/**
+ * @open
+ * @fn email_get_network_status(int* on_sending, int* on_receiving)
+ * @brief This function gives the current network status.This gives the information to the user whether sending operation is in progress or receiving operation.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[out] on_sending True if sending is in progress.
+ * @param[out] on_receiving True if receivng is in progress.
+ * @exception none
+ * @see none
+ * @remarks N/A
+ */
+EXPORT_API int email_get_network_status(int* on_sending, int* on_receiving);
+
+/**
+ * @open
+ * @fn email_send_saved(int account_id, email_option_t* sending_option, unsigned* handle)
+ * @brief Send all mails to been saved in Offline-mode.This function is invoked when user wants to send an email and after saving it.
+ * This will save the email in draft mailbox and then sends.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] account_id Specifies the account ID.
+ * @param[in] sending_option Specifies the sending option.
+ * @param[out] handle Specifies the handle for stopping sending.
+ * @exception none
+ * @see email_option_t
+ * @remarks N/A
+ */
+EXPORT_API int email_send_saved(int account_id, email_option_t* sending_option, unsigned* handle);
+
+/**
+ * @open
+ * @fn email_sync_imap_mailbox_list(int account_id, unsigned* handle)
+ * @brief fetch all the mailbox names from server and store the non-existing mailboxes in DB.This function is invoked when user wants to download all server mailboxes from IMAP server
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] account_id Specifies the account ID.
+ * @param[out] handle Specifies the handle for stopping Network operation.
+ * @exception none
+ * @see none
+ * @remarks N/A
+ */
+EXPORT_API int email_sync_imap_mailbox_list(int account_id, unsigned* handle);
+
+/**
+ * @open
+ * @fn email_search_mail_on_server(int input_account_id, int input_mailbox_id, email_search_filter_t *input_search_filter_list, int input_search_filter_count, unsigned *output_handle)
+ * @brief Search the mails on server.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] account_id Specifies the Account ID
+ * @param[in] mailbox_id Specifies the Mailbox ID
+ * @param[in] search_type Specifies the searching type(EMAIL_SEARCH_FILTER_SUBJECT, EMAIL_SEARCH_FILTER_SENDER, EMAIL_SEARCH_FILTER_RECIPIENT, EMAIL_SEARCH_FILTER_ALL)
+ * @param[in] search_value Specifies the value to use for searching. (ex : Subject, email address, display name)
+ * @exception none
+ * @see email_search_filter_t,
+ * @code
+ * @endcode
+ * @remarks N/A
+ */
+EXPORT_API int email_search_mail_on_server(int input_account_id, int input_mailbox_id, email_search_filter_t *input_search_filter_list, int input_search_filter_count, unsigned *output_handle);
+
+EXPORT_API int email_clear_result_of_search_mail_on_server(int input_account_id);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/**
+* @}
+*/
+
+
+#endif /* __EMAIL_API_NETWORK_H__ */
diff --git a/email-api/include/email-api-rule.h b/email-api/include/email-api-rule.h
index 71a1ca2..096b98e 100755
--- a/email-api/include/email-api-rule.h
+++ b/email-api/include/email-api-rule.h
@@ -1,218 +1,218 @@
-/*
-* email-service
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
-*
-* 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.
-*
-*/
-
-
-#ifndef __EMAIL_API_RULE_H__
-#define __EMAIL_API_RULE_H__
-
-#include "email-types.h"
-
-/**
-* @defgroup EMAIL_SERVICE Email Service
-* @{
-*/
-
-/**
-* @ingroup EMAIL_SERVICE
-* @defgroup EMAIL_API_RULE Email Rule API
-* @{
-*/
-
- /**
- *
- * This file contains the data structures and interfaces needed for application,
- * to interact with email-service.
- * @file email-api-rule.h
- * @author Kyuho Jo <kyuho.jo@samsung.com>
- * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
- * @version 0.1
- * @brief This file contains the data structures and interfaces of Rule related Functionality provided by
- * email-service .
- * @{
-
- * @code
- * #include "email-api-rule.h"
- * bool
- * other_app_invoke_uniform_api_sample(int* error_code)
- * {
- * int err = EMF_ERROR_NONE;
- * emf_rule_t* rule = NULL;
- * int filter_id = 1;
- * int count = 0;
- *
- * // Get a information of filtering
- * printf("Enter filter Id:\n");
- * scanf("%d",&filter_id);
- *
- * if(EMF_ERROR_NONE == email_get_rule (filter_id,&rule))
- * //success
- * else
- * //failure
- *
- * // Get all filterings
- * if(EMF_ERROR_NONE == email_get_rule_list(&rule,&count))
- * //success
- * else
- * //failure
- *
- *
- * // Add a filter information
- * if(EMF_ERROR_NONE == email_add_rule (rule))
- * //success
- * else
- * //failure
- * err = email_free_rule (&rule,1);
- *
- * // Change a filter information
- * if(EMF_ERROR_NONE == email_update_rule (filter_id,rule))
- * //success
- * else
- * //failure
- * err = email_free_rule (&rule,1);
- *
- * // Delete a filter information
- * printf("Enter filter Id:\n");
- * scanf("%d",&filter_id);
- *
- * if(EMF_ERROR_NONE == email_delete_rule (filter_id))
- * //success
- * else
- * //failure
- *
- * // Free allocated memory
- * if(EMF_ERROR_NONE == email_free_rule (&rule,1))
- * //success
- * else
- * //failure
- *
- * }
- *
- * @endcode
- * @}
- */
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
-
- * @open
- * @fn email_get_rule(int filter_id, emf_rule_t** filtering_set)
- * @brief Get a information of filtering.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure
- * @param[in] filter_id Specifies the filter ID.
- * @param[out] filtering_set The returned information of filter are saved here.
- * @exception #EMF_ERROR-INVALID_PARAM -Invalid argument
- * @see emf_rule_t
- * @remarks N/A
- */
-EXPORT_API int email_get_rule(int filter_id, emf_rule_t** filtering_set);
-
-/**
-
- * @open
- * @fn email_get_rule_list(emf_rule_t** filtering_set, int* count)
- * @brief Get all filterings.This function gives all the filter rules already set before by user.
- * This will provide total number of filter rules available and information of all rules.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure
- * @param[out] filtering_set The returned filterings are saved here.(possibly NULL)
- * @param[out] count The count of returned filters is saved here.(possibly 0)
- * @exception #EMF_ERROR-INVALID_PARAM -Invalid argument
- * @see emf_rule_t
- * @remarks N/A
- */
-EXPORT_API int email_get_rule_list(emf_rule_t** filtering_set, int* count);
-
-/**
-
- * @open
- * @fn email_add_rule(emf_rule_t* filtering_set)
- * @brief Add a filter information.This function is invoked if user wants to add a new filter rule.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] filtering_set Specifies the pointer of adding filter structure.
- * @exception #EMF_ERROR-INVALID_PARAM -Invalid argument
- * @see emf_rule_t
- * @remarks N/A
- */
-EXPORT_API int email_add_rule(emf_rule_t* filtering_set);
-
-/**
-
- * @open
- * @fn email_update_rule(int filter_id, emf_rule_t* new_set)
- * @brief Change a filter information.This function will update the existing filter rule with new information.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure.
- * @param[in] filter_id Specifies the original filter ID.
- * @param[in] new_set Specifies the information of new filter.
- * @exception #EMF_ERROR-INVALID_PARAM -Invalid argument
- * @see emf_rule_t
- * @remarks N/A
- */
-EXPORT_API int email_update_rule(int filter_id, emf_rule_t* new_set);
-
-/**
-
- * @open
- * @fn email_delete_rule(int filter_id)
- * @brief Delete a filter information.This function will delete the exsting filter information by specified filter Id.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure
- * @param[in] filter_id Specifies the filter ID.
- * @exception #EMF_ERROR-INVALID_PARAM -Invalid argument
- * @see none
- * @remarks N/A
- */
-EXPORT_API int email_delete_rule(int filter_id);
-
-
-
-/**
-
- * @open
- * @fn email_free_rule (emf_rule_t** filtering_set, int count)
- * @brief Free allocated memory.
- *
- * @return This function returns EMF_ERROR_NONE on success or error code (refer to EMF_ERROR_XXX) on failure
- * @param[in] filtering_set Specifies the pointer of pointer of filter structure for memory free.
- * @param[in] count Specifies the count of filter.
- * @exception #EMF_ERROR-INVALID_PARAM -Invalid argument
- * @see emf_rule_t
- * @remarks N/A
- */
-EXPORT_API int email_free_rule (emf_rule_t** filtering_set, int count);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-/**
-* @} @}
-*/
-
-
-#endif /* __EMAIL_API_RULE_H__ */
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* 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.
+*
+*/
+
+
+#ifndef __EMAIL_API_RULE_H__
+#define __EMAIL_API_RULE_H__
+
+#include "email-types.h"
+
+/**
+* @defgroup EMAIL_SERVICE Email Service
+* @{
+*/
+
+/**
+* @ingroup EMAIL_SERVICE
+* @defgroup EMAIL_API_RULE Email Rule API
+* @{
+*/
+
+ /**
+ *
+ * This file contains the data structures and interfaces needed for application,
+ * to interact with email-service.
+ * @file email-api-rule.h
+ * @author Kyuho Jo <kyuho.jo@samsung.com>
+ * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
+ * @version 0.1
+ * @brief This file contains the data structures and interfaces of Rule related Functionality provided by
+ * email-service .
+ * @{
+
+ * @code
+ * #include "email-api-rule.h"
+ * bool
+ * other_app_invoke_uniform_api_sample(int* error_code)
+ * {
+ * int err = EMAIL_ERROR_NONE;
+ * email_rule_t* rule = NULL;
+ * int filter_id = 1;
+ * int count = 0;
+ *
+ * // Get a information of filtering
+ * printf("Enter filter Id:\n");
+ * scanf("%d",&filter_id);
+ *
+ * if(EMAIL_ERROR_NONE == email_get_rule (filter_id,&rule))
+ * //success
+ * else
+ * //failure
+ *
+ * // Get all filterings
+ * if(EMAIL_ERROR_NONE == email_get_rule_list(&rule,&count))
+ * //success
+ * else
+ * //failure
+ *
+ *
+ * // Add a filter information
+ * if(EMAIL_ERROR_NONE == email_add_rule (rule))
+ * //success
+ * else
+ * //failure
+ * err = email_free_rule (&rule,1);
+ *
+ * // Change a filter information
+ * if(EMAIL_ERROR_NONE == email_update_rule (filter_id,rule))
+ * //success
+ * else
+ * //failure
+ * err = email_free_rule (&rule,1);
+ *
+ * // Delete a filter information
+ * printf("Enter filter Id:\n");
+ * scanf("%d",&filter_id);
+ *
+ * if(EMAIL_ERROR_NONE == email_delete_rule (filter_id))
+ * //success
+ * else
+ * //failure
+ *
+ * // Free allocated memory
+ * if(EMAIL_ERROR_NONE == email_free_rule (&rule,1))
+ * //success
+ * else
+ * //failure
+ *
+ * }
+ *
+ * @endcode
+ * @}
+ */
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+
+ * @open
+ * @fn email_get_rule(int filter_id, email_rule_t** filtering_set)
+ * @brief Get a information of filtering.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure
+ * @param[in] filter_id Specifies the filter ID.
+ * @param[out] filtering_set The returned information of filter are saved here.
+ * @exception #EMAIL_ERROR-INVALID_PARAM -Invalid argument
+ * @see email_rule_t
+ * @remarks N/A
+ */
+EXPORT_API int email_get_rule(int filter_id, email_rule_t** filtering_set);
+
+/**
+
+ * @open
+ * @fn email_get_rule_list(email_rule_t** filtering_set, int* count)
+ * @brief Get all filterings.This function gives all the filter rules already set before by user.
+ * This will provide total number of filter rules available and information of all rules.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure
+ * @param[out] filtering_set The returned filterings are saved here.(possibly NULL)
+ * @param[out] count The count of returned filters is saved here.(possibly 0)
+ * @exception #EMAIL_ERROR-INVALID_PARAM -Invalid argument
+ * @see email_rule_t
+ * @remarks N/A
+ */
+EXPORT_API int email_get_rule_list(email_rule_t** filtering_set, int* count);
+
+/**
+
+ * @open
+ * @fn email_add_rule(email_rule_t* filtering_set)
+ * @brief Add a filter information.This function is invoked if user wants to add a new filter rule.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] filtering_set Specifies the pointer of adding filter structure.
+ * @exception #EMAIL_ERROR-INVALID_PARAM -Invalid argument
+ * @see email_rule_t
+ * @remarks N/A
+ */
+EXPORT_API int email_add_rule(email_rule_t* filtering_set);
+
+/**
+
+ * @open
+ * @fn email_update_rule(int filter_id, email_rule_t* new_set)
+ * @brief Change a filter information.This function will update the existing filter rule with new information.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
+ * @param[in] filter_id Specifies the original filter ID.
+ * @param[in] new_set Specifies the information of new filter.
+ * @exception #EMAIL_ERROR-INVALID_PARAM -Invalid argument
+ * @see email_rule_t
+ * @remarks N/A
+ */
+EXPORT_API int email_update_rule(int filter_id, email_rule_t* new_set);
+
+/**
+
+ * @open
+ * @fn email_delete_rule(int filter_id)
+ * @brief Delete a filter information.This function will delete the exsting filter information by specified filter Id.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure
+ * @param[in] filter_id Specifies the filter ID.
+ * @exception #EMAIL_ERROR-INVALID_PARAM -Invalid argument
+ * @see none
+ * @remarks N/A
+ */
+EXPORT_API int email_delete_rule(int filter_id);
+
+
+
+/**
+
+ * @open
+ * @fn email_free_rule (email_rule_t** filtering_set, int count)
+ * @brief Free allocated memory.
+ *
+ * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure
+ * @param[in] filtering_set Specifies the pointer of pointer of filter structure for memory free.
+ * @param[in] count Specifies the count of filter.
+ * @exception #EMAIL_ERROR-INVALID_PARAM -Invalid argument
+ * @see email_rule_t
+ * @remarks N/A
+ */
+EXPORT_API int email_free_rule (email_rule_t** filtering_set, int count);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/**
+* @} @}
+*/
+
+
+#endif /* __EMAIL_API_RULE_H__ */
diff --git a/email-api/include/email-api-smime.h b/email-api/include/email-api-smime.h
new file mode 100755
index 0000000..2e46eed
--- /dev/null
+++ b/email-api/include/email-api-smime.h
@@ -0,0 +1,53 @@
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* 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.
+*
+*/
+
+#ifndef __EMAIL_API_SMIME_H__
+#define __EMAIL_API_SMIME_H__
+
+#include "email-types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+EXPORT_API int email_add_certificate(char *certificate_path, char *email_address);
+
+EXPORT_API int email_delete_certificate(char *email_address);
+
+EXPORT_API int email_get_certificate(char *email_address, email_certificate_t **certificate);
+
+EXPORT_API int email_get_decrypt_message(int mail_id, email_mail_data_t **output_mail_data, email_attachment_data_t **output_attachment_data, int *output_attachment_count);
+
+EXPORT_API int email_verify_signature(char *certificate_path, int mail_id, int *verify);
+
+EXPORT_API int email_verify_certificate(char *certificate_path, int *verify);
+
+EXPORT_API int email_get_resolve_recipients(int account_id, char *email_address, unsigned *handle);
+
+EXPORT_API int email_validate_certificate(int account_id, char *email_address, unsigned *handle);
+
+EXPORT_API int email_free_certificate(email_certificate_t **certificate, int count);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __EMAIL_API_SMIME_H__ */
diff --git a/email-api/include/email-api.h b/email-api/include/email-api.h
index 67e7f2d..b7b294d 100755
--- a/email-api/include/email-api.h
+++ b/email-api/include/email-api.h
@@ -1,74 +1,76 @@
-/*
-* email-service
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
-*
-* 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.
-*
-*/
-
-
-#ifndef __EMAIL_API_H__
-#define __EMAIL_API_H__
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "email-types.h"
-#include "email-api-account.h"
-#include "email-api-init.h"
-#include "email-api-mail.h"
-#include "email-api-mailbox.h"
-#include "email-api-network.h"
-#include "email-api-rule.h"
-
-
-/**
-* @defgroup EMAIL_SERVICE Email Service
-* @{
-*/
-
-/**
-* @{
-*/
-
-/**
- *
- * This file contains the data structures and interfaces needed for application,
- * to interact with email-service.
- * @file email-api.h
- * @author Kyuho Jo <kyuho.jo@samsung.com>
- * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
- * @version 0.1
- * @brief This file contains the data structures and interfaces provided by
- * email-service.
- */
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-/**
-* @} @}
-*/
-
-#endif /* __EMAIL_MAPI_H__ */
-
-
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* 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.
+*
+*/
+
+
+#ifndef __EMAIL_API_H__
+#define __EMAIL_API_H__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "email-types.h"
+#include "email-api-account.h"
+#include "email-api-init.h"
+#include "email-api-mail.h"
+#include "email-api-mailbox.h"
+#include "email-api-network.h"
+#include "email-api-rule.h"
+#include "email-api-smime.h"
+#include "email-api-etc.h"
+
+
+/**
+* @defgroup EMAIL_SERVICE Email Service
+* @{
+*/
+
+/**
+* @{
+*/
+
+/**
+ *
+ * This file contains the data structures and interfaces needed for application,
+ * to interact with email-service.
+ * @file email-api.h
+ * @author Kyuho Jo <kyuho.jo@samsung.com>
+ * @author Sunghyun Kwon <sh0701.kwon@samsung.com>
+ * @version 0.1
+ * @brief This file contains the data structures and interfaces provided by
+ * email-service.
+ */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/**
+* @} @}
+*/
+
+#endif /* __EMAIL_MAPI_H__ */
+
+