changes for the new email-service
authordavid8.kim <david8.kim@samsung.com>
Tue, 9 Oct 2012 07:34:29 +0000 (16:34 +0900)
committerdavid8.kim <david8.kim@samsung.com>
Tue, 9 Oct 2012 07:34:29 +0000 (16:34 +0900)
account/include/email-account.h
account/src/email-account-folder.c
common/include/email-engine.h
common/src/email-engine.c
mailbox/include/email-mailbox.h
mailbox/src/email-mailbox-controlbar.c
mailbox/src/email-mailbox-list.c
mailbox/src/email-mailbox.c

index d9e9227..6eddf13 100755 (executable)
@@ -177,7 +177,7 @@ struct ug_data {
        int mailbox_type;
 
        int folder_mode;
-       unsigned emf_handle;
+       int emf_handle;
        Elm_Object_Item *root_item;
        Elm_Object_Item *it;
        Evas_Object *entry;
index 70b6dc9..7b87d5a 100755 (executable)
@@ -92,7 +92,7 @@ static void _cancel_button_cb(void *data, Evas_Object *obj, void *event_info);
 /*static void _go_button_clicked_cb(void *data, Evas_Object * obj, void *event_info);*/
 
 static void _edbus_event_account_receive(void *local_data, DBusMessage *message);
-static void _stop_emf_job(EmailAccountUGD *ug_data, unsigned handle);
+static void _stop_emf_job(EmailAccountUGD *ug_data, int handle);
 
 static void _entry_changed_cb(void *data, Evas_Object *obj, void *event_info);
 static void _entry_focused_cb(void *data, Evas_Object *obj, void *event_info);
@@ -2218,7 +2218,7 @@ static void _delete_con_cb(void *data, Evas_Object *obj, void *event_info)
        email_mailbox_t *mlist = (email_mailbox_t *)(node->data);
        email_mailbox_t mbox = { 0, };
        int err_code = EMAIL_ERROR_NONE;
-       unsigned handle;
+       int handle;
        int on_server = (EMAIL_SERVER_TYPE_POP3 == GET_ACCOUNT_SERVER_TYPE(ug_data->account_id)?0:1);
 
        memset(&mbox, 0x00, sizeof(email_mailbox_t));
@@ -2350,7 +2350,7 @@ static void _create_con_cb(void *data, Evas_Object *obj, void *event_info)
        email_mailbox_t *mlist = (email_mailbox_t *)(node->data);
        email_mailbox_t mbox = { 0, };
        int err_code = EMAIL_ERROR_NONE;
-       unsigned handle;
+       int handle;
        char arg1[MAX_STR_LEN] = { 0, };
        char arg2[MAX_STR_LEN] = { 0, };
        char arg3[MAX_STR_LEN] = { 0, };
@@ -2512,7 +2512,7 @@ static void _rename_con_cb(void *data, Evas_Object *obj, void *event_info)
        char arg2[MAX_STR_LEN] = { 0, };
        char arg3[MAX_STR_LEN] = { 0, };
        int err_code = EMAIL_ERROR_NONE;
-       unsigned handle;
+       int handle;
        int on_server = (EMAIL_SERVER_TYPE_POP3 == GET_ACCOUNT_SERVER_TYPE(alist->ug_data->account_id)?0:1);
 
        strcpy(arg1, elm_entry_markup_to_utf8(elm_object_text_get(alist->ug_data->entry)));
@@ -2677,7 +2677,7 @@ static void _move_con_cb(void *data, Evas_Object *obj, void *event_info)
        email_mailbox_t *mlist_to = (email_mailbox_t *)(node_to->data);
        char arg1[MAX_STR_LEN] = { 0, };
        int err_code = EMAIL_ERROR_NONE;
-       unsigned handle;
+       int handle;
        int on_server = (EMAIL_SERVER_TYPE_POP3 == GET_ACCOUNT_SERVER_TYPE(alist->ug_data->account_id)?0:1);
 
        if(strlen(mlist_to->mailbox_name) > 0)
@@ -3392,7 +3392,7 @@ static void _edbus_event_account_receive(void *local_data, DBusMessage *message)
        debug_leave();
 }
 
