/* ----------------------------------------------------------------------------- */
/* Feature definitions */
-#define __FEATURE_USING_MY_ACCOUNT__
#define __FEATURE_BACKUP_ACCOUNT__
#define __FEATURE_MOVE_TO_OUTBOX_FIRST__
/* #define __FEATURE_PARTIAL_BODY_FOR_POP3__ */
#define __FEATURE_AUTO_POLLING__
#define __FEATURE_DEBUG_LOG__
#define __FEATURE_USE_SHARED_MUTEX_FOR_GENERATING_MAIL_ID__
+#define __FEATURE_XLIST_SUPPORT__
/* #define __FEATURE_USE_SHARED_MUTEX_FOR_PROTECTED_FUNC_CALL__ */
/* #define __FEATURE_IMAP_IDLE__ */
-#define __FEATURE_SUPPORT_ACTIVE_SYNC__
-#define __HEADER_OPTIMIZATION__ /* Will be removed */
-#define __DOWNLOAD_BODY_ATTACHMENT_OPTIMIZATION__ /* Will be removed */
/* ----------------------------------------------------------------------------- */
/* Macro */
#define PARTIAL_BODY_SIZE_IN_BYTES 15360 /* Partial Body download - 15K */
#define NO_LIMITATION 0
#define MAX_MAILBOX_TYPE 100
-#define EMF_SYNC_ALL_MAILBOX 1
-#define EMF_ATTACHMENT_MAX_COUNT 512
+#define EMAIL_SYNC_ALL_MAILBOX 1
+#define EMAIL_ATTACHMENT_MAX_COUNT 512
#define DOWNLOAD_MAX_BUFFER_SIZE 8000
#define LOCAL_MAX_BUFFER_SIZE 1000000
#define IMAP_MAX_COMMAND_LENGTH 1000
#define MAILHOME DATA_PATH"/email/.emfdata"
#define DIRECTORY_PERMISSION 0755
-#define VCONF_KEY_LAST_SYNC_TIME "db/email/last_sync_time"
-#define VCONF_KEY_DEFAULT_SLOT_SIZE "db/email/slot_size"
-#define VCONF_KEY_LATEST_MAIL_ID "db/email/latest_mail_id"
-#define VCONF_KEY_DEFAULT_ACCOUNT_ID "db/email/defaultaccount"
-#define VCONF_KEY_UNREAD_MAIL_COUNT "db/badge/com.samsung.email"
-
#define MIME_SUBTYPE_DRM_OBJECT "vnd.oma.drm.message"
#define MIME_SUBTYPE_DRM_RIGHTS "vnd.oma.drm.rights+xml"
#define MIME_SUBTYPE_DRM_DCF "vnd.oma.drm.dcf"
#define SHM_FILE_FOR_DB_LOCK "/.email_shm_db_lock"
-#define NATIVE_EMAIL_APPLICATION_PKG "com.samsung.email"
+#define NATIVE_EMAIL_APPLICATION_PKG "org.tizen.email"
#ifdef __FEATURE_USE_SHARED_MUTEX_FOR_GENERATING_MAIL_ID__
#define SHM_FILE_FOR_MAIL_ID_LOCK "/.email_shm_mail_id_lock"
#define LF_STRING "\n"
#define CRLF_STRING "\r\n"
-#define SYNC_STATUS_FINISHED 0 /* BIN 00000000 */
-#define SYNC_STATUS_SYNCING 1 /* BIN 00000001 */
-#define SYNC_STATUS_HAVE_NEW_MAILS 2 /* BIN 00000010 */
-
#define GRAB_TYPE_TEXT 1 /* retrieve text and attachment list */
#define GRAB_TYPE_ATTACHMENT 2 /* retrieve attachment */
#define SAVE_TYPE_BUFFER 2 /* save content to buffer */
#define SAVE_TYPE_FILE 3 /* save content to temporary file */
-#define FINISH_OFF_IF_CANCELED if (!emcore_check_thread_status()) { err = EMF_ERROR_CANCELLED; goto FINISH_OFF; }
+#define FINISH_OFF_IF_CANCELED if (!emcore_check_thread_status()) { err = EMAIL_ERROR_CANCELLED; goto FINISH_OFF; }
#define CHECK_JOB_CANCELED() {if (!emcore_check_thread_status()) goto JOB_CANCEL; }
#define SNPRINTF(buff, size, format, args...) snprintf(buff, size, format, ##args)
#define DELETE_RECURSIVE_CRITICAL_SECTION(cs) {EM_DEBUG_LOG("DELETE_RECURSIVE_CRITICAL_SECTION "#cs); if(cs) pthread_mutex_destroy(cs);}
typedef pthread_t thread_t;
-#define SMTP_RESPONSE_OK 250
-#define SMTP_RESPONSE_READY 354
-#define SMTP_RESPONSE_WANT_AUTH 505
-#define SMTP_RESPONSE_WANT_AUTH2 530
-#define SMTP_RESPONSE_UNAVAIL 550
+#define SMTP_RESPONSE_OK 250
+#define SMTP_RESPONSE_READY 354
+#define SMTP_RESPONSE_WANT_AUTH 505
+#define SMTP_RESPONSE_WANT_AUTH2 530
+#define SMTP_RESPONSE_UNAVAIL 550
+
+#define VCONF_KEY_DEFAULT_SLOT_SIZE "db/private/email-service/slot_size"
+#define VCONF_KEY_LATEST_MAIL_ID "db/private/email-service/latest_mail_id"
+#define VCONF_KEY_DEFAULT_ACCOUNT_ID "db/private/email-service/default_account_id"
+
/* ----------------------------------------------------------------------------- */
/* Type */
typedef enum
#ifdef __FEATURE_PARTIAL_BODY_DOWNLOAD__
_SERVICE_THREAD_TYPE_PBD = 3,
#endif /* __FEATURE_PARTIAL_BODY_DOWNLOAD__ */
-} emf_service_thread_type;
+} email_service_thread_type;
typedef enum
{
- EMF_PROTOCOL_NONE = 0,
- EMF_PROTOCOL_POP3 = 1,
- EMF_PROTOCOL_IMAP = 2,
- EMF_PROTOCOL_SMTP = 3,
-} emf_protocol_type_t;
+ EMAIL_PROTOCOL_NONE = 0,
+ EMAIL_PROTOCOL_POP3 = 1,
+ EMAIL_PROTOCOL_IMAP = 2,
+ EMAIL_PROTOCOL_SMTP = 3,
+} email_protocol_type_t;
+typedef enum
+{
+ ACCOUNT_SVC_SYNC_STATUS_RUNNING = 0,
+ ACCOUNT_SVC_SYNC_STATUS_IDLE = 1,
+ ACCOUNT_SVC_SYNC_STATUS_OFF = 2,
+} email_account_svc_sync_status;
+
+typedef enum {
+ SET_TYPE_SET = 1,
+ SET_TYPE_UNION = 2,
+ SET_TYPE_MINUS = 3,
+ SET_TYPE_INTERSECT = 4 /* Not supported */
+} email_set_type_t;
#ifdef __FEATURE_KEEP_CONNECTION__
enum
{
- EMF_STREAM_STATUS_DISCONNECTED = 0,
- EMF_STREAM_STATUS_CONNECTED = 1
+ EMAIL_STREAM_STATUS_DISCONNECTED = 0,
+ EMAIL_STREAM_STATUS_CONNECTED = 1
} ;
#endif /* __FEATURE_KEEP_CONNECTION__ */
typedef struct
{
int account_id; /* in general, account id */
- emf_event_type_t type;
- emf_event_status_type_t status;
- char *event_param_data_1; /* in general, mailbox name (exception in emcore_send_mail, emcore_send_saved_mail it is emf_option_t **/
+ email_event_type_t type;
+ email_event_status_type_t status;
+ char *event_param_data_1; /* in general, mailbox name (exception in emcore_send_mail, emcore_send_saved_mail it is email_option_t **/
char *event_param_data_2;
char *event_param_data_3;
int event_param_data_4;
int event_param_data_5;
int event_param_data_6; /* in general, notification parameter #1 */
int event_param_data_7; /* in general, notification parameter #2 */
-} emf_event_t;
+ int event_param_data_8;
+} email_event_t;
typedef struct
{
int num;
void *data;
-} emf_callback_holder_t;
+} email_callback_holder_t;
-typedef struct emf_search_key_t emf_search_key_t;
-struct emf_search_key_t
+typedef struct email_search_key_t email_search_key_t;
+struct email_search_key_t
{
int type;
char *value;
- emf_search_key_t *next;
+ email_search_key_t *next;
};
typedef struct
{
int tid;
- emf_protocol_type_t protocol;
+ email_protocol_type_t protocol;
void *stream;
int auth;
int network;
int error;
int status;
-} emf_session_t;
+} email_session_t;
+
+typedef struct
+{
+ int mailbox_id; /**< Unique id on mailbox table.*/
+ char *mailbox_name; /**< Specifies the path of mailbox.*/
+ email_mailbox_type_e mailbox_type; /**< Specifies the type of mailbox */
+ 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 local; /**< Specifies the local mailbox.*/
+ int synchronous; /**< Specifies the mailbox with synchronized the server.*/
+ int account_id; /**< Specifies the account ID for mailbox.*/
+ int has_archived_mails; /**< Specifies the archived mails.*/
+ int mail_slot_size; /**< Specifies how many mails can be stored in local mailbox.*/
+ void *user_data; /**< Specifies the internal data.*/
+ void *mail_stream; /**< Specifies the internal data.*/
+} email_internal_mailbox_t;
#ifdef __FEATURE_KEEP_CONNECTION__
-typedef struct emf_connection_info
+typedef struct email_connection_info
{
int account_id;
int sending_server_stream_status;
void *sending_server_stream;
int receiving_server_stream_status;
void *receiving_server_stream;
- struct emf_connection_info *next;
-} emf_connection_info_t;
+ struct email_connection_info *next;
+} email_connection_info_t;
#endif /* __FEATURE_KEEP_CONNECTION__ */
-typedef void (*emf_event_callback)(int total, int done, int status, int account_id, int mail_id, int handle, void *user_data, int error);
+typedef struct
+{
+ char *contact_name;
+ char *email_address;
+ char *alias;
+ int storage_type;
+ int contact_id;
+} email_mail_contact_info_t;
+
+/* global account lis */
+typedef struct email_account_list
+{
+ email_account_t *account;
+ struct email_account_list *next;
+} email_account_list_t;
+
+typedef void (*email_event_callback)(int total, int done, int status, int account_id, int mail_id, int handle, void *user_data, int error);
/* ----------------------------------------------------------------------------- */
/* Please contact Himanshu [h.gahlaut@samsung.com] for any explanation in code here under __FEATURE_PARTIAL_BODY_DOWNLOAD__ MACRO */
ACTIVITY_PARTIAL_BODY_DOWNLOAD_IMAP4 = 1,
ACTIVITY_PARTIAL_BODY_DOWNLOAD_POP3_WAIT,
ACTIVITY_PARTIAL_BODY_DOWNLOAD_POP3_ACTIVE
-} emf_pdb_activity_type_e;
+} email_pdb_activity_type_e;
typedef struct
{
int mail_id;
unsigned long server_mail_id;
int activity_id;
+ int mailbox_id;
char *mailbox_name;
- emf_event_type_t event_type; /* Event Type Null means event is created from local activitys */
+ email_event_type_t event_type; /* Event Type Null means event is created from local activitys */
int activity_type; /* Activity Type Null means event is created from event queue */
-} emf_event_partial_body_thd;
+} email_event_partial_body_thd;
#endif /* __FEATURE_PARTIAL_BODY_DOWNLOAD__ */
#ifdef __cplusplus