summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/.gitignore2
-rwxr-xr-xinclude/emf-account.h52
-rwxr-xr-xinclude/emf-auto-poll.h62
-rwxr-xr-xinclude/emf-dbglog.h228
-rwxr-xr-xinclude/emf-emn-noti.h69
-rwxr-xr-xinclude/emf-emn-storage.h83
-rwxr-xr-xinclude/emf-emn.h88
-rwxr-xr-xinclude/emf-global.h54
-rwxr-xr-xinclude/emf-init.h46
-rwxr-xr-xinclude/emf-mutex.h79
-rwxr-xr-xinclude/emf-types.h1445
-rwxr-xr-xinclude/emflib.h837
12 files changed, 3045 insertions, 0 deletions
diff --git a/include/.gitignore b/include/.gitignore
new file mode 100644
index 0000000..f42dfd4
--- /dev/null
+++ b/include/.gitignore
@@ -0,0 +1,2 @@
+contact-engine-h
+filemanager-service-h
diff --git a/include/emf-account.h b/include/emf-account.h
new file mode 100755
index 0000000..1891fda
--- /dev/null
+++ b/include/emf-account.h
@@ -0,0 +1,52 @@
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+
+/******************************************************************************
+ * File: emf-account.h
+ * Desc: Mail Framework Account Header
+ *
+ * Auth:
+ *
+ * History:
+ * 2006.08.01 : created
+ *****************************************************************************/
+#ifndef __EMF_ACCONT_H__
+#define __EMF_ACCONT_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include "emflib.h"
+
+ int
+ emf_init_account_reference();
+ emf_account_t*
+ emf_get_account_reference(int account_id);
+ int emf_free_account_reference(void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/include/emf-auto-poll.h b/include/emf-auto-poll.h
new file mode 100755
index 0000000..1f8cd98
--- /dev/null
+++ b/include/emf-auto-poll.h
@@ -0,0 +1,62 @@
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+
+/**
+ * This file defines all APIs of Auto Poll.
+ * @file emf-auto-poll.h
+ * @author
+ * @version 0.1
+ * @brief This file is the header file of Auto Poll.
+ */
+#ifndef __EMF_AUTO_POLL_H__
+#define __EMF_AUTO_POLL_H__
+
+#include "em-core-types.h"
+
+#ifdef __FEATURE_AUTO_POLLING__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+ #include "alarm.h"
+
+#if !defined(EXPORT_API)
+#define EXPORT_API __attribute__((visibility("default")))
+#endif
+
+
+EXPORT_API int emf_add_polling_alarm(int account_id, int alarm_interval);
+EXPORT_API int emf_remove_polling_alarm(int account_id);
+EXPORT_API int is_auto_polling_started(int account_id);
+EXPORT_API int emf_alarm_polling_cb(alarm_id_t alarm_id, void* user_param);
+EXPORT_API int emf_free_account_alarm_binder_list();
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __FEATURE_AUTO_POLLING__ */
+
+#endif /* __EMF_AUTO_POLL_H__ */
+/* EOF */
diff --git a/include/emf-dbglog.h b/include/emf-dbglog.h
new file mode 100755
index 0000000..6375d59
--- /dev/null
+++ b/include/emf-dbglog.h
@@ -0,0 +1,228 @@
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+
+
+/******************************************************************************
+ * File: emf-dbglog.h
+ * Desc: Mail Framework Debug Header
+ *
+ * Auth:
+ *
+ * History:
+ * 2006.08.01 : created
+ *****************************************************************************/
+#ifndef __DEBUG_LOG_H__
+#define __DEBUG_LOG_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <glib.h>
+#include <glib-object.h>
+#include <dlog.h>
+
+#define __FEATURE_DEBUG_LOG__
+
+#ifdef __FEATURE_DEBUG_LOG__
+
+#define DEBUG_PREFIX "Email-Engine"
+#define LOG_FILE_PATH "/var/log/email.log"
+
+/* definition of LOG_TAG */
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "email-service"
+
+#define EM_DEBUG_LOG(format, arg...) SLOGD("[%s:%s():%d] " format "\n", (rindex(__FILE__, '/')? rindex(__FILE__,'/')+1 : __FILE__ ), __FUNCTION__, __LINE__, ##arg)
+#define EM_DEBUG_EXCEPTION(format, arg...) SLOGE("[%s:%s():%d][EXCEPTION!!] " format "\n", (rindex(__FILE__, '/')? rindex(__FILE__,'/')+1 : __FILE__ ), __FUNCTION__, __LINE__, ##arg)
+
+#ifdef _DEBUG_MIME_PARSE_
+#define EM_DEBUG_LOG_MIME(format, arg...) EM_DEBUG_LOG(format, ##arg)
+#else /* _DEBUG_MIME_PARSE */
+#define EM_DEBUG_LOG_MIME(format, arg...)
+#endif /* _DEBUG_MIME_PARSE */
+
+#define EM_DEBUG_FUNC_BEGIN(format, arg...) EM_DEBUG_LOG("BEGIN - "format, ##arg)
+#define EM_DEBUG_FUNC_END(format, arg...) EM_DEBUG_LOG("END - "format, ##arg)
+#define EM_DEBUG_LINE EM_DEBUG_LOG("FUNC[%s : %d]", __FUNCTION__, __LINE__)
+#define EM_DEBUG_DB_EXEC(eval, expr, X) if (eval) { EM_DEBUG_LOG X; expr;} else {;}
+
+#define EM_DEBUG_ERROR_FILE_PATH "/opt/data/email/.emfdata/.critical_error.log"
+#define EM_DEBUG_CRITICAL_EXCEPTION(format, arg...) { FILE *fp_error = NULL; fp_error = fopen(EM_DEBUG_ERROR_FILE_PATH, "a");\
+ if(fp_error) {fprintf(fp_error, "[%s:%s():%d] " format "\n", (rindex(__FILE__, '/')? rindex(__FILE__,'/')+1 : __FILE__ ), __FUNCTION__, __LINE__, ##arg); \
+ fclose(fp_error);}}
+#ifdef _USE_PROFILE_DEBUG_
+#define EM_PROFILE_BEGIN(pfid) \
+ unsigned int __prf_l1_##pfid = __LINE__;\
+ struct timeval __prf_1_##pfid;\
+ struct timeval __prf_2_##pfid;\
+ do {\
+ gettimeofday(&__prf_1_##pfid, 0);\
+ EM_DEBUG_LOG("**PROFILE BEGIN** [EMAILFW: %s: %s() %u ~ ] " #pfid \
+ " -> Start Time: %u.%06u seconds\n",\
+ rindex(__FILE__,'/')+1, \
+ __FUNCTION__,\
+ __prf_l1_##pfid,\
+ (unsigned int)__prf_1_##pfid.tv_sec,\
+ (unsigned int)__prf_1_##pfid.tv_usec );\
+ } while (0)
+
+#define EM_PROFILE_END(pfid) \
+ unsigned int __prf_l2_##pfid = __LINE__;\
+ do { \
+ gettimeofday(&__prf_2_##pfid, 0);\
+ long __ds = __prf_2_##pfid.tv_sec - __prf_1_##pfid.tv_sec;\
+ long __dm = __prf_2_##pfid.tv_usec - __prf_1_##pfid.tv_usec;\
+ if ( __dm < 0 ) { __ds--; __dm = 1000000 + __dm; } \
+ EM_DEBUG_LOG("**PROFILE END** [EMAILFW: %s: %s() %u ~ %u] " #pfid \
+ " -> Elapsed Time: %u.%06u seconds\n",\
+ rindex(__FILE__, '/')+1,\
+ __FUNCTION__,\
+ __prf_l1_##pfid,\
+ __prf_l2_##pfid,\
+ (unsigned int)(__ds),\
+ (unsigned int)(__dm));\
+ } while (0)
+#else
+
+#define EM_PROFILE_BEGIN(pfid)
+#define EM_PROFILE_END(pfid)
+
+#endif
+
+
+#else /* __FEATURE_DEBUG_LOG__ */
+
+ #define EM_DEBUG_LINE
+ #define EM_DEBUG_LOG(format, arg...)
+ #define EM_DEBUG_ASSERT(format, arg...)
+ #define EM_DEBUG_EXCEPTION(format, arg...)
+
+
+ #define EM_DEBUG_DB_EXEC(eval, expr, X) if (eval) { EM_DEBUG_DB X; expr;} else {;}
+ #define EM_PROFILE_BEGIN(pfid)
+ #define EM_PROFILE_END(pfid)
+
+#endif /* __FEATURE_DEBUG_LOG__ */
+
+
+#define EM_NULL_CHECK_FOR_VOID(expr) \
+ {\
+ if (!expr) {\
+ EM_DEBUG_EXCEPTION ("INVALID PARAM: "#expr" NULL ");\
+ return;\
+ }\
+ }
+
+#define EM_IF_NULL_RETURN_VALUE(expr, val) \
+ {\
+ if (!expr ) {\
+ EM_DEBUG_EXCEPTION ("INVALID PARAM: "#expr" NULL ");\
+ return val; \
+ }\
+ }
+
+#define EM_RETURN_ERR_CODE(err_ptr, err_code, ret) \
+ {\
+ if(err_ptr) *err_ptr = err_code;\
+ return ret;\
+ }
+
+#define EM_EXIT_ERR_CODE(err_ptr, err_code) \
+ {\
+ if(err_ptr) *err_ptr = err_code;\
+ return;\
+ }
+
+
+#define EM_SAFE_FREE(expr) \
+ ({\
+ if (expr ) {\
+ free(expr);\
+ expr = NULL;\
+ }\
+ })
+
+#define EM_SAFE_STRDUP(s) \
+ ({\
+ char* _s = (char*)s;\
+ (_s)? strdup(_s) : NULL;\
+ })
+
+#define EM_SAFE_STRCMP(dest, src) \
+ ({\
+ char* _dest = dest;\
+ char* _src = src;\
+ ((_src) && (_dest))? strcmp(_dest, _src) : -1;\
+ })
+
+#define EM_SAFE_STRCPY(dest, src) \
+ ({\
+ char* _dest = dest;\
+ char* _src = src;\
+ ((_src) && (_dest))? strcpy(_dest, _src) : NULL;\
+ })
+
+#define EM_SAFE_STRNCPY(dest, src, size) \
+ ({\
+ char* _dest = dest;\
+ char* _src = src;\
+ int _size = size;\
+ ((_src) && (_dest))? strncpy(_dest, _src, _size) : NULL;\
+ })
+
+#define EM_SAFE_STRCAT(dest, src) \
+ ({\
+ char* _dest = dest;\
+ char* _src = src;\
+ ((_src) && (_dest))? strcat(_dest, _src) : NULL;\
+ })
+
+#define EM_SAFE_STRLEN(s) \
+ ({\
+ char* _s = (char*)s;\
+ (_s)? strlen(_s) : 0;\
+ })
+
+
+#define EM_IF_ACCOUNT_ID_NULL(expr, ret) {\
+ if (expr <= 0) {\
+ EM_DEBUG_EXCEPTION ("EM_IF_ACCOUNT_ID_NULL: Account ID [ %d ] ", expr);\
+ return ret;\
+ }\
+ }
+
+
+#define EM_STRERROR(err) ({ char buf[128]; strerror_r(err, buf, sizeof(buf));})
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplu */
+
+#endif /* __DEBUG_LOG_H_ */
diff --git a/include/emf-emn-noti.h b/include/emf-emn-noti.h
new file mode 100755
index 0000000..fc458c9
--- /dev/null
+++ b/include/emf-emn-noti.h
@@ -0,0 +1,69 @@
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+
+/******************************************************************************
+ * File: emf_noti.h
+ * Desc: Email notification
+ *
+ * Auth:
+ *
+ * History:
+ * 2006.08.01 : created
+ *****************************************************************************/
+#ifndef __EMF_EMN_NOTI_H__
+#define __EMF_EMN_NOTI_H__
+
+
+enum
+{
+ EMN_HEADER_DATA = 0,
+ EMN_WBXML_DATA,
+};
+
+/* Error Values for the Email options */
+enum
+{
+ EMAIL_OPTION_ERROR_NONE = 0,
+ EMAIL_OPTION_ERROR_INVALID_PARAM,
+ EMAIL_OPTION_ERROR_STORAGE,
+};
+
+/* Manual Network value */
+#define EMAIL_OPTION_NETWORK_MANUAL 1
+
+
+/* Enums for the Gcong Option Key */
+typedef enum
+{
+ EMAIL_OPTION_KEY_HOME_NETWORK = 0,
+ EMAIL_OPTION_KEY_ROAMING_NETWORK,
+}optionkey;
+
+#define EMAIL_GCONF_DIR "/Apps/Email"
+
+
+int emf_emn_noti_init(void);
+int emf_emn_noti_quit(int bExtDest);
+
+void
+emn_test_func(void);
+#endif /*__EMF_EMN_NOTI_H__*/
diff --git a/include/emf-emn-storage.h b/include/emf-emn-storage.h
new file mode 100755
index 0000000..812fd92
--- /dev/null
+++ b/include/emf-emn-storage.h
@@ -0,0 +1,83 @@
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+
+/**
+ * This file defines all APIs of EMN's storage.
+ * @file emf-emn-storage.h
+ * @version 0.1
+ * @brief This file is the header file of EMN's storage library.
+ */
+
+#ifndef __EMF_EMN_STORAGE_H__
+#define __EMF_EMN_STORAGE_H__
+
+/**
+* @ingroup EMAIL_FRAMEWORK
+* @defgroup EMN_STORAGE EMN Storage
+* @{
+*/
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#if !defined(EXPORT_API)
+#define EXPORT_API __attribute__((visibility("default")))
+#endif
+
+#ifdef MAILHOME
+#undef MAILHOME
+#endif
+
+#define MAILHOME DATA_PATH"/.email-service/.emfdata" /**< This defines the storage mailbox. */
+#define MAILTEMP "tmp" /**< This defines the temporary mailbox. */
+#ifndef true
+#define true 1 /**< This defines true. */
+#define false 0 /**< This defines false. */
+#endif
+
+/**
+ * This enumeration specifies the mail service type.
+ */
+typedef enum
+{
+ EMF_SVC_EMN = 1, /**< Specifies the EMN service.*/
+ EMF_SVC_VISTO, /**< Specifies the Pushmail service(VISTO).*/
+ EMF_SVC_IMAP_IDLE /**< Specifies the normal email service.*/
+} emf_svc_type_t;
+
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/**
+* @} @}
+*/
+
+
+
+#endif /* __EMF_EMN_STORAGE_H__ */
+/* EOF */
+
diff --git a/include/emf-emn.h b/include/emf-emn.h
new file mode 100755
index 0000000..01815f9
--- /dev/null
+++ b/include/emf-emn.h
@@ -0,0 +1,88 @@
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+
+
+/**
+ * This file defines all APIs of EMN.
+ * @file emf-emn.h
+ * @author Kyuho Jo(kyuho.jo@samsung.com)
+ * @version 0.1
+ * @brief This file is the header file of EMN library.
+ */
+
+#ifndef __EMF_EMN_H__
+#define __EMF_EMN_H__
+
+/**
+* @ingroup EMAIL_FRAMEWORK
+* @defgroup EMN EMN
+* @{
+*/
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#if !defined(EXPORT_API)
+#define EXPORT_API __attribute__((visibility("default")))
+#endif
+
+/**
+ * This callback specifies the callback of retrieving the result that is downloaded new messages.
+ *
+ * @param[in] mail_count Specifies count of new mail.
+ * @param[in] user_data Specifies the user data.
+ * @param[in] err_code Specifies the error code.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+typedef int (*emf_emn_noti_cb)(
+ void* user_data,
+ int err_code
+);
+
+#ifdef USE_OMA_EMN
+/**
+ * Handle OMA EMN data
+ *
+ * @param[in] wbxml_b64 Specifies the encoded string
+ * @param[in] callback Specifies the callback function for retrieving the result that is downloaded new mail.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_emn_handler(unsigned char* wbxml_b64, emf_emn_noti_cb callback, int* err_code);
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/**
+* @} @}
+*/
+
+
+#endif /* __EMF_EMN_H__ */
+/* EOF */
+
diff --git a/include/emf-global.h b/include/emf-global.h
new file mode 100755
index 0000000..609d049
--- /dev/null
+++ b/include/emf-global.h
@@ -0,0 +1,54 @@
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+
+
+/******************************************************************************
+ * File: emf-global.h
+ * Desc: Mail Framework Global Header
+ *
+ * Auth:
+ *
+ * History:
+ * 2006.08.01 : created
+ *****************************************************************************/
+#ifndef __EMF_GLOBAL_H__
+#define __EMF_GLOBAL_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include "emflib.h"
+
+#ifndef NULL
+#define NULL (char*)0
+#endif
+
+#include "vconf-keys.h"
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/include/emf-init.h b/include/emf-init.h
new file mode 100755
index 0000000..0e4e61f
--- /dev/null
+++ b/include/emf-init.h
@@ -0,0 +1,46 @@
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+
+/******************************************************************************
+ * File: emf-init.h
+ * Desc: Mail Framework Initialization Header
+ *
+ * Auth:
+ *
+ * History:
+ * 2006.08.16 : created
+ *****************************************************************************/
+#ifndef __EMF_INIT_H__
+#define __EMF_INIT_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include "em-storage.h"
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
diff --git a/include/emf-mutex.h b/include/emf-mutex.h
new file mode 100755
index 0000000..27b8fe9
--- /dev/null
+++ b/include/emf-mutex.h
@@ -0,0 +1,79 @@
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+
+#ifndef _EMF_MUTEX_H_
+#define _EMF_MUTEX_H_
+
+#include <sys/time.h>
+
+class Mutex
+{
+public:
+ Mutex(){ pthread_mutex_init(&m, NULL); }
+ void lock(){ pthread_mutex_lock(&m); }
+ void unlock(){ pthread_mutex_unlock(&m); }
+ pthread_mutex_t* pMutex() { return &m; }
+
+private:
+ pthread_mutex_t m;
+};
+
+class MutexLocker
+{
+public:
+ MutexLocker(Mutex& mx) {
+ pm = &mx;
+ pm->lock();
+ }
+
+ ~MutexLocker() {
+ pm->unlock();
+ }
+
+private:
+ Mutex *pm;
+};
+
+class CndVar
+{
+public:
+ CndVar(){ pthread_cond_init(&c, NULL); }
+ void wait(pthread_mutex_t* m) { pthread_cond_wait(&c, m); }
+ int timedwait(pthread_mutex_t* m, int sec) {
+ struct timeval now = {0};
+ struct timespec timeout = {0};
+ gettimeofday(&now, NULL);
+ timeout.tv_sec = now.tv_sec+sec;
+ timeout.tv_nsec = now.tv_usec;
+ int retcode = pthread_cond_timedwait(&c, m, &timeout);
+ return retcode;
+ }
+ int signal(){ return pthread_cond_signal(&c); }
+ int broadcast(){ return pthread_cond_broadcast(&c); }
+
+private:
+ pthread_cond_t c;
+};
+
+
+#endif
+
diff --git a/include/emf-types.h b/include/emf-types.h
new file mode 100755
index 0000000..8b878ed
--- /dev/null
+++ b/include/emf-types.h
@@ -0,0 +1,1445 @@
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+
+#ifndef __EMF_TYPES_H__
+#define __EMF_TYPES_H__
+
+/**
+* @defgroup EMAIL_FRAMEWORK Email Service
+* @{
+*/
+
+/**
+* @ingroup EMAIL_FRAMEWORK
+* @defgroup EMAIL_TYPES Email Types
+* @{
+*/
+/**
+ * This file defines structures and enums of Email Framework.
+ * @file emf-types.h
+ * @author Kyu-ho Jo(kyuho.jo@samsung.com)
+ * @author Choongho Lee(ch715.lee@samsung.com)
+ * @version 0.1
+ * @brief This file is the header file of Email Framework library.
+ */
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include <glib.h>
+#include <stdbool.h>
+
+
+/*****************************************************************************/
+/* Macros */
+/*****************************************************************************/
+
+#define MAILBOX_NAME_LENGTH 256
+#define MAX_EMAIL_ADDRESS_LENGTH 320 /* 64(user name) + 1(@) + 255(host name */
+#define MAX_DATETIME_STRING_LENGTH 20
+#define MAX_PREVIEW_TEXT_LENGTH 50 /* should be 512 */
+#define STRING_LENGTH_FOR_DISPLAY 100
+#define MEETING_REQ_OBJECT_ID_LENGTH 128 /* should be 256 */
+
+#define ALL_ACCOUNT 0
+#define NEW_ACCOUNT_ID 0xFFFFFFFE
+#define ALL_MAIL -1
+
+#define EMF_SEARCH_FILTER_NONE 0x00
+#define EMF_SEARCH_FILTER_SUBJECT 0x01
+#define EMF_SEARCH_FILTER_SENDER 0x02
+#define EMF_SEARCH_FILTER_RECIPIENT 0x04
+#define EMF_SEARCH_FILTER_ALL 0x07 /* EMF_SEARCH_FILTER_SUBJECT + EMF_SEARCH_FILTER_SENDER + EMF_SEARCH_FILTER_RECIPIEN */
+
+#define EMF_SUCCESS 0 /* we need to modify the success return valu */
+
+#define EMF_ACC_GET_OPT_DEFAULT 0x01 /**< Default values without account name */
+#define EMF_ACC_GET_OPT_ACCOUNT_NAME 0x02 /**< Account name */
+#define EMF_ACC_GET_OPT_PASSWORD 0x04 /**< With password */
+#define EMF_ACC_GET_OPT_OPTIONS 0x08 /**< Account options : emf_option_t */
+#define EMF_ACC_GET_OPT_FULL_DATA 0xFF /**< With all data of account */
+
+#define GET_FULL_DATA 0x00
+#define GET_FULL_DATA_WITHOUT_PASSWORD (EMF_ACC_GET_OPT_DEFAULT | EMF_ACC_GET_OPT_ACCOUNT_NAME | EMF_ACC_GET_OPT_OPTIONS )
+#define WITHOUT_OPTION (EMF_ACC_GET_OPT_DEFAULT | EMF_ACC_GET_OPT_ACCOUNT_NAME )
+#define ONLY_OPTION (EMF_ACC_GET_OPT_OPTIONS)
+
+#define THREAD_TYPE_RECEIVING 0 /**< for function 'email_activate_pdp' */
+#define THREAD_TYPE_SENDING 1 /**< for function 'email_activate_pdp' */
+
+#define EMF_IMAP_PORT 143 /**< Specifies the default IMAP port.*/
+#define EMF_POP3_PORT 110 /**< Specifies the default POP3 port.*/
+#define EMF_SMTP_PORT 25 /**< Specifies the default SMTP port.*/
+#define EMF_IMAPS_PORT 993 /**< Specifies the default IMAP SSL port.*/
+#define EMF_POP3S_PORT 995 /**< Specifies the default POP3 SSL port.*/
+#define EMF_SMTPS_PORT 465 /**< Specifies the default SMTP SSL port.*/
+#define EMF_ACCOUNT_MAX 10 /**< Specifies the MAX account.*/
+
+#define EMF_INBOX_NAME "INBOX" /**< Specifies the name of inbox.*/
+#define EMF_DRAFTBOX_NAME "DRAFTBOX" /**< Specifies the name of draftbox.*/
+#define EMF_OUTBOX_NAME "OUTBOX" /**< Specifies the name of outbox.*/
+#define EMF_SENTBOX_NAME "SENTBOX" /**< Specifies the name of sentbox.*/
+#define EMF_TRASH_NAME "TRASH" /**< Specifies the name of trash.*/
+#define EMF_SPAMBOX_NAME "SPAMBOX" /**< Specifies the name of spambox.*/
+
+#define EMF_INBOX_DISPLAY_NAME "Inbox" /**< Specifies the display name of inbox.*/
+#define EMF_DRAFTBOX_DISPLAY_NAME "Draftbox" /**< Specifies the display name of draftbox.*/
+#define EMF_OUTBOX_DISPLAY_NAME "Outbox" /**< Specifies the display name of outbox.*/
+#define EMF_SENTBOX_DISPLAY_NAME "Sentbox" /**< Specifies the display name of sentbox.*/
+#define EMF_TRASH_DISPLAY_NAME "Trash" /**< Specifies the display name of sentbox.*/
+#define EMF_SPAMBOX_DISPLAY_NAME "Spambox" /**< Specifies the display name of spambox.*/
+
+#define EMF_SEARCH_RESULT_MAILBOX_NAME "_`S1!E2@A3#R4$C5^H6&R7*E8(S9)U0-L=T_" /**< Specifies the name of search mailbox.*/
+
+#define FAILURE -1
+#define SUCCESS 0
+
+#define NATIVE_EMAIL_APPLICATION_PKG "org.tizen.email"
+#define DAEMON_EXECUTABLE_PATH "/usr/bin/email-service"
+
+#ifndef DEPRECATED
+#define DEPRECATED __attribute__((deprecated))
+#endif
+
+#ifndef EXPORT_API
+#define EXPORT_API __attribute__((visibility("default")))
+#endif
+
+/* __LOCAL_ACTIVITY__ supported
+#define BULK_OPERATION_COUNT 50
+#define ALL_ACTIVITIES 0
+*/
+
+/*****************************************************************************/
+/* Enumerations */
+/*****************************************************************************/
+enum
+{
+ EMF_DELETE_LOCALLY = 0, /**< Specifies Mail Delete local only */
+ EMF_DELETE_LOCAL_AND_SERVER, /**< Specifies Mail Delete local & server */
+ EMF_DELETE_FOR_SEND_THREAD, /**< Created to check which activity to delete in send thread */
+};
+
+typedef enum
+{
+ NOTI_MAIL_ADD = 10000,
+ NOTI_MAIL_DELETE = 10001,
+ NOTI_MAIL_DELETE_ALL = 10002,
+ NOTI_MAIL_DELETE_WITH_ACCOUNT = 10003,
+ NOTI_MAIL_DELETE_FAIL = 10007,
+ NOTI_MAIL_DELETE_FINISH = 10008,
+
+ NOTI_MAIL_UPDATE = 10004,
+ NOTI_MAIL_FIELD_UPDATE = 10020,
+
+ NOTI_MAIL_MOVE = 10005,
+ NOTI_MAIL_MOVE_FAIL = 10010,
+ NOTI_MAIL_MOVE_FINISH = 10006,
+
+ NOTI_THREAD_MOVE = 11000,
+ NOTI_THREAD_DELETE = 11001,
+ NOTI_THREAD_MODIFY_SEEN_FLAG = 11002,
+
+ NOTI_ACCOUNT_ADD = 20000,
+ NOTI_ACCOUNT_DELETE = 20001,
+ NOTI_ACCOUNT_DELETE_FAIL = 20003,
+ NOTI_ACCOUNT_UPDATE = 20002,
+ NOTI_ACCOUNT_UPDATE_SYNC_STATUS = 20010,
+
+
+ NOTI_MAILBOX_ADD = 40000,
+ NOTI_MAILBOX_DELETE,
+ NOTI_MAILBOX_UPDATE,
+ /* To be added more */
+}emf_noti_on_storage_event;
+
+typedef enum
+{
+ NOTI_SEND_START = 1002,
+ NOTI_SEND_FINISH = 1004,
+ NOTI_SEND_FAIL = 1005,
+ NOTI_SEND_CANCEL = 1003,
+
+ NOTI_DOWNLOAD_START = 2000,
+ NOTI_DOWNLOAD_FINISH,
+ NOTI_DOWNLOAD_FAIL,
+ NOTI_DOWNLOAD_CANCEL = 2004,
+ NOTI_DOWNLOAD_NEW_MAIL = 2003,
+
+ NOTI_DOWNLOAD_BODY_START = 3000,
+ NOTI_DOWNLOAD_BODY_FINISH = 3002,
+ NOTI_DOWNLOAD_BODY_FAIL = 3004,
+ NOTI_DOWNLOAD_BODY_CANCEL = 3003,
+ NOTI_DOWNLOAD_MULTIPART_BODY = 3001,
+
+ NOTI_DOWNLOAD_ATTACH_START = 4000,
+ NOTI_DOWNLOAD_ATTACH_FINISH,
+ NOTI_DOWNLOAD_ATTACH_FAIL,
+ NOTI_DOWNLOAD_ATTACH_CANCEL,
+
+ NOTI_MAIL_DELETE_ON_SERVER_FAIL = 5000,
+ NOTI_MAIL_MOVE_ON_SERVER_FAIL,
+
+ NOTI_VALIDATE_ACCOUNT_FINISH = 7000,
+ NOTI_VALIDATE_ACCOUNT_FAIL,
+ NOTI_VALIDATE_ACCOUNT_CANCEL,
+
+ NOTI_VALIDATE_AND_CREATE_ACCOUNT_FINISH = 8000,
+ NOTI_VALIDATE_AND_CREATE_ACCOUNT_FAIL,
+ NOTI_VALIDATE_AND_CREATE_ACCOUNT_CANCEL,
+
+ NOTI_VALIDATE_AND_UPDATE_ACCOUNT_FINISH = 9000,
+ NOTI_VALIDATE_AND_UPDATE_ACCOUNT_FAIL,
+ NOTI_VALIDATE_AND_UPDATE_ACCOUNT_CANCEL,
+
+ /* To be added more */
+}emf_noti_on_network_event;
+
+
+
+/**
+ * This enumeration specifies the core engine type.
+ */
+typedef enum
+{
+ EMF_ENGINE_TYPE_EM_CORE = 1, /**< Specifies the Callia mail core engine.*/
+} emf_engine_type_t;
+
+/**
+ * This enumeration specifies the mail type of account.
+ */
+typedef enum
+{
+ EMF_BIND_TYPE_DISABLE = 0, /**< Specifies the bind type for Disabled account.*/
+ EMF_BIND_TYPE_EM_CORE = 1, /**< Specifies the bind type for Callia.*/
+} emf_account_bind_t;
+
+/**
+ * This enumeration specifies the server type of account.
+ */
+typedef enum
+{
+ EMF_SERVER_TYPE_POP3 = 1, /**< Specifies the POP3 Server.*/
+ EMF_SERVER_TYPE_IMAP4, /**< Specifies the IMAP4 Server.*/
+ EMF_SERVER_TYPE_SMTP, /**< Specifies the SMTP Server.*/
+ EMF_SERVER_TYPE_NONE, /**< Specifies the Local.*/
+ EMF_SERVER_TYPE_ACTIVE_SYNC, /** < Specifies the Active Sync. */
+} emf_account_server_t;
+
+/**
+ * This enumeration specifies the mode of retrieval.
+ */
+typedef enum
+{
+ EMF_IMAP4_RETRIEVAL_MODE_NEW = 0, /**< Specifies the retrieval mode for new email.*/
+ EMF_IMAP4_RETRIEVAL_MODE_ALL, /**< Specifies the retrieval mode for all email.*/
+} emf_imap4_retrieval_mode_t;
+
+/**
+ * This enumeration specifies the filtering type.
+ */
+typedef enum
+{
+ EMF_FILTER_FROM = 1, /**< Specifies the filtering of sender.*/
+ EMF_FILTER_SUBJECT, /**< Specifies the filtering of email subject.*/
+ EMF_FILTER_BODY, /** < Specifies the filterinf of email body.*/
+} emf_rule_type_t;
+
+
+/**
+ * This enumeration specifies the rules for filtering type.
+ */
+typedef enum
+{
+ RULE_TYPE_INCLUDES = 1, /**< Specifies the filtering rule for includes.*/
+ RULE_TYPE_EXACTLY, /**< Specifies the filtering rule for Exactly same as.*/
+} emf_filtering_type_t;
+
+
+/**
+ * This enumeration specifies the action for filtering type.
+ */
+typedef enum
+{
+ EMF_FILTER_MOVE = 1, /**< Specifies the move of email.*/
+ EMF_FILTER_BLOCK = 2, /**< Specifies the block of email.*/
+ EMF_FILTER_DELETE = 3, /**< Specifies delete email.*/
+} emf_rule_action_t;
+
+/**
+ * This enumeration specifies the email status.
+ */
+typedef enum
+{
+ EMF_MAIL_STATUS_NONE = 0, /**< The Mail is in No Operation state */
+ EMF_MAIL_STATUS_RECEIVED, /**< The mail is a received mail.*/
+ EMF_MAIL_STATUS_SENT, /**< The mail is a sent mail.*/
+ EMF_MAIL_STATUS_SAVED, /**< The mail is a saved mail.*/
+ EMF_MAIL_STATUS_SAVED_OFFLINE, /**< The mail is a saved mail in offline-mode.*/
+ EMF_MAIL_STATUS_SENDING, /**< The mail is being sent.*/
+ EMF_MAIL_STATUS_SEND_FAILURE, /**< The mail is a mail to been failed to send.*/
+ EMF_MAIL_STATUS_SEND_CANCELED, /**< The mail is a cancelled mail.*/
+ EMF_MAIL_STATUS_SEND_WAIT, /**< The mail is a mail to be send .*/
+} emf_mail_status_t;
+
+/**
+ * This enumeration specifies the email priority.
+ */
+typedef enum
+{
+ EMF_MAIL_PRIORITY_HIGH = 1, /**< The priority is high.*/
+ EMF_MAIL_PRIORITY_NORMAL = 3, /**< The priority is normal.*/
+ EMF_MAIL_PRIORITY_LOW = 5, /**< The priority is low.*/
+} emf_mail_priority_t;
+
+/**
+ * This enumeration specifies the email status.
+ */
+typedef enum
+{
+ EMF_MAIL_REPORT_NONE = 0, /**< The mail isn't report mail.*/
+ EMF_MAIL_REPORT_DSN, /**< The mail is a delivery-status report mail.*/
+ EMF_MAIL_REPORT_MDN, /**< The mail is a read-status report mail.*/
+ EMF_MAIL_REPORT_REQUEST, /**< The mail require a read-status report mail.*/
+} emf_mail_report_t;
+
+/**
+ * This enumeration specifies the DRM type
+ */
+typedef enum
+{
+ EMF_ATTACHMENT_DRM_NONE = 0, /**< The mail isn't DRM file.*/
+ EMF_ATTACHMENT_DRM_OBJECT, /**< The mail is a DRM object.*/
+ EMF_ATTACHMENT_DRM_RIGHTS, /**< The mail is a DRM rights as xml format.*/
+ EMF_ATTACHMENT_DRM_DCF, /**< The mail is a DRM dcf.*/
+} emf_attachment_drm_t;
+
+typedef enum
+{
+ EMF_MAIL_TYPE_NORMAL = 0, /* NOT a meeting request mail. A Normal mail */
+ EMF_MAIL_TYPE_MEETING_REQUEST = 1, /* a meeting request mail from a serve */
+ EMF_MAIL_TYPE_MEETING_RESPONSE = 2, /* a response mail about meeting reques */
+ EMF_MAIL_TYPE_MEETING_ORIGINATINGREQUEST = 3 /* a originating mail about meeting reques */
+} emf_mail_type_t;
+
+typedef enum
+{
+ EMF_MEETING_RESPONSE_NONE = 0,
+ EMF_MEETING_RESPONSE_ACCEPT,
+ EMF_MEETING_RESPONSE_TENTATIVE,
+ EMF_MEETING_RESPONSE_DECLINE,
+ EMF_MEETING_RESPONSE_REQUEST, /* create a meeting reques */
+ EMF_MEETING_RESPONSE_CANCEL, /* create a meeting cancelatio */
+} emf_meeting_response_t;
+
+
+typedef enum
+{
+ EMF_ACTION_SEND_MAIL = 0,
+ EMF_ACTION_SYNC_HEADER,
+ EMF_ACTION_DOWNLOAD_BODY,
+ EMF_ACTION_DOWNLOAD_ATTACHMENT,
+ EMF_ACTION_DELETE_MAIL,
+ EMF_ACTION_SEARCH_MAIL,
+ EMF_ACTION_SAVE_MAIL,
+ EMF_ACTION_SYNC_MAIL_FLAG_TO_SERVER,
+ EMF_ACTION_SYNC_FLAGS_FIELD_TO_SERVER,
+ EMF_ACTION_MOVE_MAIL,
+ EMF_ACTION_CREATE_MAILBOX, /* = 1 */
+ EMF_ACTION_DELETE_MAILBOX,
+ EMF_ACTION_SYNC_HEADER_OMA,
+ EMF_ACTION_VALIDATE_ACCOUNT,
+ EMF_ACTION_VALIDATE_AND_CREATE_ACCOUNT,
+ EMF_ACTION_VALIDATE_AND_UPDATE_ACCOUNT,
+ EMF_ACTION_ACTIVATE_PDP = 20,
+ EMF_ACTION_DEACTIVATE_PDP,
+ EMF_ACTION_UPDATE_MAIL,
+ EMF_ACTION_SET_MAIL_SLOT_SIZE,
+ EMF_ACTION_NUM,
+} emf_action_t;
+
+/**
+ * This enumeration specifies the status of getting envelope list.
+ */
+typedef enum
+{
+ EMF_LIST_NONE = 0,
+ EMF_LIST_WAITING,
+ EMF_LIST_PREPARE, /**< Specifies the preparation.*/
+ EMF_LIST_CONNECTION_START, /**< Specifies the connection start.*/
+ EMF_LIST_CONNECTION_SUCCEED, /**< Specifies the success of connection.*/
+ EMF_LIST_CONNECTION_FINISH, /**< Specifies the connection finish.*/
+ EMF_LIST_CONNECTION_FAIL, /**< Specifies the connection failure.*/
+ EMF_LIST_START, /**< Specifies the getting start.*/
+ EMF_LIST_PROGRESS, /**< Specifies the status of getting.*/
+ EMF_LIST_FINISH, /**< Specifies the getting complete.*/
+ EMF_LIST_FAIL, /**< Specifies the download failure.*/
+} emf_envelope_list_status_t;
+
+/**
+ * This enumeration specifies the downloaded status of email.
+ */
+typedef enum
+{
+ EMF_DOWNLOAD_NONE = 0,
+ EMF_DOWNLOAD_WAITING,
+ EMF_DOWNLOAD_PREPARE, /**< Specifies the preparation.*/
+ EMF_DOWNLOAD_CONNECTION_START, /**< Specifies the connection start.*/
+ EMF_DOWNLOAD_CONNECTION_SUCCEED, /**< Specifies the success of connection.*/
+ EMF_DOWNLOAD_CONNECTION_FINISH, /**< Specifies the connection finish.*/
+ EMF_DOWNLOAD_CONNECTION_FAIL, /**< Specifies the connection failure.*/
+ EMF_DOWNLOAD_START, /**< Specifies the download start.*/
+ EMF_DOWNLOAD_PROGRESS, /**< Specifies the status of download.*/
+ EMF_DOWNLOAD_FINISH, /**< Specifies the download complete.*/
+ EMF_DOWNLOAD_FAIL, /**< Specifies the download failure.*/
+} emf_download_status_t;
+
+/**
+ * This enumeration specifies the status of sending email.
+ */
+typedef enum
+{
+ EMF_SEND_NONE = 0,
+ EMF_SEND_WAITING,
+ EMF_SEND_PREPARE, /**< Specifies the preparation.*/
+ EMF_SEND_CONNECTION_START, /**< Specifies the connection start.*/
+ EMF_SEND_CONNECTION_SUCCEED, /**< Specifies the success of connection.*/
+ EMF_SEND_CONNECTION_FINISH, /**< Specifies the connection finish.*/
+ EMF_SEND_CONNECTION_FAIL, /**< Specifies the connection failure.*/
+ EMF_SEND_START, /**< Specifies the sending start.*/
+ EMF_SEND_PROGRESS, /**< Specifies the status of sending.*/
+ EMF_SEND_FINISH, /**< Specifies the sending complete.*/
+ EMF_SEND_FAIL, /**< Specifies the sending failure.*/
+ EMF_SAVE_WAITING, /**< Specfies the Waiting of Sync */
+} emf_send_status_t;
+
+typedef enum
+{
+ EMF_SYNC_NONE = 0,
+ EMF_SYNC_WAITING,
+ EMF_SYNC_PREPARE,
+ EMF_SYNC_CONNECTION_START,
+ EMF_SYNC_CONNECTION_SUCCEED,
+ EMF_SYNC_CONNECTION_FINISH,
+ EMF_SYNC_CONNECTION_FAIL,
+ EMF_SYNC_START,
+ EMF_SYNC_PROGRESS,
+ EMF_SYNC_FINISH,
+ EMF_SYNC_FAIL,
+} emf_sync_status_t;
+
+/**
+* This enumeration specifies the deleting status of email.
+*/
+typedef enum
+{
+ EMF_DELETE_NONE = 0,
+ EMF_DELETE_WAITING,
+ EMF_DELETE_PREPARE, /**< Specifies the preparation.*/
+ EMF_DELETE_CONNECTION_START, /**< Specifies the connection start.*/
+ EMF_DELETE_CONNECTION_SUCCEED, /**< Specifies the success of connection.*/
+ EMF_DELETE_CONNECTION_FINISH, /**< Specifies the connection finish.*/
+ EMF_DELETE_CONNECTION_FAIL, /**< Specifies the connection failure.*/
+ EMF_DELETE_START, /**< Specifies the deletion start.*/
+ EMF_DELETE_PROGRESS, /**< Specifies the status of deleting.*/
+ EMF_DELETE_SERVER_PROGRESS, /**< Specifies the status of server deleting.*/
+ EMF_DELETE_LOCAL_PROGRESS, /**< Specifies the status of local deleting.*/
+ EMF_DELETE_FINISH, /**< Specifies the deletion complete.*/
+ EMF_DELETE_FAIL, /**< Specifies the deletion failure.*/
+} emf_delete_status_t;
+
+/**
+* This enumeration specifies the status of validating account
+*/
+typedef enum
+{
+ EMF_VALIDATE_ACCOUNT_NONE = 0,
+ EMF_VALIDATE_ACCOUNT_WAITING,
+ EMF_VALIDATE_ACCOUNT_PREPARE, /**< Specifies the preparation.*/
+ EMF_VALIDATE_ACCOUNT_CONNECTION_START, /**< Specifies the connection start.*/
+ EMF_VALIDATE_ACCOUNT_CONNECTION_SUCCEED, /**< Specifies the success of connection.*/
+ EMF_VALIDATE_ACCOUNT_CONNECTION_FINISH, /**< Specifies the connection finish.*/
+ EMF_VALIDATE_ACCOUNT_CONNECTION_FAIL, /**< Specifies the connection failure.*/
+ EMF_VALIDATE_ACCOUNT_START, /**< Specifies the getting start.*/
+ EMF_VALIDATE_ACCOUNT_PROGRESS, /**< Specifies the status of getting.*/
+ EMF_VALIDATE_ACCOUNT_FINISH, /**< Specifies the getting complete.*/
+ EMF_VALIDATE_ACCOUNT_FAIL, /**< Specifies the validation failure.*/
+} emf_validate_account_status_t;
+
+typedef enum
+{
+ EMF_SET_SLOT_SIZE_NONE = 0,
+ EMF_SET_SLOT_SIZE_WAITING,
+ EMF_SET_SLOT_SIZE_START,
+ EMF_SET_SLOT_SIZE_FINISH,
+ EMF_SET_SLOT_SIZE_FAIL,
+}emf_set_slot_size_status_e;
+
+/**
+* This enumeration specifies the type of mailbox
+*/
+typedef enum
+{
+ EMF_MAILBOX_TYPE_NONE = 0, /**< Unspecified mailbox type*/
+ EMF_MAILBOX_TYPE_INBOX = 1, /**< Specified inbox type*/
+ EMF_MAILBOX_TYPE_SENTBOX = 2, /**< Specified sent box type*/
+ EMF_MAILBOX_TYPE_TRASH = 3, /**< Specified trash type*/
+ EMF_MAILBOX_TYPE_DRAFT = 4, /**< Specified draft box type*/
+ EMF_MAILBOX_TYPE_SPAMBOX = 5, /**< Specified spam box type*/
+ EMF_MAILBOX_TYPE_OUTBOX = 6, /**< Specified outbox type*/
+ EMF_MAILBOX_TYPE_ALL_EMAILS = 7, /**< Specified all emails type of gmail*/
+ EMF_MAILBOX_TYPE_SEARCH_RESULT = 8, /**< Specified mailbox type for result of search on server */
+ EMF_MAILBOX_TYPE_USER_DEFINED = 0xFF, /**< Specified mailbox type for all other mailboxes */
+}emf_mailbox_type_e;
+
+typedef enum
+{
+ EMF_SYNC_LATEST_MAILS_FIRST = 0,
+ EMF_SYNC_OLDEST_MAILS_FIRST,
+ EMF_SYNC_ALL_MAILBOX_50_MAILS,
+} EMF_RETRIEVE_MODE;
+
+/* event typ */
+typedef enum
+{
+ EMF_EVENT_NONE = 0,
+ EMF_EVENT_SYNC_HEADER = 1, /* synchronize mail headers with server (network used) */
+ EMF_EVENT_DOWNLOAD_BODY, /* download mail body from server (network used)*/
+ EMF_EVENT_DOWNLOAD_ATTACHMENT, /* download mail attachment from server (network used) */
+ EMF_EVENT_SEND_MAIL, /* send a mail (network used) */
+ EMF_EVENT_SEND_MAIL_SAVED, /* send all mails in 'outbox' box (network used) */
+ EMF_EVENT_SYNC_IMAP_MAILBOX, /* download imap mailboxes from server (network used) */
+ EMF_EVENT_DELETE_MAIL, /* delete mails (network unused) */
+ EMF_EVENT_DELETE_MAIL_ALL, /* delete all mails (network unused) */
+ EMF_EVENT_SYNC_MAIL_FLAG_TO_SERVER, /* sync mail flag to server */
+ EMF_EVENT_SYNC_FLAGS_FIELD_TO_SERVER, /* sync a field of flags to server */
+ EMF_EVENT_SAVE_MAIL,
+ EMF_EVENT_MOVE_MAIL, /* move mails to specific mailbox on server */
+ EMF_EVENT_CREATE_MAILBOX,
+ EMF_EVENT_UPDATE_MAILBOX,
+ EMF_EVENT_DELETE_MAILBOX,
+ EMF_EVENT_ISSUE_IDLE,
+ EMF_EVENT_SYNC_HEADER_OMA,
+ EMF_EVENT_VALIDATE_ACCOUNT,
+ EMF_EVENT_VALIDATE_AND_CREATE_ACCOUNT,
+ EMF_EVENT_VALIDATE_AND_UPDATE_ACCOUNT,
+
+ EMF_EVENT_ADD_MAIL = 10001,
+ EMF_EVENT_UPDATE_MAIL_OLD = 10002,
+ EMF_EVENT_UPDATE_MAIL = 10003,
+ EMF_EVENT_SET_MAIL_SLOT_SIZE = 20000,
+
+/* EMF_EVENT_LOCAL_ACTIVITY, // __LOCAL_ACTIVITY_ */
+
+ EMF_EVENT_BULK_PARTIAL_BODY_DOWNLOAD, /* __FEATURE_PARTIAL_BODY_DOWNLOAD__ supported */
+ EMF_EVENT_LOCAL_ACTIVITY_SYNC_BULK_PBD, /* __FEATURE_PARTIAL_BODY_DOWNLOAD__ supported */
+ EMF_EVENT_GET_PASSWORD_LENGTH /* get password length of an account */
+} emf_event_type_t;
+
+/* event statu */
+typedef enum
+{
+ EMF_EVENT_STATUS_UNUSED = 0,
+ EMF_EVENT_STATUS_WAIT,
+ EMF_EVENT_STATUS_STARTED,
+ EMF_EVENT_STATUS_CANCELED,
+} emf_event_status_type_t;
+
+
+/* sorting_orde */
+typedef enum
+{
+ EMF_SORT_DATETIME_HIGH = 0,
+ EMF_SORT_DATETIME_LOW,
+ EMF_SORT_SENDER_HIGH,
+ EMF_SORT_SENDER_LOW,
+ EMF_SORT_RCPT_HIGH,
+ EMF_SORT_RCPT_LOW,
+ EMF_SORT_SUBJECT_HIGH,
+ EMF_SORT_SUBJECT_LOW,
+ EMF_SORT_PRIORITY_HIGH,
+ EMF_SORT_PRIORITY_LOW,
+ EMF_SORT_ATTACHMENT_HIGH,
+ EMF_SORT_ATTACHMENT_LOW,
+ EMF_SORT_FAVORITE_HIGH,
+ EMF_SORT_FAVORITE_LOW,
+ EMF_SORT_MAILBOX_NAME_HIGH,
+ EMF_SORT_MAILBOX_NAME_LOW,
+ EMF_SORT_FLAGGED_FLAG_HIGH,
+ EMF_SORT_FLAGGED_FLAG_LOW,
+ EMF_SORT_SEEN_FLAG_HIGH,
+ EMF_SORT_SEEN_FLAG_LOW,
+ EMF_SORT_END,
+}emf_sort_type_t;
+
+typedef enum
+{
+ EMAIL_MAILBOX_SORT_BY_NAME_ASC = 0,
+ EMAIL_MAILBOX_SORT_BY_NAME_DSC,
+ EMAIL_MAILBOX_SORT_BY_TYPE_ASC,
+ EMAIL_MAILBOX_SORT_BY_TYPE_DSC,
+} email_mailbox_sort_type_t;
+
+
+/**
+* This enumeration specifies the priority.
+*/
+enum
+{
+ EMF_OPTION_PRIORITY_HIGH = 1, /**< Specifies the high priority.*/
+ EMF_OPTION_PRIORITY_NORMAL = 3, /**< Specifies the normal priority*/
+ EMF_OPTION_PRIORITY_LOW = 5, /**< Specifies the low priority.*/
+};
+
+/**
+* This enumeration specifies the saving save a copy after sending.
+*/
+enum
+{
+ EMF_OPTION_KEEP_LOCAL_COPY_OFF = 0, /**< Specifies off the keeping local copy.*/
+ EMF_OPTION_KEEP_LOCAL_COPY_ON = 1, /**< Specifies on the keeping local copy.*/
+};
+
+/**
+* This enumeration specifies the request of delivery report.
+*/
+enum
+{
+ EMF_OPTION_REQ_DELIVERY_RECEIPT_OFF = 0, /**< Specifies off the requesting delivery receipt.*/
+ EMF_OPTION_REQ_DELIVERY_RECEIPT_ON = 1, /**< Specifies on the requesting delivery receipt.*/
+};
+
+/**
+* This enumeration specifies the request of read receipt.
+*/
+enum
+{
+ EMF_OPTION_REQ_READ_RECEIPT_OFF = 0, /**< Specifies off the requesting read receipt.*/
+ EMF_OPTION_REQ_READ_RECEIPT_ON = 1, /**< Specifies on the requesting read receipt.*/
+};
+
+/**
+* This enumeration specifies the blocking of address.
+*/
+enum
+{
+ EMF_OPTION_BLOCK_ADDRESS_OFF = 0, /**< Specifies off the blocking by address.*/
+ EMF_OPTION_BLOCK_ADDRESS_ON = 1, /**< Specifies on the blocking by address.*/
+};
+
+/**
+* This enumeration specifies the blocking of subject.
+*/
+enum
+{
+ EMF_OPTION_BLOCK_SUBJECT_OFF = 0, /**< Specifies off the blocking by subject.*/
+ EMF_OPTION_BLOCK_SUBJECT_ON = 1, /**< Specifies on the blocking by subject.*/
+};
+
+enum
+{
+ EMF_LIST_TYPE_UNREAD = -3,
+ EMF_LIST_TYPE_LOCAL = -2,
+ EMF_LIST_TYPE_THREAD = -1,
+ EMF_LIST_TYPE_NORMAL = 0
+};
+
+/**
+* This enumeration specifies the mailbox sync type.
+*/
+enum
+{
+ EMF_MAILBOX_ALL = -1, /**< All mailboxes.*/
+ EMF_MAILBOX_FROM_SERVER = 0, /**< Mailboxes from server. */
+ EMF_MAILBOX_FROM_LOCAL = 1, /**< Mailboxes from local. */
+};
+
+typedef enum
+{
+ APPEND_BODY = 1,
+ UPDATE_MAILBOX,
+ UPDATE_ATTACHMENT_INFO,
+ UPDATE_FLAG,
+ UPDATE_SAVENAME,
+ UPDATE_EXTRA_FLAG,
+ UPDATE_MAIL,
+ UPDATE_DATETIME,
+ UPDATE_FROM_CONTACT_INFO,
+ UPDATE_TO_CONTACT_INFO,
+ UPDATE_ALL_CONTACT_NAME,
+ UPDATE_ALL_CONTACT_INFO,
+ UPDATE_STICKY_EXTRA_FLAG,
+ UPDATE_PARTIAL_BODY_DOWNLOAD,
+ UPDATE_MEETING,
+ UPDATE_SEEN_FLAG_OF_THREAD,
+} emf_mail_change_type_t;
+
+
+/**
+* This enumeration specifies the address type.
+*/
+typedef enum
+{
+ EMF_ADDRESS_TYPE_FROM = 1, /**< Specifies the from address.*/
+ EMF_ADDRESS_TYPE_TO, /**< Specifies the to receipient address.*/
+ EMF_ADDRESS_TYPE_CC, /**< Specifies the cc receipient address.*/
+ EMF_ADDRESS_TYPE_BCC, /**< Specifies the bcc receipient address.*/
+ EMF_ADDRESS_TYPE_REPLY, /**< Specifies the reply receipient address.*/
+ EMF_ADDRESS_TYPE_RETURN, /**< Specifies the return receipient address.*/
+} emf_address_type_t;
+
+/**
+ * This enumeration specifies the search type for searching mailbox.
+ */
+typedef enum
+{
+ EMF_MAILBOX_SEARCH_KEY_TYPE_SUBJECT, /**< The search key is for searching subject.*/
+ EMF_MAILBOX_SEARCH_KEY_TYPE_FROM, /**< The search key is for searching sender address.*/
+ EMF_MAILBOX_SEARCH_KEY_TYPE_BODY, /**< The search key is for searching body.*/
+ EMF_MAILBOX_SEARCH_KEY_TYPE_TO, /**< The search key is for searching recipient address.*/
+} emf_mailbox_search_key_t;
+
+/**
+ * This enumeration specifies the download status of mail body.
+ */
+
+typedef enum
+{
+ EMF_BODY_DOWNLOAD_STATUS_NONE = 0,
+ EMF_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED = 1,
+ EMF_BODY_DOWNLOAD_STATUS_PARTIALLY_DOWNLOADED = 2,
+} emf_body_download_status_t;
+
+/**
+ * This enumeration specifies the moving type.
+ */
+typedef enum
+{
+ EMF_MOVED_BY_COMMAND = 0,
+ EMF_MOVED_BY_MOVING_THREAD,
+ EMF_MOVED_AFTER_SENDING
+} emf_move_type;
+
+/**
+ * This enumeration specifies the deletion type.
+ */
+typedef enum
+{
+ EMF_DELETED_BY_COMMAND = 0,
+ EMF_DELETED_BY_OVERFLOW,
+ EMF_DELETED_BY_DELETING_THREAD,
+ EMF_DELETED_BY_MOVING_TO_OTHER_ACCOUNT,
+ EMF_DELETED_AFTER_SENDING,
+ EMF_DELETED_FROM_SERVER,
+} emf_delete_type;
+
+/**
+ * This enumeration specifies the status field type.
+ */
+typedef enum
+{
+ EMF_FLAGS_SEEN_FIELD = 0,
+ EMF_FLAGS_DELETED_FIELD,
+ EMF_FLAGS_FLAGGED_FIELD,
+ EMF_FLAGS_ANSWERED_FIELD,
+ EMF_FLAGS_RECENT_FIELD,
+ EMF_FLAGS_DRAFT_FIELD,
+ EMF_FLAGS_FORWARDED_FIELD,
+ EMF_FLAGS_FIELD_COUNT,
+} emf_flags_field_type;
+
+typedef enum
+{
+ EMF_FLAG_NONE = 0,
+ EMF_FLAG_FLAGED = 1,
+ EMF_FLAG_TASK_STATUS_CLEAR = 2,
+ EMF_FLAG_TASK_STATUS_ACTIVE = 3,
+ EMF_FLAG_TASK_STATUS_COMPLETE = 4,
+} emf_flagged_type;
+
+
+/*****************************************************************************/
+/* Data Structures */
+/*****************************************************************************/
+
+/**
+ * This structure is used to save mail time.
+ */
+typedef struct
+{
+ unsigned short year; /**< Specifies the Year.*/
+ unsigned short month; /**< Specifies the Month.*/
+ unsigned short day; /**< Specifies the Day.*/
+ unsigned short hour; /**< Specifies the Hour.*/
+ unsigned short minute; /**< Specifies the Minute.*/
+ unsigned short second; /**< Specifies the Second.*/
+} emf_datetime_t;
+
+/**
+ * This structure is used to save the options.
+ */
+typedef struct
+{
+ int priority; /**< Specifies the prority. 1=high 3=normal 5=low.*/
+ int keep_local_copy; /**< Specifies the saving save a copy after sending.*/
+ int req_delivery_receipt; /**< Specifies the request of delivery report. 0=off 1=on*/
+ int req_read_receipt; /**< Specifies the request of read receipt. 0=off 1=on*/
+ int download_limit; /**< Specifies the limit of size for downloading.*/
+ int block_address; /**< Specifies the blocking of address. 0=off 1=on*/
+ int block_subject; /**< Specifies the blocking of subject. 0=off 1=on*/
+ char *display_name_from; /**< Specifies the display name of from.*/
+ int reply_with_body; /**< Specifies the replying with body 0=off 1=on*/
+ int forward_with_files; /**< Specifies the fowarding with files 0=off 1=on*/
+ int add_myname_card; /**< Specifies the adding name card 0=off 1=on*/
+ int add_signature; /**< Specifies the adding signature 0=off 1=on*/
+ char *signature; /**< Specifies the signature*/
+ int add_my_address_to_bcc; /**< Specifies whether bcc field should be always filled with my address. 0=off 1=on*/
+} emf_option_t;
+
+/**
+ * This structure is used to save the information of email account.
+ */
+typedef struct
+{
+ emf_account_bind_t account_bind_type; /**< Specifies the Bind Type.*/
+ char *account_name; /**< Specifies the account name.*/
+ emf_account_server_t receiving_server_type; /**< Specifies the receiving server type.*/
+ char *receiving_server_addr; /**< Specifies the address of receiving server.*/
+ char *email_addr; /**< Specifies the email adderee.*/
+ char *user_name; /**< Specifies the user name.*/
+ char *password; /**< Specifies the password.*/
+ emf_imap4_retrieval_mode_t retrieval_mode; /**< Specifies the retrieval mode in IMAP case.*/
+ int port_num; /**< Specifies the port number of receiving server.*/
+ int use_security; /**< Specifies the security such as SSL.*/
+ emf_account_server_t sending_server_type; /**< Specifies the type of sending server.*/
+ char *sending_server_addr; /**< Specifies the address of sending server.*/
+ int sending_port_num; /**< Specifies the port number of sending server.*/
+ int sending_auth; /**< Specifies the authentication of sending server.*/
+ int sending_security; /**< Specifies the security such as SSL.*/
+ char *sending_user; /**< Specifies the user name of SMTP server.*/
+ char *sending_password; /**< Specifies the user password of SMTP server.*/
+ char *display_name; /**< Specifies the display name.*/
+ char *reply_to_addr; /**< Specifies the reply email address.*/
+ char *return_addr; /**< Specifies the email address for return.*/
+ int account_id; /**< Specifies the ID of account. Especially, 1 is assigned to Local Account.*/
+ int keep_on_server; /**< Specifies the keeping mail on server.*/
+ int flag1; /**< Specifies the downloading option. 0 is subject only, 1 is text body, 2 is normal.*/
+ int flag2; /**< Specifies the 'Same as POP3' option. 0 is none, 1 is 'Same as POP3'.*/
+ int pop_before_smtp; /**< POP before SMTP authentication */
+ int apop; /**< APOP Authentication */
+ char *logo_icon_path; /**< Account logo icon */
+ int preset_account; /**< Preset account or not */
+ emf_option_t options; /**< Specifies the Sending options */
+ int target_storage; /**< Specifies the targetStorage. 0 is phone, 1 is MMC */
+ int check_interval; /**< Specifies the Check interval. Unit is minutes */
+ int my_account_id; /**< Specifies accout id of my account */
+ int index_color; /**< Specifies index color for displaying classifying accounts */
+}emf_account_t;
+
+/**
+ * This structure is used to save the information of email server.
+ */
+
+typedef struct
+{
+ int configuration_id; /**< Specifies the id of configuration.*/
+ emf_account_server_t protocol_type; /**< Specifies the type of configuration.*/
+ char *server_addr; /**< Specifies the address of configuration.*/
+ int port_number; /**< Specifies the port number of configuration.*/
+ int security_type; /**< Specifies the security such as SSL.*/
+ int auth_type; /**< Specifies the authentication type of configuration.*/
+} emf_protocol_config_t;
+
+typedef struct
+{
+ char *service_name; /**< Specifies the name of service.*/
+ int authname_format; /**< Specifies the type of user name for authentication.*/
+ int protocol_conf_count; /**< Specifies count of protocol configurations.*/
+ emf_protocol_config_t *protocol_config_array; /**< Specifies array of protocol configurations.*/
+} emf_server_info_t;
+
+typedef struct
+{
+ int mailbox_type;
+ char mailbox_name[MAILBOX_NAME_LENGTH];
+} emf_mailbox_type_item_t;
+
+/**
+ * This structure is contains the Mail information.
+ */
+
+typedef struct
+{
+ int mail_id; /**< Specifies the Mail ID.*/
+ int account_id; /**< Specifies the Account ID.*/
+ char *mailbox_name; /**< Specifies the Mailbox Name.*/
+ int mailbox_type; /**< Specifies the mailbox type of the mail. */
+ char *subject; /**< Specifies the subject.*/
+ char *datetime; /**< Specifies the Date time.*/
+ int server_mail_status; /**< Specifies the Whether sever mail or not.*/
+ char *server_mailbox_name; /**< Specifies the server mailbox.*/
+ char *server_mail_id; /**< Specifies the Server Mail ID.*/
+ char *message_id; /**< Specifies the message id */
+ char *full_address_from; /**< Specifies the From Addr.*/
+ char *full_address_reply; /**< Specifies the Reply to addr */
+ char *full_address_to; /**< Specifies the To addr.*/
+ char *full_address_cc; /**< Specifies the CC addr.*/
+ char *full_address_bcc; /**< Specifies the BCC addr*/
+ char *full_address_return; /**< Specifies the return Path*/
+ char *email_address_sender; /**< Specifies the email address of sender.*/
+ char *email_address_recipient; /**< Specifies the email address of recipients.*/
+ char *alias_sender; /**< Specifies the alias of sender. */
+ char *alias_recipient; /**< Specifies the alias of recipients. */
+ int body_download_status; /**< Specifies the Text donwloaded or not.*/
+ char *file_path_plain; /**< Specifies the path of text mail body.*/
+ char *file_path_html; /**< Specifies the path of HTML mail body.*/
+ int mail_size; /**< Specifies the Mail Size.*/
+ char flags_seen_field; /**< Specifies the seen flags*/
+ char flags_deleted_field; /**< Specifies the deleted flags*/
+ char flags_flagged_field; /**< Specifies the flagged flags*/
+ char flags_answered_field; /**< Specifies the answered flags*/
+ char flags_recent_field; /**< Specifies the recent flags*/
+ char flags_draft_field; /**< Specifies the draft flags*/
+ char flags_forwarded_field; /**< Specifies the forwarded flags*/
+ int DRM_status; /**< Specifies the DRM state. */
+ int priority; /**< Specifies the priority of Mails.*/
+ int save_status; /**< Specifies the save status*/
+ int lock_status; /**< Specifies the Locked*/
+ int report_status; /**< Specifies the Mail Report.*/
+ int attachment_count; /**< Specifies the attachment count. */
+ int inline_content_count; /**< Specifies the inline content count. */
+ int thread_id; /**< Specifies the thread id for thread view. */
+ int thread_item_count; /**< Specifies the item count of specific thread. */
+ char *preview_text; /**< Specifies the preview body. */
+ int meeting_request_status; /**< Specifies the status of meeting request. */
+}emf_mail_data_t;
+
+/**
+ * This structure is contains information for displaying mail list.
+ */
+typedef struct
+{
+ int mail_id; /**< Specifies the Mail ID.*/
+ int account_id; /**< Specifies the Account ID.*/
+ char mailbox_name[STRING_LENGTH_FOR_DISPLAY]; /**< Specifies the Mailbox Name.*/
+ char from[STRING_LENGTH_FOR_DISPLAY]; /**< Specifies the from display name.*/
+ char from_email_address[MAX_EMAIL_ADDRESS_LENGTH]; /**< Specifies the from email address.*/
+ char recipients[STRING_LENGTH_FOR_DISPLAY]; /**< Specifies the recipients display name.*/
+ char subject[STRING_LENGTH_FOR_DISPLAY]; /**< Specifies the subject.*/
+ int is_text_downloaded; /**< Specifies the Text donwloaded or not.*/
+ char datetime[MAX_DATETIME_STRING_LENGTH]; /**< Specifies the Date time.*/
+ char flags_seen_field; /**< Specifies the seen flags*/
+ char flags_deleted_field; /**< Specifies the deleted flags*/
+ char flags_flagged_field; /**< Specifies the flagged flags*/
+ char flags_answered_field; /**< Specifies the answered flags*/
+ char flags_recent_field; /**< Specifies the recent flags*/
+ char flags_draft_field; /**< Specifies the draft flags*/
+ char flags_forwarded_field; /**< Specifies the forwarded flags*/
+ int priority; /**< Specifies the priority of Mails.*/
+ int save_status; /**< Specifies the save status*/
+ int is_locked; /**< Specifies the Locked*/
+ int is_report_mail; /**< Specifies the Mail Report.*/
+ int recipients_count; /**< Specifies the number of to Recipients*/
+ int has_attachment; /**< the mail has attachments or not[ 0: none, 1: over one] */
+ int has_drm_attachment; /**< the mail has drm attachment or not*/
+ char previewBodyText[MAX_PREVIEW_TEXT_LENGTH]; /**< text for preview body*/
+ int thread_id; /**< thread id for thread view*/
+ int thread_item_count; /**< item count of specific thread */
+ int is_meeting_request; /**< Whether the mail is a meeting request or not */
+}emf_mail_list_item_t;
+
+/**
+ * This structure is used to save the filtering structure.
+ */
+typedef struct
+{
+ int account_id; /**< Specifies the account ID.*/
+ int filter_id; /**< Specifies the filtering ID.*/
+ emf_rule_type_t type; /**< Specifies the filtering type.*/
+ char *value; /**< Specifies the filtering value.*/
+ emf_rule_action_t faction; /**< Specifies the action type for filtering.*/
+ char *mailbox; /**< Specifies the mail box if action type means move.*/
+ int flag1; /**< Specifies the activation.*/
+ int flag2; /**< Reserved.*/
+} emf_rule_t;
+
+/**
+ * This structure is used to save the information of mail flag.
+ */
+typedef struct
+{
+ unsigned int seen : 1; /**< Specifies the read email.*/
+ unsigned int deleted : 1; /**< Reserved.*/
+ unsigned int flagged : 1; /**< Specifies the flagged email.*/
+ unsigned int answered : 1; /**< Reserved.*/
+ unsigned int recent : 1; /**< Reserved.*/
+ unsigned int draft : 1; /**< Specifies the draft email.*/
+ unsigned int has_attachment : 1; /**< Reserved.*/
+ unsigned int forwarded : 1; /**< Reserved.*/
+ unsigned int sticky : 1; /**< Sticky flagged mails cannot be deleted */
+} emf_mail_flag_t;
+
+
+/**
+ * This structure is used to save the information of mail extra flag.
+ */
+typedef struct
+{
+ unsigned int priority : 3; /**< Specifies the mail priority.
+ The value is greater than or equal to EMF_MAIL_PRIORITY_HIGH.
+ The value is less than or eqult to EMF_MAIL_PRIORITY_LOW.*/
+ unsigned int status : 4; /**< Specifies the mail status.
+ The value is a value of enumeration emf_mail_status_t.*/
+ unsigned int noti : 1; /**< Specifies the notified mail.*/
+ unsigned int lock : 1; /**< Specifies the locked mail.*/
+ unsigned int report : 2; /**< Specifies the MDN/DSN mail. The value is a value of enumeration emf_mail_report_t.*/
+ unsigned int drm : 1; /**< Specifies the drm mail.*/
+ unsigned int text_download_yn : 2; /**< body download y/n*/ /* To be removed */
+} emf_extra_flag_t;
+
+/**
+ * This structure is used to save the email basic information.
+ */
+typedef struct
+{
+ int account_id; /**< Specifies the email's account ID.*/
+ int uid; /**< Specifies the email's UID on local.*/
+ int rfc822_size; /**< Specifies the email's size.*/
+ int body_downloaded; /**< Specifies the download of email body.*/
+ emf_mail_flag_t flags; /**< Specifies the email's flag information.*/
+ emf_extra_flag_t extra_flags; /**< Specifies the email's extra flag information.*/
+ char *sid; /**< Specifies the email's UID on server.*/
+ int is_meeting_request; /**< Specifies whether this mail is a meeting request mail or not. 0: normal mail, 1: meeting request mail from server, 2: response mail about meeting request mail */
+ int thread_id; /**< Specifies the email's thread id.*/
+ int thread_item_count; /**< Specifies the item count of thread*/
+} emf_mail_info_t;
+
+/**
+ * This structure is used to save the information of email header.
+ */
+typedef struct
+{
+ char *mid; /**< Specifies the message ID.*/
+ char *subject; /**< Specifies the email subject.*/
+ char *to; /**< Specifies the recipient.*/
+ char *from; /**< Specifies the sender.*/
+ char *cc; /**< Specifies the carbon copy.*/
+ char *bcc; /**< Specifies the blind carbon copy.*/
+ char *reply_to; /**< Specifies the replier.*/
+ char *return_path; /**< Specifies the address of return.*/
+ emf_datetime_t datetime; /**< Specifies the sending or receiving time.*/
+ char *from_contact_name;
+ char *to_contact_name;
+ char *cc_contact_name;
+ char *bcc_contact_name;
+ char *previewBodyText; /**< Specifies the text contains for preview body.*/
+} emf_mail_head_t;
+
+/**
+ * This structure is used to save the information of attachment.
+ */
+typedef struct st_emf_attachment_info
+{
+ int inline_content;
+ int attachment_id; /**< Specifies the attachment ID*/
+ char *name; /**< Specifies the attachment name.*/
+ int size; /**< Specifies the attachment size.*/
+ int downloaded; /**< Specifies the download of attachment.*/
+ char *savename; /**< Specifies the absolute path of attachment.*/
+ int drm; /**< Specifies the drm type.*/
+ struct st_emf_attachment_info *next; /**< Specifies the pointer of next attachment.*/
+} emf_attachment_info_t;
+
+typedef struct
+{
+ int attachment_id;
+ char *attachment_name;
+ char *attachment_path;
+ int attachment_size;
+ int mail_id;
+ int account_id;
+ char *mailbox_name;
+ int save_status;
+ int drm_status;
+ int inline_content_status;
+} emf_attachment_data_t;
+
+/**
+ * This structure is used to save the information of email body
+ */
+typedef struct
+{
+ char *plain; /**< Specifies the absolute path of file to contain email body (Plain Text).*/
+ char *plain_charset; /**< Specifies the character set of plain text boy. */
+ char *html; /**< Specifies the absolute path of file to contain email body (HTML).*/
+ int attachment_num; /**< Specifies the count of attachment.*/
+ emf_attachment_info_t *attachment; /**< Specifies the structure of attachment.*/
+} emf_mail_body_t;
+
+/**
+ * This structure is used to save the information of email
+ */
+typedef struct
+{
+ emf_mail_info_t *info; /**< Specifies the structure pointer of mail basic information.*/
+ emf_mail_head_t *head; /**< Specifies the structure pointer of email header.*/
+ emf_mail_body_t *body; /**< Specifies the structure pointer of email body.*/
+} emf_mail_t;
+
+
+typedef struct
+{
+ int offset_from_GMT;
+ char standard_name[32];
+ struct tm standard_time_start_date;
+ int standard_bias;
+ char daylight_name[32];
+ struct tm daylight_time_start_date;
+ int daylight_bias;
+} emf_time_zone_t;
+
+typedef struct
+{
+ int mail_id; /**< Specifies the mail id of meeting request on DB. This is the primary key. */
+ emf_meeting_response_t meeting_response; /**< Specifies the meeting response. */
+ struct tm start_time;
+ struct tm end_time;
+ char *location; /**< Specifies the location of meeting. Maximum length of this string is 32768 */
+ char global_object_id[MEETING_REQ_OBJECT_ID_LENGTH]; /**< Specifies the object id. */
+ emf_time_zone_t time_zone;
+} emf_meeting_request_t;
+
+/**
+ * This structure is used to save the informatioin of sender list with unread/total mail counts
+ */
+typedef struct
+{
+ char *address; /**< Specifies the address of a sender.*/
+ char *display_name; /**< Specifies a display name. This may be one of contact name, alias in original mail and email address of sender. (Priority order : contact name, alias, email address) */
+ int unread_count; /**< Specifies the number of unread mails received from sender address*/
+ int total_count; /**< Specifies the total number of mails which are received from sender address*/
+} emf_sender_list_t;
+
+
+/* Creates a type name for structure emf_mailbox_st */
+typedef struct emf_mailbox_st emf_mailbox_t; /**< This is an information of mail box. */
+
+/**
+ * This structure is used to save the information of mailbox.
+ */
+struct emf_mailbox_st
+{
+ int mailbox_id; /**< Unique id on mailbox table.*/
+ char *name; /**< Specifies the path of mailbox.*/
+ emf_mailbox_type_e mailbox_type;
+ char *alias; /**< Specifies the display name of mailbox.*/
+ int unread_count; /**< Specifies the Unread Mail count in the mailbox.*/
+ int total_mail_count_on_local; /**< Specifies the total number of mails in the mailbox in the local DB.*/
+ int total_mail_count_on_server; /**< Specifies the total number of mails in the mailbox in the mail server.*/
+ int hold_connection; /**< Will have a valid socket descriptor when connection to server is active.. else 0>*/
+ int local; /**< Specifies the local mailbox.*/
+ int synchronous; /**< Specifies the mailbox with synchronized the server.*/
+ int account_id; /**< Specifies the account ID for mailbox.*/
+ void *user_data; /**< Specifies the internal data.*/
+ void *mail_stream; /**< Specifies the internal data.*/
+ int has_archived_mails; /**< Specifies the archived mails.*/
+ int mail_slot_size; /**< Specifies how many mails can be stored.*/
+ char *account_name; /**< Specifies the name of account.*/
+ emf_mailbox_t *next; /**< Reserved.*/
+};
+
+
+typedef struct
+{
+ char *contact_name;
+ char *email_address;
+ char *alias;
+ int storage_type;
+ int contact_id;
+} emf_mail_contact_info_t;
+
+typedef struct
+{
+ emf_address_type_t address_type;
+ char *address;
+ char *display_name;
+ int storage_type;
+ int contact_id;
+} emf_address_info_t;
+
+typedef struct
+{
+ GList *from;
+ GList *to;
+ GList *cc;
+ GList *bcc;
+} emf_address_info_list_t;
+
+typedef struct
+{
+ int contact_id; /* Inpu */
+ int storage_type; /* Input, but not used in email-servic */
+ int address_count; /* Inpu */
+ char **address_list; /* Input, array of email account */
+ int unread_count; /* Outpu */
+} emf_contact_item_for_count_t;
+
+typedef struct
+{
+ int contact_id; /* Inpu */
+ int storage_type; /* Input, but not used in email-servic */
+ int address_count; /* Inpu */
+ char **address_list; /* Input array of email account */
+ int mail_id_count; /* Outpu */
+ int *mail_id_list; /* Outpu */
+} emf_contact_item_for_mail_id_t;
+
+typedef struct
+{
+ int address_type; /* type of mail (sender : 0, recipient : 1)*/
+ int address_count; /* The number of email addresse */
+ char **address_list; /* strings of email addresse */
+}emf_email_address_list_t;
+
+/* global account lis */
+typedef struct emf_account_list_t emf_account_list_t;
+struct emf_account_list_t
+{
+ emf_account_t *account;
+ emf_account_list_t *next;
+};
+
+
+/*****************************************************************************/
+/* Errors */
+/*****************************************************************************/
+
+#define EMF_ERROR_NONE 1 /* There is no error */
+#define EMF_ERROR_INVALID_PARAM -1001 /* invalid parameter was given. - Invalid input paramete */
+#define EMF_ERROR_INVALID_ACCOUNT -1002 /* invalid account information was given. - Unsupported accoun */
+#define EMF_ERROR_INVALID_USER -1003 /* NOT USED : unknown user ID was given. - Invalid user or passwor */
+#define EMF_ERROR_INVALID_PASSWORD -1004 /* NOT USED : invalid password was given. - Invalid user or passwor */
+#define EMF_ERROR_INVALID_SERVER -1005 /* invalid server information was given. - Server unavailabl */
+#define EMF_ERROR_INVALID_MAIL -1006 /* invalid mail information was given */
+#define EMF_ERROR_INVALID_ADDRESS -1007 /* invalid address information was given. - Incorrect addres */
+#define EMF_ERROR_INVALID_ATTACHMENT -1008 /* invalid attachment information was given */
+#define EMF_ERROR_INVALID_MAILBOX -1009 /* invalid mailbox information was given */
+#define EMF_ERROR_INVALID_FILTER -1010 /* invalid filter information was given */
+#define EMF_ERROR_INVALID_PATH -1011 /* invalid flle path was given */
+#define EMF_ERROR_INVALID_DATA -1012 /* NOT USE */
+#define EMF_ERROR_INVALID_RESPONSE -1013 /* unexpected network response was given. - Invalid server respons */
+#define EMF_ERROR_ACCOUNT_NOT_FOUND -1014 /* no matched account was found */
+#define EMF_ERROR_MAIL_NOT_FOUND -1015 /* no matched mail was found */
+#define EMF_ERROR_MAILBOX_NOT_FOUND -1016 /* no matched mailbox was found */
+#define EMF_ERROR_ATTACHMENT_NOT_FOUND -1017 /* no matched attachment was found */
+#define EMF_ERROR_FILTER_NOT_FOUND -1018 /* no matched filter was found */
+#define EMF_ERROR_CONTACT_NOT_FOUND -1019 /* no matched contact was found */
+#define EMF_ERROR_FILE_NOT_FOUND -1020 /* no matched file was found */
+#define EMF_ERROR_DATA_NOT_FOUND -1021 /* NOT USE */
+#define EMF_ERROR_NO_MORE_DATA -1022 /* NOT USE */
+#define EMF_ERROR_ALREADY_EXISTS -1023 /* data duplicate */
+#define EMF_ERROR_MAX_EXCEEDED -1024 /* NOT USE */
+#define EMF_ERROR_DATA_TOO_LONG -1025 /* NOT USE */
+#define EMF_ERROR_DATA_TOO_SMALL -1026 /* NOT USE */
+#define EMF_ERROR_NETWORK_TOO_BUSY -1027 /* NOT USE */
+#define EMF_ERROR_OUT_OF_MEMORY -1028 /* There is not enough memory */
+#define EMF_ERROR_DB_FAILURE -1029 /* database operation failed */
+#define EMF_ERROR_PROFILE_FAILURE -1030 /* no proper profile was found */
+#define EMF_ERROR_SOCKET_FAILURE -1031 /* socket operation failed */
+#define EMF_ERROR_CONNECTION_FAILURE -1032 /* network connection failed */
+#define EMF_ERROR_CONNECTION_BROKEN -1033 /* network connection was broken */
+#define EMF_ERROR_DISCONNECTED -1034 /* NOT USED : connection was disconnected */
+#define EMF_ERROR_LOGIN_FAILURE -1035 /* login failed */
+#define EMF_ERROR_NO_RESPONSE -1036 /* There is no server response */
+#define EMF_ERROR_MAILBOX_FAILURE -1037 /* The agent failed to scan mailboxes in server */
+#define EMF_ERROR_AUTH_NOT_SUPPORTED -1038 /* The server doesn't support authentication */
+#define EMF_ERROR_AUTHENTICATE -1039 /* The server failed to authenticate user */
+#define EMF_ERROR_TLS_NOT_SUPPORTED -1040 /* The server doesn't support TLS */
+#define EMF_ERROR_TLS_SSL_FAILURE -1041 /* The agent failed TLS/SSL */
+#define EMF_ERROR_APPEND_FAILURE -1042 /* The agent failed to append mail to server */
+#define EMF_ERROR_COMMAND_NOT_SUPPORTED -1043 /* The server doesn't support this command */
+#define EMF_ERROR_ANNONYM_NOT_SUPPORTED -1044 /* The server doesn't support anonymous user */
+#define EMF_ERROR_CERTIFICATE_FAILURE -1045 /* certificate failure - Invalid server certificat */
+#define EMF_ERROR_CANCELLED -1046 /* The job was canceled by user */
+#define EMF_ERROR_NOT_IMPLEMENTED -1047 /* The function was not implemented */
+#define EMF_ERROR_NOT_SUPPORTED -1048 /* The function is not supported */
+#define EMF_ERROR_MAIL_LOCKED -1049 /* The mail was locked */
+#define EMF_ERROR_SYSTEM_FAILURE -1050 /* There is a system error */
+#define EMF_ERROR_MAIL_MAX_COUNT -1052 /* The mailbox is full */
+#define EMF_ERROR_ACCOUNT_MAX_COUNT -1053 /* There is too many account */
+#define EMF_ERROR_MAIL_MEMORY_FULL -1054 /* There is no more storage */
+#define EMF_ERROR_MAIL_NOT_FOUND_ON_SERVER -1055 /* The expected mail is not found in server */
+#define EMF_ERROR_LOAD_ENGINE_FAILURE -1056 /* loading engine failed */
+#define EMF_ERROR_CLOSE_FAILURE -1057 /* engine is still used */
+#define EMF_ERROR_GCONF_FAILURE -1058 /* The error occurred on accessing Gconf */
+#define EMF_ERROR_NO_SUCH_HOST -1059 /* no such host was found */
+#define EMF_ERROR_EVENT_QUEUE_FULL -1060 /* event queue is full */
+#define EMF_ERROR_EVENT_QUEUE_EMPTY -1061 /* event queue is empty */
+#define EMF_ERROR_NO_RECIPIENT -1062 /* no recipients information was found */
+#define EMF_ERROR_SMTP_SEND_FAILURE -1063 /* SMTP send failed */
+#define EMF_ERROR_MAILBOX_OPEN_FAILURE -1064 /* accessing mailbox failed */
+#define EMF_ERROR_RETRIEVE_HEADER_DATA_FAILURE -1065 /* retrieving header failed */
+#define EMF_ERROR_XML_PARSER_FAILURE -1066 /* XML parsing failed */
+#define EMF_ERROR_SESSION_NOT_FOUND -1067 /* no matched session was found */
+#define EMF_ERROR_INVALID_STREAM -1068
+#define EMF_ERROR_AUTH_REQUIRED -1069 /* SMTP Authentication needed */
+#define EMF_ERROR_POP3_DELE_FAILURE -1100
+#define EMF_ERROR_POP3_UIDL_FAILURE -1101
+#define EMF_ERROR_POP3_LIST_FAILURE -1102
+#define EMF_ERROR_IMAP4_STORE_FAILURE -1200
+#define EMF_ERROR_IMAP4_EXPUNGE_FAILURE -1201
+#define EMF_ERROR_IMAP4_FETCH_UID_FAILURE -1202
+#define EMF_ERROR_IMAP4_FETCH_SIZE_FAILURE -1203
+#define EMF_ERROR_IMAP4_IDLE_FAILURE -1204 /* IDLE faile */
+#define EMF_ERROR_NO_SIM_INSERTED -1205
+#define EMF_ERROR_FLIGHT_MODE -1206
+#define EMF_SUCCESS_VALIDATE_ACCOUNT -1207
+#define EMF_ERROR_VALIDATE_ACCOUNT -1208
+#define EMF_ERROR_NO_MMC_INSERTED -1209
+#define EMF_ERROR_ACTIVE_SYNC_NOTI_FAILURE -1300
+#define EMF_ERROR_HANDLE_NOT_FOUND -1301
+#define EMF_ERROR_NULL_VALUE -1302
+#define EMF_ERROR_FAILED_BY_SECURITY_POLICY -1303
+#define EMF_ERROR_CANNOT_NEGOTIATE_TLS -1400 /* "Cannot negotiate TLS" */
+#define EMF_ERROR_STARTLS -1401 /* "STARTLS" */
+#define EMF_ERROR_IPC_CRASH -1500
+#define EMF_ERROR_IPC_CONNECTION_FAILURE -1501
+#define EMF_ERROR_IPC_SOCKET_FAILURE -1502
+#define EMF_ERROR_LOGIN_ALLOWED_EVERY_15_MINS -1600 /* "login allowed only every 15 minutes" */
+#define EMF_ERROR_TOO_MANY_LOGIN_FAILURE -1601 /* "Too many login failure" */
+#define EMF_ERROR_ON_PARSING -1700
+#define EMF_ERROR_NETWORK_NOT_AVAILABLE -1800 /* WIFI not availble*/
+#define EMF_ERROR_CANNOT_STOP_THREAD -2000
+#define EMF_ERROR_UNKNOWN -8000 /* unknown erro */
+
+
+
+/*****************************************************************************/
+/* For Active Sync */
+/*****************************************************************************/
+
+#define VCONFKEY_EMAIL_SERVICE_ACTIVE_SYNC_HANDLE "db/email_handle/active_sync_handle"
+#define EMF_ACTIVE_SYNC_NOTI "User.Email.ActiveSync"
+
+typedef enum
+{
+ ACTIVE_SYNC_NOTI_SEND_MAIL, /* a sending notification to ASE (active sync engine */
+ ACTIVE_SYNC_NOTI_SEND_SAVED, /* a sending notification to ASE (active sync engine), All saved mails should be sent */
+ ACTIVE_SYNC_NOTI_SEND_REPORT, /* a sending notification to ASE (active sync engine), report should be sen */
+ ACTIVE_SYNC_NOTI_SYNC_HEADER, /* a sync header - download mails from server. */
+ /* It is depended on account/s flag1 field whether it excutes downloading header only or downloading header + body */
+ /* downloading option : 0 is subject only, 1 is text body, 2 is normal */
+ ACTIVE_SYNC_NOTI_DOWNLOAD_BODY, /* a downloading body notification to AS */
+ ACTIVE_SYNC_NOTI_DOWNLOAD_ATTACHMENT, /* a downloading attachment notification to AS */
+ ACTIVE_SYNC_NOTI_VALIDATE_ACCOUNT, /* a account validating notification to AS */
+ ACTIVE_SYNC_NOTI_CANCEL_JOB, /* a cancling job notification to AS */
+ ACTIVE_SYNC_NOTI_SEARCH_ON_SERVER, /* a searching on server notification to AS */
+} eactivesync_noti_t;
+
+typedef union
+{
+ struct _send_mail
+ {
+ int handle;
+ int account_id;
+ char *mailbox_name;
+ int mail_id;
+ emf_option_t options;
+ } send_mail;
+
+ struct _send_mail_saved
+ {/* not defined ye */
+ int handle;
+ int account_id;
+ } send_mail_saved;
+
+ struct _send_report
+ {/* not defined ye */
+ int handle;
+ int account_id;
+ } send_report;
+
+ struct _sync_header
+ {
+ int handle;
+ int account_id;
+ char *mailbox_name;
+ } sync_header;
+
+ struct _download_body
+ {
+ int handle;
+ int account_id;
+ int mail_id;
+ int with_attachment; /* 0: without attachments, 1: with attachment */
+ } download_body;
+
+ struct _download_attachment
+ {
+ int handle;
+ int account_id;
+ int mail_id;
+ char *attachment_order;
+ } download_attachment;
+
+ struct _cancel_job
+ {
+ int account_id;
+ int handle; /* job handle to be canceled. this value is issued by email-service (actually in Emf_Mapi_xxx() */
+ } cancel_job;
+
+ struct _validate_account
+ {/* not defined yet */
+ int handle;
+ int account_id;
+ } validate_account;
+
+ struct _find_mail_on_server
+ {
+ int handle;
+ int account_id;
+ char *mailbox_name;
+ int search_type;
+ char *search_value;
+ } find_mail_on_server;
+
+} ASNotiData;
+
+
+/* types for noti string */
+typedef enum
+{
+ EMF_CONVERT_STRUCT_TYPE_MAIL_LIST_ITEM, /** specifies emf_mail_list_t */
+} emf_convert_struct_type_e;
+
+#ifdef __cplusplus
+}
+#endif
+
+/**
+* @} @}
+*/
+
+#endif /* __EMF_LIB_H__ */
diff --git a/include/emflib.h b/include/emflib.h
new file mode 100755
index 0000000..c9c1992
--- /dev/null
+++ b/include/emflib.h
@@ -0,0 +1,837 @@
+/*
+* email-service
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+
+
+/**
+ * This file defines all APIs of Email Framework.
+ * @file emflib.h
+ * @author Kyu-ho Jo(kyuho.jo@samsung.com)
+ * @version 0.1
+ * @brief This file is the header file of email-engine library.
+ */
+#ifndef __EMFLIB_H__
+#define __EMFLIB_H__
+
+/**
+* @defgroup EMAIL_FRAMEWORK EmailFW
+* @{
+*/
+
+/**
+* @ingroup EMAIL_FRAMEWORK
+* @defgroup EMAIL_SERVICE Email Service
+* @{
+*/
+
+#include "emf-types.h"
+#include "em-core-types.h"
+
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#if !defined(EXPORT_API)
+#define EXPORT_API __attribute__((visibility("default")))
+#endif
+
+/*****************************************************************************/
+/* Initialization */
+/*****************************************************************************/
+/**
+ * Initialize Email-engine.
+ *
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_init(int* err_code);
+
+/**
+ * Finalize Email-engine.
+ *
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_close(int* err_code);
+
+
+/*****************************************************************************/
+/* Account */
+/*****************************************************************************/
+/**
+ * Create a new email account.
+ *
+ * @param[in] account Specifies the structure pointer of account.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_account_create(emf_account_t* account, int* err_code);
+
+/**
+ * Delete a email account.
+ *
+ * @param[in] account_id Specifies the account ID.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_account_delete(int account_id, int* err_code);
+
+/**
+ * Validate a email account.
+ *
+ * @param[in] account_id Specifies the account ID.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_account_validate(int account_id, unsigned* handle, int* err_code);
+
+/**
+ * Change the information of a email account.
+ *
+ * @param[in] account_id Specifies the orignal account ID.
+ * @param[in] new_account Specifies the information of new account.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_account_modify(int account_id, emf_account_t* new_account, int* err_code);
+
+/**
+ * Change the information of a email account after validation
+ *
+ * @param[in] old_account_id Specifies the orignal account ID.
+ * @param[in] new_account_info Specifies the information of new account.
+ * @param[in] handle Specifies the handle for stopping validation.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_account_validate_and_update(int old_account_id, emf_account_t* new_account_info, unsigned* handle,int *err_code);
+
+/**
+ * Get a email account by ID.
+ *
+ * @param[in] account_id Specifies the account ID.
+ * @param[in] pulloption Specifies the pulloption.
+ * @param[out] acount The returned account is saved here.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_account_get(int account_id, int pulloption, emf_account_t** acount, int* err_code);
+
+/**
+ * Get all emails.
+ *
+ * @param[out] acount_list The returned accounts are saved here.(possibly NULL)
+ * @param[out] count The count of returned accounts is saved here.(possibly 0)
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_account_get_list(emf_account_t** acount_list, int* count, int* err_code);
+
+/**
+ * Free allocated memory.
+ *
+ * @param[in] account_list Specifies the structure pointer of account.
+ * @param[in] count Specifies the count of accounts.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_account_free(emf_account_t** account_list, int count, int* err_code);
+
+/**
+ * Get a information of filtering.
+ *
+ * @param[in] filter_id Specifies the filter ID.
+ * @param[out] filtering_set The returned information of filter are saved here.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_filter_get(int filter_id, emf_rule_t** filtering_set, int* err_code);
+
+/**
+ * Get all filterings.
+ *
+ * @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)
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_filter_get_list(emf_rule_t** filtering_set, int* count, int* err_code);
+
+/**
+ * find a filter already exists.
+ *
+ * @param[in] filtering_set Specifies the pointer of adding filter structure.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true if enable add filter, else returns false.
+ */
+EXPORT_API int emf_filter_find(emf_rule_t* filter_info, int* err_code);
+
+/**
+ * Add a filter information.
+ *
+ * @param[in] filtering_set Specifies the pointer of adding filter structure.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.(only EMF_FILTER_BLOCK supported.)
+ */
+EXPORT_API int emf_filter_add(emf_rule_t* filtering_set, int* err_code);
+
+/**
+ * Change a filter information.
+ *
+ * @param[in] filter_id Specifies the original filter ID.
+ * @param[in] new_set Specifies the information of new filter.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_filter_change(int filter_id, emf_rule_t* new_set, int* err_code);
+
+/**
+ * Delete a filter information.
+ *
+ * @param[in] filter_id Specifies the filter ID.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_filter_delete(int filter_id, int* err_code);
+
+/**
+ * Free allocated memory.
+ *
+ * @param[in] filtering_set Specifies the pointer of pointer of filter structure for memory free.
+ * @param[in] count Specifies the count of filter.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_filter_free (emf_rule_t** filtering_set, int count, int* err_code);
+
+
+/*****************************************************************************/
+/* Mail */
+/*****************************************************************************/
+
+/**
+ * Send a mail.
+ *
+ * @param[in] mailbox Specifies the mailbox to consist a sending email.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] sending_option Specifies the sending option.
+ * @param[in] callback Specifies the callback function for retrieving sending information.
+ * @param[in] handle Specifies the handle for stopping sending.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_send(emf_mailbox_t* mailbox, int mail_id, emf_option_t* sending_option, unsigned* handle, int* err_code);
+
+/**
+ * Send all mails to been saved in Offline-mode.
+ *
+ * @param[in] account_id Specifies the account ID.
+ * @param[in] sending_option Specifies the sending option.
+ * @param[in] callback Specifies the callback function for retrieving sending information.
+ * @param[in] handle Specifies the handle for stopping sending.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_send_saved(int account_id, emf_option_t* sending_option, unsigned* handle, int* err_code);
+
+/**
+ * Send a read receipt mail.
+ *
+ * @param[in] mail Specifies the mail to been read.
+ * @param[in] callback Specifies the callback function for retrieving sending information.
+ * @param[in] handle Specifies the handle for stopping sending.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_send_report(emf_mail_t* mail, unsigned* handle, int* err_code);
+
+EXPORT_API int emf_add_mail(emf_mail_data_t *input_mail_data, emf_attachment_data_t *input_attachment_data_list, int input_attachment_count, emf_meeting_request_t *input_meeting_request, int input_sync_server);
+
+/**
+ * Save a mail to specific mail box.
+ *
+ * @param[in] mail Specifies the saving mail.
+ * @param[in] mailbox Specifies the mailbox structure for saving email.
+ * @param[in] meeting_req Specifies the meeting_req structure for saving email.
+ * @param[in] from_composer Specifies the mail is from composer.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+
+EXPORT_API int emf_mail_save_to_mailbox(emf_mail_t* mail, emf_mailbox_t* mailbox, emf_meeting_request_t *meeting_req, int from_composer, int* err_code);
+
+EXPORT_API int emf_mail_add_meeting_request(int account_id, char *mailbox_name, emf_meeting_request_t *meeting_req, int* err_code);
+
+/**
+ * Delete a mail or multiple mails.
+ *
+ * @param[in] account_id Specifies the account id.
+ * @param[in] mailbox Specifies the mailbox.
+ * @param[in] mail_id Specifies the arrary of mail id.
+ * @param[in] num Specifies the number of mail id.
+ * @param[in] from_server Specifies whether mails are deleted from server.
+ * @param[in] callback Specifies the callback function for retrieving deleting information.
+ * @param[in] handle Reserved.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+
+EXPORT_API int emf_mail_delete(int account_id, emf_mailbox_t* mailbox, int mail_id[], int num, int from_server, unsigned* handle, int* err_code);
+
+/**
+ * Delete all mail from a mailbox.
+ *
+ * @param[in] mailbox Specifies the structure of mailbox.
+ * @param[in] with_server Specifies whether mails are also deleted from server.
+ * @param[in] callback Specifies the callback function for delivering status during deleting.
+ * @param[in] handle Reserved.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_delete_all(emf_mailbox_t* mailbox, int with_server, unsigned* handle, int* err_code);
+
+/**
+ * Move a email to another mailbox.
+ *
+ *
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] dst_mailbox Specifies the mailbox structure for moving email.
+ * @param[in] noti_param_1 Specifies first parameter of result notification.
+ * @param[in] noti_param_2 Specifies second parameter of result notification.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_move(int mail_ids[], int num, emf_mailbox_t* dst_mailbox, int noti_param_1, int noti_param_2, int* err_code);
+
+/**
+ * Move all email to another mailbox.
+ *
+ *
+ * @param[in] src_mailbox Specifies the source mailbox structure for moving email.
+ * @param[in] dst_mailbox Specifies the destination mailbox structure for moving email.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_move_all_mails(emf_mailbox_t* src_mailbox, emf_mailbox_t* dst_mailbox, int* err_code);
+
+
+/* Deprecated */
+EXPORT_API int emf_mail_update(int mail_id, emf_mail_t* mail, emf_meeting_request_t *meeting_req, int with_server, int* err_code);
+
+/**
+ * Update a existing email information.
+ *
+ * @param[in] input_mail_data Specifies the structure of mail data.
+ * @param[in] input_attachment_data_list Specifies the structure of mail data.
+ * @param[in] input_attachment_count Specifies the pointer of attachment structure.
+ * @param[in] input_meeting_request Specifies the number of attachment data.
+ * @param[in] input_sync_server Specifies whether sync server.
+ * @remarks N/A
+ * @return This function returns EMF_ERROR_NONE on success or error code on failure.
+ */
+EXPORT_API int emf_update_mail(emf_mail_data_t *input_mail_data, emf_attachment_data_t *input_attachment_data_list, int input_attachment_count, emf_meeting_request_t *input_meeting_request, int input_sync_server);
+
+
+/**
+ * Callback for mail resend
+ *
+ * @param[in] data Specifies the pointer to mail_id.
+ * @remarks N/A
+ * @return This function returns void.
+ */
+EXPORT_API void _OnMailSendRetryTimerCB( void* data );
+
+/**
+ * Get a mail from mailbox.
+ *
+ * @param[in] mailbox Reserved.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[out] mail The returned mail is save here.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_get_mail(emf_mailbox_t* mailbox, int mail_id, emf_mail_t** mail, int* err_code);
+
+/**
+ * Get a mail info.
+ *
+ * @param[in] mailbox Reserved.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[out] info The returned body of mail is saved here.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_get_info(emf_mailbox_t* mailbox, int mail_id, emf_mail_info_t** info, int* err_code);
+
+/**
+ * Get a mail head.
+ *
+ * @param[in] mailbox Reserved.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[out] head The returned info of mail is saved here.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_get_head(emf_mailbox_t* mailbox, int mail_id, emf_mail_head_t** head, int* err_code);
+
+/**
+ * Get a mail body.
+ *
+ * @param[in] mailbox Reserved.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[out] body The returned body of mail is saved here.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_get_body(emf_mailbox_t* mailbox, int mail_id, emf_mail_body_t** body, int* err_code);
+
+/**
+ * Download email body from server.
+ *
+ * @param[in] mailbox Reserved.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] callback Specifies the callback function for retrieving download status.
+ * @param[in] handle Specifies the handle for stopping downloading.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_download_body(emf_mailbox_t* mailbox, int mail_id, int verbose, int with_attachment, unsigned* handle, int* err_code);
+
+/**
+ * Get a mail attachment.
+ *
+ * @param[in] mailbox Reserved.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] attachment_id Specifies the buffer that a attachment ID been saved.
+ * @param[out] attachment The returned attachment is save here.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_get_attachment(emf_mailbox_t* mailbox, int mail_id, char* attachment_id, emf_attachment_info_t** attachment, int* err_code);
+
+/**
+ * Download a email nth-attachment from server.
+ *
+ * @param[in] mailbox Reserved.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] nth Specifies the buffer that a attachment number been saved. the minimum number is "1".
+ * @param[in] callback Specifies the callback function for retrieving download status.
+ * @param[in] handle Specifies the handle for stopping downloading.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_download_attachment(emf_mailbox_t* mailbox, int mail_id, char* nth, unsigned* handle, int* err_code);
+
+
+/**
+ * Append a attachment to email.
+ *
+ * @param[in] mailbox Reserved.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] attachment Specifies the structure of attachment.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_add_attachment(emf_mailbox_t* mailbox, int mail_id, emf_attachment_info_t* attachment, int* err_code);
+
+/**
+ * Delete a attachment from email.
+ *
+ * @param[in] mailbox Reserved.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] attachment_id Specifies the buffer that a attachment ID been saved.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_delete_attachment(emf_mailbox_t* mailbox, int mail_id, char* attachment_id, int* err_code);
+
+/**
+ * Free allocated memroy for emails.
+ *
+ * @param[in] mail_list Specifies the pointer of mail structure pointer.
+ * @param[in] count Specifies the count of mails.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_free(emf_mail_t** mail_list, int count, int* err_code);
+
+/**
+ * Free allocated memroy for email infoes.
+ *
+ * @param[in] head_list Specifies the pointer of mail info structures.
+ * @param[in] count Specifies the number of mail infoes.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_info_free(emf_mail_info_t** info_list, int count, int* err_code);
+
+/**
+ * Free allocated memroy for email headers.
+ *
+ * @param[in] head_list Specifies the pointer of mail head structure list.
+ * @param[in] count Specifies the number of mail heads.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_head_free(emf_mail_head_t** head_list, int count, int* err_code);
+
+/**
+ * Free allocated memroy for email bodies.
+ *
+ * @param[in] body_list Specifies the pointer of mail body structures.
+ * @param[in] count Specifies the number of mail bodies.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_body_free(emf_mail_body_t** body_list, int count, int* err_code);
+
+/**
+ * Free allocated memroy for email attachment.
+ *
+ * @param[in] atch_info Specifies the pointer of mail attachment structure pointer.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_attachment_info_free(emf_attachment_info_t** atch_info, int* err_code);
+
+/**
+ * Change email flag.
+ *
+ * @param[in] mailbox Reserved.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] new_flag Specifies the new email flag.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_modify_flag(int mail_id, emf_mail_flag_t new_flag, int onserver, int sticky_flag, int* err_code);
+
+/**
+ * Change email extra flag.
+ *
+ * @param[in] mailbox Reserved.
+ * @param[in] mail_id Specifies the mail ID.
+ * @param[in] new_flag Specifies the new email extra flag.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_modify_extra_flag(int mail_id, emf_extra_flag_t new_flag, int* err_code);
+
+/**
+ * Change email read/unread flag.
+ * @param[in] account_id Specifies the account id.
+ * @param[in] mail_ids Specifies the array of mail ID.
+ * @param[in] num Specifies the numbers of mail ID.
+ * @param[in] field_type Specifies the field type what you want to set. Refer emf_flags_field_type.
+ * @param[in] value Specifies the value what you want to set.
+ * @param[in] onserver Specifies the mail on server.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_set_flags_field(int account_id, int mail_ids[], int num, emf_flags_field_type field_type, int value, int onserver, int* err_code);
+
+/*****************************************************************************/
+/* Mailbox */
+/*****************************************************************************/
+EXPORT_API int emf_mailbox_get_imap_mailbox_list(int account_id, char* mailbox, unsigned* handle, int* err_code);
+
+/**
+ * Download header of new emails from mail server.
+ *
+ * @param[in] mailbox Specifies the structure of mailbox.
+ * @param[in] callback Specifies the callback function for retrieving download status.
+ * @param[out] handle Specifies the handle for stopping downloading.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mailbox_sync_header(emf_mailbox_t* mailbox, unsigned* handle, int* err_code);
+
+
+EXPORT_API int emf_mailbox_oma_sync_header(int account_id, char*email_address, unsigned* handle, int* err_code);
+
+
+EXPORT_API int emf_mailbox_get_by_now_account_addr(int account_id, char* now_address, emf_mailbox_t** mailbox_list, int* count, int* err_code);
+
+/**
+ * Get mail count from mailbox.
+ *
+ * @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.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mailbox_get_mail_count(emf_mailbox_t* mailbox, int* total, int* unseen, int* err_code);
+
+/**
+ * Get all mailboxes from account.
+ *
+ * @param[in] account_id Specifies the account ID.
+ * @param[out] mailbox_list Specifies the pointer of mailbox structure pointer.(possibly NULL)
+ * @param[out] count The mailbox count is saved here.(possibly 0)
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mailbox_get_list(int account_id, emf_mailbox_t** mailbox_list, int* count, int* err_code);
+
+/**
+ * Create a new mailbox.
+ *
+ * @param[in] new_mailbox Specifies the pointer of creating mailbox information.
+ * @param[out] handle Specifies the handle for stopping creating mailbox.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mailbox_create(emf_mailbox_t* new_mailbox, int on_server, unsigned* handle, int* err_code);
+
+/**
+ * Delete a mailbox.
+ *
+ * @param[in] mailbox Specifies the pointer of deleting mailbox information.
+ * @param[out] handle Specifies the handle for stopping creating mailbox.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mailbox_delete(emf_mailbox_t* mailbox, int on_server, unsigned* handle, int* err_code);
+
+/**
+ * Delete all sub-mailboxes from a specific mailbox.
+ *
+ * @param[in] mailbox Specifies the pointer of mailbox information.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mailbox_delete_all(emf_mailbox_t* mailbox, int* err_code);
+
+/**
+ * Free allocated memory for mailbox information.
+ *
+ * @param[in] mailbox_list Specifies the pointer for searching mailbox structure pointer.
+ * @param[in] count Specifies the count of mailboxes.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mailbox_free(emf_mailbox_t** mailbox_list, int count, int* err_code);
+
+/*****************************************************************************/
+/* Etc */
+/*****************************************************************************/
+
+
+/**
+ * Register a callback for event processing.
+ *
+ * @param[in] action Kind of event callback.
+ * @param[in] callback Function which will be called during processing event.
+ * @param[in] event_data Event data which will be passed to the callback.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_register_event_callback(emf_action_t action, emf_event_callback callback, void* event_data);
+
+/**
+ * Unregister a callback for event processing.
+ *
+ * @param[in] action Kind of event callback.
+ * @param[in] callback Function which will be called during processing event.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_unregister_event_callback(emf_action_t action, emf_event_callback callback);
+
+/**
+ * Get current event queue status.
+ *
+ * @param[out] on_sending True if sending is in progress.
+ * @param[out] on_receiving True if receiving is in progress.
+ * @remarks N/A
+ */
+EXPORT_API void emf_get_event_queue_status(int* on_sending, int* on_receiving);
+
+/**
+ * Get the handle of a pending job.
+ *
+ * @param[in] action Specifies kind of the job.
+ * @param[in] account_id Specifies the account ID.
+ * @param[in] mail_id Specifies the mail ID.
+ * @remarks N/A
+ * @return This function return its handle if a pending job exists, otherwise -1.
+ */
+EXPORT_API int emf_get_pending_job(emf_action_t action, int account_id, int mail_id, emf_event_status_type_t* status);
+
+/**
+ * Cancel a progressive work.
+ *
+ * @param[in] account_id Specifies the account ID.
+ * @param[in] handle Specifies the ID of cancelling work.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_cancel_job(int account_id, int handle, int* err_code);
+
+
+
+/**
+ * Cancel a progressive send mail job.
+ *
+ * @param[in] account_id Specifies the account ID.
+ * @param[in] mail_id Specifies the Mail ID of cancelling send mail.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_mail_send_mail_cancel_job(int account_id, int mail_id, int* err_code);
+
+
+
+#ifdef PARSING_EMN_WBXML
+/**
+ * Retrieve a account from OMA EMN data.
+ *
+ * @param[in] wbxml_b64 Specifies the EMN data. The data is a BASE64 encoded string.
+ * @param[out] account_id The account ID is saved here.
+ * @param[out] mailbox The name of mailbox is saved here.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_get_emn_account (unsigned char* wbxml_b64, int* account_id, char** mailbox, int* err_code);
+#endif
+
+/**
+ * set email options.
+ *
+ * @param[in] option Specifies the email options.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_set_option(emf_option_t* option, int* err_code);
+
+/**
+ * get email options.
+ *
+ * @param[out] option Specifies the email options.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_get_option(emf_option_t* option, int* err_code);
+
+/**
+ * Sync the Local activity
+ *
+ *
+ * @param[in] account_id Specifies the Account ID.
+ * @param[out] err_code Specifies the error code returned.
+ * @remarks N/A
+ * @return This function returns true on success or false on failure.
+ */
+EXPORT_API int emf_local_activity_sync(int account_id, int *err_code);
+
+
+#ifdef __FEATURE_AUTO_POLLING__
+EXPORT_API int emf_auto_polling(int* err_code);
+#endif
+
+EXPORT_API int emf_account_insert_accountinfo_to_contact(emf_account_t* account);
+
+EXPORT_API int emf_account_update_accountinfo_to_contact(emf_account_t* old_account, emf_account_t* new_account);
+
+EXPORT_API int emf_mail_get_mail_by_uid(int account_id, char *uid, emf_mail_t **mail, int *err);
+
+EXPORT_API int emf_mailbox_update(emf_mailbox_t* old_mailbox, emf_mailbox_t* new_mailbox, int on_server, unsigned* handle, int* err_code);
+
+EXPORT_API int emf_clear_mail_data(int* err_code);
+
+EXPORT_API int emf_mail_send_retry( int mail_id, int timeout_in_sec, int* err_code);
+
+EXPORT_API int emf_account_validate_and_create(emf_account_t* new_account, unsigned* handle, int* err_code);
+
+EXPORT_API int emf_mailbox_set_mail_slot_size(int account_id, char* mailbox_name, int new_slot_size, unsigned* handle, int *err_code);
+
+EXPORT_API int emf_mail_move_thread_to_mailbox(int thread_id, char *target_mailbox_name, int move_always_flag, int *err_code);
+
+EXPORT_API int emf_mail_delete_thread(int thread_id, int delete_always_flag, unsigned* handle, int *err_code);
+
+EXPORT_API int emf_mail_modify_seen_flag_of_thread(int thread_id, int seen_flag, int on_server, unsigned* handle, int *err_code);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/**
+* @} @}
+*/
+
+#endif /* __EMFLIB_H__ */