-static void _stop_emf_job(EmailAccountUGD *ug_data, unsigned handle)
+static void _stop_emf_job(EmailAccountUGD *ug_data, int handle)
 {
        debug_log("");
        if (!ug_data) {
index 90f7750..fa12ca2 100755 (executable)
@@ -54,7 +54,7 @@ typedef struct {
 gboolean email_engine_initialize(void);
 void email_engine_finalize(void);
 void email_engine_finalize_force(void);
-gboolean email_engine_add_account_with_validation(email_account_t *_account, int *account_id, unsigned *handle, int *error_code);
+gboolean email_engine_add_account_with_validation(email_account_t *_account, int *account_id, int *handle, int *error_code);
 gboolean email_engine_add_account(email_account_t *_account, int *account_id);
 gboolean email_engine_update_account_with_validation(gint account_id, email_account_t *_account);
 gboolean email_engine_update_account(gint account_id, email_account_t *_account);
@@ -65,13 +65,13 @@ gboolean email_engine_get_account_full_data(int acctid, email_account_t **accoun
 gboolean email_engine_get_default_account(gint *account_id);
 gboolean email_engine_set_default_account(gint account_id);
 
-gboolean email_engine_sync_folder(gint account_id, int mailbox_id, unsigned *handle);
-void email_engine_stop_working(gint account_id, unsigned handle);
+gboolean email_engine_sync_folder(gint account_id, int mailbox_id, int *handle);
+void email_engine_stop_working(gint account_id, int handle);
 
 gboolean email_engine_check_seen_mail(gint account_id, gint mail_id);
 int email_engine_check_body_download(int mail_id);
-gboolean email_engine_body_download(gint account_id, gint mail_id, unsigned *handle);
-gboolean email_engine_attachment_download(gint account_id, gint mail_id, gint index, unsigned *handle);
+gboolean email_engine_body_download(gint account_id, gint mail_id, int *handle);
+gboolean email_engine_attachment_download(gint account_id, gint mail_id, gint index, int *handle);
 
 gboolean email_engine_delete_mail(gint account_id, int mailbox_id, gint mail_id, int sync);
 gboolean email_engine_delete_all_mail(gint account_id, int mailbox_id, int sync);
index 11d1144..82d3bf0 100755 (executable)
@@ -131,7 +131,7 @@ gboolean email_engine_add_account(email_account_t *_account, int *account_id)
        return TRUE;
 }
 
-gboolean email_engine_add_account_with_validation(email_account_t *_account, int *account_id, unsigned *handle, int *error_code)
+gboolean email_engine_add_account_with_validation(email_account_t *_account, int *account_id, int *handle, int *error_code)
 {
        debug_log("");
        RETURN_VAL_IF_FAIL(_account != NULL, FALSE);
@@ -340,7 +340,7 @@ gboolean email_engine_sync_folder(gint account_id, int mailbox_id, unsigned *han
        debug_log("account id (%d)", account_id);
 
        gboolean res = FALSE;
-       unsigned email_handle = 0;
+       int email_handle = 0;
        int err = 0;
 
        err = email_sync_header(account_id, mailbox_id, &email_handle);
@@ -449,7 +449,7 @@ gboolean email_engine_body_download(gint account_id, gint mail_id, unsigned *han
        RETURN_VAL_IF_FAIL(mail_id > 0, FALSE);
 
        int err = 0;
-       unsigned email_handle = 0;
+       int email_handle = 0;
        gboolean res = FALSE;
 
        err = email_download_body(mail_id, 0, &email_handle);
@@ -470,7 +470,7 @@ gboolean email_engine_body_download(gint account_id, gint mail_id, unsigned *han
        return res;
 }
 
-gboolean email_engine_attachment_download(gint account_id, gint mail_id, gint index, unsigned *handle)
+gboolean email_engine_attachment_download(gint account_id, gint mail_id, gint index, int *handle)
 {
        debug_log("");
        RETURN_VAL_IF_FAIL(account_id > ACCOUNT_MIN, FALSE);
@@ -478,7 +478,7 @@ gboolean email_engine_attachment_download(gint account_id, gint mail_id, gint in
        RETURN_VAL_IF_FAIL(index > 0, FALSE);
 
        int err = 0;
-       unsigned email_handle = 0;
+       int email_handle = 0;
        gboolean res = FALSE;
 
        err = email_download_attachment(mail_id, index, &email_handle);
index 27dbe1a..25b74a9 100755 (executable)
@@ -102,7 +102,7 @@ typedef struct {
        int mailbox_type;
        gboolean is_attachment;
        gboolean is_seen;
-       gboolean is_sending_now;
+       email_mail_status_t is_sending_now;
        gboolean is_body_download;
        gint mail_id;
        gint account_id;
@@ -330,7 +330,7 @@ struct ug_data {
 
        MailboxAdvSearchViewInfo *adv_search_info;
        gboolean b_advanced_search_view;
-       unsigned emf_handle;
+       int emf_handle;
        EmailAccountInfo *account_info;
        E_DBus_Connection *edbus_conn;
        gchar *prev_group_title;
@@ -441,7 +441,7 @@ void _update_navigationbar_title(EmailMailboxUGD *mailbox_ugd);
 ui_gadget_h create_composer_ug(char *ug_name, service_h service, void *data);
 void layout_composer_cb(ui_gadget_h ug, enum ug_mode mode, void *priv);
 void result_composer_cb(ui_gadget_h ug, service_h service, void *priv);
-void _stop_emf_job(EmailMailboxUGD *mailbox_ugd, unsigned handle, gboolean change_download_label_in_panel);
+void _stop_emf_job(EmailMailboxUGD *mailbox_ugd, int handle, gboolean change_download_label_in_panel);
 void email_rotate_landscape(EmailMailboxUGD *mailbox_ugd);
 void _update_toolbar_clicked_cb(void *data, Evas_Object *obj, void *event_info);
 void _update_toolbar_cancel_clicked_cb(void *data, Evas_Object *obj, void *event_info);
index 1b7b0f0..63a16d7 100755 (executable)
@@ -225,11 +225,9 @@ static void _markunread_mail_cb(void *data, Evas_Object *obj, void *event_info)
                Eina_List *nth_list = eina_list_nth_list(list, i);
 
                list_data *ld = eina_list_data_get(nth_list);
-               /* For all other views where mail list is present but threaded mail list is not present */
-               int seen_flag = (ld->is_seen == false)? 1 /* make it read */ :
-                                                                                               0 /* make it unread */;
 
-               int err = email_set_flags_field(ld->account_id, &(ld->mail_id), 1, EMAIL_FLAGS_SEEN_FIELD, seen_flag, 1);
+               //make it unread state in all cases
+               int err = email_set_flags_field(ld->account_id, &(ld->mail_id), 1, EMAIL_FLAGS_SEEN_FIELD, 0, 1);
                if (err != EMAIL_ERROR_NONE)
                        debug_log("email_set_flags_field - err(%d)", err);
 
index 4ab5f86..9ae0808 100755 (executable)
@@ -461,7 +461,7 @@ static void _realized_cb(void *data, Evas_Object *obj, void *event_info)
        if (ld->is_attachment == true) {
                elm_object_item_signal_emit(ld->item, "elm,state,attach", "elm");
        }
-       if(ld->priority != EMAIL_OPTION_PRIORITY_NORMAL) {
+       if(ld->priority != EMAIL_MAIL_PRIORITY_NORMAL) {
                elm_object_item_signal_emit(ld->item, "elm,state,priority", "elm");
        }
        if(ld->reply_flag || ld->forward_flag) {
@@ -750,7 +750,7 @@ static Evas_Object *_gl_mail_item_content_get(void *data, Evas_Object *obj, cons
 
        else if(!g_strcmp0(source, "elm.icon.priority"))
        {
-               if(ld->priority == EMAIL_OPTION_PRIORITY_HIGH) {
+               if(ld->priority == EMAIL_MAIL_PRIORITY_HIGH) {
                        Evas_Object *ic = elm_icon_add(obj);
                        elm_icon_file_set(ic, IMGDIR "/M02_email_icon_priority.png", NULL);
                        elm_icon_resizable_set(ic, 0, 0);
@@ -759,7 +759,7 @@ static Evas_Object *_gl_mail_item_content_get(void *data, Evas_Object *obj, cons
                        return (void *)ic;
                }
 #if 0  // support low priority message
-               else if(ld->priority == EMAIL_OPTION_PRIORITY_LOW) {
+               else if(ld->priority == EMAIL_MAIL_PRIORITY_LOW) {
                        if(ld->item)
                                edje_object_signal_emit((Evas_Object *)elm_genlist_item_object_get(ld->item), "elm,state,priority", "elm");
                        Evas_Object *ic = elm_icon_add(obj);
@@ -792,7 +792,7 @@ static Evas_Object *_gl_mail_item_content_get(void *data, Evas_Object *obj, cons
 #if 0
        else if(!g_strcmp0(source, "elm.icon.appointment"))
        {
-               if(ld->priority == 1)
+               if(ld->priority == EMAIL_MAIL_PRIORITY_HIGH)
                {
                        if(ld->item)
                                edje_object_signal_emit((Evas_Object *)elm_genlist_item_object_get(ld->item), "elm,state,priority", "elm");
@@ -1427,11 +1427,11 @@ static int email_set_group(list_data *ld)
                        break;
 
                case EMAIL_VIEW_PRIORITY:
-                       if(ld->priority == EMAIL_OPTION_PRIORITY_HIGH){
+                       if(ld->priority == EMAIL_MAIL_PRIORITY_HIGH){
                                group_index = 0;
                                ld->group_title = g_strdup(_("IDS_EMAIL_BODY_HIGH_M_PRIORITY"));
                        }
-                       else if(ld->priority == EMAIL_OPTION_PRIORITY_NORMAL)
+                       else if(ld->priority == EMAIL_MAIL_PRIORITY_NORMAL)
                        {
                                group_index = 1;
                                ld->group_title = g_strdup(_("IDS_EMAIL_BODY_NORMAL_M_EMAILPRIORITY"));
index 5c29727..2de4ce9 100755 (executable)
@@ -1252,7 +1252,7 @@ Eina_Bool _state_get(void *data, Evas_Object *obj, const char *part)
        return EINA_FALSE;
 }
 
-void _stop_emf_job(EmailMailboxUGD *mailbox_ugd, unsigned handle, gboolean change_download_label_in_panel)
+void _stop_emf_job(EmailMailboxUGD *mailbox_ugd, int handle, gboolean change_download_label_in_panel)
 {
        debug_log("");
        gint account_id = mailbox_ugd->account_id;
@@ -1283,7 +1283,7 @@ void _sync_curr_folder(EmailMailboxUGD *mailbox_ugd, int mailbox_id)
 {
        debug_log("");
 
-       unsigned handle = 0;
+       int handle = 0;
        gboolean res = FALSE;
        gint account_id = mailbox_ugd->account_id;
 
@@ -1302,7 +1302,7 @@ void _sync_all_folder(EmailMailboxUGD *mailbox_ugd)
 {
        debug_log("");
 
-       unsigned handle = 0;
+       int handle = 0;
        int err = 0;
 
        err = email_sync_header_for_all_account(&handle);