summaryrefslogtreecommitdiff
path: root/email-api
diff options
context:
space:
mode:
Diffstat (limited to 'email-api')
-rwxr-xr-xemail-api/CMakeLists.txt6
-rwxr-xr-xemail-api/email-api-account.c345
-rwxr-xr-xemail-api/email-api-etc.c147
-rwxr-xr-xemail-api/email-api-init.c55
-rwxr-xr-xemail-api/email-api-mail.c274
-rwxr-xr-xemail-api/email-api-mailbox.c304
-rwxr-xr-xemail-api/email-api-network.c216
-rwxr-xr-xemail-api/email-api-rule.c37
-rwxr-xr-xemail-api/email-api-smime.c238
-rwxr-xr-xemail-api/include/email-api-account.h606
-rwxr-xr-xemail-api/include/email-api-etc.h170
-rwxr-xr-xemail-api/include/email-api-init.h187
-rwxr-xr-xemail-api/include/email-api-mail.h2316
-rwxr-xr-xemail-api/include/email-api-mailbox.h652
-rwxr-xr-xemail-api/include/email-api-network.h578
-rwxr-xr-xemail-api/include/email-api-rule.h308
-rwxr-xr-xemail-api/include/email-api-smime.h248
-rwxr-xr-xemail-api/include/email-api.h24
18 files changed, 3933 insertions, 2778 deletions
diff --git a/email-api/CMakeLists.txt b/email-api/CMakeLists.txt
index 4697005..15ad244 100755
--- a/email-api/CMakeLists.txt
+++ b/email-api/CMakeLists.txt
@@ -14,6 +14,7 @@ MESSAGE(">>> Build type: ${CMAKE_BUILD_TYPE}")
SET(VISIBILITY "-DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\"")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VISIBILITY} -fvisibility=hidden")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--gc-sections")
##########################################################
# Define Email API
@@ -35,15 +36,14 @@ INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/email-api/include
${CMAKE_SOURCE_DIR}/email-api/socket/include
${CMAKE_SOURCE_DIR}/email-ipc/include
+ ${CMAKE_SOURCE_DIR}/email-ipc/email-activation/include
${CMAKE_SOURCE_DIR}/email-core/include
${CMAKE_SOURCE_DIR}/email-core/email-storage/include
${CMAKE_SOURCE_DIR}/email-common-use/include
)
INCLUDE(FindPkgConfig)
-pkg_check_modules(api_pkgs REQUIRED glib-2.0 dlog dbus-1 vconf db-util uw-imap-toolkit)
-
-#pkg_check_modules(api_pkgs REQUIRED glib-2.0 dlog dbus-1 vconf db-util contacts-service2 uw-imap-toolkit)
+pkg_check_modules(api_pkgs REQUIRED glib-2.0 dlog dbus-1 vconf contacts-service2 uw-imap-toolkit gmime-2.6)
FOREACH(flag ${api_pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
diff --git a/email-api/email-api-account.c b/email-api/email-api-account.c
index 7786f1e..c2e7336 100755
--- a/email-api/email-api-account.c
+++ b/email-api/email-api-account.c
@@ -29,7 +29,6 @@
* email-service .
*/
-#include "email-api.h"
#include "string.h"
#include "email-convert.h"
#include "email-api-account.h"
@@ -39,15 +38,17 @@
#include "email-core-utils.h"
#include "email-utilities.h"
#include "email-ipc.h"
+#include "email-dbus-activation.h"
/* API - Adds the Email Account */
EXPORT_API int email_add_account(email_account_t* account)
{
EM_DEBUG_API_BEGIN ("account[%p]", account);
- char* local_account_stream = NULL;
int size = 0;
int err = EMAIL_ERROR_NONE;
int ret_from_ipc = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
+ char* local_account_stream = NULL;
HIPC_API hAPI = NULL;
if (account == NULL || account->user_email_address == NULL || account->incoming_server_user_name == NULL || account->incoming_server_address == NULL||
@@ -56,38 +57,53 @@ EXPORT_API int email_add_account(email_account_t* account)
return EMAIL_ERROR_INVALID_PARAM;
}
- if(emstorage_check_duplicated_account(account, true, &err) == false) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if (!emstorage_check_duplicated_account(multi_user_name, account, true, &err)) {
EM_DEBUG_EXCEPTION("emstorage_check_duplicated_account failed (%d) ", err);
- return err;
+ goto FINISH_OFF;
}
/* composing account information to be added */
hAPI = emipc_create_email_api(_EMAIL_API_ADD_ACCOUNT);
- EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
+ if (hAPI == NULL) {
+ EM_DEBUG_EXCEPTION("emipc_create_email_api failed");
+ err = EMAIL_ERROR_NULL_VALUE;
+ goto FINISH_OFF;
+ }
local_account_stream = em_convert_account_to_byte_stream(account, &size);
- EM_PROXY_IF_NULL_RETURN_VALUE(local_account_stream, hAPI, EMAIL_ERROR_NULL_VALUE);
+ if (local_account_stream == NULL) {
+ EM_DEBUG_EXCEPTION("em_convert_account_to_byte_stream failed");
+ err = EMAIL_ERROR_NULL_VALUE;
+ goto FINISH_OFF;
+ }
- if(!emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, local_account_stream, size)) {
+ if (!emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, local_account_stream, size)) {
EM_DEBUG_EXCEPTION("emipc_add_parameter failed");
- EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
+ err = EMAIL_ERROR_NULL_VALUE;
+ goto FINISH_OFF;
}
EM_DEBUG_LOG("APPID[%d], APIID [%d]", emipc_get_app_id(hAPI), emipc_get_api_id(hAPI));
/* passing account information to service */
- if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
- EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
+ err = EMAIL_ERROR_IPC_SOCKET_FAILURE;
+ goto FINISH_OFF;
}
/* get result from service */
- if( (ret_from_ipc = emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err)) != EMAIL_ERROR_NONE) {
+ if ((ret_from_ipc = emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emipc_get_parameter failed [%d]", ret_from_ipc);
err = ret_from_ipc;
goto FINISH_OFF;
}
- if(err == EMAIL_ERROR_NONE) {
+ if (err == EMAIL_ERROR_NONE) {
emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), &account->account_id);
}
else { /* get error code */
@@ -96,9 +112,11 @@ EXPORT_API int email_add_account(email_account_t* account)
FINISH_OFF:
- if(hAPI)
+ if (hAPI)
emipc_destroy_email_api(hAPI);
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -133,9 +151,11 @@ EXPORT_API int email_free_account(email_account_t** account_list, int count)
EM_SAFE_FREE(p[i].return_address);
EM_SAFE_FREE(p[i].logo_icon_path);
EM_SAFE_FREE(p[i].user_data);
+ EM_SAFE_FREE(p[i].certificate_path);
p[i].user_data_length = 0;
EM_SAFE_FREE(p[i].options.display_name_from);
EM_SAFE_FREE(p[i].options.signature);
+ EM_SAFE_FREE(p[i].options.alert_ringtone_path);
}
free(p); *account_list = NULL;
}
@@ -179,6 +199,7 @@ EXPORT_API int email_delete_account(int account_id)
if(ret != EMAIL_ERROR_NONE) { /* get error code */
emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), &err);
}
+
emipc_destroy_email_api(hAPI);
hAPI = NULL;
@@ -191,7 +212,6 @@ EXPORT_API int email_update_account(int account_id, email_account_t* new_account
{
EM_DEBUG_API_BEGIN ("account_id[%d] new_account[%p]", account_id, new_account);
- int ret = 0;
int size = 0;
int err = EMAIL_ERROR_NONE;
int with_validation = false;
@@ -231,18 +251,14 @@ EXPORT_API int email_update_account(int account_id, email_account_t* new_account
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
}
- emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &ret);
- if(ret != EMAIL_ERROR_NONE) {
- /* get error code */
- emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), &err);
- }
+ emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err);
FINISH_OFF:
emipc_destroy_email_api(hAPI);
hAPI = NULL;
- EM_DEBUG_API_END ("ret[%d] err[%d]", ret, err);
+ EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -251,7 +267,6 @@ EXPORT_API int email_update_account_with_validation(int account_id, email_accoun
{
EM_DEBUG_API_BEGIN ("account_id[%d] new_account[%p]", account_id, new_account);
- int ret = 0;
int size = 0;
int err = EMAIL_ERROR_NONE;
int with_validation = true;
@@ -293,15 +308,12 @@ EXPORT_API int email_update_account_with_validation(int account_id, email_accoun
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
}
- emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &ret);
- if(ret != EMAIL_ERROR_NONE) { /* get error code */
- emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), &err);
- }
+ emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err);
emipc_destroy_email_api(hAPI);
hAPI = NULL;
- EM_DEBUG_API_END ("ret[%d] err[%d]", ret, err);
+ EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -310,17 +322,22 @@ EXPORT_API int email_update_account_with_validation(int account_id, email_accoun
EXPORT_API int email_get_account(int account_id, int pulloption, email_account_t** account)
{
EM_DEBUG_FUNC_BEGIN ("account_id[%d] pulloption[%d]", account_id, pulloption);
- int ret = 0;
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
emstorage_account_tbl_t *account_tbl = NULL;
EM_IF_NULL_RETURN_VALUE(account_id, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(account, EMAIL_ERROR_INVALID_PARAM);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
if (pulloption == GET_FULL_DATA)
pulloption = EMAIL_ACC_GET_OPT_FULL_DATA;
- if (!emstorage_get_account_by_id(account_id, pulloption, &account_tbl, true, &err)) {
+ if (!emstorage_get_account_by_id(multi_user_name, account_id, pulloption, &account_tbl, true, &err)) {
if (err != EMAIL_ERROR_SECURED_STORAGE_FAILURE) {
EM_DEBUG_EXCEPTION("emstorage_get_account_by_id failed - %d", err);
goto FINISH_OFF;
@@ -331,7 +348,7 @@ EXPORT_API int email_get_account(int account_id, int pulloption, email_account_t
EM_DEBUG_LOG("change pulloption : disable password");
}
- if (!emstorage_get_account_by_id(account_id, pulloption, &account_tbl, true, &err)) {
+ if (!emstorage_get_account_by_id(multi_user_name, account_id, pulloption, &account_tbl, true, &err)) {
EM_DEBUG_EXCEPTION("emstorage_get_account_by_id failed - %d", err);
goto FINISH_OFF;
}
@@ -345,13 +362,13 @@ EXPORT_API int email_get_account(int account_id, int pulloption, email_account_t
memset((void*)*account, 0, sizeof(email_account_t));
em_convert_account_tbl_to_account(account_tbl, *account);
-
- ret = true;
-
FINISH_OFF:
+
if (account_tbl)
emstorage_free_account(&account_tbl, 1, NULL);
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_FUNC_END ("err[%d]", err);
return err;
}
@@ -361,14 +378,20 @@ EXPORT_API int email_get_account_list(email_account_t** account_list, int* count
EM_DEBUG_FUNC_BEGIN ();
int err = EMAIL_ERROR_NONE, i = 0;
- emstorage_account_tbl_t *temp_account_tbl = NULL;
+ char *multi_user_name = NULL;
EM_IF_NULL_RETURN_VALUE(account_list, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(count, EMAIL_ERROR_INVALID_PARAM);
- if (!emstorage_get_account_list(count, &temp_account_tbl , true, false, &err)) {
- EM_DEBUG_EXCEPTION("emstorage_get_account_list failed [%d]", err);
+ emstorage_account_tbl_t *temp_account_tbl = NULL;
+
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+ if (!emstorage_get_account_list(multi_user_name, count, &temp_account_tbl , true, false, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_get_account_list failed [%d]", err);
goto FINISH_OFF;
}
@@ -379,6 +402,7 @@ EXPORT_API int email_get_account_list(email_account_t** account_list, int* count
err = EMAIL_ERROR_OUT_OF_MEMORY;
goto FINISH_OFF;
}
+
memset((void*)*account_list, 0, sizeof(email_account_t) * (*count));
for(i = 0; i < (*count); i++)
em_convert_account_tbl_to_account(temp_account_tbl + i, (*account_list) + i);
@@ -386,9 +410,11 @@ EXPORT_API int email_get_account_list(email_account_t** account_list, int* count
FINISH_OFF:
-
if(temp_account_tbl)
emstorage_free_account(&temp_account_tbl, (*count), NULL);
+
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_FUNC_END ("err[%d]", err);
return err;
@@ -488,6 +514,8 @@ EXPORT_API int email_add_account_with_validation(email_account_t* account, int *
int ret = -1;
int size = 0;
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
+ HIPC_API hAPI = NULL;
if (account == NULL || account->user_email_address == NULL || account->incoming_server_user_name == NULL || account->incoming_server_address == NULL||
account->outgoing_server_user_name == NULL || account->outgoing_server_address == NULL) {
@@ -495,25 +523,41 @@ EXPORT_API int email_add_account_with_validation(email_account_t* account, int *
return EMAIL_ERROR_INVALID_PARAM;
}
- if(emstorage_check_duplicated_account(account, true, &err) == false) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ return err;
+ }
+
+ if(emstorage_check_duplicated_account(multi_user_name, account, true, &err) == false) {
EM_DEBUG_EXCEPTION("emstorage_check_duplicated_account failed (%d) ", err);
- return err;
+ goto FINISH_OFF;
}
/* create account information */
- HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_ADD_ACCOUNT_WITH_VALIDATION);
- EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
+ hAPI = emipc_create_email_api(_EMAIL_API_ADD_ACCOUNT_WITH_VALIDATION);
+ if (hAPI == NULL) {
+ EM_DEBUG_EXCEPTION("emipc_create_email_api failed");
+ err = EMAIL_ERROR_NULL_VALUE;
+ goto FINISH_OFF;
+ }
local_account_stream = em_convert_account_to_byte_stream(account, &size);
- EM_PROXY_IF_NULL_RETURN_VALUE(local_account_stream, hAPI, EMAIL_ERROR_NULL_VALUE);
+ if (local_account_stream == NULL) {
+ EM_DEBUG_EXCEPTION("em_convert_account_to_byte_stream failed");
+ err = EMAIL_ERROR_NULL_VALUE;
+ goto FINISH_OFF;
+ }
+
if(!emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, local_account_stream, size)) {
EM_DEBUG_EXCEPTION(" emipc_add_parameter failed ");
- EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
+ err = EMAIL_ERROR_NULL_VALUE;
+ goto FINISH_OFF;
}
if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION(" emipc_execute_proxy_api failed ");
- EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
+ err = EMAIL_ERROR_IPC_SOCKET_FAILURE;
+ goto FINISH_OFF;
}
emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &ret);
@@ -525,8 +569,14 @@ EXPORT_API int email_add_account_with_validation(email_account_t* account, int *
emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), &err);
}
- emipc_destroy_email_api(hAPI);
- hAPI = NULL;
+FINISH_OFF:
+
+ if (hAPI) {
+ emipc_destroy_email_api(hAPI);
+ hAPI = NULL;
+ }
+
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
@@ -547,29 +597,46 @@ EXPORT_API int email_backup_accounts_into_secure_storage(const char *file_name)
}
HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_BACKUP_ACCOUNTS);
-
EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
+ /* Checked the existed account */
+ int account_count = 0;
+
+ if (!emstorage_get_account_count(NULL, &account_count, false, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_get_account_count failed - %d", err);
+ goto FINISH_OFF;
+ }
+
+ if (account_count == 0) {
+ EM_DEBUG_LOG("Account is empty");
+ err = EMAIL_ERROR_ACCOUNT_NOT_FOUND;
+ goto FINISH_OFF;
+ }
+
/* file_name */
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)file_name, EM_SAFE_STRLEN(file_name)+1)) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)file_name, EM_SAFE_STRLEN(file_name)+1)) {
EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed ");
- EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
+ err = EMAIL_ERROR_NULL_VALUE;
+ goto FINISH_OFF;
}
- if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION(" emipc_execute_proxy_api failed ");
- EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
+ err = EMAIL_ERROR_IPC_SOCKET_FAILURE;
+ goto FINISH_OFF;
}
emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &ret);
- if(0 == ret) { /* get error code */
+ if (ret == false) { /* get error code */
emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), &err);
}
- emipc_destroy_email_api(hAPI);
+FINISH_OFF:
+ emipc_destroy_email_api(hAPI);
hAPI = NULL;
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -580,30 +647,26 @@ EXPORT_API int email_restore_accounts_from_secure_storage(const char * file_name
int ret = 0;
int err = EMAIL_ERROR_NONE;
- if (!file_name) {
- EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
- err = EMAIL_ERROR_INVALID_PARAM;
- return err;
- }
-
HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_RESTORE_ACCOUNTS);
EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
/* file_name */
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)file_name, EM_SAFE_STRLEN(file_name)+1)) {
- EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed ");
- EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
+ if (file_name) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)file_name, EM_SAFE_STRLEN(file_name)+1)) {
+ EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed ");
+ EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
+ }
}
- if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION(" emipc_execute_proxy_api failed ");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
}
emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &ret);
- if(0==ret) { /* get error code */
+ if (0 == ret) { /* get error code */
emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), &err);
}
@@ -614,12 +677,11 @@ EXPORT_API int email_restore_accounts_from_secure_storage(const char * file_name
return err;
}
-EXPORT_API int email_get_password_length_of_account(const int account_id, int *password_length)
+EXPORT_API int email_get_password_length_of_account(int account_id, email_get_password_length_type password_type, int *password_length)
{
EM_DEBUG_API_BEGIN ("account_id[%d] password_length[%p]", account_id, password_length);
int ret = 0;
int err = EMAIL_ERROR_NONE;
- int password_type = 1;
if (account_id <= 0 || password_length == NULL) {
EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
@@ -659,48 +721,11 @@ EXPORT_API int email_get_password_length_of_account(const int account_id, int *p
return err;
}
-EXPORT_API int email_query_server_info(const char* domain_name, email_server_info_t **result_server_info)
+EXPORT_API int email_update_notification_bar(int account_id, int total_mail_count, int unread_mail_count, int input_from_eas)
{
- EM_DEBUG_API_BEGIN ("domain_name[%p] result_server_info[%p]", domain_name, result_server_info);
+ EM_DEBUG_API_BEGIN ("account_id[%d] total_mail_count[%d] unread_mail_count[%d]", account_id, total_mail_count, unread_mail_count);
int err = EMAIL_ERROR_NONE;
- if (!domain_name || !result_server_info) {
- EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
- err = EMAIL_ERROR_INVALID_PARAM;
- return err;
- }
-
- err = emcore_query_server_info(domain_name, result_server_info);
-
- EM_DEBUG_API_END ("err[%d]", err);
- return err;
-}
-
-
-EXPORT_API int email_free_server_info(email_server_info_t **result_server_info)
-{
- EM_DEBUG_API_BEGIN ("result_server_info[%p]", result_server_info);
- int err = EMAIL_ERROR_NONE;
-
- if (!result_server_info) {
- EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
- err = EMAIL_ERROR_INVALID_PARAM;
- return err;
- }
-
- err = emcore_free_server_info(result_server_info);
-
- EM_DEBUG_API_END ("ret[%d]", err);
- return err;
-}
-
-EXPORT_API int email_update_notification_bar(int account_id)
-{
- EM_DEBUG_API_BEGIN("account_id [%d]", account_id);
- int err = EMAIL_ERROR_NONE;
- int total_mail_count = 0;
- int unread_mail_count = 0;
-
if (account_id == 0) {
EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
err = EMAIL_ERROR_INVALID_PARAM;
@@ -728,6 +753,14 @@ EXPORT_API int email_update_notification_bar(int account_id)
EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
+
+ /* input_from_eas */
+ if(!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&input_from_eas, sizeof(int))) {
+ EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed");
+ EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
+ }
+
+
if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION(" emipc_execute_proxy_api failed ");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
@@ -741,15 +774,65 @@ EXPORT_API int email_update_notification_bar(int account_id)
return err;
}
-
EXPORT_API int email_clear_all_notification_bar()
{
- EM_DEBUG_FUNC_BEGIN ();
+ EM_DEBUG_API_BEGIN ();
int err = EMAIL_ERROR_NONE;
+ int account_id = ALL_ACCOUNT;
- err = emcore_clear_all_notifications();
+ HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_CLEAR_NOTIFICATION_BAR);
- EM_DEBUG_FUNC_END ("ret[%d]", err);
+ EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
+
+ /* account_id */
+ if(!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&account_id, sizeof(int))) {
+ EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed");
+ EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
+ }
+
+ if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION(" emipc_execute_proxy_api failed ");
+ EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
+ }
+
+ emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err);
+ emipc_destroy_email_api(hAPI);
+
+ hAPI = NULL;
+ EM_DEBUG_API_END ("ret[%d]", err);
+ return err;
+}
+
+EXPORT_API int email_clear_notification_bar(int account_id)
+{
+ EM_DEBUG_API_BEGIN ();
+ int err = EMAIL_ERROR_NONE;
+
+ if (account_id < ALL_ACCOUNT) {
+ EM_DEBUG_EXCEPTION ("EMAIL_ERROR_INVALID_PARAM");
+ return EMAIL_ERROR_INVALID_PARAM;
+ }
+
+ HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_CLEAR_NOTIFICATION_BAR);
+
+ EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
+
+ /* account_id */
+ if(!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&account_id, sizeof(int))) {
+ EM_DEBUG_EXCEPTION(" emipc_add_parameter account_id failed");
+ EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
+ }
+
+ if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION(" emipc_execute_proxy_api failed ");
+ EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
+ }
+
+ emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err);
+ emipc_destroy_email_api(hAPI);
+
+ hAPI = NULL;
+ EM_DEBUG_API_END ("ret[%d]", err);
return err;
}
@@ -758,8 +841,29 @@ EXPORT_API int email_save_default_account_id(int input_account_id)
EM_DEBUG_API_BEGIN ("input_account_id [%d]", input_account_id);
int err = EMAIL_ERROR_NONE;
- err = emcore_save_default_account_id(input_account_id);
+ if (input_account_id < ALL_ACCOUNT) {
+ EM_DEBUG_EXCEPTION ("EMAIL_ERROR_INVALID_PARAM");
+ return EMAIL_ERROR_INVALID_PARAM;
+ }
+
+ HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_SAVE_DEFAULT_ACCOUNT_ID);
+ EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
+
+ /* Input account ID */
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char *)&input_account_id, sizeof(int))) {
+ EM_DEBUG_EXCEPTION("emipc_add_parameter input_account_id failed");
+ EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
+ }
+ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
+ EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
+ }
+
+ emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err);
+ emipc_destroy_email_api(hAPI);
+
+ hAPI = NULL;
EM_DEBUG_API_END ("ret[%d]", err);
return err;
}
@@ -767,9 +871,30 @@ EXPORT_API int email_save_default_account_id(int input_account_id)
EXPORT_API int email_load_default_account_id(int *output_account_id)
{
EM_DEBUG_FUNC_BEGIN ("output_account_id[%p]", output_account_id);
+
int err = EMAIL_ERROR_NONE;
+ int account_id = 0;
+
+ EM_IF_NULL_RETURN_VALUE(output_account_id, EMAIL_ERROR_INVALID_PARAM);
+
+ HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_LOAD_DEFAULT_ACCOUNT_ID);
+ EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
+
+ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
+ EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
+ }
+
+ emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err);
+
+ if (err == EMAIL_ERROR_NONE) {
+ emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), &account_id);
+ }
+
+ emipc_destroy_email_api(hAPI);
+ hAPI = NULL;
- err = emcore_load_default_account_id(output_account_id);
+ *output_account_id = account_id;
EM_DEBUG_FUNC_END ("ret[%d]", err);
return err;
diff --git a/email-api/email-api-etc.c b/email-api/email-api-etc.c
index 4c5a1cd..8b046c2 100755
--- a/email-api/email-api-etc.c
+++ b/email-api/email-api-etc.c
@@ -28,7 +28,6 @@
* @brief This file contains the data structures and interfaces of functionalities provided by email-service .
*/
-#include "email-api.h"
#include "email-types.h"
#include "email-ipc.h"
#include "email-debug-log.h"
@@ -37,13 +36,14 @@
#include "email-core-mime.h"
#include "email-convert.h"
#include "email-utilities.h"
+#include "email-core-gmime.h"
EXPORT_API int email_show_user_message(int id, email_action_t action, int error_code)
{
EM_DEBUG_API_BEGIN ("id[%d] action[%d] error_code[%d]", id, action, error_code);
int err = EMAIL_ERROR_NONE;
- if(id < 0 || action < 0) {
+ if (id < 0 || action < 0) {
EM_DEBUG_LOG("EMAIL_ERROR_INVALID_PARAM");
return EMAIL_ERROR_INVALID_PARAM;
}
@@ -51,24 +51,24 @@ EXPORT_API int email_show_user_message(int id, email_action_t action, int error_
HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_SHOW_USER_MESSAGE);
/* id */
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&id, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&id, sizeof(int))) {
EM_DEBUG_LOG("emipc_add_parameter failed ");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
/* action */
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&action, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&action, sizeof(int))) {
EM_DEBUG_LOG("emipc_add_parameter failed ");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
/* error_code */
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&error_code, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, (char*)&error_code, sizeof(int))) {
EM_DEBUG_LOG("emipc_add_parameter failed ");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(!emipc_execute_proxy_api(hAPI)) {
+ if (!emipc_execute_proxy_api(hAPI)) {
EM_DEBUG_LOG("ipcProxy_ExecuteAsyncAPI failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
}
@@ -82,30 +82,32 @@ EXPORT_API int email_show_user_message(int id, email_action_t action, int error_
return err;
}
-EXPORT_API int email_parse_mime_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_parse_mime_file(char *eml_file_path, email_mail_data_t **output_mail_data,
+ email_attachment_data_t **output_attachment_data, int *output_attachment_count)
{
- EM_DEBUG_API_BEGIN ("eml_file_path[%p] output_mail_data[%p] output_attachment_data[%p]", eml_file_path, output_mail_data, output_attachment_data);
+ EM_DEBUG_API_BEGIN ("eml_file_path[%p] output_mail_data[%p] output_attachment_data[%p]",
+ eml_file_path, output_mail_data, output_attachment_data);
int err = EMAIL_ERROR_NONE;
EM_IF_NULL_RETURN_VALUE(eml_file_path, EMAIL_ERROR_INVALID_PARAM);
- if (!emcore_parse_mime_file_to_mail(eml_file_path, output_mail_data, output_attachment_data, output_attachment_count, &err) || !*output_mail_data)
+ if (!emcore_parse_mime_file_to_mail(eml_file_path, output_mail_data, output_attachment_data,
+ output_attachment_count, &err) || !*output_mail_data)
EM_DEBUG_EXCEPTION("emcore_parse_mime_file_to_mail failed [%d]", err);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
-EXPORT_API int email_write_mime_file(email_mail_data_t *input_mail_data, email_attachment_data_t *input_attachment_data, int input_attachment_count, char **output_file_path)
+EXPORT_API int email_write_mime_file(email_mail_data_t *input_mail_data,
+ email_attachment_data_t *input_attachment_data,
+ int input_attachment_count, char **output_file_path)
{
- EM_DEBUG_API_BEGIN ("input_mail_data[%p] input_attachment_data[%p] input_attachment_count[%d]", input_mail_data, input_attachment_data, input_attachment_count);
-
- int err = EMAIL_ERROR_NONE;
- int size = 0;
- int *ret_nth_value = 0;
- char *p_output_file_path = NULL;
- char *mail_data_stream = NULL;
- char *attachment_data_list_stream = NULL;
+ EM_DEBUG_API_BEGIN ("input_mail_data[%p] input_attachment_data[%p] input_attachment_count[%d]",
+ input_mail_data, input_attachment_data, input_attachment_count);
+
+ int err = EMAIL_ERROR_NONE;
+ int ret_from_ipc = EMAIL_ERROR_NONE;
HIPC_API hAPI = NULL;
EM_IF_NULL_RETURN_VALUE(input_mail_data, EMAIL_ERROR_INVALID_PARAM);
@@ -118,75 +120,29 @@ EXPORT_API int email_write_mime_file(email_mail_data_t *input_mail_data, email_a
goto FINISH_OFF;
}
- mail_data_stream = em_convert_mail_data_to_byte_stream(input_mail_data, &size);
- if (!mail_data_stream) {
- EM_DEBUG_EXCEPTION("em_convert_mail_data_to_byte_stream failed");
- err = EMAIL_ERROR_NULL_VALUE;
- goto FINISH_OFF;
- }
-
- if (!emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, mail_data_stream, size)) {
- EM_DEBUG_EXCEPTION("emipc_add_dynamic_parameter failed");
- err = EMAIL_ERROR_OUT_OF_MEMORY;
- goto FINISH_OFF;
- }
-
- attachment_data_list_stream = em_convert_attachment_data_to_byte_stream(input_attachment_data, input_attachment_count, &size);
- if ((size > 0) && !emipc_add_dynamic_parameter(hAPI, ePARAMETER_IN, attachment_data_list_stream, size)) {
- EM_DEBUG_EXCEPTION("emipc_add_dynamic_parameter failed");
- err = EMAIL_ERROR_OUT_OF_MEMORY;
+ if (!emipc_execute_proxy_api(hAPI)) {
+ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
+ err = EMAIL_ERROR_IPC_SOCKET_FAILURE;
goto FINISH_OFF;
}
- if (*output_file_path && (size = EM_SAFE_STRLEN(*output_file_path)) > 0) {
- EM_DEBUG_LOG_SEC("output_file_path : [%s] size : [%d]", *output_file_path, size);
- size = size + 1;
- } else {
- size = 0;
- }
- if (!emipc_add_parameter(hAPI, ePARAMETER_IN, *output_file_path, size)) {
- EM_DEBUG_EXCEPTION("emipc_add_dynamic_parameter failed");
- err = EMAIL_ERROR_OUT_OF_MEMORY;
- goto FINISH_OFF;
- }
-
- if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
- EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
- err = EMAIL_ERROR_IPC_SOCKET_FAILURE;
+ if ((ret_from_ipc = emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_parameter failed:[%d]", ret_from_ipc);
+ err = ret_from_ipc;
goto FINISH_OFF;
}
- if ((ret_nth_value = (int*)emipc_get_nth_parameter_data(hAPI, ePARAMETER_OUT, 0))) {
- err = *ret_nth_value;
-
- if (err == EMAIL_ERROR_NONE) {
- size = emipc_get_parameter_length(hAPI, ePARAMETER_OUT, 1);
- if (size > 0) {
- p_output_file_path = (char *)em_malloc(size);
- if (p_output_file_path == NULL) {
- err = EMAIL_ERROR_OUT_OF_MEMORY;
- goto FINISH_OFF;
- }
-
- if ((err = emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, size, p_output_file_path)) != EMAIL_ERROR_NONE) {
- EM_DEBUG_EXCEPTION("emipc_get_parameter failed : [%d]", err);
- goto FINISH_OFF;
- }
- }
- }
+ if (!emcore_make_rfc822_file(NULL, input_mail_data, input_attachment_data, input_attachment_count, false,
+ output_file_path, &err)) {
+ EM_DEBUG_EXCEPTION("emcore_make_rfc822_file failed : [%d]", err);
}
- EM_SAFE_FREE(*output_file_path);
- *output_file_path = EM_SAFE_STRDUP(p_output_file_path);
-
FINISH_OFF:
if (hAPI)
emipc_destroy_email_api(hAPI);
- EM_SAFE_FREE(p_output_file_path);
-
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -195,12 +151,20 @@ EXPORT_API int email_delete_parsed_data(email_mail_data_t *input_mail_data)
{
EM_DEBUG_API_BEGIN ("mail_data[%p]", input_mail_data);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
EM_IF_NULL_RETURN_VALUE(input_mail_data, EMAIL_ERROR_INVALID_PARAM);
- if (!emcore_delete_parsed_data(input_mail_data, &err))
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ return err;
+ }
+
+ if (!emcore_delete_parsed_data(multi_user_name, input_mail_data, &err))
EM_DEBUG_EXCEPTION("emcore_delete_parsed_data failed [%d]", err);
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -219,4 +183,39 @@ EXPORT_API int email_get_mime_entity(char *mime_path, char **mime_entity)
return err;
}
+EXPORT_API int email_verify_email_address(char *input_email_address)
+{
+ EM_DEBUG_API_BEGIN ("input_email_address[%p]", input_email_address);
+ int err = EMAIL_ERROR_NONE;
+
+ EM_IF_NULL_RETURN_VALUE(input_email_address, EMAIL_ERROR_INVALID_PARAM);
+
+ if ((err = em_verify_email_address (input_email_address)) != EMAIL_ERROR_NONE)
+ EM_DEBUG_EXCEPTION("em_verify_email_address failed [%d]", err);
+
+ EM_DEBUG_API_END("err [%d]", err);
+ return err;
+}
+
+EXPORT_API int email_convert_mutf7_to_utf8(const char *mutf7_str, char **utf8_str)
+{
+ EM_DEBUG_API_BEGIN ("mutf7_str[%p]", mutf7_str);
+ int err = EMAIL_ERROR_NONE;
+
+ EM_IF_NULL_RETURN_VALUE(mutf7_str, EMAIL_ERROR_INVALID_PARAM);
+ emcore_gmime_init();
+
+ char *tmp_mutf7_str = g_strdup(mutf7_str);
+ *utf8_str = emcore_convert_mutf7_to_utf8(tmp_mutf7_str);
+ if (!(*utf8_str) || EM_SAFE_STRLEN(*utf8_str) == 0) {
+ EM_DEBUG_EXCEPTION("emcore_convert_mutf7_to_utf8 failed");
+ err = EMAIL_ERROR_UNKNOWN;
+ }
+ EM_SAFE_FREE(tmp_mutf7_str);
+
+ emcore_gmime_shutdown();
+
+ EM_DEBUG_API_END ("ret[%d]", err);
+ return err;
+}
diff --git a/email-api/email-api-init.c b/email-api/email-api-init.c
index f6a1efd..2adb5fb 100755
--- a/email-api/email-api-init.c
+++ b/email-api/email-api-init.c
@@ -30,26 +30,35 @@
* email-service .
*/
-#include "email-api.h"
#include "string.h"
#include "email-convert.h"
#include "email-storage.h"
#include "email-ipc.h"
#include "email-core-task-manager.h"
+#include "email-core-account.h"
#include "email-utilities.h"
+#include "email-dbus-activation.h"
+#include "email-core-container.h"
#include <sqlite3.h>
-
+#include <gio/gio.h>
EXPORT_API int email_open_db(void)
{
EM_DEBUG_API_BEGIN ();
int error = EMAIL_ERROR_NONE;
-
- if (emstorage_db_open(&error) == NULL)
+ char *multi_user_name = NULL;
+
+ if ((error = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", error);
+ return error;
+ }
+
+ if (emstorage_db_open(multi_user_name, &error) == NULL)
EM_DEBUG_EXCEPTION("emstorage_db_open failed [%d]", error);
-
- EM_DEBUG_API_END ("err[%d]", error);
+ EM_SAFE_FREE(multi_user_name);
+
+ EM_DEBUG_API_END ("error[%d]", error);
return error;
}
@@ -57,11 +66,19 @@ EXPORT_API int email_close_db(void)
{
EM_DEBUG_API_BEGIN ();
int error = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
+
+ if ((error = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", error);
+ return error;
+ }
- if ( !emstorage_db_close(&error))
+ if (!emstorage_db_close(multi_user_name, &error))
EM_DEBUG_EXCEPTION("emstorage_db_close failed [%d]", error);
- EM_DEBUG_API_END ("err[%d]", error);
+ EM_SAFE_FREE(multi_user_name);
+
+ EM_DEBUG_API_END ("error[%d]", error);
return error;
}
@@ -81,12 +98,18 @@ EXPORT_API int email_service_begin(void)
return ret;
}
+extern GCancellable *cancel;
EXPORT_API int email_service_end(void)
{
EM_DEBUG_API_BEGIN ();
int ret = -1;
-
+
+ if (cancel) {
+ g_cancellable_cancel (cancel);
+ while (cancel) usleep(1000000);
+ }
+
ret = emipc_finalize_proxy();
EM_DEBUG_API_END ("err[%d]", ret);
@@ -101,12 +124,20 @@ EXPORT_API int email_init_storage(void)
{
EM_DEBUG_API_BEGIN ();
int error = EMAIL_ERROR_NONE;
-
- if (!emstorage_create_table(EMAIL_CREATE_DB_CHECK, &error)) {
+ char *multi_user_name = NULL;
+
+ if ((error = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", error);
+ return error;
+ }
+
+ if (!emstorage_create_table(multi_user_name, EMAIL_CREATE_DB_NORMAL, &error)) {
EM_DEBUG_EXCEPTION("emstorage_create_table failed [%d]", error);
}
- EM_DEBUG_API_END ("err[%d]", error);
+ EM_SAFE_FREE(multi_user_name);
+
+ EM_DEBUG_API_END ("error[%d]", error);
return error;
}
diff --git a/email-api/email-api-mail.c b/email-api/email-api-mail.c
index 80a3a18..524da69 100755
--- a/email-api/email-api-mail.c
+++ b/email-api/email-api-mail.c
@@ -33,8 +33,9 @@
#include <stdlib.h>
#include <time.h>
#include <string.h>
-#include "email-api.h"
#include "email-ipc.h"
+#include "email-api-init.h"
+#include "email-api-mailbox.h"
#include "email-convert.h"
#include "email-core-tasks.h"
#include "email-core-utils.h"
@@ -46,7 +47,6 @@
#include "email-core-signal.h"
#include "email-utilities.h"
#include "email-core-smime.h"
-#include "db-util.h"
#define DIR_SEPERATOR_CH '/'
@@ -71,14 +71,20 @@ EXPORT_API int email_add_mail(email_mail_data_t *input_mail_data, email_attachme
int *ret_nth_value = NULL;
int size = 0;
char *rfc822_file = NULL;
+ char *multi_user_name = NULL;
char *mail_data_stream = NULL;
char *attachment_data_list_stream = NULL;
char *meeting_request_stream = NULL;
HIPC_API hAPI = NULL;
-
+
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
if(input_from_eas == 0) { /* native emails */
if ((input_mail_data->smime_type != EMAIL_SMIME_NONE) && (input_mail_data->mailbox_type != EMAIL_MAILBOX_TYPE_DRAFT)) {
- if (!emcore_make_rfc822_file(input_mail_data, input_attachment_data_list, input_attachment_count, &rfc822_file, &err)) {
+ if (!emcore_make_rfc822_file(multi_user_name, input_mail_data, input_attachment_data_list, input_attachment_count, true, &rfc822_file, &err)) {
EM_DEBUG_EXCEPTION("emcore_make_rfc822_file failed [%d]", err);
goto FINISH_OFF;
}
@@ -166,7 +172,7 @@ EXPORT_API int email_add_mail(email_mail_data_t *input_mail_data, email_attachme
goto FINISH_OFF;
}
} else { /* take care of mails from eas */
- err = emcore_add_mail(input_mail_data, input_attachment_data_list, input_attachment_count, input_meeting_request, input_from_eas, false);
+ err = emcore_add_mail(multi_user_name, input_mail_data, input_attachment_data_list, input_attachment_count, input_meeting_request, input_from_eas, false);
if(err != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emcore_add_mail failed [%d]", err);
goto FINISH_OFF;
@@ -174,9 +180,11 @@ EXPORT_API int email_add_mail(email_mail_data_t *input_mail_data, email_attachme
}
FINISH_OFF:
+
if(hAPI)
emipc_destroy_email_api(hAPI);
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
@@ -224,7 +232,7 @@ EXPORT_API int email_add_read_receipt(int input_read_mail_id, int *output_receip
#define TMP_BODY_PATH "/tmp/UTF-8"
-int email_create_db_full()
+EXPORT_API int email_create_db_full()
{
int mailbox_index, mail_index, mailbox_count, mail_slot_size;
int account_id = 0;
@@ -239,15 +247,14 @@ int email_create_db_full()
return err;
}
- if ((err = emcore_load_default_account_id(&account_id)) != EMAIL_ERROR_NONE) {
+ if ((err = emcore_load_default_account_id(NULL, &account_id)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emcore_load_default_account_id failed : [%d]", err);
goto FINISH_OFF;
}
- body_file = fopen(TMP_BODY_PATH, "w");
- if (body_file == NULL) {
- EM_DEBUG_EXCEPTION("fopen failed");
- err = EMAIL_ERROR_SYSTEM_FAILURE;
+ err = em_fopen(TMP_BODY_PATH, "w", &body_file);
+ if (err != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("em_fopen failed : [%s][%d]", TMP_BODY_PATH, err);
goto FINISH_OFF;
}
@@ -275,7 +282,8 @@ int email_create_db_full()
sprintf(mail_table_data.subject, "Subject #%d",mail_index);
mail_table_data.mailbox_id = mailbox_list[mailbox_index].mailbox_id;
mail_table_data.mailbox_type = mailbox_list[mailbox_index].mailbox_type;
- if( !emstorage_add_mail(&mail_table_data, 1, true, &err)) {
+
+ if( !emstorage_add_mail(NULL, &mail_table_data, 1, true, &err)) {
EM_DEBUG_EXCEPTION("emstorage_add_mail failed [%d]",err);
goto FINISH_OFF;
@@ -296,6 +304,7 @@ FINISH_OFF:
EM_SAFE_FREE(mail_table_data.subject);
EM_SAFE_FREE(mail_table_data.full_address_from);
EM_SAFE_FREE(mail_table_data.full_address_to);
+ EM_SAFE_FREE(mail_table_data.file_path_plain);
return err;
}
@@ -391,7 +400,7 @@ EXPORT_API int email_update_mail(email_mail_data_t *input_mail_data, email_attac
}
}
else {
- if( (err = emcore_update_mail(input_mail_data, input_attachment_data_list, input_attachment_count, input_meeting_request, input_from_eas)) != EMAIL_ERROR_NONE) {
+ if( (err = emcore_update_mail(NULL, input_mail_data, input_attachment_data_list, input_attachment_count, input_meeting_request, input_from_eas)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emcore_update_mail failed [%d]", err);
goto FINISH_OFF;
}
@@ -478,6 +487,7 @@ EXPORT_API int email_count_mail(email_list_filter_t *input_filter_list, int inpu
int total_count = 0;
int unread = 0;
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
char *conditional_clause_string = NULL;
EM_IF_NULL_RETURN_VALUE(input_filter_list, EMAIL_ERROR_INVALID_PARAM);
@@ -485,12 +495,17 @@ EXPORT_API int email_count_mail(email_list_filter_t *input_filter_list, int inpu
EM_IF_NULL_RETURN_VALUE(output_total_mail_count, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(output_unseen_mail_count, EMAIL_ERROR_INVALID_PARAM);
- if( (err = emstorage_write_conditional_clause_for_getting_mail_list(input_filter_list, input_filter_count, NULL, 0, -1, -1, &conditional_clause_string)) != EMAIL_ERROR_NONE) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if ((err = emstorage_write_conditional_clause_for_getting_mail_list(multi_user_name, input_filter_list, input_filter_count, NULL, 0, -1, -1, &conditional_clause_string)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emstorage_write_conditional_clause_for_getting_mail_list failed[%d]", err);
goto FINISH_OFF;
}
- if ((err = emstorage_query_mail_count(conditional_clause_string, true, &total_count, &unread)) != EMAIL_ERROR_NONE) {
+ if ((err = emstorage_query_mail_count(multi_user_name, conditional_clause_string, true, &total_count, &unread)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emstorage_query_mail_count failed [%d]", err);
goto FINISH_OFF;
}
@@ -500,6 +515,8 @@ EXPORT_API int email_count_mail(email_list_filter_t *input_filter_list, int inpu
FINISH_OFF:
+ EM_SAFE_FREE(multi_user_name);
+ EM_SAFE_FREE (conditional_clause_string); /* detected by valgrind */
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -743,14 +760,19 @@ EXPORT_API int email_query_mails(char *conditional_clause_string, email_mail_dat
EM_DEBUG_API_BEGIN ("conditional_clause_string[%s] mail_list[%p] result_count[%p]", conditional_clause_string, mail_list, result_count);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
emstorage_mail_tbl_t *result_mail_tbl = NULL;
EM_IF_NULL_RETURN_VALUE(result_count, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(conditional_clause_string, EMAIL_ERROR_INVALID_PARAM);
- if (!emstorage_query_mail_tbl(conditional_clause_string, true, &result_mail_tbl, result_count, &err)) {
- EM_DEBUG_EXCEPTION("emstorage_query_mail_list failed [%d]", err);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed :[%d]", err);
+ goto FINISH_OFF;
+ }
+ if (!emstorage_query_mail_tbl(multi_user_name, conditional_clause_string, true, &result_mail_tbl, result_count, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_query_mail_list failed [%d]", err);
goto FINISH_OFF;
}
@@ -760,9 +782,12 @@ EXPORT_API int email_query_mails(char *conditional_clause_string, email_mail_dat
}
FINISH_OFF:
+
if(result_mail_tbl && !emstorage_free_mail(&result_mail_tbl, *result_count, NULL))
EM_DEBUG_EXCEPTION("emstorage_free_mail failed");
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -772,16 +797,24 @@ EXPORT_API int email_query_mail_list(char *input_conditional_clause_string, emai
EM_DEBUG_API_BEGIN ("input_conditional_clause_string[%s] output_mail_list[%p] output_result_count[%p]", input_conditional_clause_string, output_mail_list, output_result_count);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
EM_IF_NULL_RETURN_VALUE(input_conditional_clause_string, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(output_result_count, EMAIL_ERROR_INVALID_PARAM);
- if (!emstorage_query_mail_list(input_conditional_clause_string, true, output_mail_list, output_result_count, &err)) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed :[%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if (!emstorage_query_mail_list(multi_user_name, input_conditional_clause_string, true, output_mail_list, output_result_count, &err)) {
EM_DEBUG_EXCEPTION("emstorage_query_mail_list failed [%d]", err);
goto FINISH_OFF;
}
FINISH_OFF:
+
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err [%d]", err);
return err;
}
@@ -862,12 +895,19 @@ FINISH_OFF:
EXPORT_API int email_get_attachment_data_list(int input_mail_id, email_attachment_data_t **output_attachment_data, int *output_attachment_count)
{
EM_DEBUG_API_BEGIN ("input_mail_id[%d] output_attachment_data[%p] output_attachment_count[%p]", input_mail_id, output_attachment_data, output_attachment_count);
- int err = EMAIL_ERROR_NONE;
-
- if((err = emcore_get_attachment_data_list(input_mail_id, output_attachment_data, output_attachment_count)) != EMAIL_ERROR_NONE) {
+ int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
+
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ return err;
+ }
+
+ if((err = emcore_get_attachment_data_list(multi_user_name, input_mail_id, output_attachment_data, output_attachment_count)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emcore_get_attachment_data_list failed [%d]", err);
}
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -889,26 +929,34 @@ EXPORT_API int email_get_mail_list_ex(email_list_filter_t *input_filter_list, in
EM_DEBUG_FUNC_BEGIN ("input_filter_list[%p] input_filter_count[%d] input_sorting_rule_list[%p] input_sorting_rule_count[%d] input_start_index[%d] input_limit_count[%d] output_mail_list[%p] output_result_count[%p]", input_filter_list, input_filter_count, input_sorting_rule_list, input_sorting_rule_count, input_start_index, input_limit_count, output_mail_list, output_result_count);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
char *conditional_clause_string = NULL;
EM_IF_NULL_RETURN_VALUE(output_mail_list, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(output_result_count, EMAIL_ERROR_INVALID_PARAM);
- if( (err = emstorage_write_conditional_clause_for_getting_mail_list(input_filter_list, input_filter_count, input_sorting_rule_list, input_sorting_rule_count, input_start_index, input_limit_count, &conditional_clause_string)) != EMAIL_ERROR_NONE) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if( (err = emstorage_write_conditional_clause_for_getting_mail_list(multi_user_name, input_filter_list, input_filter_count, input_sorting_rule_list, input_sorting_rule_count, input_start_index, input_limit_count, &conditional_clause_string)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emstorage_write_conditional_clause_for_getting_mail_list failed[%d]", err);
goto FINISH_OFF;
}
EM_DEBUG_LOG_DEV ("conditional_clause_string[%s].", conditional_clause_string);
- if(!emstorage_query_mail_list(conditional_clause_string, true, output_mail_list, output_result_count, &err)) {
+ if(!emstorage_query_mail_list(multi_user_name, conditional_clause_string, true, output_mail_list, output_result_count, &err)) {
if (err != EMAIL_ERROR_MAIL_NOT_FOUND) /* there is no mail and it is definitely common */
EM_DEBUG_EXCEPTION("emstorage_query_mail_list [%d]", err);
goto FINISH_OFF;
}
FINISH_OFF:
+
EM_SAFE_FREE(conditional_clause_string);
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_FUNC_END ("err[%d]", err);
return err;
@@ -932,6 +980,7 @@ EXPORT_API int email_get_mails(int account_id , int mailbox_id, int thread_id, i
EM_DEBUG_API_BEGIN ("account_id[%d] mailbox_id[%d] thread_id[%d]", account_id, mailbox_id, thread_id);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
emstorage_mail_tbl_t *mail_tbl_list = NULL;
EM_IF_NULL_RETURN_VALUE(result_count, EMAIL_ERROR_INVALID_PARAM);
@@ -941,9 +990,13 @@ EXPORT_API int email_get_mails(int account_id , int mailbox_id, int thread_id, i
goto FINISH_OFF;
}
- if (!emstorage_get_mails(account_id, mailbox_id, NULL, thread_id, start_index, limit_count, sorting, true, &mail_tbl_list, result_count, &err)) {
- EM_DEBUG_EXCEPTION("emstorage_get_mails failed [%d]", err);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+ if (!emstorage_get_mails(multi_user_name, account_id, mailbox_id, NULL, thread_id, start_index, limit_count, sorting, true, &mail_tbl_list, result_count, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_get_mails failed [%d]", err);
goto FINISH_OFF;
}
@@ -953,9 +1006,12 @@ EXPORT_API int email_get_mails(int account_id , int mailbox_id, int thread_id, i
}
FINISH_OFF:
+
if(mail_tbl_list && !emstorage_free_mail(&mail_tbl_list, *result_count, NULL))
EM_DEBUG_EXCEPTION("emstorage_free_mail failed");
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -965,6 +1021,7 @@ EXPORT_API int email_get_mail_list(int account_id , int mailbox_id, int thread_i
EM_DEBUG_API_BEGIN ("account_id[%d] mailbox_id[%d] thread_id[%d]", account_id, mailbox_id, thread_id);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
EM_IF_NULL_RETURN_VALUE(result_count, EMAIL_ERROR_INVALID_PARAM);
@@ -973,13 +1030,20 @@ EXPORT_API int email_get_mail_list(int account_id , int mailbox_id, int thread_i
return EMAIL_ERROR_INVALID_PARAM;
}
- if (!emstorage_get_mail_list(account_id, mailbox_id, NULL, thread_id, start_index, limit_count, 0, NULL, sorting, true, mail_list, result_count, &err)) {
- EM_DEBUG_EXCEPTION("emstorage_get_mail_list failed [%d]", err);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+ if (!emstorage_get_mail_list(multi_user_name, account_id, mailbox_id, NULL, thread_id, start_index, limit_count, 0, NULL, sorting, true, mail_list, result_count, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_get_mail_list failed [%d]", err);
goto FINISH_OFF;
}
FINISH_OFF:
+
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -989,7 +1053,7 @@ EXPORT_API int email_get_mail_by_address(int account_id , int mailbox_id, email_
{
EM_DEBUG_API_BEGIN ("account_id[%d] mailbox_id[%d]", account_id, mailbox_id);
int err = EMAIL_ERROR_NONE;
-
+ char *multi_user_name = NULL;
email_mail_list_item_t* mail_list_item = NULL;
EM_IF_NULL_RETURN_VALUE(mail_list, EMAIL_ERROR_INVALID_PARAM);
@@ -1001,15 +1065,22 @@ EXPORT_API int email_get_mail_by_address(int account_id , int mailbox_id, email_
return err;
}
- if (!emstorage_get_mail_list(account_id, mailbox_id, addr_list, EMAIL_LIST_TYPE_NORMAL, start_index, limit_count, search_type, search_value, sorting, true, &mail_list_item, result_count, &err)) {
- EM_DEBUG_EXCEPTION("emstorage_get_mail_list failed [%d]", err);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+ if (!emstorage_get_mail_list(multi_user_name, account_id, mailbox_id, addr_list, EMAIL_LIST_TYPE_NORMAL, start_index, limit_count, search_type, search_value, sorting, true, &mail_list_item, result_count, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_get_mail_list failed [%d]", err);
goto FINISH_OFF;
}
*mail_list = mail_list_item;
FINISH_OFF:
+
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -1018,11 +1089,17 @@ EXPORT_API int email_get_thread_information_by_thread_id(int thread_id, email_ma
{
EM_DEBUG_API_BEGIN ("thread_id[%d]", thread_id);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
emstorage_mail_tbl_t *mail_table_data = NULL;
EM_IF_NULL_RETURN_VALUE(thread_info, EMAIL_ERROR_INVALID_PARAM);
- if (!emstorage_get_thread_information(thread_id, &mail_table_data , true, &err)) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if (!emstorage_get_thread_information(multi_user_name, thread_id, &mail_table_data , true, &err)) {
EM_DEBUG_EXCEPTION("emstorage_get_thread_information failed [%d]", err);
goto FINISH_OFF;
}
@@ -1037,6 +1114,8 @@ FINISH_OFF:
if(mail_table_data && !emstorage_free_mail(&mail_table_data, 1, NULL))
EM_DEBUG_EXCEPTION("emstorage_free_mail failed");
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -1045,12 +1124,18 @@ EXPORT_API int email_get_thread_information_ex(int thread_id, email_mail_list_it
{
EM_DEBUG_API_BEGIN ("thread_id[%d]", thread_id);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
emstorage_mail_tbl_t *mail_table_data = NULL;
email_mail_list_item_t *temp_thread_info = NULL;
EM_IF_NULL_RETURN_VALUE(thread_info, EMAIL_ERROR_INVALID_PARAM);
- if (!emstorage_get_thread_information(thread_id, &mail_table_data , true, &err)) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if (!emstorage_get_thread_information(multi_user_name, thread_id, &mail_table_data , true, &err)) {
EM_DEBUG_EXCEPTION("emstorage_get_thread_information -- failed [%d]", err);
goto FINISH_OFF;
}
@@ -1092,6 +1177,8 @@ FINISH_OFF:
if(mail_table_data)
emstorage_free_mail(&mail_table_data, 1, NULL);
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -1100,10 +1187,18 @@ EXPORT_API int email_get_mail_data(int input_mail_id, email_mail_data_t **output
{
EM_DEBUG_API_BEGIN ("input_mail_id[%d]", input_mail_id);
int err = EMAIL_ERROR_NONE;
-
- if ( ((err = emcore_get_mail_data(input_mail_id, output_mail_data)) != EMAIL_ERROR_NONE) || !output_mail_data)
+ char *multi_user_name = NULL;
+
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ return err;
+ }
+
+ if ( ((err = emcore_get_mail_data(multi_user_name, input_mail_id, output_mail_data)) != EMAIL_ERROR_NONE) || !output_mail_data)
EM_DEBUG_EXCEPTION("emcore_get_mail_data failed [%d]", err);
-
+
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -1356,6 +1451,9 @@ EXPORT_API int email_free_mail_data(email_mail_data_t** mail_list, int count)
{
EM_DEBUG_FUNC_BEGIN ("mail_list[%p] count[%d]", mail_list, count);
int err = EMAIL_ERROR_NONE;
+
+ EM_IF_NULL_RETURN_VALUE(mail_list, EMAIL_ERROR_INVALID_PARAM);
+
emcore_free_mail_data_list(mail_list, count);
EM_DEBUG_FUNC_END ("err[%d]", err);
return err;
@@ -1371,12 +1469,17 @@ EXPORT_API int email_cancel_sending_mail(int mail_id)
int err = EMAIL_ERROR_NONE;
int account_id = 0;
+ char *multi_user_name = NULL;
email_mail_data_t* mail_data = NULL;
email_account_server_t account_server_type;
HIPC_API hAPI = NULL;
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_container_name error : [%d]", err);
+ goto FINISH_OFF;
+ }
- if (((err = emcore_get_mail_data(mail_id, &mail_data)) != EMAIL_ERROR_NONE) || mail_data == NULL) {
+ if (((err = emcore_get_mail_data(multi_user_name, mail_id, &mail_data)) != EMAIL_ERROR_NONE) || mail_data == NULL) {
EM_DEBUG_EXCEPTION("emcore_get_mail_data failed [%d]", err);
goto FINISH_OFF;
}
@@ -1384,7 +1487,7 @@ EXPORT_API int email_cancel_sending_mail(int mail_id)
account_id = mail_data->account_id;
/* check account bind type and branch off */
- if ( em_get_account_server_type_by_account_id(account_id, &account_server_type, false, &err) == false ) {
+ if ( em_get_account_server_type_by_account_id(multi_user_name, account_id, &account_server_type, false, &err) == false ) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
@@ -1401,9 +1504,10 @@ EXPORT_API int email_cancel_sending_mail(int mail_id)
}
/* noti to active sync */
- as_noti_data.cancel_sending_mail.handle = as_handle;
- as_noti_data.cancel_sending_mail.mail_id = mail_id;
- as_noti_data.cancel_sending_mail.account_id = account_id;
+ as_noti_data.cancel_sending_mail.handle = as_handle;
+ as_noti_data.cancel_sending_mail.mail_id = mail_id;
+ as_noti_data.cancel_sending_mail.account_id = account_id;
+ as_noti_data.cancel_sending_mail.multi_user_name = EM_SAFE_STRDUP(multi_user_name);
if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_CANCEL_SENDING_MAIL, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
@@ -1452,6 +1556,8 @@ FINISH_OFF:
if(mail_data)
emcore_free_mail_data_list(&mail_data, 1);
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
@@ -1546,6 +1652,7 @@ EXPORT_API int email_get_address_info_list(int mail_id, email_address_info_list_
EM_DEBUG_FUNC_BEGIN ("mail_id[%d] address_info_list[%p]", mail_id, address_info_list);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
email_address_info_list_t *temp_address_info_list = NULL;
@@ -1555,21 +1662,28 @@ EXPORT_API int email_get_address_info_list(int mail_id, email_address_info_list_
err = EMAIL_ERROR_INVALID_PARAM ;
return err;
}
-
- if ( !emcore_get_mail_address_info_list(mail_id, &temp_address_info_list, &err) ) {
- EM_DEBUG_EXCEPTION("emcore_get_mail_address_info_list failed [%d]", err);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if (!emcore_get_mail_address_info_list(multi_user_name, mail_id, &temp_address_info_list, &err)) {
+ EM_DEBUG_EXCEPTION("emcore_get_mail_address_info_list failed [%d]", err);
goto FINISH_OFF;
}
- if ( address_info_list ) {
+ if (address_info_list) {
*address_info_list = temp_address_info_list;
temp_address_info_list = NULL;
}
FINISH_OFF:
- if ( temp_address_info_list )
+
+ if (temp_address_info_list)
emstorage_free_address_info_list(&temp_address_info_list);
+
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_FUNC_END ("err[%d]", err);
return err;
}
@@ -1587,25 +1701,26 @@ EXPORT_API int email_free_address_info_list(email_address_info_list_t **address_
return err;
}
-EXPORT_API int email_get_structure(const char*encoded_string, void **struct_var, email_convert_struct_type_e type)
-{
- EM_DEBUG_API_BEGIN ("encoded_string[%s] struct_var[%p] type[%d]", encoded_string, struct_var, type);
- EM_DEBUG_API_END ("err[%d]", EMAIL_ERROR_NOT_IMPLEMENTED);
- return EMAIL_ERROR_NOT_IMPLEMENTED;
-}
-
EXPORT_API int email_query_meeting_request(char *input_conditional_clause_string, email_meeting_request_t **output_meeting_req, int *output_count)
{
EM_DEBUG_API_BEGIN ("input_conditional_clause_string[%s] output_meeting_req[%p] output_count[%p]", input_conditional_clause_string, output_meeting_req, output_count);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
EM_IF_NULL_RETURN_VALUE(input_conditional_clause_string, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(output_count, EMAIL_ERROR_INVALID_PARAM);
- if ((err = emstorage_query_meeting_request(input_conditional_clause_string, output_meeting_req, output_count, true)) != EMAIL_ERROR_NONE) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ return err;
+ }
+
+ if ((err = emstorage_query_meeting_request(multi_user_name, input_conditional_clause_string, output_meeting_req, output_count, true)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emstorage_query_meeting_request failed [%d]", err);
}
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -1615,26 +1730,33 @@ EXPORT_API int email_get_meeting_request(int mail_id, email_meeting_request_t **
EM_DEBUG_API_BEGIN ("mail_id[%d] meeting_req[%p]", mail_id, meeting_req);
int err = EMAIL_ERROR_NONE;
-
+ char *multi_user_name = NULL;
email_meeting_request_t *temp_meeting_req = NULL;
EM_IF_NULL_RETURN_VALUE(meeting_req, EMAIL_ERROR_INVALID_PARAM);
- if( mail_id <= 0 ) {
+ if (mail_id <= 0) {
EM_DEBUG_EXCEPTION(" Invalid Mail Id Param ");
err = EMAIL_ERROR_INVALID_PARAM ;
return err;
}
-
- if ( !emstorage_get_meeting_request(mail_id, &temp_meeting_req, 1, &err) ) {
- EM_DEBUG_EXCEPTION("emstorage_get_meeting_request failed[%d]", err);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ return err;
+ }
+
+ if (!emstorage_get_meeting_request(multi_user_name, mail_id, &temp_meeting_req, 1, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_get_meeting_request failed[%d]", err);
goto FINISH_OFF;
}
- if ( meeting_req )
+ if (meeting_req)
*meeting_req = temp_meeting_req;
FINISH_OFF:
+
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -1716,6 +1838,12 @@ EXPORT_API int email_delete_thread(int thread_id, int delete_always_flag)
EM_DEBUG_API_BEGIN ("thread_id[%d] delete_always_flag[%d]", thread_id, delete_always_flag);
int err = EMAIL_ERROR_NONE;
+ if (thread_id <= 0) {
+ EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
+ err = EMAIL_ERROR_INVALID_PARAM;
+ return err;
+ }
+
HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_DELETE_THREAD);
if(!hAPI) {
@@ -1748,6 +1876,7 @@ EXPORT_API int email_delete_thread(int thread_id, int delete_always_flag)
emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err);
FINISH_OFF:
+
if(hAPI)
emipc_destroy_email_api(hAPI);
@@ -1759,6 +1888,13 @@ EXPORT_API int email_modify_seen_flag_of_thread(int thread_id, int seen_flag, in
{
EM_DEBUG_API_BEGIN ("thread_id[%d] seen_flag[%d] on_server[%d]", thread_id, seen_flag, on_server);
int err = EMAIL_ERROR_NONE;
+
+ if (thread_id <= 0) {
+ EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
+ err = EMAIL_ERROR_INVALID_PARAM;
+ return err;
+ }
+
HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_MODIFY_SEEN_FLAG_OF_THREAD);
if(!hAPI) {
@@ -1809,10 +1945,16 @@ EXPORT_API int email_expunge_mails_deleted_flagged(int input_mailbox_id, int inp
EM_DEBUG_API_BEGIN ("input_mailbox_id[%d] input_on_server[%d] output_handle[%p]", input_mailbox_id, input_on_server, output_handle);
int err = EMAIL_ERROR_NONE;
int return_value = 0;
+ char *multi_user_name = NULL;
HIPC_API hAPI = NULL;
emstorage_mailbox_tbl_t *mailbox_tbl_data = NULL;
- if( (err = emstorage_get_mailbox_by_id(input_mailbox_id, &mailbox_tbl_data)) != EMAIL_ERROR_NONE) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if( (err = emstorage_get_mailbox_by_id(multi_user_name, input_mailbox_id, &mailbox_tbl_data)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emstorage_get_mailbox_by_id failed[%d]", err);
goto FINISH_OFF;
}
@@ -1822,7 +1964,7 @@ EXPORT_API int email_expunge_mails_deleted_flagged(int input_mailbox_id, int inp
memset(&as_noti_data, 0, sizeof(ASNotiData)); /* initialization of union members */
- if ( em_get_account_server_type_by_account_id(mailbox_tbl_data->account_id, &account_server_type, true, &err) == false ) {
+ if ( em_get_account_server_type_by_account_id(multi_user_name, mailbox_tbl_data->account_id, &account_server_type, true, &err) == false ) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
goto FINISH_OFF;
}
@@ -1836,10 +1978,11 @@ EXPORT_API int email_expunge_mails_deleted_flagged(int input_mailbox_id, int inp
}
/* noti to active sync */
- as_noti_data.expunge_mails_deleted_flagged.handle = as_handle;
- as_noti_data.expunge_mails_deleted_flagged.account_id = mailbox_tbl_data->account_id;
- as_noti_data.expunge_mails_deleted_flagged.mailbox_id = input_mailbox_id;
- as_noti_data.expunge_mails_deleted_flagged.on_server = input_on_server;
+ as_noti_data.expunge_mails_deleted_flagged.handle = as_handle;
+ as_noti_data.expunge_mails_deleted_flagged.account_id = mailbox_tbl_data->account_id;
+ as_noti_data.expunge_mails_deleted_flagged.mailbox_id = input_mailbox_id;
+ as_noti_data.expunge_mails_deleted_flagged.on_server = input_on_server;
+ as_noti_data.expunge_mails_deleted_flagged.multi_user_name = multi_user_name;
return_value = em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_EXPUNGE_MAILS_DELETED_FLAGGED, &as_noti_data);
@@ -1898,6 +2041,7 @@ FINISH_OFF:
emstorage_free_mailbox(&mailbox_tbl_data, 1, NULL);
}
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
diff --git a/email-api/email-api-mailbox.c b/email-api/email-api-mailbox.c
index 09474b4..a520f4b 100755
--- a/email-api/email-api-mailbox.c
+++ b/email-api/email-api-mailbox.c
@@ -30,7 +30,6 @@
* email-service .
*/
-#include "email-api.h"
#include "string.h"
#include "email-convert.h"
#include "email-storage.h"
@@ -38,7 +37,6 @@
#include "email-core-signal.h"
#include "email-utilities.h"
#include "email-ipc.h"
-#include "db-util.h"
/* API - Create a mailbox */
@@ -49,16 +47,22 @@ EXPORT_API int email_add_mailbox(email_mailbox_t* new_mailbox, int on_server, in
int size = 0;
int err = EMAIL_ERROR_NONE;
char* local_mailbox_stream = NULL;
+ char *multi_user_name = NULL;
email_account_server_t account_server_type;
HIPC_API hAPI = NULL;
ASNotiData as_noti_data;
- memset(&as_noti_data, 0x00, sizeof(ASNotiData));
-
EM_IF_NULL_RETURN_VALUE(new_mailbox, EMAIL_ERROR_INVALID_PARAM);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ memset(&as_noti_data, 0x00, sizeof(ASNotiData));
+
/* check account bind type and branch off */
- if ( em_get_account_server_type_by_account_id(new_mailbox->account_id, &account_server_type, false, &err) == false ) {
+ if ( em_get_account_server_type_by_account_id(multi_user_name, new_mailbox->account_id, &account_server_type, false, &err) == false ) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
@@ -74,20 +78,21 @@ EXPORT_API int email_add_mailbox(email_mailbox_t* new_mailbox, int on_server, in
}
/* noti to active sync */
- as_noti_data.add_mailbox.handle = as_handle;
- as_noti_data.add_mailbox.account_id = new_mailbox->account_id;
- as_noti_data.add_mailbox.mailbox_alias = new_mailbox->alias;
- as_noti_data.add_mailbox.mailbox_path = new_mailbox->mailbox_name;
- as_noti_data.add_mailbox.eas_data = new_mailbox->eas_data;
+ as_noti_data.add_mailbox.handle = as_handle;
+ as_noti_data.add_mailbox.account_id = new_mailbox->account_id;
+ as_noti_data.add_mailbox.mailbox_alias = new_mailbox->alias;
+ as_noti_data.add_mailbox.mailbox_path = new_mailbox->mailbox_name;
+ as_noti_data.add_mailbox.eas_data = new_mailbox->eas_data;
as_noti_data.add_mailbox.eas_data_length = new_mailbox->eas_data_length;
+ as_noti_data.add_mailbox.multi_user_name = multi_user_name;
- if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_ADD_MAILBOX, &as_noti_data) == false) {
+ if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_ADD_MAILBOX, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
}
- if(handle)
+ if (handle)
*handle = as_handle;
}
else {
@@ -99,25 +104,25 @@ EXPORT_API int email_add_mailbox(email_mailbox_t* new_mailbox, int on_server, in
EM_PROXY_IF_NULL_RETURN_VALUE(local_mailbox_stream, hAPI, EMAIL_ERROR_NULL_VALUE);
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, local_mailbox_stream, size)) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, local_mailbox_stream, size)) {
EM_DEBUG_EXCEPTION("emipc_add_parameter failed");
EM_SAFE_FREE(local_mailbox_stream);
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, &on_server, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &on_server, sizeof(int))) {
EM_DEBUG_EXCEPTION("emipc_add_parameter failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
}
emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err);
- if(handle) {
+ if (handle) {
emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), handle);
EM_DEBUG_LOG(" >>>>> Handle [%d]", *handle);
}
@@ -131,6 +136,7 @@ EXPORT_API int email_add_mailbox(email_mailbox_t* new_mailbox, int on_server, in
FINISH_OFF:
EM_SAFE_FREE(local_mailbox_stream);
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
@@ -141,6 +147,7 @@ EXPORT_API int email_rename_mailbox(int input_mailbox_id, char *input_mailbox_na
EM_DEBUG_API_BEGIN ("input_mailbox_id[%d] input_mailbox_name[%p] input_mailbox_alias[%p] input_on_server[%d] output_handle[%p]", input_mailbox_id, input_mailbox_name, input_mailbox_alias, input_on_server, output_handle);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
email_account_server_t account_server_type;
HIPC_API hAPI = NULL;
ASNotiData as_noti_data;
@@ -150,43 +157,49 @@ EXPORT_API int email_rename_mailbox(int input_mailbox_id, char *input_mailbox_na
EM_IF_NULL_RETURN_VALUE(input_mailbox_name, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(input_mailbox_alias, EMAIL_ERROR_INVALID_PARAM);
- if ((err = emstorage_get_mailbox_by_id(input_mailbox_id, &mailbox_tbl)) != EMAIL_ERROR_NONE || !mailbox_tbl) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if ((err = emstorage_get_mailbox_by_id(multi_user_name, input_mailbox_id, &mailbox_tbl)) != EMAIL_ERROR_NONE || !mailbox_tbl) {
EM_DEBUG_EXCEPTION("emstorage_get_mailbox_by_id failed. [%d]", err);
goto FINISH_OFF;
}
/* check account bind type and branch off */
- if ( em_get_account_server_type_by_account_id(mailbox_tbl->account_id, &account_server_type, false, &err) == false ) {
+ if (em_get_account_server_type_by_account_id(multi_user_name, mailbox_tbl->account_id, &account_server_type, false, &err) == false) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
}
- if ( account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC && input_on_server) {
+ if (account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC && input_on_server) {
int as_handle;
- if ( em_get_handle_for_activesync(&as_handle, &err) == false ) {
+ if (em_get_handle_for_activesync(&as_handle, &err) == false) {
EM_DEBUG_EXCEPTION("em_get_handle_for_activesync failed[%d].", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
}
/* noti to active sync */
- as_noti_data.rename_mailbox.handle = as_handle;
- as_noti_data.rename_mailbox.account_id = mailbox_tbl->account_id;
- as_noti_data.rename_mailbox.mailbox_id = input_mailbox_id;
- as_noti_data.rename_mailbox.mailbox_name = input_mailbox_name;
- as_noti_data.rename_mailbox.mailbox_alias = input_mailbox_alias;
+ as_noti_data.rename_mailbox.handle = as_handle;
+ as_noti_data.rename_mailbox.account_id = mailbox_tbl->account_id;
+ as_noti_data.rename_mailbox.mailbox_id = input_mailbox_id;
+ as_noti_data.rename_mailbox.mailbox_name = input_mailbox_name;
+ as_noti_data.rename_mailbox.mailbox_alias = input_mailbox_alias;
as_noti_data.rename_mailbox.eas_data = NULL;
as_noti_data.rename_mailbox.eas_data_length = 0;
+ as_noti_data.rename_mailbox.multi_user_name = multi_user_name;
- if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_RENAME_MAILBOX, &as_noti_data) == false) {
+ if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_RENAME_MAILBOX, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
}
- if(output_handle)
+ if (output_handle)
*output_handle = as_handle;
}
else {
@@ -228,6 +241,7 @@ FINISH_OFF:
if (mailbox_tbl)
emstorage_free_mailbox(&mailbox_tbl, 1, NULL);
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -237,6 +251,7 @@ EXPORT_API int email_rename_mailbox_ex(int input_mailbox_id, char *input_mailbox
EM_DEBUG_API_BEGIN ("input_mailbox_id[%d] input_mailbox_name[%p] input_mailbox_alias[%p] input_eas_data[%p] input_eas_data_length[%d] input_on_server[%d] output_handle[%p]", input_mailbox_id, input_mailbox_name, input_mailbox_alias, input_eas_data, input_eas_data_length, input_on_server, output_handle);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
email_account_server_t account_server_type;
HIPC_API hAPI = NULL;
ASNotiData as_noti_data;
@@ -246,22 +261,27 @@ EXPORT_API int email_rename_mailbox_ex(int input_mailbox_id, char *input_mailbox
EM_IF_NULL_RETURN_VALUE(input_mailbox_name, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(input_mailbox_alias, EMAIL_ERROR_INVALID_PARAM);
- if ((err = emstorage_get_mailbox_by_id(input_mailbox_id, &mailbox_tbl)) != EMAIL_ERROR_NONE || !mailbox_tbl) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if ((err = emstorage_get_mailbox_by_id(multi_user_name, input_mailbox_id, &mailbox_tbl)) != EMAIL_ERROR_NONE || !mailbox_tbl) {
EM_DEBUG_EXCEPTION("emstorage_get_mailbox_by_id failed. [%d]", err);
goto FINISH_OFF;
}
/* check account bind type and branch off */
- if ( em_get_account_server_type_by_account_id(mailbox_tbl->account_id, &account_server_type, false, &err) == false ) {
+ if (em_get_account_server_type_by_account_id(multi_user_name, mailbox_tbl->account_id, &account_server_type, false, &err) == false) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
}
- if ( account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC && input_on_server) {
+ if (account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC && input_on_server) {
int as_handle;
- if ( em_get_handle_for_activesync(&as_handle, &err) == false ) {
+ if (em_get_handle_for_activesync(&as_handle, &err) == false) {
EM_DEBUG_EXCEPTION("em_get_handle_for_activesync failed[%d].", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
@@ -275,45 +295,46 @@ EXPORT_API int email_rename_mailbox_ex(int input_mailbox_id, char *input_mailbox
as_noti_data.rename_mailbox.mailbox_alias = input_mailbox_alias;
as_noti_data.rename_mailbox.eas_data = input_eas_data;
as_noti_data.rename_mailbox.eas_data_length = input_eas_data_length;
+ as_noti_data.rename_mailbox.multi_user_name = multi_user_name;
- if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_RENAME_MAILBOX, &as_noti_data) == false) {
+ if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_RENAME_MAILBOX, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
}
- if(output_handle)
+ if (output_handle)
*output_handle = as_handle;
}
else {
hAPI = emipc_create_email_api(_EMAIL_API_RENAME_MAILBOX_EX);
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_id, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_id, sizeof(int))) {
EM_DEBUG_EXCEPTION(" emipc_add_parameter for input_mailbox_id failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, input_mailbox_name, EM_SAFE_STRLEN(input_mailbox_name)+1 )) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, input_mailbox_name, EM_SAFE_STRLEN(input_mailbox_name)+1 )) {
EM_DEBUG_EXCEPTION(" emipc_add_parameter for input_mailbox_path failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, input_mailbox_alias, EM_SAFE_STRLEN(input_mailbox_alias)+1 )) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, input_mailbox_alias, EM_SAFE_STRLEN(input_mailbox_alias)+1 )) {
EM_DEBUG_EXCEPTION(" emipc_add_parameter for input_mailbox_alias failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, input_eas_data, input_eas_data_length )) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, input_eas_data, input_eas_data_length )) {
EM_DEBUG_EXCEPTION(" emipc_add_parameter for input_eas_data failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_on_server, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_on_server, sizeof(int))) {
EM_DEBUG_EXCEPTION("emipc_add_parameter failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
}
@@ -329,6 +350,7 @@ FINISH_OFF:
if (mailbox_tbl)
emstorage_free_mailbox(&mailbox_tbl, 1, NULL);
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -341,6 +363,7 @@ EXPORT_API int email_delete_mailbox(int input_mailbox_id, int input_on_server, i
EM_DEBUG_API_BEGIN ("input_mailbox_id[%d] input_on_server[%d] output_handle[%p]", input_mailbox_id, input_on_server, output_handle);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
email_account_server_t account_server_type;
emstorage_mailbox_tbl_t *mailbox_tbl = NULL;
HIPC_API hAPI = NULL;
@@ -348,39 +371,45 @@ EXPORT_API int email_delete_mailbox(int input_mailbox_id, int input_on_server, i
EM_IF_NULL_RETURN_VALUE(input_mailbox_id, EMAIL_ERROR_INVALID_PARAM);
- if ( (err = emstorage_get_mailbox_by_id(input_mailbox_id, &mailbox_tbl)) != EMAIL_ERROR_NONE) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if ((err = emstorage_get_mailbox_by_id(multi_user_name, input_mailbox_id, &mailbox_tbl)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emstorage_get_mailbox_by_id failed[%d]", err);
goto FINISH_OFF;
}
/* check account bind type and branch off */
- if ( em_get_account_server_type_by_account_id(mailbox_tbl->account_id, &account_server_type, false, &err) == false ) {
+ if (em_get_account_server_type_by_account_id(multi_user_name, mailbox_tbl->account_id, &account_server_type, false, &err) == false) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
}
- if ( account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC && input_on_server) {
+ if (account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC && input_on_server) {
int as_handle;
- if ( em_get_handle_for_activesync(&as_handle, &err) == false ) {
+ if (em_get_handle_for_activesync(&as_handle, &err) == false) {
EM_DEBUG_EXCEPTION("em_get_handle_for_activesync failed[%d].", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
}
/* noti to active sync */
- as_noti_data.delete_mailbox.handle = as_handle;
- as_noti_data.delete_mailbox.account_id = mailbox_tbl->account_id;
- as_noti_data.delete_mailbox.mailbox_id = input_mailbox_id;
+ as_noti_data.delete_mailbox.handle = as_handle;
+ as_noti_data.delete_mailbox.account_id = mailbox_tbl->account_id;
+ as_noti_data.delete_mailbox.mailbox_id = input_mailbox_id;
+ as_noti_data.delete_mailbox.multi_user_name = multi_user_name;
- if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_DELETE_MAILBOX, &as_noti_data) == false) {
+ if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_DELETE_MAILBOX, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
}
- if(output_handle)
+ if (output_handle)
*output_handle = as_handle;
}
else {
@@ -388,17 +417,17 @@ EXPORT_API int email_delete_mailbox(int input_mailbox_id, int input_on_server, i
EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_id, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_id, sizeof(int))) {
EM_DEBUG_EXCEPTION("emipc_add_parameter failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_on_server, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_on_server, sizeof(int))) {
EM_DEBUG_EXCEPTION("emipc_add_parameter failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
}
@@ -406,7 +435,7 @@ EXPORT_API int email_delete_mailbox(int input_mailbox_id, int input_on_server, i
emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err);
EM_DEBUG_LOG("error VALUE [%d]", err);
- if(input_on_server) {
+ if (input_on_server) {
emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), output_handle);
EM_DEBUG_LOG("output_handle [%d]", output_handle);
}
@@ -419,6 +448,7 @@ FINISH_OFF:
emstorage_free_mailbox(&mailbox_tbl, 1, NULL);
}
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -427,27 +457,33 @@ EXPORT_API int email_delete_mailbox_ex(int input_account_id, int *input_mailbox_
{
EM_DEBUG_API_BEGIN ("input_account_id[%d] input_mailbox_id_array[%p] input_mailbox_id_count[%d] input_on_server[%d] output_handle[%p]", input_mailbox_id_array, input_mailbox_id_array, input_mailbox_id_count, input_on_server, output_handle);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
email_account_server_t account_server_type;
task_parameter_EMAIL_ASYNC_TASK_DELETE_MAILBOX_EX task_parameter;
- if(input_account_id == 0 || input_mailbox_id_count <= 0 || input_mailbox_id_array == NULL) {
+ if (input_account_id == 0 || input_mailbox_id_count <= 0 || input_mailbox_id_array == NULL) {
EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
err = EMAIL_ERROR_INVALID_PARAM;
goto FINISH_OFF;
}
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
/* check account bind type and branch off */
- if ( em_get_account_server_type_by_account_id(input_account_id, &account_server_type, false, &err) == false ) {
+ if (em_get_account_server_type_by_account_id(multi_user_name, input_account_id, &account_server_type, false, &err) == false) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
}
- if ( account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC && input_on_server) {
+ if (account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC && input_on_server) {
int as_handle;
ASNotiData as_noti_data;
- if ( em_get_handle_for_activesync(&as_handle, &err) == false ) {
+ if (em_get_handle_for_activesync(&as_handle, &err) == false) {
EM_DEBUG_EXCEPTION("em_get_handle_for_activesync failed[%d].", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
@@ -459,14 +495,15 @@ EXPORT_API int email_delete_mailbox_ex(int input_account_id, int *input_mailbox_
as_noti_data.delete_mailbox_ex.mailbox_id_array = input_mailbox_id_array;
as_noti_data.delete_mailbox_ex.mailbox_id_count = input_mailbox_id_count;
as_noti_data.delete_mailbox_ex.on_server = input_on_server;
+ as_noti_data.delete_mailbox_ex.multi_user_name = EM_SAFE_STRDUP(multi_user_name);
- if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_DELETE_MAILBOX_EX, &as_noti_data) == false) {
+ if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_DELETE_MAILBOX_EX, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
}
- if(output_handle)
+ if (output_handle)
*output_handle = as_handle;
}
else {
@@ -475,7 +512,7 @@ EXPORT_API int email_delete_mailbox_ex(int input_account_id, int *input_mailbox_
task_parameter.mailbox_id_count = input_mailbox_id_count;
task_parameter.on_server = input_on_server;
- if((err = emipc_execute_proxy_task(EMAIL_ASYNC_TASK_DELETE_MAILBOX_EX, &task_parameter)) != EMAIL_ERROR_NONE) {
+ if ((err = emipc_execute_proxy_task(EMAIL_ASYNC_TASK_DELETE_MAILBOX_EX, &task_parameter)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("execute_proxy_task failed [%d]", err);
goto FINISH_OFF;
}
@@ -483,6 +520,8 @@ EXPORT_API int email_delete_mailbox_ex(int input_account_id, int *input_mailbox_
FINISH_OFF:
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -498,17 +537,17 @@ EXPORT_API int email_set_mailbox_type(int input_mailbox_id, email_mailbox_type_e
EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_id, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_id, sizeof(int))) {
EM_DEBUG_EXCEPTION("emipc_add_parameter failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_type, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_type, sizeof(int))) {
EM_DEBUG_EXCEPTION("emipc_add_parameter failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
}
@@ -533,17 +572,17 @@ EXPORT_API int email_set_local_mailbox(int input_mailbox_id, int input_is_local_
EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_id, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_id, sizeof(int))) {
EM_DEBUG_EXCEPTION("emipc_add_parameter failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_is_local_mailbox, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_is_local_mailbox, sizeof(int))) {
EM_DEBUG_EXCEPTION("emipc_add_parameter failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
}
@@ -563,16 +602,20 @@ EXPORT_API int email_get_sync_mailbox_list(int account_id, email_mailbox_t** mai
int mailbox_count = 0;
int err = EMAIL_ERROR_NONE ;
int i = 0;
+ char *multi_user_name = NULL;
emstorage_mailbox_tbl_t* mailbox_tbl_list = NULL;
EM_IF_NULL_RETURN_VALUE(mailbox_list, EMAIL_ERROR_INVALID_PARAM);
EM_IF_ACCOUNT_ID_NULL(account_id, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(count, EMAIL_ERROR_INVALID_PARAM);
- if (!emstorage_get_mailbox_list(account_id, 0, EMAIL_MAILBOX_SORT_BY_NAME_ASC, &mailbox_count, &mailbox_tbl_list, true, &err)) {
- EM_DEBUG_EXCEPTION("emstorage_get_mailbox failed [%d]", err);
-
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+ if (!emstorage_get_mailbox_list(multi_user_name, account_id, 0, EMAIL_MAILBOX_SORT_BY_NAME_ASC, &mailbox_count, &mailbox_tbl_list, true, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_get_mailbox failed [%d]", err);
goto FINISH_OFF;
} else
err = EMAIL_ERROR_NONE;
@@ -590,9 +633,12 @@ EXPORT_API int email_get_sync_mailbox_list(int account_id, email_mailbox_t** mai
*count = mailbox_count;
- FINISH_OFF:
+FINISH_OFF:
+
if (mailbox_tbl_list != NULL)
emstorage_free_mailbox(&mailbox_tbl_list, mailbox_count, NULL);
+
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -606,14 +652,19 @@ EXPORT_API int email_get_mailbox_list(int account_id, int mailbox_sync_type, ema
emstorage_mailbox_tbl_t* mailbox_tbl_list = NULL;
int err =EMAIL_ERROR_NONE;
int i;
+ char *multi_user_name = NULL;
EM_IF_NULL_RETURN_VALUE(mailbox_list, EMAIL_ERROR_INVALID_PARAM);
EM_IF_ACCOUNT_ID_NULL(account_id, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(count, EMAIL_ERROR_INVALID_PARAM);
- if (!emstorage_get_mailbox_list(account_id, mailbox_sync_type, EMAIL_MAILBOX_SORT_BY_NAME_ASC, &mailbox_count, &mailbox_tbl_list, true, &err)) {
- EM_DEBUG_EXCEPTION("emstorage_get_mailbox failed [%d]", err);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+ if (!emstorage_get_mailbox_list(multi_user_name, account_id, mailbox_sync_type, EMAIL_MAILBOX_SORT_BY_NAME_ASC, &mailbox_count, &mailbox_tbl_list, true, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_get_mailbox failed [%d]", err);
goto FINISH_OFF;
} else
err = EMAIL_ERROR_NONE;
@@ -633,15 +684,16 @@ EXPORT_API int email_get_mailbox_list(int account_id, int mailbox_sync_type, ema
*count = mailbox_count;
FINISH_OFF:
+
if (mailbox_tbl_list != NULL)
emstorage_free_mailbox(&mailbox_tbl_list, mailbox_count, NULL);
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err [%d]", err);
return err;
}
-
-
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)
{
EM_DEBUG_FUNC_BEGIN ();
@@ -650,14 +702,19 @@ EXPORT_API int email_get_mailbox_list_ex(int account_id, int mailbox_sync_type,
emstorage_mailbox_tbl_t* mailbox_tbl_list = NULL;
int err =EMAIL_ERROR_NONE;
int i;
-
+ char *multi_user_name = NULL;
+
EM_IF_NULL_RETURN_VALUE(mailbox_list, EMAIL_ERROR_INVALID_PARAM);
EM_IF_ACCOUNT_ID_NULL(account_id, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(count, EMAIL_ERROR_INVALID_PARAM);
- if (!emstorage_get_mailbox_list_ex(account_id, mailbox_sync_type, with_count, &mailbox_count, &mailbox_tbl_list, true, &err)) {
- EM_DEBUG_EXCEPTION("emstorage_get_mailbox_list_ex failed [%d]", err);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+ if (!emstorage_get_mailbox_list_ex(multi_user_name, account_id, mailbox_sync_type, with_count, &mailbox_count, &mailbox_tbl_list, true, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_get_mailbox_list_ex failed [%d]", err);
goto FINISH_OFF;
} else
err = EMAIL_ERROR_NONE;
@@ -679,9 +736,12 @@ EXPORT_API int email_get_mailbox_list_ex(int account_id, int mailbox_sync_type,
*count = mailbox_count;
FINISH_OFF:
+
if (mailbox_tbl_list != NULL)
emstorage_free_mailbox(&mailbox_tbl_list, mailbox_count, NULL);
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_FUNC_END ("err[%d]", err);
return err;
}
@@ -694,11 +754,17 @@ EXPORT_API int email_get_mailbox_list_by_keyword(int account_id, char *keyword,
emstorage_mailbox_tbl_t* mailbox_tbl_list = NULL;
int err = EMAIL_ERROR_NONE;
int i = 0;
+ char *multi_user_name = NULL;
EM_IF_NULL_RETURN_VALUE(mailbox_list, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(count, EMAIL_ERROR_INVALID_PARAM);
- if (!emstorage_get_mailbox_by_keyword(account_id, keyword, &mailbox_tbl_list, &mailbox_count, true, &err)) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if (!emstorage_get_mailbox_by_keyword(multi_user_name, account_id, keyword, &mailbox_tbl_list, &mailbox_count, true, &err)) {
EM_DEBUG_EXCEPTION("emstorage_get_mailbox_by_keyword failed [%d]", err);
goto FINISH_OFF;
}
@@ -723,6 +789,8 @@ FINISH_OFF:
if (mailbox_tbl_list != NULL)
emstorage_free_mailbox(&mailbox_tbl_list, mailbox_count, NULL);
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -732,31 +800,48 @@ EXPORT_API int email_get_mailbox_by_mailbox_type(int account_id, email_mailbox_t
EM_DEBUG_FUNC_BEGIN ();
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
email_mailbox_t* curr_mailbox = NULL;
emstorage_mailbox_tbl_t* local_mailbox = NULL;
EM_IF_NULL_RETURN_VALUE(mailbox, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(account_id, EMAIL_ERROR_INVALID_PARAM) ;
- if(mailbox_type < EMAIL_MAILBOX_TYPE_INBOX || mailbox_type > EMAIL_MAILBOX_TYPE_USER_DEFINED)
- return EMAIL_ERROR_INVALID_PARAM;
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
- if (!emstorage_get_mailbox_by_mailbox_type(account_id, mailbox_type, &local_mailbox, true, &err)) {
- EM_DEBUG_EXCEPTION("emstorage_get_mailbox_by_mailbox_type failed [%d]", err);
+ if (mailbox_type < EMAIL_MAILBOX_TYPE_INBOX || mailbox_type > EMAIL_MAILBOX_TYPE_USER_DEFINED) {
+ err = EMAIL_ERROR_INVALID_PARAM;
+ goto FINISH_OFF;
+ }
+ if (!emstorage_get_mailbox_by_mailbox_type(multi_user_name, account_id, mailbox_type, &local_mailbox, true, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_get_mailbox_by_mailbox_type failed [%d]", err);
goto FINISH_OFF;
} else {
err = EMAIL_ERROR_NONE;
curr_mailbox = em_malloc(sizeof(email_mailbox_t));
+ if (curr_mailbox == NULL) {
+ EM_DEBUG_EXCEPTION("em_malloc failed");
+ err = EMAIL_ERROR_OUT_OF_MEMORY;
+ goto FINISH_OFF;
+ }
+
memset(curr_mailbox, 0x00, sizeof(email_mailbox_t));
em_convert_mailbox_tbl_to_mailbox(local_mailbox, curr_mailbox);
}
*mailbox = curr_mailbox;
+
FINISH_OFF:
- if(local_mailbox)
+ if (local_mailbox)
emstorage_free_mailbox(&local_mailbox, 1, NULL);
+
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_FUNC_END ("err[%d]", err);
return err;
}
@@ -766,16 +851,27 @@ EXPORT_API int email_get_mailbox_by_mailbox_id(int input_mailbox_id, email_mailb
EM_DEBUG_API_BEGIN ();
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
email_mailbox_t* curr_mailbox = NULL;
emstorage_mailbox_tbl_t* local_mailbox = NULL;
EM_IF_NULL_RETURN_VALUE(output_mailbox, EMAIL_ERROR_INVALID_PARAM);
- if ( (err = emstorage_get_mailbox_by_id(input_mailbox_id, &local_mailbox)) != EMAIL_ERROR_NONE) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if ((err = emstorage_get_mailbox_by_id(multi_user_name, input_mailbox_id, &local_mailbox)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emstorage_get_mailbox_by_id failed [%d]", err);
- return err;
+ goto FINISH_OFF;
} else {
curr_mailbox = em_malloc(sizeof(email_mailbox_t));
+ if (curr_mailbox == NULL) {
+ EM_DEBUG_EXCEPTION("em_malloc failed");
+ err = EMAIL_ERROR_OUT_OF_MEMORY;
+ goto FINISH_OFF;
+ }
memset(curr_mailbox, 0x00, sizeof(email_mailbox_t));
@@ -784,7 +880,12 @@ EXPORT_API int email_get_mailbox_by_mailbox_id(int input_mailbox_id, email_mailb
*output_mailbox = curr_mailbox;
- emstorage_free_mailbox(&local_mailbox, 1, &err);
+FINISH_OFF:
+
+ if (local_mailbox)
+ emstorage_free_mailbox(&local_mailbox, 1, &err);
+
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
@@ -796,32 +897,31 @@ EXPORT_API int email_set_mail_slot_size(int account_id, int mailbox_id, int new_
int err = EMAIL_ERROR_NONE;
- if(new_slot_size < 0) {
+ if (new_slot_size < 0) {
EM_DEBUG_EXCEPTION("new_slot_size should be greater than 0 or should be equal to 0");
return EMAIL_ERROR_INVALID_PARAM;
}
HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_SET_MAIL_SLOT_SIZE);
-
EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
if (hAPI) {
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, &account_id, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &account_id, sizeof(int))) {
EM_DEBUG_EXCEPTION(" emipc_add_parameter for account_id failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, &mailbox_id, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &mailbox_id, sizeof(int))) {
EM_DEBUG_EXCEPTION(" emipc_add_parameter for account_id failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(!emipc_add_parameter(hAPI, ePARAMETER_IN, &new_slot_size, sizeof(int))) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &new_slot_size, sizeof(int))) {
EM_DEBUG_EXCEPTION(" emipc_add_parameter for new_slot_size failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
}
@@ -849,7 +949,25 @@ EXPORT_API int email_stamp_sync_time_of_mailbox(int input_mailbox_id)
EM_IF_NULL_RETURN_VALUE(input_mailbox_id, EMAIL_ERROR_INVALID_PARAM);
- err = emstorage_stamp_last_sync_time_of_mailbox(input_mailbox_id, 1);
+ HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_STAMP_SYNC_TIME_OF_MAILBOX);
+ EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
+
+ if (hAPI) {
+ if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &input_mailbox_id, sizeof(int))) {
+ EM_DEBUG_EXCEPTION(" emipc_add_parameter for account_id failed");
+ EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
+ }
+
+ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
+ EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_IPC_SOCKET_FAILURE);
+ }
+
+ emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err);
+ EM_DEBUG_LOG("email_stamp_sync_time_of_mailbox error VALUE [%d]", err);
+ emipc_destroy_email_api(hAPI);
+ hAPI = NULL;
+ }
EM_DEBUG_API_END ("err[%d]", err);
return err;
@@ -861,6 +979,8 @@ EXPORT_API int email_free_mailbox(email_mailbox_t** mailbox_list, int count)
int err = EMAIL_ERROR_NONE;
if (count <= 0 || !mailbox_list || !*mailbox_list) {
+ EM_DEBUG_LOG("EMAIL_ERROR_INVALID_PARAM");
+ err = EMAIL_ERROR_INVALID_PARAM;
goto FINISH_OFF;
}
diff --git a/email-api/email-api-network.c b/email-api/email-api-network.c
index 1054660..825d872 100755
--- a/email-api/email-api-network.c
+++ b/email-api/email-api-network.c
@@ -30,7 +30,6 @@
* email-service .
*/
-#include "email-api.h"
#include "string.h"
#include "email-convert.h"
#include "email-api-mailbox.h"
@@ -46,18 +45,24 @@ EXPORT_API int email_send_mail(int mail_id, int *handle)
EM_DEBUG_API_BEGIN ("mail_id[%d] handle[%p]", mail_id, handle);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
emstorage_mail_tbl_t* mail_table_data = NULL;
email_account_server_t account_server_type;
HIPC_API hAPI = NULL;
ASNotiData as_noti_data;
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
if(mail_id <= 0) {
EM_DEBUG_EXCEPTION("mail_id is not valid");
- err= EMAIL_ERROR_INVALID_PARAM;
+ err = EMAIL_ERROR_INVALID_PARAM;
goto FINISH_OFF;
}
- if(!emstorage_get_mail_by_id(mail_id, &mail_table_data, true, &err) || !mail_table_data) {
+ if(!emstorage_get_mail_by_id(multi_user_name, mail_id, &mail_table_data, true, &err) || !mail_table_data) {
EM_DEBUG_EXCEPTION("Failed to get mail by mail_id [%d]", err);
goto FINISH_OFF;
}
@@ -73,7 +78,7 @@ EXPORT_API int email_send_mail(int mail_id, int *handle)
memset(&as_noti_data, 0x00, sizeof(ASNotiData));
/* check account bind type and branch off */
- if ( em_get_account_server_type_by_account_id(mail_table_data->account_id, &account_server_type, false, &err) == false ) {
+ if (em_get_account_server_type_by_account_id(multi_user_name, mail_table_data->account_id, &account_server_type, false, &err) == false ) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
@@ -88,9 +93,10 @@ EXPORT_API int email_send_mail(int mail_id, int *handle)
}
/* noti to active sync */
- as_noti_data.send_mail.handle = as_handle;
- as_noti_data.send_mail.account_id = mail_table_data->account_id;
- as_noti_data.send_mail.mail_id = mail_id;
+ as_noti_data.send_mail.handle = as_handle;
+ as_noti_data.send_mail.account_id = mail_table_data->account_id;
+ as_noti_data.send_mail.mail_id = mail_id;
+ as_noti_data.send_mail.multi_user_name = multi_user_name;
if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_SEND_MAIL, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
@@ -136,6 +142,8 @@ FINISH_OFF:
emstorage_free_mail(&mail_table_data, 1, NULL);
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -145,18 +153,24 @@ EXPORT_API int email_send_mail_with_downloading_attachment_of_original_mail(int
EM_DEBUG_API_BEGIN ("input_mail_id[%d] output_handle[%p]", input_mail_id, output_handle);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
emstorage_mail_tbl_t* mail_table_data = NULL;
email_account_server_t account_server_type;
HIPC_API hAPI = NULL;
task_parameter_EMAIL_ASYNC_TASK_SEND_MAIL_WITH_DOWNLOADING_ATTACHMENT_OF_ORIGINAL_MAIL task_parameter;
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
if(input_mail_id <= 0) {
EM_DEBUG_EXCEPTION("mail_id is not valid");
err= EMAIL_ERROR_INVALID_PARAM;
goto FINISH_OFF;
}
- if(!emstorage_get_mail_by_id(input_mail_id, &mail_table_data, true, &err) || !mail_table_data) {
+ if(!emstorage_get_mail_by_id(multi_user_name, input_mail_id, &mail_table_data, true, &err) || !mail_table_data) {
EM_DEBUG_EXCEPTION("Failed to get mail by mail_id [%d]", err);
goto FINISH_OFF;
}
@@ -170,7 +184,7 @@ EXPORT_API int email_send_mail_with_downloading_attachment_of_original_mail(int
EM_DEBUG_LOG("mail_table_data->account_id[%d], mail_table_data->mailbox_id[%d]", mail_table_data->account_id, mail_table_data->mailbox_id);
/* check account bind type and branch off */
- if ( em_get_account_server_type_by_account_id(mail_table_data->account_id, &account_server_type, false, &err) == false ) {
+ if ( em_get_account_server_type_by_account_id(multi_user_name, mail_table_data->account_id, &account_server_type, false, &err) == false ) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
@@ -189,9 +203,10 @@ EXPORT_API int email_send_mail_with_downloading_attachment_of_original_mail(int
}
/* noti to active sync */
- as_noti_data.send_mail_with_downloading_attachment_of_original_mail.handle = as_handle;
- as_noti_data.send_mail_with_downloading_attachment_of_original_mail.mail_id = input_mail_id;
- as_noti_data.send_mail_with_downloading_attachment_of_original_mail.account_id = mail_table_data->account_id;
+ as_noti_data.send_mail_with_downloading_attachment_of_original_mail.handle = as_handle;
+ as_noti_data.send_mail_with_downloading_attachment_of_original_mail.mail_id = input_mail_id;
+ as_noti_data.send_mail_with_downloading_attachment_of_original_mail.account_id = mail_table_data->account_id;
+ as_noti_data.send_mail_with_downloading_attachment_of_original_mail.multi_user_name = multi_user_name;
if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_SEND_MAIL_WITH_DOWNLOADING_OF_ORIGINAL_MAIL, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
@@ -217,6 +232,8 @@ FINISH_OFF:
emstorage_free_mail(&mail_table_data, 1, NULL);
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -226,24 +243,30 @@ EXPORT_API int email_schedule_sending_mail(int input_mail_id, time_t input_sched
EM_DEBUG_API_BEGIN ("mail_id[%d] input_time[%d]", input_mail_id, input_scheduled_time);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
emstorage_mail_tbl_t* mail_table_data = NULL;
email_account_server_t account_server_type;
HIPC_API hAPI = NULL;
task_parameter_EMAIL_SYNC_TASK_SCHEDULE_SENDING_MAIL task_parameter;
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
if(input_mail_id <= 0) {
EM_DEBUG_EXCEPTION("mail_id is not valid");
err = EMAIL_ERROR_INVALID_PARAM;
goto FINISH_OFF;
}
- if(!emstorage_get_mail_by_id(input_mail_id, &mail_table_data, true, &err) || !mail_table_data) {
+ if(!emstorage_get_mail_by_id(multi_user_name, input_mail_id, &mail_table_data, true, &err) || !mail_table_data) {
EM_DEBUG_EXCEPTION("Failed to get mail by mail_id [%d]", err);
goto FINISH_OFF;
}
/* check account bind type and branch off */
- if ( em_get_account_server_type_by_account_id(mail_table_data->account_id, &account_server_type, false, &err) == false ) {
+ if ( em_get_account_server_type_by_account_id(multi_user_name, mail_table_data->account_id, &account_server_type, false, &err) == false ) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
@@ -262,10 +285,11 @@ EXPORT_API int email_schedule_sending_mail(int input_mail_id, time_t input_sched
}
/* noti to active sync */
- as_noti_data.schedule_sending_mail.handle = as_handle;
- as_noti_data.schedule_sending_mail.account_id = mail_table_data->account_id;
- as_noti_data.schedule_sending_mail.mail_id = input_mail_id;
- as_noti_data.schedule_sending_mail.scheduled_time = input_scheduled_time;
+ as_noti_data.schedule_sending_mail.handle = as_handle;
+ as_noti_data.schedule_sending_mail.account_id = mail_table_data->account_id;
+ as_noti_data.schedule_sending_mail.mail_id = input_mail_id;
+ as_noti_data.schedule_sending_mail.scheduled_time = input_scheduled_time;
+ as_noti_data.schedule_sending_mail.multi_user_name = multi_user_name;
if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_SCHEDULE_SENDING_MAIL, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
@@ -289,6 +313,8 @@ FINISH_OFF:
emstorage_free_mail(&mail_table_data, 1, NULL);
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -334,6 +360,7 @@ EXPORT_API int email_sync_header(int input_account_id, int input_mailbox_id, int
{
EM_DEBUG_API_BEGIN ("input_account_id[%d] input_mailbox_id[%d] handle[%p]", input_account_id, input_mailbox_id, handle);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
/* int total_count = 0; */
EM_IF_ACCOUNT_ID_NULL(input_account_id, EMAIL_ERROR_INVALID_PARAM);
@@ -343,8 +370,13 @@ EXPORT_API int email_sync_header(int input_account_id, int input_mailbox_id, int
ASNotiData as_noti_data;
memset(&as_noti_data, 0x00, sizeof(ASNotiData));
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
/* 2010/02/12 ch715.lee : check account bind type and branch off */
- if ( em_get_account_server_type_by_account_id(input_account_id, &account_server_type, true, &err) == false ) {
+ if (em_get_account_server_type_by_account_id(multi_user_name, input_account_id, &account_server_type, true, &err) == false) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
goto FINISH_OFF;
}
@@ -357,18 +389,19 @@ EXPORT_API int email_sync_header(int input_account_id, int input_mailbox_id, int
}
/* noti to active sync */
- as_noti_data.sync_header.handle = as_handle;
- as_noti_data.sync_header.account_id = input_account_id;
+ as_noti_data.sync_header.handle = as_handle;
+ as_noti_data.sync_header.account_id = input_account_id;
/* In case that Mailbox is NULL, SYNC ALL MAILBOX */
- as_noti_data.sync_header.mailbox_id = input_mailbox_id;
+ as_noti_data.sync_header.mailbox_id = input_mailbox_id;
+ as_noti_data.sync_header.multi_user_name = multi_user_name;
- if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_SYNC_HEADER, &as_noti_data) == false) {
+ if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_SYNC_HEADER, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
}
- if(handle)
+ if (handle)
*handle = as_handle;
}
@@ -406,9 +439,12 @@ EXPORT_API int email_sync_header(int input_account_id, int input_mailbox_id, int
}
FINISH_OFF:
+
emipc_destroy_email_api(hAPI);
hAPI = NULL;
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -418,6 +454,7 @@ EXPORT_API int email_sync_header_for_all_account(int *handle)
{
EM_DEBUG_API_BEGIN ("handle[%p]", handle);
char* mailbox_stream = NULL;
+ char *multi_user_name = NULL;
int err = EMAIL_ERROR_NONE;
HIPC_API hAPI = NULL;
int return_handle;
@@ -428,6 +465,11 @@ EXPORT_API int email_sync_header_for_all_account(int *handle)
int input_account_id = ALL_ACCOUNT;
int input_mailbox_id = 0; /* all case */
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
hAPI = emipc_create_email_api(_EMAIL_API_SYNC_HEADER);
EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
@@ -457,14 +499,13 @@ EXPORT_API int email_sync_header_for_all_account(int *handle)
if (err != EMAIL_ERROR_NONE)
goto FINISH_OFF;
- emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), &return_handle);
+ emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), &return_handle);
memset(&as_noti_data, 0x00, sizeof(ASNotiData));
/* Get all accounts for sending notification to active sync engine. */
- if (!emstorage_get_account_list(&account_count, &account_tbl_array , true, false, &as_err)) {
+ if (!emstorage_get_account_list(multi_user_name, &account_count, &account_tbl_array , true, false, &as_err)) {
EM_DEBUG_EXCEPTION("emstorage_get_account_list failed [ %d ] ", as_err);
-
goto FINISH_OFF;
}
@@ -480,10 +521,11 @@ EXPORT_API int email_sync_header_for_all_account(int *handle)
*/
/* noti to active sync */
- as_noti_data.sync_header.handle = return_handle;
- as_noti_data.sync_header.account_id = account_tbl_array[i].account_id;
+ as_noti_data.sync_header.handle = return_handle;
+ as_noti_data.sync_header.account_id = account_tbl_array[i].account_id;
/* In case that Mailbox is NULL, SYNC ALL MAILBOX */
- as_noti_data.sync_header.mailbox_id = 0;
+ as_noti_data.sync_header.mailbox_id = 0;
+ as_noti_data.sync_header.multi_user_name = multi_user_name;
if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_SYNC_HEADER, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
@@ -503,7 +545,8 @@ FINISH_OFF:
if ( account_tbl_array )
emstorage_free_account(&account_tbl_array, account_count, NULL);
-
+
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -517,6 +560,13 @@ EXPORT_API int email_download_body(int mail_id, int with_attachment, int *handle
email_account_server_t account_server_type;
HIPC_API hAPI = NULL;
ASNotiData as_noti_data;
+ char *multi_user_name = NULL;
+
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
memset(&as_noti_data, 0x00, sizeof(ASNotiData));
if(mail_id <= 0) {
@@ -525,7 +575,7 @@ EXPORT_API int email_download_body(int mail_id, int with_attachment, int *handle
goto FINISH_OFF;
}
- if(!emstorage_get_mail_by_id(mail_id, &mail_table_data, true, &err) || !mail_table_data ) {
+ if(!emstorage_get_mail_by_id(multi_user_name, mail_id, &mail_table_data, true, &err) || !mail_table_data ) {
EM_DEBUG_EXCEPTION("Failed to get mail by mail_id [%d]", err);
goto FINISH_OFF;
}
@@ -538,7 +588,7 @@ EXPORT_API int email_download_body(int mail_id, int with_attachment, int *handle
account_id = mail_table_data->account_id;
/* 2010/02/12 ch715.lee : check account bind type and branch off */
- if ( em_get_account_server_type_by_account_id(account_id, &account_server_type, true, &err) == false ) {
+ if ( em_get_account_server_type_by_account_id(multi_user_name, account_id, &account_server_type, true, &err) == false ) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
goto FINISH_OFF;
}
@@ -551,10 +601,11 @@ EXPORT_API int email_download_body(int mail_id, int with_attachment, int *handle
}
/* noti to active sync */
- as_noti_data.download_body.handle = as_handle;
- as_noti_data.download_body.account_id = account_id;
- as_noti_data.download_body.mail_id = mail_id;
+ as_noti_data.download_body.handle = as_handle;
+ as_noti_data.download_body.account_id = account_id;
+ as_noti_data.download_body.mail_id = mail_id;
as_noti_data.download_body.with_attachment = with_attachment;
+ as_noti_data.download_body.multi_user_name = multi_user_name;
if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_DOWNLOAD_BODY, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
@@ -595,11 +646,9 @@ EXPORT_API int email_download_body(int mail_id, int with_attachment, int *handle
if (err != EMAIL_ERROR_NONE)
goto FINISH_OFF;
- if(handle)
- {
+ if(handle) {
emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), handle);
EM_DEBUG_LOG("RETURN VALUE : %d handle %d", err, *handle);
-
}
}
@@ -611,6 +660,8 @@ FINISH_OFF:
emstorage_free_mail(&mail_table_data, 1, &err);
}
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
@@ -629,6 +680,13 @@ EXPORT_API int email_download_attachment(int mail_id, int nth, int *handle)
email_account_server_t account_server_type;
HIPC_API hAPI = NULL;
ASNotiData as_noti_data;
+ char *multi_user_name = NULL;
+
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
memset(&as_noti_data, 0x00, sizeof(ASNotiData));
if(mail_id <= 0) {
@@ -637,7 +695,7 @@ EXPORT_API int email_download_attachment(int mail_id, int nth, int *handle)
goto FINISH_OFF;
}
- if(!emstorage_get_mail_by_id(mail_id, &mail_table_data, true, &err) || !mail_table_data ) {
+ if(!emstorage_get_mail_by_id(multi_user_name, mail_id, &mail_table_data, true, &err) || !mail_table_data ) {
EM_DEBUG_EXCEPTION("Failed to get mail by mail_id [%d]", err);
goto FINISH_OFF;
}
@@ -648,8 +706,8 @@ EXPORT_API int email_download_attachment(int mail_id, int nth, int *handle)
}
account_id = mail_table_data->account_id;
-
- if ( em_get_account_server_type_by_account_id(account_id, &account_server_type, true, &err) == false ) {
+
+ if ( em_get_account_server_type_by_account_id(multi_user_name, account_id, &account_server_type, true, &err) == false ) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
goto FINISH_OFF;
}
@@ -662,10 +720,12 @@ EXPORT_API int email_download_attachment(int mail_id, int nth, int *handle)
}
/* noti to active sync */
- as_noti_data.download_attachment.handle = as_handle;
- as_noti_data.download_attachment.account_id = account_id;
- as_noti_data.download_attachment.mail_id = mail_id;
+ as_noti_data.download_attachment.handle = as_handle;
+ as_noti_data.download_attachment.account_id = account_id;
+ as_noti_data.download_attachment.mail_id = mail_id;
as_noti_data.download_attachment.attachment_order = nth;
+ as_noti_data.download_attachment.multi_user_name = multi_user_name;
+
if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_DOWNLOAD_ATTACHMENT, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
@@ -721,6 +781,8 @@ FINISH_OFF:
emstorage_free_mail(&mail_table_data, 1, &err);
}
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
@@ -736,30 +798,36 @@ EXPORT_API int email_cancel_job(int input_account_id, int input_handle, email_ca
ASNotiData as_noti_data;
emstorage_account_tbl_t *account_list = NULL;
int i, account_count = 0;
+ char *multi_user_name = NULL;
if(input_account_id < 0)
return EMAIL_ERROR_INVALID_PARAM;
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
if ( input_account_id == ALL_ACCOUNT ) {
/* this means that job is executed with all account */
/* Get all accounts for sending notification to active sync engine. */
- if (!emstorage_get_account_list(&account_count, &account_list , true, false, &err)) {
+ if (!emstorage_get_account_list(multi_user_name, &account_count, &account_list , true, false, &err)) {
EM_DEBUG_EXCEPTION("emstorage_get_account_list failed [%d]", err);
goto FINISH_OFF;
}
for(i = 0; i < account_count; i++) {
- if ( em_get_account_server_type_by_account_id(account_list[i].account_id, &account_server_type, true, &err) == false ) {
+ if ( em_get_account_server_type_by_account_id(multi_user_name, account_list[i].account_id, &account_server_type, true, &err) == false ) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
goto FINISH_OFF;
}
if ( account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC ) {
memset(&as_noti_data, 0x00, sizeof(ASNotiData));
- as_noti_data.cancel_job.account_id = account_list[i].account_id;
- as_noti_data.cancel_job.handle = input_handle;
- as_noti_data.cancel_job.cancel_type = input_cancel_type;
-
+ as_noti_data.cancel_job.account_id = account_list[i].account_id;
+ as_noti_data.cancel_job.handle = input_handle;
+ as_noti_data.cancel_job.cancel_type = input_cancel_type;
+ as_noti_data.cancel_job.multi_user_name = multi_user_name;
if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_CANCEL_JOB, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
@@ -802,15 +870,16 @@ EXPORT_API int email_cancel_job(int input_account_id, int input_handle, email_ca
hAPI = NULL;
}
else {
- if ( em_get_account_server_type_by_account_id(input_account_id, &account_server_type, true, &err) == false ) {
+ if ( em_get_account_server_type_by_account_id(multi_user_name, input_account_id, &account_server_type, true, &err) == false ) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
goto FINISH_OFF;
}
if ( account_server_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC ) {
memset(&as_noti_data, 0x00, sizeof(ASNotiData));
- as_noti_data.cancel_job.account_id = input_account_id;
- as_noti_data.cancel_job.handle = input_handle;
+ as_noti_data.cancel_job.account_id = input_account_id;
+ as_noti_data.cancel_job.handle = input_handle;
+ as_noti_data.cancel_job.multi_user_name = multi_user_name;
if ( em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_CANCEL_JOB, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed.");
@@ -848,7 +917,8 @@ FINISH_OFF:
hAPI = NULL;
if (account_list)
emstorage_free_account(&account_list, account_count, NULL);
-
+
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -891,7 +961,7 @@ EXPORT_API int email_get_task_information(email_task_information_t **output_task
goto FINISH_OFF;
}
- if(emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
+ if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
err = EMAIL_ERROR_IPC_CRASH;
goto FINISH_OFF;
@@ -921,6 +991,9 @@ EXPORT_API int email_get_task_information(email_task_information_t **output_task
}
}
+ if (err == EMAIL_ERROR_DATA_NOT_FOUND)
+ err = EMAIL_ERROR_NONE;
+
FINISH_OFF:
if(hAPI)
emipc_destroy_email_api(hAPI);
@@ -972,6 +1045,7 @@ EXPORT_API int email_search_mail_on_server(int input_account_id, int input_mailb
int return_value = 0;
int stream_size_for_search_filter_list = 0;
char *stream_for_search_filter_list = NULL;
+ char *multi_user_name = NULL;
HIPC_API hAPI = NULL;
email_account_server_t account_server_type = EMAIL_SERVER_TYPE_NONE;
ASNotiData as_noti_data;
@@ -980,9 +1054,14 @@ EXPORT_API int email_search_mail_on_server(int input_account_id, int input_mailb
EM_IF_NULL_RETURN_VALUE(input_mailbox_id, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(input_search_filter_list, EMAIL_ERROR_INVALID_PARAM);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
memset(&as_noti_data, 0, sizeof(ASNotiData)); /* initialization of union members */
- if ( em_get_account_server_type_by_account_id(input_account_id, &account_server_type, true, &err) == false ) {
+ if ( em_get_account_server_type_by_account_id(multi_user_name, input_account_id, &account_server_type, true, &err) == false ) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
goto FINISH_OFF;
}
@@ -1001,6 +1080,7 @@ EXPORT_API int email_search_mail_on_server(int input_account_id, int input_mailb
as_noti_data.search_mail_on_server.mailbox_id = input_mailbox_id;
as_noti_data.search_mail_on_server.search_filter_list = input_search_filter_list;
as_noti_data.search_mail_on_server.search_filter_count = input_search_filter_count;
+ as_noti_data.search_mail_on_server.multi_user_name = multi_user_name;
return_value = em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_SEARCH_ON_SERVER, &as_noti_data);
@@ -1063,6 +1143,7 @@ FINISH_OFF:
hAPI = NULL;
}
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -1074,14 +1155,20 @@ EXPORT_API int email_clear_result_of_search_mail_on_server(int input_account_id)
int err = EMAIL_ERROR_NONE;
int return_value = 0;
HIPC_API hAPI = NULL;
+ char *multi_user_name = NULL;
email_account_server_t account_server_type = EMAIL_SERVER_TYPE_NONE;
ASNotiData as_noti_data;
- EM_IF_NULL_RETURN_VALUE(input_account_id, EMAIL_ERROR_INVALID_PARAM);
+ EM_IF_NULL_RETURN_VALUE(input_account_id, EMAIL_ERROR_INVALID_PARAM);
+
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
memset(&as_noti_data, 0, sizeof(ASNotiData)); /* initialization of union members */
- if ( em_get_account_server_type_by_account_id(input_account_id, &account_server_type, true, &err) == false ) {
+ if ( em_get_account_server_type_by_account_id(multi_user_name, input_account_id, &account_server_type, true, &err) == false ) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
goto FINISH_OFF;
}
@@ -1097,6 +1184,7 @@ EXPORT_API int email_clear_result_of_search_mail_on_server(int input_account_id)
/* noti to active sync */
as_noti_data.clear_result_of_search_mail_on_server.handle = as_handle;
as_noti_data.clear_result_of_search_mail_on_server.account_id = input_account_id;
+ as_noti_data.clear_result_of_search_mail_on_server.multi_user_name = multi_user_name;
return_value = em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_CLEAR_RESULT_OF_SEARCH_ON_SERVER, &as_noti_data);
@@ -1136,6 +1224,7 @@ FINISH_OFF:
hAPI = NULL;
}
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -1144,6 +1233,7 @@ EXPORT_API int email_query_smtp_mail_size_limit(int account_id, int *handle)
{
EM_DEBUG_API_BEGIN ("account_id[%d] handle[%p]", account_id, handle);
int err = EMAIL_ERROR_NONE;
+ char *multi_user_name = NULL;
email_account_server_t account_server_type;
HIPC_API hAPI = NULL;
@@ -1153,7 +1243,12 @@ EXPORT_API int email_query_smtp_mail_size_limit(int account_id, int *handle)
goto FINISH_OFF;
}
- if (em_get_account_server_type_by_account_id(account_id, &account_server_type, false, &err) == false ) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if (em_get_account_server_type_by_account_id(multi_user_name, account_id, &account_server_type, false, &err) == false ) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
goto FINISH_OFF;
}
@@ -1188,6 +1283,7 @@ FINISH_OFF:
emipc_destroy_email_api(hAPI);
hAPI = (HIPC_API)NULL;
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
diff --git a/email-api/email-api-rule.c b/email-api/email-api-rule.c
index 26f949d..4bd92c0 100755
--- a/email-api/email-api-rule.c
+++ b/email-api/email-api-rule.c
@@ -30,30 +30,38 @@
* email-service .
*/
-#include "email-api.h"
#include "string.h"
#include "email-convert.h"
#include "email-storage.h"
#include "email-utilities.h"
#include "email-ipc.h"
+#include "email-core-utils.h"
EXPORT_API int email_get_rule(int filter_id, email_rule_t** filtering_set)
{
EM_DEBUG_API_BEGIN ("filter_id[%d] filtering_set[%p]", filter_id, filtering_set);
int err = 0;
+ char *multi_user_name = NULL;
EM_IF_NULL_RETURN_VALUE(filtering_set, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(filter_id, EMAIL_ERROR_INVALID_PARAM);
- if (!emstorage_get_rule_by_id(filter_id, (emstorage_rule_tbl_t**)filtering_set, true, &err)) {
- EM_DEBUG_EXCEPTION("emstorage_get_rule_by_id failed [%d]", err);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+ if (!emstorage_get_rule_by_id(multi_user_name, filter_id, (emstorage_rule_tbl_t**)filtering_set, true, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_get_rule_by_id failed [%d]", err);
goto FINISH_OFF;
} else
err = EMAIL_ERROR_NONE;
FINISH_OFF:
+
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -65,21 +73,28 @@ EXPORT_API int email_get_rule_list(email_rule_t** filtering_set, int* count)
int err = EMAIL_ERROR_NONE;
int is_completed = 0;
+ char *multi_user_name = NULL;
EM_IF_NULL_RETURN_VALUE(filtering_set, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(count, EMAIL_ERROR_INVALID_PARAM);
- *count = 1000;
-
- if (!emstorage_get_rule(0, 0, 0, count, &is_completed, (emstorage_rule_tbl_t**)filtering_set, true, &err)) {
- EM_DEBUG_EXCEPTION("emstorage_get_rule failed [%d]", err);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+ *count = 1000;
+ if (!emstorage_get_rule(multi_user_name, 0, 0, 0, count, &is_completed, (emstorage_rule_tbl_t**)filtering_set, true, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_get_rule failed [%d]", err);
goto FINISH_OFF;
} else
err = EMAIL_ERROR_NONE;
FINISH_OFF:
+
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
@@ -229,11 +244,11 @@ EXPORT_API int email_free_rule (email_rule_t** filtering_set, int count)
if (count > 0) {
email_rule_t* p = *filtering_set;
- for (i = 0; i < count; i++) {
- EM_SAFE_FREE(p[i].value);
- }
+ for (i = 0; i < count; i++)
+ emcore_free_rule(p + i);
- EM_SAFE_FREE(p); *filtering_set = NULL;
+ EM_SAFE_FREE(p);
+ *filtering_set = NULL;
}
EM_DEBUG_FUNC_END ("err[%d]", err);
diff --git a/email-api/email-api-smime.c b/email-api/email-api-smime.c
index 11090c4..66c9c02 100755
--- a/email-api/email-api-smime.c
+++ b/email-api/email-api-smime.c
@@ -30,8 +30,8 @@
* Email Engine .
*/
-#include "email-api.h"
#include "string.h"
+#include "email-api-mail.h"
#include "email-convert.h"
#include "email-api-account.h"
#include "email-storage.h"
@@ -41,6 +41,7 @@
#include "email-core-account.h"
#include "email-core-cert.h"
#include "email-core-smime.h"
+#include "email-core-pgp.h"
#include "email-core-signal.h"
#include "email-ipc.h"
@@ -149,34 +150,48 @@ EXPORT_API int email_get_certificate(char *email_address, email_certificate_t **
EM_DEBUG_API_BEGIN ();
int err = EMAIL_ERROR_NONE;
char temp_email_address[130] = {0, };
+ char *multi_user_name = NULL;
emstorage_certificate_tbl_t *cert = NULL;
EM_IF_NULL_RETURN_VALUE(email_address, EMAIL_ERROR_INVALID_PARAM);
EM_IF_NULL_RETURN_VALUE(certificate, EMAIL_ERROR_INVALID_PARAM);
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
SNPRINTF(temp_email_address, sizeof(temp_email_address), "<%s>", email_address);
- if (!emstorage_get_certificate_by_email_address(temp_email_address, &cert, false, 0, &err)) {
+
+ if (!emstorage_get_certificate_by_email_address(multi_user_name, temp_email_address, &cert, false, 0, &err)) {
EM_DEBUG_EXCEPTION("emstorage_get_certificate_by_index failed - %d", err);
- return err;
+ goto FINISH_OFF;
}
if (!em_convert_certificate_tbl_to_certificate(cert, certificate, &err)) {
EM_DEBUG_EXCEPTION("em_convert_certificate_tbl_to_certificate failed");
- return err;
+ goto FINISH_OFF;
}
-
+
+FINISH_OFF:
+
+ EM_SAFE_FREE(multi_user_name);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
-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_get_decrypt_message(int mail_id, email_mail_data_t **output_mail_data,
+ email_attachment_data_t **output_attachment_data,
+ int *output_attachment_count, int *verify)
{
EM_DEBUG_API_BEGIN ("mail_id[%d]", mail_id);
int err = EMAIL_ERROR_NONE;
int p_output_attachment_count = 0;
- int i = 0;
+ int i = 0;
char *decrypt_filepath = NULL;
- char *search = NULL;
+ char *search = NULL;
+ char *multi_user_name = NULL;
email_mail_data_t *p_output_mail_data = NULL;
email_attachment_data_t *p_output_attachment_data = NULL;
emstorage_account_tbl_t *p_account_tbl = NULL;
@@ -189,17 +204,22 @@ EXPORT_API int email_get_decrypt_message(int mail_id, email_mail_data_t **output
goto FINISH_OFF;
}
- if ((err = emcore_get_mail_data(mail_id, &p_output_mail_data)) != EMAIL_ERROR_NONE) {
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]");
+ goto FINISH_OFF;
+ }
+
+ if ((err = emcore_get_mail_data(multi_user_name, mail_id, &p_output_mail_data)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emcore_get_mail_data failed");
goto FINISH_OFF;
}
- if (!emstorage_get_account_by_id(p_output_mail_data->account_id, EMAIL_ACC_GET_OPT_OPTIONS, &p_account_tbl, false, &err)) {
+ if (!emstorage_get_account_by_id(multi_user_name, p_output_mail_data->account_id, EMAIL_ACC_GET_OPT_OPTIONS, &p_account_tbl, false, &err)) {
EM_DEBUG_EXCEPTION("emstorage_get_account_by_id failed : [%d]", err);
goto FINISH_OFF;
}
- if ((err = emcore_get_attachment_data_list(mail_id, &p_output_attachment_data, &p_output_attachment_count)) != EMAIL_ERROR_NONE) {
+ if ((err = emcore_get_attachment_data_list(multi_user_name, mail_id, &p_output_attachment_data, &p_output_attachment_count)) != EMAIL_ERROR_NONE) {
EM_DEBUG_EXCEPTION("emcore_get_attachment_data_list failed");
goto FINISH_OFF;
}
@@ -209,7 +229,10 @@ EXPORT_API int email_get_decrypt_message(int mail_id, email_mail_data_t **output
if (p_output_attachment_data[i].attachment_mime_type && (search = strcasestr(p_output_attachment_data[i].attachment_mime_type, "PKCS7-MIME"))) {
EM_DEBUG_LOG("Found the encrypt file");
break;
- }
+ } else if (p_output_attachment_data[i].attachment_mime_type && (search = strcasestr(p_output_attachment_data[i].attachment_mime_type, "octet-stream"))) {
+ EM_DEBUG_LOG("Found the encrypt file");
+ break;
+ }
}
if (!search) {
@@ -218,8 +241,27 @@ EXPORT_API int email_get_decrypt_message(int mail_id, email_mail_data_t **output
goto FINISH_OFF;
}
- if (!emcore_smime_set_decrypt_message(p_output_attachment_data[i].attachment_path, p_account_tbl->certificate_path, &decrypt_filepath, &err)) {
- EM_DEBUG_EXCEPTION("emcore_smime_set_decrypt_message failed");
+ if (p_output_mail_data->smime_type == EMAIL_SMIME_ENCRYPTED || p_output_mail_data->smime_type == EMAIL_SMIME_SIGNED_AND_ENCRYPTED) {
+ emcore_init_openssl_library();
+ if (!emcore_smime_get_decrypt_message(p_output_attachment_data[i].attachment_path, p_account_tbl->certificate_path, &decrypt_filepath, &err)) {
+ EM_DEBUG_EXCEPTION("emcore_smime_get_decrypt_message failed");
+ emcore_clean_openssl_library();
+ goto FINISH_OFF;
+ }
+ emcore_clean_openssl_library();
+ } else if (p_output_mail_data->smime_type == EMAIL_PGP_ENCRYPTED) {
+ if ((err = emcore_pgp_get_decrypted_message(p_output_attachment_data[i].attachment_path, p_output_mail_data->pgp_password, false, &decrypt_filepath, verify)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emcore_pgp_get_decrypted_message failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+ } else if (p_output_mail_data->smime_type == EMAIL_PGP_SIGNED_AND_ENCRYPTED) {
+ if ((err = emcore_pgp_get_decrypted_message(p_output_attachment_data[i].attachment_path, p_output_mail_data->pgp_password, true, &decrypt_filepath, verify)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emcore_pgp_get_decrypted_message failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+ } else {
+ EM_DEBUG_LOG("Invalid encrypted mail");
+ err = EMAIL_ERROR_INVALID_PARAM;
goto FINISH_OFF;
}
@@ -239,9 +281,12 @@ EXPORT_API int email_get_decrypt_message(int mail_id, email_mail_data_t **output
(*output_mail_data)->full_address_to = EM_SAFE_STRDUP(p_output_mail_data->full_address_to);
(*output_mail_data)->full_address_cc = EM_SAFE_STRDUP(p_output_mail_data->full_address_cc);
(*output_mail_data)->full_address_bcc = EM_SAFE_STRDUP(p_output_mail_data->full_address_bcc);
+ (*output_mail_data)->flags_flagged_field = p_output_mail_data->flags_flagged_field;
FINISH_OFF:
+ EM_SAFE_FREE(decrypt_filepath);
+
if (p_account_tbl)
emstorage_free_account(&p_account_tbl, 1, NULL);
@@ -251,6 +296,113 @@ FINISH_OFF:
if (p_output_attachment_data)
email_free_attachment_data(&p_output_attachment_data, p_output_attachment_count);
+ EM_SAFE_FREE(multi_user_name);
+
+ EM_DEBUG_API_END ("err[%d]", err);
+ return err;
+}
+
+EXPORT_API int email_get_decrypt_message_ex(email_mail_data_t *input_mail_data,
+ email_attachment_data_t *input_attachment_data,
+ int input_attachment_count,
+ email_mail_data_t **output_mail_data,
+ email_attachment_data_t **output_attachment_data,
+ int *output_attachment_count,
+ int *verify)
+{
+ EM_DEBUG_API_BEGIN ();
+ int err = EMAIL_ERROR_NONE;
+ int i = 0;
+ char *decrypt_filepath = NULL;
+ char *search = NULL;
+ char *multi_user_name = NULL;
+ emstorage_account_tbl_t *p_account_tbl = NULL;
+
+ EM_IF_NULL_RETURN_VALUE(input_mail_data, EMAIL_ERROR_INVALID_PARAM);
+
+ if (!output_mail_data || !output_attachment_data || !output_attachment_count) {
+ EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
+ err = EMAIL_ERROR_INVALID_PARAM;
+ goto FINISH_OFF;
+ }
+
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ if (!emstorage_get_account_by_id(multi_user_name, input_mail_data->account_id, EMAIL_ACC_GET_OPT_OPTIONS, &p_account_tbl, false, &err)) {
+ EM_DEBUG_EXCEPTION("emstorage_get_account_by_id failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ for (i = 0; i < input_attachment_count; i++) {
+ EM_DEBUG_LOG("mime_type : [%s]", input_attachment_data[i].attachment_mime_type);
+ if (input_attachment_data[i].attachment_mime_type && (search = strcasestr(input_attachment_data[i].attachment_mime_type, "PKCS7-MIME"))) {
+ EM_DEBUG_LOG("Found the encrypt file");
+ break;
+ } else if (input_attachment_data[i].attachment_mime_type && (search = strcasestr(input_attachment_data[i].attachment_mime_type, "octet-stream"))) {
+ EM_DEBUG_LOG("Found the encrypt file");
+ break;
+ }
+ }
+
+ if (!search) {
+ EM_DEBUG_EXCEPTION("No have a decrypt file");
+ err = EMAIL_ERROR_INVALID_PARAM;
+ goto FINISH_OFF;
+ }
+
+ if (input_mail_data->smime_type == EMAIL_SMIME_ENCRYPTED || input_mail_data->smime_type == EMAIL_SMIME_SIGNED_AND_ENCRYPTED) {
+ emcore_init_openssl_library();
+ if (!emcore_smime_get_decrypt_message(input_attachment_data[i].attachment_path, p_account_tbl->certificate_path, &decrypt_filepath, &err)) {
+ EM_DEBUG_EXCEPTION("emcore_smime_get_decrypt_message failed");
+ emcore_clean_openssl_library();
+ goto FINISH_OFF;
+ }
+ emcore_clean_openssl_library();
+ } else if (input_mail_data->smime_type == EMAIL_PGP_ENCRYPTED) {
+ if ((err = emcore_pgp_get_decrypted_message(input_attachment_data[i].attachment_path, input_mail_data->pgp_password, false, &decrypt_filepath, verify)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emcore_pgp_get_decrypted_message failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+ } else if (input_mail_data->smime_type == EMAIL_PGP_SIGNED_AND_ENCRYPTED) {
+ if ((err = emcore_pgp_get_decrypted_message(input_attachment_data[i].attachment_path, input_mail_data->pgp_password, true, &decrypt_filepath, verify)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emcore_pgp_get_decrypted_message failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+ } else {
+ EM_DEBUG_LOG("Invalid encrypted mail");
+ err = EMAIL_ERROR_INVALID_PARAM;
+ goto FINISH_OFF;
+ }
+
+ /* Change decrpyt_message to mail_data_t */
+ if (!emcore_parse_mime_file_to_mail(decrypt_filepath, output_mail_data, output_attachment_data, output_attachment_count, &err)) {
+ EM_DEBUG_EXCEPTION("emcore_parse_mime_file_to_mail failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
+ (*output_mail_data)->subject = EM_SAFE_STRDUP(input_mail_data->subject);
+ (*output_mail_data)->date_time = input_mail_data->date_time;
+ (*output_mail_data)->full_address_return = EM_SAFE_STRDUP(input_mail_data->full_address_return);
+ (*output_mail_data)->email_address_recipient = EM_SAFE_STRDUP(input_mail_data->email_address_recipient);
+ (*output_mail_data)->email_address_sender = EM_SAFE_STRDUP(input_mail_data->email_address_sender);
+ (*output_mail_data)->full_address_reply = EM_SAFE_STRDUP(input_mail_data->full_address_reply);
+ (*output_mail_data)->full_address_from = EM_SAFE_STRDUP(input_mail_data->full_address_from);
+ (*output_mail_data)->full_address_to = EM_SAFE_STRDUP(input_mail_data->full_address_to);
+ (*output_mail_data)->full_address_cc = EM_SAFE_STRDUP(input_mail_data->full_address_cc);
+ (*output_mail_data)->full_address_bcc = EM_SAFE_STRDUP(input_mail_data->full_address_bcc);
+ (*output_mail_data)->flags_flagged_field = input_mail_data->flags_flagged_field;
+
+FINISH_OFF:
+
+ EM_SAFE_FREE(decrypt_filepath);
+ EM_SAFE_FREE(multi_user_name);
+
+ if (p_account_tbl)
+ emstorage_free_account(&p_account_tbl, 1, NULL);
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -258,11 +410,15 @@ FINISH_OFF:
EXPORT_API int email_verify_signature(int mail_id, int *verify)
{
EM_DEBUG_API_BEGIN ("mail_id[%d]", mail_id);
+
+ if (mail_id <= 0) {
+ EM_DEBUG_EXCEPTION("Invalid parameter");
+ return EMAIL_ERROR_INVALID_PARAM;
+ }
+
int result_from_ipc = 0;
- int err = EMAIL_ERROR_NONE;
int p_verify = 0;
-
- EM_IF_NULL_RETURN_VALUE(mail_id, EMAIL_ERROR_INVALID_PARAM);
+ int err = EMAIL_ERROR_NONE;
HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_VERIFY_SIGNATURE);
if (hAPI == NULL) {
@@ -319,8 +475,20 @@ EXPORT_API int email_verify_signature_ex(email_mail_data_t *input_mail_data, ema
break;
}
- if (!emcore_verify_signature(input_attachment_data[count].attachment_path, input_mail_data->file_path_mime_entity, verify, &err))
- EM_DEBUG_EXCEPTION("emcore_verify_signature failed");
+ if (input_mail_data->smime_type == EMAIL_SMIME_SIGNED) {
+ emcore_init_openssl_library();
+ if (!emcore_verify_signature(input_attachment_data[count].attachment_path, input_mail_data->file_path_mime_entity, verify, &err))
+ EM_DEBUG_EXCEPTION("emcore_verify_signature failed : [%d]", err);
+
+ emcore_clean_openssl_library();
+ } else if(input_mail_data->smime_type == EMAIL_PGP_SIGNED) {
+ if ((err = emcore_pgp_get_verify_signature(input_attachment_data[count].attachment_path, input_mail_data->file_path_mime_entity, input_mail_data->digest_type, verify)) != EMAIL_ERROR_NONE)
+ EM_DEBUG_EXCEPTION("emcore_pgp_get_verify_siganture failed : [%d]", err);
+ } else {
+ EM_DEBUG_LOG("Invalid signed mail : mime_type[%d]", input_mail_data->smime_type);
+ err = EMAIL_ERROR_INVALID_PARAM;
+ }
+
EM_DEBUG_API_END ("err[%d]", err);
return err;
@@ -406,10 +574,10 @@ EXPORT_API int email_check_ocsp_status(char *email_address, char *response_url,
EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
}
- emipc_get_paramter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err);
+ emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err);
if (err == EMAIL_ERROR_NONE) {
if (handle)
- emipc_get_paramter(hAPI, ePARAMETER_OUT, 1, sizeof(int), handle);
+ emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), handle);
}
}
*/
@@ -423,12 +591,18 @@ EXPORT_API int email_validate_certificate(int account_id, char *email_address, u
int err = EMAIL_ERROR_NONE;
int as_handle = 0;
+ char *multi_user_name = NULL;
email_account_server_t account_server_type;
ASNotiData as_noti_data;
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
memset(&as_noti_data, 0x00, sizeof(ASNotiData));
- if (em_get_account_server_type_by_account_id(account_id, &account_server_type, false, &err) == false) {
+ if (em_get_account_server_type_by_account_id(multi_user_name, account_id, &account_server_type, false, &err) == false) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
@@ -448,7 +622,8 @@ EXPORT_API int email_validate_certificate(int account_id, char *email_address, u
as_noti_data.validate_certificate.handle = as_handle;
as_noti_data.validate_certificate.account_id = account_id;
- as_noti_data.validate_certificate.email_address = strdup(email_address);
+ as_noti_data.validate_certificate.email_address = email_address;
+ as_noti_data.validate_certificate.multi_user_name = multi_user_name;
if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_VALIDATE_CERTIFICATE, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed");
@@ -461,6 +636,7 @@ EXPORT_API int email_validate_certificate(int account_id, char *email_address, u
FINISH_OFF:
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
@@ -475,12 +651,18 @@ EXPORT_API int email_get_resolve_recipients(int account_id, char *email_address,
int err = EMAIL_ERROR_NONE;
int as_handle = 0;
+ char *multi_user_name = NULL;
email_account_server_t account_server_type;
ASNotiData as_noti_data;
+ if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
+ EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
+ goto FINISH_OFF;
+ }
+
memset(&as_noti_data, 0x00, sizeof(ASNotiData));
- if (em_get_account_server_type_by_account_id(account_id, &account_server_type, false, &err) == false) {
+ if (em_get_account_server_type_by_account_id(multi_user_name, account_id, &account_server_type, false, &err) == false) {
EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
goto FINISH_OFF;
@@ -498,9 +680,10 @@ EXPORT_API int email_get_resolve_recipients(int account_id, char *email_address,
goto FINISH_OFF;
}
- as_noti_data.get_resolve_recipients.handle = as_handle;
- as_noti_data.get_resolve_recipients.account_id = account_id;
- as_noti_data.get_resolve_recipients.email_address = strdup(email_address);
+ as_noti_data.get_resolve_recipients.handle = as_handle;
+ as_noti_data.get_resolve_recipients.account_id = account_id;
+ as_noti_data.get_resolve_recipients.email_address = email_address;
+ as_noti_data.get_resolve_recipients.multi_user_name = multi_user_name;
if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_RESOLVE_RECIPIENT, &as_noti_data) == false) {
EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed");
@@ -513,6 +696,7 @@ EXPORT_API int email_get_resolve_recipients(int account_id, char *email_address,
FINISH_OFF:
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_API_END ("err[%d]", err);
return err;
}
diff --git a/email-api/include/email-api-account.h b/email-api/include/email-api-account.h
index 98c545c..f9c7ced 100755
--- a/email-api/include/email-api-account.h
+++ b/email-api/include/email-api-account.h
@@ -26,371 +26,427 @@
#include "email-types.h"
/**
-* @defgroup EMAIL_SERVICE Email Service
-* @{
-*/
-
-
-/**
-* @ingroup EMAIL_SERVICE
-* @defgroup EMAIL_API_ACCOUNT Email Account API
-* @{
-*/
+ * @ingroup EMAIL_SERVICE_FRAMEWORK
+ * @defgroup EMAIL_SERVICE_ACCOUNT_MODULE Account API
+ * @brief Account API is a set of operations to manage email accounts like add, update, delete or get account related details.
+ *
+ * @section EMAIL_SERVICE_ACCOUNT_MODULE_HEADER Required Header
+ * \#include <email-api.h>
+ *
+ * @section EMAIL_SERVICE_ACCOUNT_MODULE_OVERVIEW Overview
+ * Account API is a set of operations to manage email accounts like add, update, delete or get account related details.
+ */
/**
+ * @file email-api-account.h
+ * @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;
*
- * 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 .
+ * account = malloc(sizeof(email_account_t));
+ * memset(account, 0x00, sizeof(email_account_t));
*
-* @{
-
-* @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->auto_resend_times = 0;
-* account->pop_before_smtp = 0;
-* account->incoming_server_requires_apop = 0;
-* account->incoming_server_authentication_method = 0;
-* 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);
-* }
+ * 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->auto_resend_times = 0;
+ * account->pop_before_smtp = 0;
+ * account->incoming_server_requires_apop = 0;
+ * account->incoming_server_authentication_method = 0;
+ * 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("tizen001");
+ * 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
* @}
*/
+/**
+ * @addtogroup EMAIL_SERVICE_ACCOUNT_MODULE
+ * @{
+ */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
- * @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
+ * @brief Creates a new email account.
+ * @details This function is invoked when the user wants to add a 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
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ * @param[in] account The structure pointer of an account
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_account_t
*/
EXPORT_API int email_add_account(email_account_t* account);
/**
- * @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
+ * @brief Deletes an email account.
+ * @details This function is invoked when the 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
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The account ID
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @retval EMAIL_ERROR_INVALID_PARAM Invalid argument
*/
EXPORT_API int email_delete_account(int account_id);
/**
- * @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
+ * @brief Changes the information of an email account.
+ * @details This function is invoked when the user wants to change some information of the existing email account.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The original account ID
+ * @param[in] new_account The information of new account
+ * @param[in] with_validation The validation flag \n
+ * If this is @c 1, email-service will validate the account before updating.
+ * If this is @c 0, email-service will update the account without validation.
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @retval #EMAIL_ERROR_INVALID_PARAM Invalid argument
+ *
+ * @see #email_account_t
*/
EXPORT_API int email_update_account(int account_id, email_account_t* new_account);
/**
- * @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
+ * @brief Changes the information of an email account.
+ * @details This function is invoked when the user wants to change some information of the existing email account.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The original account ID
+ * @param[in] new_account The information of new account
+ * @param[in] with_validation The validation tag \n
+ * If this is @c 1, email-service will validate the account before updating.
+ * If this is @c 0, email-service will update the account without validation.
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @retval #EMAIL_ERROR_INVALID_PARAM Invalid argument
+ *
+ * @see #email_account_t
*/
EXPORT_API int email_update_account_with_validation(int account_id, email_account_t* new_account);
/**
- * @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_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
+ * @brief Gets an email account by ID.
+ * @details This function is invoked when the user wants to get the account information based on account ID and option (GET_FULL_DATA/WITHOUT_OPTION/ONLY_OPTION).
+ * Memory for account information will be allocated to the 3rd param (@a account).
+ * You must free the allocated memory using email_free_account().
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The account ID
+ * @param[in] pulloption The option to specify to get full details or partial \n
+ * See definition of #EMAIL_ACC_GET_OPT_XXX.
+ * @param[out] account The returned account is saved here
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @retval #EMAIL_ERROR_INVALID_PARAM Invalid argument
+ *
+ * @see #email_account_t
*/
EXPORT_API int email_get_account(int account_id, int pulloption, email_account_t** account);
/**
- * @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_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
+ * @brief Gets an account list.
+ * @details This function is invoked when the user wants to get all account information based on the count of accounts provided by user.
+ * Memory for account information will be allocated to 3rd param (@a account).
+ * You must free the allocated memory using email_free_account().
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_list The structure pointer of an account
+ * @param[out] count The count of accounts
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @retval #EMAIL_ERROR_INVALID_PARAM Invalid argument
+ *
+ * @see #email_account_t
*/
EXPORT_API int email_get_account_list(email_account_t** account_list, int* count);
/**
- * @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_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
+ * @brief Frees allocated memory.
+ * @details This function is invoked when the user wants to delete all account information.
+ *
+ * @since_tizen 2.3
+ * @privlevel N/P
+ *
+ * @param[in] account_list The structure pointer of an account
+ * @param[out] count The count of accounts
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @retval #EMAIL_ERROR_INVALID_PARAM Invalid argument
+ *
+ * @see #email_account_t
*/
EXPORT_API int email_free_account(email_account_t** account_list, int count);
-
-/**
- * @fn email_validate_account(int account_id, int *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_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 none
- * @remarks N/A
- */
EXPORT_API int email_validate_account(int account_id, int *handle) DEPRECATED; /* Will be replaced with email_validate_account_ex */
/**
- * @fn email_validate_account_ex(email_account_t* account, int *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 .
+ * @brief Validates an account.
+ * @details This function is invoked after adding one account to validate it.
+ * If the account is not validated then t user should retry once again to add the account.
*
- * @param[in] account Specifies the account structure
- * @param[out] handle Specifies the sending handle.
- * @remarks N/A
- * @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
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account The account structure
+ * @param[out] handle The sending handle
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @retval #EMAIL_ERROR_INVALID_PARAM Invalid argument
+ *
+ * @see #email_account_t
*/
EXPORT_API int email_validate_account_ex(email_account_t* account, int *handle);
/**
- * @fn email_add_account_with_validation(email_account_t* account, int *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
+ * @brief Adds an account when the account is validated.
+ * @details This function is invoked when a user wants to validate an account.
+ * If the account is not validated then user should retry once again to add the account.
+ * 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.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account The structure pointer of an account
+ * @param[out] handle The sending handle
+ *
+ * @return @c true on success,
+ * otherwise @c false on failure
*/
EXPORT_API int email_add_account_with_validation(email_account_t* account, int *handle);
/**
- * @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.
+ * @brief Backs up information of all accounts into the secure storage.
+ * @details This function is invoked when a user wants 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.
+ * @param[in] file_name The file name in secure storage
+ *
+ * @return @c true on success,
+ * otherwise @c false on failure
*/
EXPORT_API int email_backup_accounts_into_secure_storage(const char *file_name);
/**
- * @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.
+ * @brief Restores accounts from a file stored in the secure storage.
+ * @details This function is invoked when a user wants 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.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] file_name The file name in the secure storage
+ *
+ * @return @c true on success,
+ * otherwise @c false on failure
*/
EXPORT_API int email_restore_accounts_from_secure_storage(const char * file_name);
/**
- * @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.
+ * @brief Gets the password length of an account.
+ * @details This function is invoked when a user wants to know the length of an account.
*
- * @param[in] account_id Specifies the account id
- * @param[in] password_type Specifies the password type
- * @param[out] password_length 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(int account_id, int *password_length);
-
-
-/**
- * @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.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
*
- * @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.
+ * @param[in] account_id The account ID
+ * @param[in] password_type The password type
+ * @param[out] password_length The password length
+ *
+ * @return @c true on success,
+ * otherwise @c false on failure
*/
-EXPORT_API int email_query_server_info(const char* domain_name, email_server_info_t **result_server_info);
+EXPORT_API int email_get_password_length_of_account(int account_id, email_get_password_length_type password_type, int *password_length);
/**
- * @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.
+ * @brief Updates notifications on the notification bar.
+ * @details This function is invoked when user want to update notification bar.
*
- * @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.
+ * @param[in] account_id The account ID
+ * @param[in] total_mail_count The total number of synced mail
+ * @param[in] unread_mail_count The unread number of synced mail
+ * @param[in] input_from_eas The flag that specifies whether the mail is from EAS
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise error code (see #EMAIL_ERROR_XXX) on failure
*/
-EXPORT_API int email_free_server_info(email_server_info_t **result_server_info);
+EXPORT_API int email_update_notification_bar(int account_id, int total_mail_count, int unread_mail_count, int input_from_eas);
/**
- * @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.
+ * @brief Clears all notification on the notification bar.
+ * @details This function is invoked when a user wants to clear 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.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise error code (see #EMAIL_ERROR_XXX) on failure
*/
-EXPORT_API int email_update_notification_bar(int account_id);
+EXPORT_API int email_clear_all_notification_bar();
/**
- * @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.
+ * @fn email_clear_notification_bar(int account_id)
+ * @brief Clear notification of account on notification bar.
+ * This function is getting invoked when user want to clear notification bar.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
*
* @remarks N/A
- * @return This function returns true on success or false on failure.
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
-EXPORT_API int email_clear_all_notification_bar();
-
+EXPORT_API int email_clear_notification_bar(int account_id);
/**
- * @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.
+ * @brief Saves the default account ID to the vconf storage.
+ * @details This function is invoked when a user wants to save a default account ID.
*
- * @remarks N/A
- * @return This function returns true on success or false on failure.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_save_default_account_id(int input_account_id);
/**
- * @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.
+ * @brief Loads the default account ID to the vconf storage.
+ * @details This function is invoked when a user wants to load a default account ID.
*
- * @remarks N/A
- * @return This function returns true on success or false on failure.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @return @c true on success,
+ * otherwise @c false on failure
*/
EXPORT_API int email_load_default_account_id(int *output_account_id);
@@ -399,8 +455,8 @@ EXPORT_API int email_load_default_account_id(int *output_account_id);
#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
index 4d6d2e5..f6d3821 100755
--- a/email-api/include/email-api-etc.h
+++ b/email-api/include/email-api-etc.h
@@ -20,26 +20,25 @@
*/
/**
-* @defgroup EMAIL_SERVICE Email Service
-* @{
-*/
+ * @file email-api-etc.h
+ * @brief This file contains the data structures and interfaces of etc APIs provided by email-service.
+ */
/**
-* @ingroup EMAIL_SERVICE
-* @defgroup EMAIL_API_ETC Email API
-* @{
-*/
+ * @ingroup EMAIL_SERVICE_FRAMEWORK
+ * @defgroup EMAIL_SERVICE_ETC_MODULE Other API
+ * @brief Various API set for initializing and MIME operations and verifying email address.
+ *
+ * @section EMAIL_SERVICE_ETC_MODULE_HEADER Required Header
+ * \#include <email-api-etc.h>
+ * \#include <email-api-init.h>
+ *
+ * @section EMAIL_SERVICE_ETC_MODULE_OVERVIEW Overview
+ */
/**
- *
- * 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 .
+ * @addtogroup EMAIL_SERVICE_FRAMEWORK
+ * @{
*/
#ifndef __EMAIL_API_ETC_H__
@@ -52,67 +51,120 @@ extern "C" {
#include "email-types.h"
/**
- * @fn email_show_user_message
- * @brief This function show user message.
+ * @brief Shows a user message.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] id (need to be updated)
+ * @param[in] action (need to be updated)
+ * @param[in] error_code (need to be updated)
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise error code (see #EMAIL_ERROR_XXX) on failure
*
- * @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
+ * @see #email_action_t
*/
EXPORT_API int email_show_user_message(int id, email_action_t action, int error_code);
/**
- * @fn email_parse_mime_file
- * @brief This function parse mime file
- * @param[in] eml_file_path
- * @param[out] output_mail_data
- * @param[out] output_attachment_data
- * @param[out] output_attachment_count
- * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
- * @exception none
- * @see
- * @remarks N/A
+ * @brief Parses a MIME file.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] eml_file_path (need to be updated)
+ * @param[out] output_mail_data (need to be updated)
+ * @param[out] output_attachment_data (need to be updated)
+ * @param[out] output_attachment_count (need to be updated)
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_parse_mime_file(char *eml_file_path, email_mail_data_t **output_mail_data, email_attachment_data_t **output_attachment_data, int *output_attachment_count);
/**
- * @fn email_write_mime_file
- * @brief This function create mime file from input data
- * @param[in] input_mail_data
- * @param[in] input_attachment_data
- * @param[in] input_attachment_count
- * @param[out] output_file_path
- * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
- * @exception none
- * @see
- * @remarks N/A
+ * @brief Creates a MIME file from input data.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_mail_data (need to be updated)
+ * @param[in] input_attachment_data (need to be updated)
+ * @param[in] input_attachment_count (need to be updated)
+ * @param[out] output_file_path (need to be updated)
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_write_mime_file(email_mail_data_t *input_mail_data, email_attachment_data_t *input_attachment_data, int input_attachment_count, char **output_file_path);
/**
- * @fn email_delete_parsed_data
- * @brief This function delete parsed files of mime
- * @param[in] input_mail_data
- * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
- * @exception none
- * @see
- * @remarks N/A
+ * @brief Deletes the parsed files of MIME.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_mail_data (need to be updated)
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_delete_parsed_data(email_mail_data_t *input_mail_data);
/**
- * @fn email_get_mime_entity
- * @brief This function get mime entity
- * @param[in] mime_path
- * @param[out] mime_entity
- * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
- * @exception none
- * @see
- * @remarks N/A
+ * @brief Gets a MIME entity.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mime_path (need to be updated)
+ * @param[out] mime_entity (need to be updated)
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_get_mime_entity(char *mime_path, char **mime_entity);
+
+/**
+ * @brief Validates email address.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_email_address The email address string (need to be updated)
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ */
+EXPORT_API int email_verify_email_address(char *input_email_address);
+
+/**
+ * @brief Converts mutf7 string to utf8 string.
+ *
+ * @since_tizen 2.3.1
+ *
+ * @param[in] mutf7_str The original mutf7 string
+ * @param[out] utf8_str Thr utf8 string converted
+ *
+ * @remarks The out param(utf8_str) should be freed by you.
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ * @retval EMAIL_ERROR_NONE Success in operation
+ * @retval EMAIL_ERROR_INVALID_PARAM Input paramter is invalid
+ * @retval EMAIL_ERROR_UNKWON Converting is failed
+ *
+ */
+EXPORT_API int email_convert_mutf7_to_utf8(const char *mutf7_str, char **utf8_str);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
@@ -120,5 +172,5 @@ EXPORT_API int email_get_mime_entity(char *mime_path, char **mime_entity);
#endif /* __EMAIL_API_ETC_H__ */
/**
-* @} @}
-*/
+ * @}
+ */
diff --git a/email-api/include/email-api-init.h b/email-api/include/email-api-init.h
index 6e2ffe1..22f4e93 100755
--- a/email-api/include/email-api-init.h
+++ b/email-api/include/email-api-init.h
@@ -26,140 +26,131 @@
#include "email-types.h"
/**
-* @defgroup EMAIL_SERVICE Email Service
-* @{
-*/
-
-
-/**
-* @ingroup EMAIL_SERVICE
-* @defgroup EMAIL_API_INIT Email Initialization API
-* @{
-*/
-
-/**
+ * @file email-api-init.h
+ * @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;
+ *
+ * // Opens 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;
+ * }
+ *
+ * // Executes email_init_storage() if and only if there is no db file.
+ * // This function will create db file and tables for email service
+ * If(EMAIL_ERROR_NONE !=email_init_storage())
+ * {
+ * return false;
+ * }
+ * }
+ *
+ * ......
+ *
+ * // Work with calling MAPI functions
*
- * 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();
- * }
+ * ......
+ *
+ * // Closes the connections to email-service and DB after all email jobs are finished. (ex. close an email application)
+ * // DO NOT have to call these funtions until the connections are not needed any more.
+ * err =email_close_db();
+ * err =email_service_end();
+ * }
*
* @endcode
* @}
*/
-
+/**
+ * @addtogroup EMAIL_SERVICE_ETC_MODULE
+ * @{
+ */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
- * @fn email_init_storage(void)
- * @brief Create all tables for email.
+ * @brief Creates all tables for an email.
*
- * @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
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_init_storage(void);
/**
- * @fn email_open_db(void)
- * @brief This function Open the email DB and register busy handler
+ * @brief Opens the email DB and registers a busy handler.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
*
- * @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
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_open_db(void);
/**
- * @fn email_close_db(void)
- * @brief This function closes the connection of the email DB
+ * @brief Closes the connection to the email DB.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
*
- * @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
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_close_db(void);
/**
- * @fn email_service_begin(void)
- * @brief Does the IPC Proxy Initialization by the Application which used the Email FW API's
+ * @brief Initializes IPC Proxy by an 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
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_service_begin(void);
/**
- * @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
+ * @brief Finalizes IPC Proxy by an application which used the Email FW API's.
+
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_service_end(void);
/**
- * @fn email_ping_service(void)
- * @brief This function check email-service process is running or not
+ * @brief Checks whether the email-service process is running.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
*
- * @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
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_ping_service(void);
@@ -168,8 +159,8 @@ EXPORT_API int email_ping_service(void);
#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 212cd81..9ff8c12 100755
--- a/email-api/include/email-api-mail.h
+++ b/email-api/include/email-api-mail.h
@@ -30,913 +30,998 @@
#include <unistd.h>
/**
-* @defgroup EMAIL_SERVICE Email Service
-* @{
-*/
-
-
-/**
-* @ingroup EMAIL_SERVICE
-* @defgroup EMAIL_API_MAIL Email Mail API
-* @{
-*/
+ * @file email-api-mail.h
+ */
/**
+ * @ingroup EMAIL_SERVICE_FRAMEWORK
+ * @defgroup EMAIL_SERVICE_MAIL_MODULE Mail API
+ * @brief Mail API is a set of operations to manage mail like add, update, delete or get mail related details.
+ *
+ * @section EMAIL_SERVICE_MAIL_MODULE_HEADER Required Header
+ * \#include <email-api-mail.h>
*
- * 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 .
+ * @section EMAIL_SERVICE_MAIL_MODULE_OVERVIEW Overview
+ * Mail API is a set of operations to manage mail like add, update, delete or get mail related details.
*/
-
+/**
+ * @addtogroup EMAIL_SERVICE_MAIL_MODULE
+ * @{
+ */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
- * @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 = MAILHOME"/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;
- * }
+ * @brief Saves a mail.
+ * @details This function is invoked when a user wants to add a mail.\n
+ * If the option from_eas is 1 then this will save the message on server as well as on locally.\n
+ * If the incoming_server_type is EMAIL_SERVER_TYPE_POP3 then from_eas value will be 0.\n
+ * If the incoming_server_type is EMAIL_SERVER_TYPE_IMAP4 then from_eas value will be 1/0.
*
- * 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;
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
*
- * }
+ * @param[in] input_mail_data The mail to be saved
+ * @param[in] input_attachment_data_list The mailbox structure for saving email
+ * @param[in] input_attachment_count The mail attachment count
+ * @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
*
- * 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");
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*
- * if(attachment_data)
- * email_free_attachment_data(&attachment_data, attachment_count);
+ * @see #email_mail_data_t and #email_mailbox_t
+ *
+ * @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 = MAILHOME"/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);
+ * if(meeting_req)
+ * email_free_meeting_request(&meeting_req, 1);
*
- * email_free_mail_data(&test_mail_data, 1);
- * email_free_mailbox(&mailbox_data, 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);
+ * printf("saved mail id = [%d]\n", test_mail_data->mail_id);
*
- * return 0;
+ * 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);
/**
- * @fn email_add_read_receipt(int input_read_mail_id, int *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
+ * @brief Adds a read receipt mail.
+ * @details This function is invoked when a user receives a mail with read report enable and wants to send a read report for the same.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_read_mail_id The ID of mail which has been read
+ * @param[out] output_receipt_mail_id The receipt mail ID
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_add_read_receipt(int input_read_mail_id, int *output_receipt_mail_id);
/**
- * @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
+ * @brief Updates an existing email information.
+ * @details This function is invoked when a user wants to change some existing email information with new email information.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_mail_data The mail ID
+ * @param[in] input_attachment_data_list The pointer of attachment data
+ * @param[in] input_attachment_count The number of attachment data
+ * @param[in] input_meeting_request The meeting request data
+ * @param[in] input_from_eas Specifies whether sync server
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @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;
+ * 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);
+ * printf("\n > Enter mail id : ");
+ * scanf("%d", &mail_id);
*
- * email_get_mail_data(mail_id, &test_mail_data);
+ * email_get_mail_data(mail_id, &test_mail_data);
*
- * printf("\n > Enter Subject: ");
- * scanf("%s", arg);
+ * printf("\n > Enter Subject: ");
+ * scanf("%s", arg);
*
- * test_mail_data->subject= strdup(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->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 ( 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;
- * }
+ * 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));
- * }
+ * 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 ( (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_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(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);
+ * if(meeting_req)
+ * email_free_meeting_request(&meeting_req, 1);
*
- * return 0;
+ * 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);
/**
- * @fn email_update_mail_attribute(int input_account_id, int *input_mail_id_array, int input_mail_id_count, email_mail_attribute_type input_attribute_type, email_mail_attribute_value_t input_value)
- * @brief This function update individual attribute of mail data.
- *
- * @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 id of account.
- * @param[in] input_mail_id_array Specify the array list if mail id
- * @param[in] input_mail_id_count Specify the count of mail id array
- * @param[in] input_attribute_type Specify the attribute type which to update
- * @param[in] input_value Specify the value of attribute
- * @exception none
- * @see
- * @remarks N/A
+ * @brief Updates an individual attribute of the mail data.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_account_id The ID of account
+ * @param[in] input_mail_id_array The array list of mail IDs
+ * @param[in] input_mail_id_count The count of mail ID array
+ * @param[in] input_attribute_type The attribute type to update
+ * @param[in] input_value The value of attribute
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_update_mail_attribute(int input_account_id, int *input_mail_id_array, int input_mail_id_count, email_mail_attribute_type input_attribute_type, email_mail_attribute_value_t input_value);
/**
- * @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.
+ * @brief Gets the mail count.
+ * @details This function is invoked when a user wants to know how many total mails and out of that
+ * how many unseen mails are there in a given mailbox.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mailbox The pointer of mailbox structure
+ * @param[out] total The total email count
+ * @param[out] unseen The unread email count
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*
- * @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);
- * }
+ * #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);
/**
- * @fn email_get_max_mail_count(int *Count)
- * @brief Gets the max count of mails which can be supported by email-service
+ * @brief Gets the max count of mails which can be supported by email-service.
+ *
+ * @param[out] count The max count of mails which can be supported by email-service
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*
- * @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);
- * }
+ * #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() returns [%d]\n\n", max_count);
+ * }
* @endcode
- * @remarks N/A
*/
EXPORT_API int email_get_max_mail_count(int *count);
/**
- * @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 array 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
+ * @brief Deletes a mail or multiple mails.
+ * @details Based on from_server value, this function will delete a mail or multiple mails from the server or locally.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @remarks If the incoming_server_type is #EMAIL_SERVER_TYPE_POP3 then from_server value will be @c 0. \n
+ * If the incoming_server_type is #EMAIL_SERVER_TYPE_IMAP4 then from_server value will be 1/0.
+ *
+ * @param[in] mailbox Reserved
+ * @param[in] mail_ids[] The array of mail IDs
+ * @param[in] num The number of mail IDs
+ * @param[in] from_server The flag that specifies whether mails are deleted from server
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise error code (see #EMAIL_ERROR_XXX) on failure
+ *
* @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");
- * }
+ * #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);
/**
- * @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
+ * @brief Deletes all mails from a mailbox.
+ * @details If the incoming_server_type is #EMAIL_SERVER_TYPE_POP3 then @a from_server value will be @c 0. \n
+ * If the incoming_server_type is #EMAIL_SERVER_TYPE_IMAP4 then @a 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
-
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mailbox The structure of mailbox
+ * @param[in] from_server The flag that specifies whether mails are also deleted from server
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @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");
- * }
+ * #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);
/**
- * @fn email_clear_mail_data()
- * @brief delete email data from storage. This API will be used by the Settings Application
+ * @brief Deletes email data from the storage.
+ * @details This API will be used by Settings Application.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*
- * @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
- *
- * }
+ * #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();
/**
- * @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.
+ * @brief Appends an attachment to an email.
+ * @details This function is invoked when a user wants to add attachment to an existing mail.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mail_id The mail ID
+ * @param[in] attachment The structure of attachment
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_attachment_data_t
*
- * @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");
- * }
+ * #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);
/**
- * @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
+ * @brief Deletes an attachment from email.
+ * @details This function is invoked when a user wants to delete a attachment from an existing mail based on mail ID and attachment ID.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mail_id The mail ID
+ * @param[in] attachment_id The attachment ID
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @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
- * }
+ * #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);
/**
- * @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.
+ * @brief Gets a mail attachment.
+ * @details This function is invoked when a user wants to get the attachment information based on an attachment ID for the specified mail ID.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mail_id The mail ID
+ * @param[in] attachment_id The buffer that an attachment ID is saved
+ * @param[out] attachment The returned attachment
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t and #email_mail_attachment_info_t
*
- * @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);
- * }
- * }
+ * #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);
/**
- * @fn email_get_attachment_data_list(int input_mail_id, email_attachment_data_t **output_attachment_data, int *output_attachment_count)
- * @brief Get a list of mail attachment.This function is invoked when user wants to get the information of attachment list based on mail id.
- *
- * @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_attachment_data The returned attachment list is save here.
- * @param[out] output_attachment_count The returned count of attachment list.
- * @exception none
- * @see email_attachment_data_t
- * @remarks N/A
+ * @brief Gets a list of mail attachments.
+ * @details This function is invoked when a user wants to get the the attachment list information based on the mail ID.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_mail_id The mail ID
+ * @param[out] output_attachment_data The returned attachment list is save here
+ * @param[out] output_attachment_count The returned count of attachment list
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_attachment_data_t
*/
EXPORT_API int email_get_attachment_data_list(int input_mail_id, email_attachment_data_t **output_attachment_data, int *output_attachment_count);
/**
- * @fn email_free_attachment_data(email_attachment_data_t **attachment_data_list, int attachment_data_count)
- * @brief Free allocated memroy for email attachment.
+ * @brief Frees the allocated memory for email attachments.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] atch_info The pointer of mail attachment structure pointer
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mail_attachment_info_t
*
- * @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);
- * }
- * }
+ * #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
+ Mail Information API
-----------------------------------------------------------*/
/**
- * @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.
+ * @brief Queries the mail list information from the DB based on the mailbox name.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] conditional_clause_string The where clause string
+ * @param[in/out] mail_list The pointer to the structure #email_mail_data_t
+ * @param[in/out] result_count The number of mails returned
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mail_list_item_t
*
- * @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);
- * }
- *
- * }
+ * #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);
/**
- * @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.
+ * @brief Queries the mail list information from the DB.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_conditional_clause_string The where clause string
+ * @param[in/out] output_mail_list The pointer to the structure #email_mail_list_item_t
+ * @param[in/out] output_result_count The number of mails returned
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mail_list_item_t
*
- * @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);
- * }
- *
- * }
+ * #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);
/**
- * @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.
+ * @brief Gets a mail by its mail ID.
+ * @details This function is invoked when a user wants to get a mail based on mail ID existing in the DB.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_mail_id The mail ID
+ * @param[out] output_mail_data The returned mail is save here
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mail_data_t
*
- * @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);
- * }
- * }
+ * 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);
/**
- * @fn email_free_mail_data(email_mail_data_t** mail_list, int count)
- * @brief Free allocated memroy for emails.
+ * @brief Frees the allocated memory for emails.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] mail_list The pointer of mail structure pointer
+ * @param[in] count The count of mails
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mail_data_t
*
- * @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
- *
- * }
+ * #include "email-api-account.h"
+ * bool
+ * _api_sample_free_mail()
+ * {
+ * email_mail_data_t *mail;
+ *
+ * //fill the mail structure
+ * //count - number of mail structure a 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
+ Mail Flag API
-----------------------------------------------------------*/
/**
- * @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
+ * @brief Changes an email flags field.
+ * @details If the incoming_server_type is EMAIL_SERVER_TYPE_POP3 then from_server value will be 0. \n
+ * If the incoming_server_type is EMAIL_SERVER_TYPE_IMAP4 then from_server value will be 1/0.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The account ID
+ * @param[in] mail_ids The array of mail IDs
+ * @param[in] num The number of mail IDs
+ * @param[in] field_type The field type to be set \n
+ * See #email_flags_field_type.
+ * @param[in] value The value to be set
+ * @param[in] onserver The flag indicating whether mail flag updating is in server
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
* @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
- * }
- * }
+ * #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
+ Mail Move API
-----------------------------------------------------------*/
/**
- * @fn email_move_mail_to_mailbox(int *mail_ids, int num, int input_target_mailbox_id)
- * @brief Move a email to another mailbox.
+ * @brief Moves an email to another mailbox.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mail_id The array of mail ID
+ * @param[in] num The count of mail IDs
+ * @param[in] input_target_mailbox_id The mailbox ID for moving email
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*
- * @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;
+ * #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;
+ * int err = EMAIL_ERROR_NONE;
- * printf("\n > Enter mail_id: ");
- * scanf("%d",&mail_id);
+ * printf("\n > Enter mail_id: ");
+ * scanf("%d",&mail_id);
*
- * printf("\n > Enter target mailbox_id: ");
- * scanf("%d",&mailbox_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");
+ * 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);
/**
- * @fn email_move_all_mails_to_mailbox(int input_source_mailbox_id, int input_target_mailbox_id)
- * @brief Move all email to another mailbox.
+ * @brief Moves all emails to another mailbox.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_source_mailbox_id The source mailbox ID for moving email
+ * @param[in] input_target_mailbox_id The destination mailbox ID for moving email
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*
- * @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
+ * #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);
/**
- * @fn email_move_mails_to_mailbox_of_another_account(int input_source_mailbox_id, int *mail_id_array, int mail_id_count, int input_target_mailbox_id, int *output_task_id)
- * @brief Move mails to a mailbox of another account.
- *
- * @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] mail_id_array Specifies the source mail id array for moving email.
- * @param[in] mail_id_count Specifies the count of source mail for moving email.
- * @param[in] input_target_mailbox_id Specifies the destination mailbox ID for moving email.
- * @param[out] output_task_id Specifies the task id for handling the task.
- * @exception none
- * @remarks N/A
+ * @brief Moves mails to the mailbox of an another account.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_source_mailbox_id The source mailbox ID for moving email
+ * @param[in] mail_id_array The source mail ID array for moving email
+ * @param[in] mail_id_count The count of source mail for moving email
+ * @param[in] input_target_mailbox_id The destination mailbox ID for moving email
+ * @param[out] output_task_id The Task ID for handling the task
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * or an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_move_mails_to_mailbox_of_another_account(int input_source_mailbox_id, int *mail_id_array, int mail_id_count, int input_target_mailbox_id, int *output_task_id);
/**
- * @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
+ * @brief Gets the Mail List information from the DB.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_filter_list The filter list
+ * @param[in] input_filter_count The number of filter
+ * @param[in] input_sorting_rule_list The sorting rule list
+ * @param[in] input_sorting_rule_count The number of sorting rule
+ * @param[in] input_start_index The start index for LIMIT clause of SQL query
+ * @param[in] input_limit_count The limit count for LIMIT clause of SQL query
+ * @param[in/out] output_mail_list The pointer to the structure #email_mail_list_item_t
+ * @param[in/out] output_result_count The number of mails returned
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mail_list_item_t
+ *
* @code
* email_list_filter_t *filter_list = NULL;
* email_list_sorting_rule_t *sorting_rule_list = NULL;
@@ -1015,482 +1100,543 @@ EXPORT_API int email_move_mails_to_mailbox_of_another_account(int input_source_m
*
* 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);
/**
- * @fn email_free_list_filter(email_list_filter_t **input_filter_list, int input_filter_count)
- * @brief Free allocated memroy for filers.
- *
- * @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 pointer of filter structure.
- * @param[in] input_filter_count Specifies the count of filter.
- * @exception none
- * @see email_list_filter_t
- * @remarks N/A
+ * @brief Frees the allocated memory for filters.
+ *
+ * @since_tizen 2.3
+ * @privlevel N/P
+ *
+ * @param[in] input_filter_list The pointer of filter structure
+ * @param[in] input_filter_count The count of filter
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_list_filter_t
*/
EXPORT_API int email_free_list_filter(email_list_filter_t **input_filter_list, int input_filter_count);
/**
- * @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
-
+ * @brief Gets the Mail List information from the DB based on the mailbox name.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The account ID
+ * @param[in] mailbox_id The mailbox ID
+ * @param[in] thread_id The thread ID \n
+ * It can be #EMAIL_LIST_TYPE_THREAD, #EMAIL_LIST_TYPE_NORMAL or thread ID.
+ * @param[in] start_index The start index for LIMIT clause of SQL query
+ * @param[in] limit_count The limit count for LIMIT clause of SQL query
+ * @param[in] sorting The sorting type
+ * @param[in/out] mail_list The pointer to the structure #email_mail_data_t
+ * @param[in/out] result_count The number of mails returned
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @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);
- * }
- *
- * }
+ * #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);
/**
- * @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
-
+ * @brief Gets the Mail List information from the DB based on the mailbox name.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The account ID
+ * @param[in] mailbox_id The mailbox ID
+ * @param[in] thread_id The thread ID \n
+ * It can be #EMAIL_LIST_TYPE_THREAD, #EMAIL_LIST_TYPE_NORMAL or thread ID.
+ * @param[in] start_index The start index for LIMIT clause of SQL query
+ * @param[in] limit_count The limit count for LIMIT clause of SQL query
+ * @param[in] sorting The sorting type
+ * @param[in/out] mail_list The pointer to the structure #email_mail_list_item_t
+ * @param[in/out] result_count The number of mails returned
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @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);
- * }
- *
- * }
+ * #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);
/**
- * @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
+ * @brief Gets the Mail List information from the DB based on the mailbox name account_id and sender addresses.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The Account ID
+ * @param[in] mailbox_id The Mailbox ID
+ * @param[in] addr_list The addresses of senders \n
+ * See #email_email_address_list_t.
+ * @param[in] start_index The first mail index of searched mail \n
+ * This function will return mails whose index in the result list are from @a start_index to @a start_index + @a limit_count.
+ * @param[in] limit_count The max number of returned mails
+ * @param[in] search_type The search type
+ * @param[in] search_value The search value
+ * @param[in] sorting The sorting order \n
+ * See #email_sort_type_t.
+ * @param[in/out] mail_list The Pointer to the structure #email_mail_list_item_t
+ * @param[in/out] result_count The number of searched mails
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_email_address_list_t, #email_sort_type_t, #email_mail_list_item_t
*/
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);
+ 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);
/**
- * @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
+ * @brief Gets thread information for a specific thread from DB based on the mailbox name.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] thread_id The thread ID
+ * @param[in/out] thread_info The pointer to the structure #email_mail_data_t
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @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
- * }
- *
- * }
+ * #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);
/**
- * @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
+ * @brief Gets Mail List information for a specific thread from the DB based on the mailbox name.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] thread_id The thread ID
+ * @param[in/out] thread_info The pointer to the structure #email_mail_list_item_t
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @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
- * }
- *
- * }
+ * #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);
/**
- * @fn email_retry_sending_mail( int mail_id, int timeout_in_sec)
- * @brief Retry mail send
+ * @brief Retries to send a mail.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mail_id The mail ID for the mail to resend
+ * @param[in] timeout_in_sec The timeout value in seconds
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*
- * @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
- *
- * }
+ * #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);
/**
- * @fn email_create_db_full()
- * @brief Create db and fill with dummy data
+ * @brief Creates a DB and fill it with dummy data.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
*
- * @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
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_create_db_full();
/**
- * @fn email_cancel_sending_mail( int mail_id)
- * @brief Callback function for cm popup. We set the status as EMAIL_MAIL_STATUS_SEND_CANCELED
+ * @brief Callback function for cm popup.
+ * We set the status as EMAIL_MAIL_STATUS_SEND_CANCELED <<need to be updated>>.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mail_id The mail ID
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*
- * @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;
+ * #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
+ * 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) ;
/**
- * @fn email_get_disk_space_usage(unsigned long *total_size)
- * @brief Gets the total disk usage of emails in KB.
+ * @brief Gets the total disk usage of emails in KB.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[out] total_size The total disk usage of emails
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*
- * @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);
- * }
+ * #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);
/**
- * @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()
+ * @brief Gets the address info list.
+ * @details The address info list contains From, To, CC, BCC addresses and their display name, contact ID and etc (see #email_address_info_list_t).\n
+ * Each GList (From, To, CC, BCC) is the list of #email_address_info_t data. \n
+ * "data" variable of GList structure contains #email_address_info_t data. \n
+ * To get #email_address_info_t data from GList, use type casting from GList node.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mail_id The mail ID to get the list
+ * @param[out] address_info_list The pointer to the structure #email_address_info_list_t \n
+ * Memory for a new address info list will be allocated to this.
+ * You must call email_free_address_info_list() to free the memory allocated to this.
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @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);
- * }
- * }
+ * #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);
/**
- * @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.
+ * @brief Frees the address info list allocated by email_get_address_info_list().
+ * @details This function will free the memory which is allocated to address_info_list itself.
+ *
+ * @since_tizen 2.3
+ * @privlevel N/P
+ *
+ * @param[in] address_info_list The pointer to the structure #email_address_info_list_t to be freed
*
- * @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()
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @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);
/**
- * @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);
-
-/**
-
- * @fn email_get_meeting_request(int mail_id, email_meeting_request_t **meeting_req)
- * @brief Query the information of meeting request.
- * 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] input_conditional_clause_string Specifies the where clause string.
- * @param[out] output_meeting_req Specifies the Pointer to the structure email_meeting_request_t.
- * @param[out] output_count Specifies the number of meeting request returned.
- * @exception none
- * @see email_meeting_request_t
+ * @brief Queries the information of a meeting request.
+ * @details The information of a meeting request is corresponding to only one mail. \n
+ * For this reason, the information of a meeting request can be added by using email_add_message_with_meeting_request() with the matched mail information.
+ *
+ * @param[in] input_conditional_clause_string The where clause string
+ * @param[out] output_meeting_req The pointer to the structure #email_meeting_request_t
+ * @param[out] output_count The number of meeting request returned
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * #EMAIL_ERROR_DATA_NOT_FOUND if there is no matched mail,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_meeting_request_t
*/
EXPORT_API int email_query_meeting_request(char *input_conditional_clause_string, email_meeting_request_t **output_meeting_req, int *output_count);
/**
- * @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
+ * @brief Gets the information of a meeting request.
+ * @details The information of a meeting request is based on the Mail ID. \n
+ * The information of the meeting request is corresponding to only one mail. \n
+ * For this reason, the meeting request information can be added by using email_add_message_with_meeting_request() with the matched mail information.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mail_id The mail ID for which meeting request details need to be fetched
+ * @param[in/out] meeting_req The pointer to the structure #email_meeting_request_t
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * #EMAIL_ERROR_DATA_NOT_FOUND if there is no matched mail,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_meeting_request_t
*/
EXPORT_API int email_get_meeting_request(int mail_id, email_meeting_request_t **meeting_req);
/**
- * @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()
+ * @brief Frees a meeting request allocated by email_get_meeting_request() or allocated to add.
+ * @details This function will free the memory which is allocated to meeting_req (= *meeting_req) itself.
+ *
+ * @since_tizen 2.3
+ * @privlevel N/P
+ *
+ * @param[in] email_meeting_request_t The pointer to the structure #email_meeting_request_t to be freed
+ * @param[in] count The number of elements in #meeting_req array (usually @c 1)
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_meeting_request_t, email_get_meeting_request()
*/
EXPORT_API int email_free_meeting_request(email_meeting_request_t** meeting_req, int count);
/**
- * @fn email_move_thread_to_mailbox(int thread_id, int target_mailbox_id, int move_always_flag)
- * @brief Move a thread of mails to target mailbox.
- *
- * @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 to move
- * @param[in] target_mailbox_id Specifies the mailbox id which move in
- * @param[in] move_always_flag Specify move always flag
- * @exception none
- * @see
+ * @brief Moves a thread of mails to the target mailbox.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] thread_id The thread ID to move
+ * @param[in] target_mailbox_id The mailbox ID in which to move
+ * @param[in] move_always_flag The move always flag
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_move_thread_to_mailbox(int thread_id, int target_mailbox_id, int move_always_flag);
/**
- * @fn email_delete_thread(int thread_id, int delete_always_flag)
- * @brief delete a thread of mails.
- *
- * @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 to delete
- * @param[in] delete_always_flag Specify delete always flag
- * @exception none
- * @see
+ * @brief Deletes a thread of mails.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] thread_id The thread ID to delete
+ * @param[in] delete_always_flag The delete always flag
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_delete_thread(int thread_id, int delete_always_flag);
/**
- * @fn email_modify_seen_flag_of_thread(int thread_id, int seen_flag, int on_server)
- * @brief Modify seen flags of thread
- *
- * @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 to modify
- * @param[in] seen_flag Specify seem flag
- * @param[in] on_server Specify to sync with server
- * @exception none
- * @see
+ * @brief Modifies seen flags of the thread.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] thread_id The thread ID to modify
+ * @param[in] seen_flag The seen flag
+ * @param[in] on_server The flag to sync with server
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_modify_seen_flag_of_thread(int thread_id, int seen_flag, int on_server);
/**
- * @fn email_expunge_mails_deleted_flagged(int input_mailbox_id, int input_on_server, int *output_handle)
- * @brief Delete mails which flagged to delete
- *
- * @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 mailbox
- * @param[in] input_on_server Specify to sync with server
- * @param[out] output_handle Specify the handle of task
- * @exception none
- * @see
+ * @brief Deletes mails flagged to "delete".
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_mailbox_id The mailbox ID
+ * @param[in] input_on_server The flag to sync with server
+ * @param[out] output_handle The handle of task
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_expunge_mails_deleted_flagged(int input_mailbox_id, int input_on_server, int *output_handle);
@@ -1499,8 +1645,8 @@ EXPORT_API int email_expunge_mails_deleted_flagged(int input_mailbox_id, int inp
#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 0a7b7bb..52e98a8 100755
--- a/email-api/include/email-api-mailbox.h
+++ b/email-api/include/email-api-mailbox.h
@@ -26,104 +26,100 @@
#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 .
+ * @file email-api-mailbox.h
+ * @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;
- * int 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
- *
- * }
+ * {
+ * email_mailbox_t mailbox;
+ * email_mailbox_t *new_mailbox =NULL;
+ * email_mailbox_t *mailbox_list = NULL;
+ * int count = 0;
+ * int mailbox_type;
+ * int 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
* @}
*/
+/**
+ * @ingroup EMAIL_SERVICE_FRAMEWORK
+ * @defgroup EMAIL_SERVICE_MAILBOX_MODULE Mailbox API
+ * @brief Mailbox API is a set of operations to manage email mailboxes like add, update, delete or get mailbox related details.
+ *
+ * @section EMAIL_SERVICE_MAILBOX_MODULE_HEADER Required Header
+ * \#include <email-api-mailbox.h>
+ *
+ * @section EMAIL_SERVICE_MAILBOX_MODULE_OVERVIEW Overview
+ * Mailbox API is a set of operations to manage email mailboxes like add, update, delete or get mailbox related details.
+ */
+/**
+ * @addtogroup EMAIL_SERVICE_MAILBOX_MODULE
+ * @{
+ */
#ifdef __cplusplus
extern "C"
@@ -132,269 +128,347 @@ extern "C"
/**
- * @fn int email_add_mailbox(email_mailbox_t* new_mailbox, int on_server, int *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
+ * @brief Creates a new mailbox.
+ * @details This function is invoked when a user wants to create a new mailbox for the specified account.\n
+ * If on_server is true, it will create the mailbox on the server as well as locally.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] new_mailbox The pointer of creating mailbox information
+ * @param[in] on_server The creating mailbox on server
+ * @param[out] handle The sending handle
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*/
EXPORT_API int email_add_mailbox(email_mailbox_t *new_mailbox, int on_server, int *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
+ * @brief Changes the name of a mailbox.
+ * @details This function is invoked when a user wants to change the name of an existing mail box.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @remarks See email-errors.h for exception.
+ *
+ * @param[in] input_mailbox_id The mailbox ID
+ * @param[in] input_mailbox_name The name of the mailbox
+ * @param[in] input_mailbox_alias The alias of the mailbox
+ * @param[in] input_on_server The moving mailbox on server
+ * @param[out] output_handle The handle to manage tasks
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t, #email_mailbox_type_e
*/
EXPORT_API int email_rename_mailbox(int input_mailbox_id, char *input_mailbox_name, char *input_mailbox_alias, int input_on_server, int *output_handle);
/**
- * @fn int email_rename_mailbox_ex(int input_mailbox_id, char *input_mailbox_name, char *input_mailbox_alias, void *input_eas_data, int input_eas_data_length, int input_on_server, int *output_handle);
- * @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_eas_data Specifies the eas data.
- * @param[in] input_eas_data_length Specifies the length of eas data.
- * @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
+ * @brief Changes the name of a mailbox.
+ * @details This function is invoked when a user wants to change the name of an existing mail box.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @remarks See email-errors.h for exception.
+ *
+ * @param[in] input_mailbox_id The mailbox ID
+ * @param[in] input_mailbox_name The name of the mailbox
+ * @param[in] input_mailbox_alias The alias of the mailbox
+ * @param[in] input_eas_data The EAS data
+ * @param[in] input_eas_data_length The length of EAS data
+ * @param[in] input_on_server The moving mailbox on server
+ * @param[out] output_handle The handle to manage tasks
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t, #email_mailbox_type_e
*/
EXPORT_API int email_rename_mailbox_ex(int input_mailbox_id, char *input_mailbox_name, char *input_mailbox_alias, void *input_eas_data, int input_eas_data_length, int input_on_server, int *output_handle);
/**
- * @fn int email_delete_mailbox(int input_mailbox_id, int input_on_server, int *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
+ * @brief Deletes a mailbox.
+ * @details This function deletes the existing mailbox for the specified account based on the on_server option. \n
+ * If on_server is true, it deletes the mailbox from the server as well as locally.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @remarks See email-errors.h for exception.
+ *
+ * @param[in] input_mailbox_id The target mailbox ID
+ * @param[in] input_on_server The deleting mailbox on server
+ * @param[out] output_handle The sending handle
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*/
EXPORT_API int email_delete_mailbox(int input_mailbox_id, int input_on_server, int *output_handle);
/**
- * @fn int email_delete_mailbox_ex(int input_account_id, int *input_mailbox_id_array, int input_mailbox_id_count, int input_on_server, int *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_account_id Specifies the id of account.
- * @param[in] input_mailbox_id_array Specifies the mailbox array for deleting.
- * @param[in] input_mailbox_id_count Specifies the count of mailbox for deleting.
- * @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
+ * @brief Deletes a mailbox.
+ * @details This function deletes the existing mailbox for the specified account based on the option on_server option. \n
+ * If on_server is true, it deletes the mailbox from the server as well as locally.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @remarks See email-errors.h for exception.
+ *
+ * @param[in] input_account_id The account ID
+ * @param[in] input_mailbox_id_array The mailbox array for deleting
+ * @param[in] input_mailbox_id_count The count of mailbox for deleting
+ * @param[in] input_on_server The deleting mailbox on server
+ * @param[out] output_handle The sending handle
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*/
EXPORT_API int email_delete_mailbox_ex(int input_account_id, int *input_mailbox_id_array, int input_mailbox_id_count, int input_on_server, int *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
+ * @brief Changes the mailbox type.
+ * @details This function is invoked when a user wants to change the mailbox type.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @remarks See email-errors.h for exception.
+ *
+ * @param[in] input_mailbox_id The mailbox ID
+ * @param[in] input_mailbox_type The mailbox type
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code(see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_type_e
*/
EXPORT_API int email_set_mailbox_type(int input_mailbox_id, email_mailbox_type_e input_mailbox_type);
/**
- * @fn int email_set_local_mailbox(int input_mailbox_id, int input_is_local_mailbox)
- * @brief Change the attribute 'local' of email_mailbox_t. This function is invoked when user wants to change the attribute 'local'.
- *
- * @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_is_local_mailbox Specifies the value of the attribute 'local' of email_mailbox_t.
- * @exception see email-errors.h
- * @see none
- * @remarks N/A
+ * @brief Changes the 'local' attribute of #email_mailbox_t.
+ * @details This function is invoked when a user wants to change the 'local' attribute.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @remarks See email-errors.h for exception.
+ *
+ * @param[in] input_mailbox_id The mailbox ID
+ * @param[in] input_is_local_mailbox The value of the attribute 'local' of #email_mailbox_t
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_set_local_mailbox(int input_mailbox_id, int input_is_local_mailbox);
/**
- * @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
-
+ * @brief Gets all mailboxes from account.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The account ID
+ * @param[in] mailbox_sync_type The sync type
+ * @param[out] mailbox_list The pointer of mailbox structure pointer (possibly @c NULL)
+ * @param[out] count The mailbox count (possibly @c 0)
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @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);
- * }
- * }
+ * #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);
/**
- * @fn email_get_mailbox_list_ex(int account_id, int mailbox_sync_type, int with_count, email_mailbox_t** mailbox_list, int* count)
- * @brief Extend the email_get_mailbox_list_ex function.
- *
- * @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[in] with_count specifies the count of mailbox.
- * @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
- * @remarks N/A
+ * @brief Extends the email_get_mailbox_list_ex() function.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The account ID
+ * @param[in] mailbox_sync_type The sync type
+ * @param[in] with_count The count of mailbox
+ * @param[out] mailbox_list The pointer of mailbox structure pointer (possibly @c NULL)
+ * @param[out] count The mailbox count is saved here (possibly @c 0)
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*/
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);
/**
- * @fn email_get_mailbox_list_by_keyworkd(int account_id, char *keyword , email_mailbox_t** mailbox_list, int* count)
- * @brief Get the mailbox list to using keywork.
- *
- * @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] keywork Specifies the specified keyworkd for searching.
- * @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
- * @remarks N/A
+ * @brief Gets the mailbox list based on a keyword.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The account ID
+ * @param[in] keyword The specified keyword for searching
+ * @param[out] mailbox_list The pointer of mailbox structure pointer (possibly @c NULL)
+ * @param[out] count The mailbox count is saved here (possibly @c 0)
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*/
EXPORT_API int email_get_mailbox_list_by_keyword(int account_id, char *keyword, email_mailbox_t** mailbox_list, int* count);
/**
- * @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
+ * @brief Gets a mailbox by mailbox type.
+ * @details This function is invoked when a user wants to know the mailbox information by @a mailbox_type for the given account.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The account ID
+ * @param[in] mailbox_type The mailbox type
+ * @param[out] mailbox The pointer of mailbox structure pointer (possibly @c NULL)
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*/
EXPORT_API int email_get_mailbox_by_mailbox_type(int account_id, email_mailbox_type_e mailbox_type, email_mailbox_t** mailbox);
/**
- * @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
+ * @brief Gets a mailbox by mailbox ID.
+ * @details This function is invoked when a user wants to know the mailbox information by mailbox ID.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_mailbox_id The mailbox ID
+ * @param[out] output_mailbox The pointer of mailbox structure pointer (possibly @c NULL)
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*/
EXPORT_API int email_get_mailbox_by_mailbox_id(int input_mailbox_id, email_mailbox_t** output_mailbox);
/**
- * @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
+ * @brief Sets a mail slot size.
+ * @details This function is invoked when a user wants to set the size of mail slot.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_account_id The account ID
+ * @param[in] input_mailbox_id The mailbox ID
+ * @param[in] input_new_slot_size The mail slot size
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*/
EXPORT_API int email_set_mail_slot_size(int input_account_id, int input_mailbox_id, int input_new_slot_size);
/**
- * @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
+ * @brief Sets the sync time of a mailbox.
+ * @details This function is invoked when a user wants to set the sync time of the mailbox.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_mailbox_id The mailbox ID
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*/
EXPORT_API int email_stamp_sync_time_of_mailbox(int input_mailbox_id);
/**
- * @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
-
+ * @brief Frees the memory allocated for the mailbox information.
+ *
+ * @since_tizen 2.3
+ * @privlevel N/P
+ *
+ * @param[in] mailbox_list The pointer for searching mailbox structure pointer
+ * @param[in] count The count of mailboxes
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @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
- *
- * }
+ * #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);
@@ -404,8 +478,8 @@ EXPORT_API int email_free_mailbox(email_mailbox_t** mailbox_list, int count);
#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 77f3e16..f439578 100755
--- a/email-api/include/email-api-network.h
+++ b/email-api/include/email-api-network.h
@@ -26,259 +26,286 @@
#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 .
+ * @file email-api-network.h
+ * @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;
- * 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);
- *
- * if(EMAIL_ERROR_NONE == email_send_mail(mail_id, &handle))
- * //success
- * else
- * //failure
- *
- * // Download header of new emails from mail server
- * int 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 list for 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
+ * #include "email-api.h"
+ *
+ * bool
+ * other_app_invoke_uniform_api_sample(int* error_code)
+ * {
+ *
+ * // Sends a mail
+ * email_attachment_data_t attachment;
+ * 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);
+ *
+ * if(EMAIL_ERROR_NONE == email_send_mail(mail_id, &handle))
+ * //success
+ * else
+ * //failure
+ *
+ * // Downloads header of new emails from mail server
+ * int 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
+ *
+ * //Syncs mail header for all accounts
+ * if(EMAIL_ERROR_NONE == email_sync_header_for_all_account(&handle))
+ * //success
+ * else
+ * //failure
+ *
+ * //Downloads email body from server
+ *
+ * if(EMAIL_ERROR_NONE == email_download_body (mail_id,0,&handle))
+ * //success
+ * else
+ * //failure
+ *
+ * //Downloads an 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
+ * //Gets pending job list for 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
+ *
+ * //Gets Network status
+ * if(EMAIL_ERROR_NONE == email_get_network_status(&sending,&receiving))
+ * //success
+ * else
+ * //failure
+ *
+ * //Sends read report
+ * if(EMAIL_ERROR_NONE == email_send_report(mail ,&handle))
+ * //success
+ * else
+ * //failure
+ * //Saves and sends
+ *
+ *
+ * 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
* @}
-
*/
+/**
+ * @ingroup EMAIL_SERVICE_FRAMEWORK
+ * @defgroup EMAIL_SERVICE_NETWORK_MODULE Network API
+ * @brief Network API is a set of operations to manage email send, receive and cancel related details.
+ *
+ * @section EMAIL_SERVICE_NETWORK_MODULE_HEADER Required Header
+ * \#include <email-api-network.h>
+ *
+ * @section EMAIL_SERVICE_NETWORK_MODULE_OVERVIEW Overview
+ * Network API is a set of operations to manage email send, receive and cancel related details.
+ */
+/**
+* @addtogroup EMAIL_SERVICE_NETWORK_MODULE
+* @{
+*/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
- * @fn email_send_mail(int mail_id, int *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[out] handle Specifies the sending handle.
- * @exception none
- * @see email_mailbox_t and email_option_t
- * @remarks N/A
+ * @brief Sends a mail.
+ * @details This function is invoked when a user wants to send a composed mail.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mail_id The mail ID
+ * @param[out] handle The sending handle
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t and #email_option_t
*/
EXPORT_API int email_send_mail(int mail_id, int *handle);
/**
- * @fn email_send_mail_with_downloading_attachment_of_original_mail(int input_mail_id, int *output_handle)
- * @brief Send a mail. This function is invoked when user wants to send the mail, not been downloaded the attachment.
- *
- * @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] handle Specifies the sending handle.
- * @exception none
- * @see email_mailbox_t and email_option_t
- * @remarks N/A
+ * @brief Sends a mail.
+ * @details This function is invoked when a user wants to send the mail, not been downloaded the attachment.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_mail_id The mail ID
+ * @param[out] handle The sending handle
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t and #email_option_t
*/
EXPORT_API int email_send_mail_with_downloading_attachment_of_original_mail(int input_mail_id, int *output_handle);
/**
- * @fn email_schedule_sending_mail(int input_mail_id, time_t input_time)
- * @brief Send a mail. This function is invoked when user wants to send the scheduled mail.
- *
- * @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] input_time Specifies the scheduled time.
- * @exception none
- * @see email_mailbox_t and email_option_t
- * @remarks N/A
+ * @brief Sends a mail.
+ * @details This function is invoked when a user wants to send the scheduled mail.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_mail_id The mail ID
+ * @param[out] input_time The scheduled time
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (refer to #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t and #email_option_t
*/
EXPORT_API int email_schedule_sending_mail(int input_mail_id, time_t input_time);
/**
- * @fn email_sync_header(int input_account_id, int input_mailbox_id, int *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
+ * @brief Downloads headers of new emails from the mail server.
+ * @details This function is invoked when a user wants to download only the headers of new mails.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_account_id The account ID
+ * @param[in] input_mailbox_id The mailbox ID
+ * @param[out] handle The handle for stopping downloading
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*/
EXPORT_API int email_sync_header(int input_account_id, int input_mailbox_id, int *handle);
/**
- * @fn email_sync_header_for_all_account(int *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
+ * @brief Downloads headers of new emails from the mail server for all emails.
+ * @details This function is invoked when a user wants to download headers of new mails for all accounts.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[out] handle The handle for stopping downloading
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_sync_header_for_all_account(int *handle);
/**
-
- * @fn email_download_body(int mail_id, int with_attachment, int *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
+ * @brief Downloads an email body from the server.
+ * @details This function is invoked when a user wants to download email body with/without attachment based on the @a with_attachment option
+ * from the server.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mail_id The mail ID
+ * @param[in] with_attachment The flag indicating whether there is an attachment
+ * @param[out] handle The handle for stopping downloading
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*/
EXPORT_API int email_download_body(int mail_id, int with_attachment, int *handle);
-
-
-
-
/**
- * @fn email_download_attachment(int mail_id, const char* nth, int *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
+ * @brief Downloads an email nth-attachment from the server.
+ * @details This function is invoked if a user wants to download only specific attachment of a mail whose body is already downloaded.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mail_id The mail ID
+ * @param[in] nth The attachment number been saved (The minimum number is "1")
+ * @param[out] handle The handle for stopping downloading
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_mailbox_t
*/
EXPORT_API int email_download_attachment(int mail_id, int nth, int *handle);
/**
- * @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
+ * @brief Cancels the ongoing job.
+ * @details This function is invoked if a user wants to cancel any ongoing job of a specified account.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_account_id The account ID
+ * @param[in] input_handle The handle for stopping the operation
+ * @param[in] input_cancel_type The type of cancellation
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_cancel_job(int input_account_id, int input_handle, email_cancelation_type input_cancel_type);
@@ -287,90 +314,109 @@ EXPORT_API int email_get_pending_job(email_action_t action, int account_id, int
EXPORT_API int email_get_network_status(int* on_sending, int* on_receiving) DEPRECATED;
/**
- * @fn email_get_task_information(email_task_information_t *output_task_information)
- * @brief This function gives the current job information.
- *
- * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
- * @param[out] output_task_information The array of job information.
- * @param[out] output_task_information_count The count of job information.
- * @exception none
- * @see none
- * @remarks N/A
+ * @brief Gives the current job information.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[out] output_task_information The array of job information
+ * @param[out] output_task_information_count The count of job information
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_get_task_information(email_task_information_t **output_task_information, int *output_task_information_count);
/**
- * @fn email_send_saved(int account_id, int *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[out] handle Specifies the handle for stopping sending.
- * @exception none
- * @see email_option_t
- * @remarks N/A
+ * @brief Sends all mails to be saved in offline-mode.
+ * @details This function is invoked when a user wants to send an email and saving it afterwards.
+ * This will save the email in draft mailbox and then send it.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The account ID
+ * @param[out] handle The handle for stopping sending
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_option_t
*/
EXPORT_API int email_send_saved(int account_id, int *handle);
/**
-
- * @fn email_sync_imap_mailbox_list(int account_id, int *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
+ * @brief Fetches all mailbox names from the server and stores the non-existing mailboxes in the DB.
+ * @details This function is invoked when a 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
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The account ID
+ * @param[out] handle The handle for stopping Network operation
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_sync_imap_mailbox_list(int account_id, int *handle);
/**
-
- * @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, int *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
+ * @brief Searches the mails on the server.
+ *
+ * @since_tizen 2.4
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The Account ID
+ * @param[in] mailbox_id The Mailbox ID
+ * @param[in] input_search_filter_list The searching type \n
+ * #EMAIL_SEARCH_FILTER_SUBJECT, #EMAIL_SEARCH_FILTER_SENDER, \n
+ * #EMAIL_SEARCH_FILTER_RECIPIENT, #EMAIL_SEARCH_FILTER_ALL, etc \n
+ * and The value to use for searching \n
+ * Example: Subject, email address, display name
+ * @param[in] input_search_filter_count Count of input_search_filter_list
+ * @param[out] output_handle The handle for search on server
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_search_filter_t
*/
-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, int *output_handle);
+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, int *output_handle);
/**
-
- * @fn email_clear_result_of_search_mail_on_server(int input_account_id)
- * @brief Delete the temporarily downloaded mails on local storage.
+ * @brief Deletes temporarily downloaded mails from the local storage.
*
- * @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
- * @exception none
- * @see email_search_filter_t,
- * @code
- * @endcode
- * @remarks N/A
+ * @since_tizen 2.4
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] input_account_id The Account ID
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @see #email_search_filter_t
*/
EXPORT_API int email_clear_result_of_search_mail_on_server(int input_account_id);
/**
-
- * @fn email_query_smtp_mail_size_limit(int account_id)
- * @brief query maximum mail size limit from smtp server
+ * @brief Queries the maximum mail size limit from the SMTP 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
- * @exception none
- * @code
- * @endcode
- * @remarks N/A
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The Account ID
+ * @param[out] handle The handle for stopping Network operation
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_query_smtp_mail_size_limit(int account_id, int *handle);
@@ -379,8 +425,8 @@ EXPORT_API int email_query_smtp_mail_size_limit(int account_id, int *handle);
#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 befcbc3..e9b6e90 100755
--- a/email-api/include/email-api-rule.h
+++ b/email-api/include/email-api-rule.h
@@ -26,192 +26,216 @@
#include "email-types.h"
/**
-* @defgroup EMAIL_SERVICE Email Service
-* @{
-*/
-
-/**
-* @ingroup EMAIL_SERVICE
-* @defgroup EMAIL_API_RULE Email Rule API
-* @{
-*/
-
- /**
+ * @file email-api-rule.h
+ * @brief This file contains the data structures and interfaces of Rule related Functionality provided by email-service.
*
- * 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
- *
- * }
+ * #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;
+ *
+ * // Gets 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
+ *
+ *
+ * // Adds a filter information
+ * if(EMAIL_ERROR_NONE == email_add_rule (rule))
+ * //success
+ * else
+ * //failure
+ * err = email_free_rule (&rule,1);
+ *
+ * // Changes a filter information
+ * if(EMAIL_ERROR_NONE == email_update_rule (filter_id,rule))
+ * //success
+ * else
+ * //failure
+ * err = email_free_rule (&rule,1);
+ *
+ * // Deletes 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
* @}
*/
+/**
+ * @ingroup EMAIL_SERVICE_FRAMEWORK
+ * @defgroup EMAIL_SERVICE_RULE_MOUDLE Rule API
+ * @brief Rule API is a set of operations to manage email rules like add, get, delete or update rule related details.
+ *
+ * @section EMAIL_SERVICE_RULE_MOUDLE_HEADER Required Header
+ * \#include <email-api-rule.h>
+ *
+ * @section EMAIL_SERVICE_RULE_MOUDLE_OVERVIEW Overview
+ * Rule API is a set of operations to manage email rules like add, get, delete or update rule related details.
+ */
+/**
+ * @addtogroup EMAIL_SERVICE_RULE_MOUDLE
+ * @{
+ */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
-
-
- * @fn email_get_rule(int filter_id, email_rule_t** filtering_set)
- * @brief Get a information of filtering.
+ * @brief Gets a filter rule.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] filter_id The filter ID
+ * @param[out] filtering_set The filter rule
*
- * @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
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @retval #EMAIL_ERROR_INVALID_PARAM Invalid argument
+ *
+ * @see #email_rule_t
*/
EXPORT_API int email_get_rule(int filter_id, email_rule_t** filtering_set);
/**
-
-
- * @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.
+ * @brief Gets all filter rules.
+ * @details 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.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[out] filtering_set The filtering rules (possibly @c NULL)
+ * @param[out] count The count of returned filters (possibly @c 0)
*
- * @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
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @retval EMAIL_ERROR_INVALID_PARAM Invalid argument
+ *
+ * @see #email_rule_t
*/
EXPORT_API int email_get_rule_list(email_rule_t** filtering_set, int* count);
/**
-
-
- * @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.
+ * @brief Adds a filter rule.
+ * @details This function is invoked if a user wants to add a new filter rule.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] filtering_set The pointer of adding a filter structure
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise error code (see #EMAIL_ERROR_XXX) on failure
*
- * @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
+ * @retval EMAIL_ERROR_INVALID_PARAM Invalid argument
+ *
+ * @see #email_rule_t
*/
EXPORT_API int email_add_rule(email_rule_t* filtering_set);
/**
-
-
- * @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.
+ * @brief Changes a filter rule.
+ * @details 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
+ * @param[in] filter_id The original filter ID
+ * @param[in] new_set The information of new filter
+
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @retval EMAIL_ERROR_INVALID_PARAM Invalid argument
+ *
+ * @see #email_rule_t
*/
EXPORT_API int email_update_rule(int filter_id, email_rule_t* new_set);
/**
-
- * @fn email_delete_rule(int filter_id)
- * @brief Delete a filter information.This function will delete the exsting filter information by specified filter Id.
+ * @brief Deletes a filter rule.
+ * @details This function will delete the existing filter information by the specified filter ID.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] filter_id The filter ID
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*
- * @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
+ * @retval EMAIL_ERROR_INVALID_PARAM Invalid argument
*/
EXPORT_API int email_delete_rule(int filter_id);
/**
-
- * @fn email_free_rule (email_rule_t** filtering_set, int count)
- * @brief Free allocated memory.
+ * @brief Frees allocated memory.
+ *
+ * @since_tizen 2.3
+ * @privlevel N/P
+ *
+ * @param[in] filtering_set The pointer of pointer of filter structure for memory freeing
+ * @param[in] count The count of filter
*
- * @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
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @retval EMAIL_ERROR_INVALID_PARAM Invalid argument
+ *
+ * @see #email_rule_t
*/
EXPORT_API int email_free_rule (email_rule_t** filtering_set, int count);
/**
-
- * @fn email_apply_rule(int filter_id)
- * @brief Delete a filter information.This function will delete the exsting filter information by specified filter Id.
+ * @brief Deletes a filter rule.
+ * @details This function will delete the existing filter information by the 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
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] filter_id The filter ID
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ *
+ * @retval EMAIL_ERROR_INVALID_PARAM Invalid argument
*/
EXPORT_API int email_apply_rule(int filter_id);
@@ -220,8 +244,8 @@ EXPORT_API int email_apply_rule(int filter_id);
#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
index fc66834..4019d90 100755
--- a/email-api/include/email-api-smime.h
+++ b/email-api/include/email-api-smime.h
@@ -29,136 +29,208 @@ extern "C" {
#endif /* __cplusplus */
/**
+ * @file email-api-smime.h
+ */
- * @fn email_add_certificate(char *certificate_path, char *email_address)
- * @brief Store infomations of public certificate in database.
+/**
+ * @ingroup EMAIL_SERVICE_FRAMEWORK
+ * @defgroup EMAIL_SERVICE_SMIME_MODULE SMIME API
+ * @brief SMIME API is a set of operations to handle SMIME data for secured email.
*
- * @param[in] certificate_path File path of public certificate.
- * @param[in] email_address Keyword for searching the certificate information
- * @exception none
- * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
- * @see
- * @remarks N/A
+ * @section EMAIL_SERVICE_SMIME_MODULE_HEADER Required Header
+ * \#include <email-api-smime.h>
+ *
+ * @section EMAIL_SERVICE_SMIME_MODULE_OVERVIEW Overview
+ * SMIME API is a set of operations to handle SMIME data for secured email.
*/
-EXPORT_API int email_add_certificate(char *certificate_path, char *email_address);
/**
+ * @addtogroup EMAIL_SERVICE_SMIME_MODULE
+ * @{
+ */
+
- * @fn email_delete_certificate(char *email_address)
- * @brief Delete infomations of public certificate in database.
+/**
+ * @brief Stores a public certificate information in the database.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
*
- * @param[in] email_address Keyword for deleting the certificate information
- * @exception none
- * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
- * @see
- * @remarks N/A
+ * @param[in] certificate_path The file path of public certificate
+ * @param[in] email_address The keyword for searching the certificate information
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
-EXPORT_API int email_delete_certificate(char *email_address);
+EXPORT_API int email_add_certificate(char *certificate_path, char *email_address);
/**
+ * @brief Deletes a public certificate information from the database.
+ *
+ * @param[in] email_address The keyword for deleting the certificate information
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ */
+EXPORT_API int email_delete_certificate(char *email_address);
- * @fn email_get_certificate(char *email_address, email_certificate_t **certificate)
- * @brief Get infomations of public certificate in database.
+/**
+ * @brief Gets the the public certificate information from the database.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
*
- * @param[in] email_address Keyword for geting the certificate information
- * @param[out] certificate Specifies the certificate
- * @exception none
- * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
- * @see
- * @remarks N/A
+ * @param[in] email_address The keyword for getting the certificate information
+ * @param[out] certificate The certificate
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_get_certificate(char *email_address, email_certificate_t **certificate);
/**
+ * @brief Gets a decrypted message.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mail_id The mail ID
+ * @param[out] output_mail_data The mail data
+ * @param[out] output_attachment_data The mail attachment data
+ * @param[out] output_attachment_count The count of attachment
+ * @param[out] verify The verification state \n
+ * [false : failed verification, true : verification successful]
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+ */
+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, int *verify);
- * @fn 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);
-
- * @brief Get the decrypted message
- * @param[in] mail_id Specifies the mail_id
- * @param[out] output_mail_data Specifies the mail_data
+/**
+ * @brief Gets a decrypted message.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ * @param[in] input_mail_data Specifies the signed mail data
+ * @param[in] input_attachment_data Specifies the attachment of signed mail
+ * @param[in] input_attachment_count Specifies the attachment count of signed mail
+ * @param[out] output_mail_data Specifies the mail_data
* @param[out] output_attachment_data Specifies the mail_attachment_data
* @param[out] output_attachment_count Specifies the count of attachment
- * @exception none
- * @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_get_decrypt_message(int mail_id, email_mail_data_t **output_mail_data, email_attachment_data_t **output_attachment_data, int *output_attachment_count);
+ * @param[out] verify The verification state \n
+ * [false : failed verification, true : verification successful]
+ * @return EMAIL_ERROR_NONE on success or an error code (refer to EMAIL_ERROR_XXX) on failure
+ */
+EXPORT_API int email_get_decrypt_message_ex(email_mail_data_t *input_mail_data,
+ email_attachment_data_t *input_attachment_data,
+ int input_attachment_count,
+ email_mail_data_t **output_mail_data,
+ email_attachment_data_t **output_attachment_data,
+ int *output_attachment_count,
+ int *verify);
/**
-
- * @fn email_verify_signature(int mail_id, int *verify);
-
- * @brief Verify the signed mail
- * @param[in] mail_id Specifies the mail_id
- * @param[out] verify Specifies verify [false : failed verify, true : success the verification]
- * @exception none
- * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
- * @see
- * @remarks N/A
+ * @brief Verifies a signed mail.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] mail_id The mail ID
+ * @param[out] verify The verification state \n
+ * [false : failed verification, true : verification successful]
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_verify_signature(int mail_id, int *verify);
+/**
+* @brief Verifies a signed mail.
+* @since_tizen 2.3
+*
+* @param[in] input_mail_data The signed mail data
+* @param[in] input_attachment_data The attachment of signed mail
+* @param[in] input_attachment_count The attachment count of signed mail
+* @param[out] verify The verification status \n
+* false : failed verification, true : verification successful
+*
+* @return #EMAIL_ERROR_NONE on success,
+* otherwise an error code (see #EMAIL_ERROR_XXX) on failure
+*/
EXPORT_API int email_verify_signature_ex(email_mail_data_t *input_mail_data, email_attachment_data_t *input_attachment_data, int input_attachment_count, int *verify);
/**
-
- * @fn email_verify_certificate(char *certificate_path, int *verify);
-
- * @brief Verify the certificate
- * @param[in] certificate_path Specifies the path of certificate
- * @param[out] verify Specifies verify [false : failed verify, true : success the verification]
- * @exception none
- * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
- * @see
- * @remarks N/A
+ * @brief Verifies a certificate.
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] certificate_path The path of the certificate
+ * @param[out] verify The verification status \n
+ * false : failed verification, true : verification successful
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_verify_certificate(char *certificate_path, int *verify);
/**
-
- * @fn email_get_resolve_recipients(int account_id, char *email_address, unsigned *handle);
-
- * @brief Get the certificate at the server [Using exchange server]
- * @param[in] account_id Specifies an account_id
- * @param[in] email_address Specifies email address for getting certificate
- * @param[out] handle Specifies the handle for stopping
- * @exception none
- * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
- * @see
- * @remarks N/A
+ * @brief Gets the certificate from the server (using exchange server).
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The account ID
+ * @param[in] email_address The email address that gets a certificate
+ * @param[out] handle The handle for stopping
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_get_resolve_recipients(int account_id, char *email_address, unsigned *handle);
/**
-
- * @fn email_validate_certificate(int account_id, char *email_address, unsigned *handle);
-
- * @brief Verfiy the certificate to the server [Using exchange server]
- * @param[in] account_id Specifies an account_id
- * @param[in] email_address Specifies email address for validating certificate
- * @param[out] handle Specifies the handle for stopping
- * @exception none
- * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
- * @see
- * @remarks N/A
+ * @brief Verifies the certificate to the server (using exchange server).
+ *
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/email
+ *
+ * @param[in] account_id The account ID
+ * @param[in] email_address The email address that validates a certificate
+ * @param[out] handle The handle for stopping
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise an error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_validate_certificate(int account_id, char *email_address, unsigned *handle);
/**
-
- * @fn email_free_certificate(email_certificate_t **certificate, int count);
-
- * @brief Free the memory of certificate
- * @param[in] certificate Specifies the certificate
- * @param[in] count Specifies the count of certificates
- * @exception none
- * @return This function returns EMAIL_ERROR_NONE on success or error code (refer to EMAIL_ERROR_XXX) on failure.
- * @see
- * @remarks N/A
+ * @brief Frees the memory of the certificate.
+ *
+ * @since_tizen 2.3
+ * @privlevel N/P
+ *
+ * @param[in] certificate The certificate
+ * @param[in] count The count of certificates
+ *
+ * @return #EMAIL_ERROR_NONE on success,
+ * otherwise error code (see #EMAIL_ERROR_XXX) on failure
*/
EXPORT_API int email_free_certificate(email_certificate_t **certificate, int count);
+/**
+ * @}
+ */
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/email-api/include/email-api.h b/email-api/include/email-api.h
index 8da1b26..e3841e9 100755
--- a/email-api/include/email-api.h
+++ b/email-api/include/email-api.h
@@ -35,26 +35,9 @@
#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.
+ * @file email-api.h
+ * @brief This file contains the data structures and interfaces provided by email-service.
*/
@@ -67,9 +50,6 @@ extern "C" {
}
#endif
-/**
-* @} @}
-*/
#endif /* __EMAIL_MAPI_H__ */