From: Kim Jinho Date: Mon, 21 Jan 2013 09:42:16 +0000 (+0900) Subject: Merged with mailbox latest code X-Git-Tag: 2.1b_release~3^2~49 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0f151c3704c275f5840ada84cc915fac40c2b7c;p=apps%2Fcore%2Fpreloaded%2Femail.git Merged with mailbox latest code --- diff --git a/account/include/email-account.h b/account/include/email-account.h index e87a430..5ff6882 100755 --- a/account/include/email-account.h +++ b/account/include/email-account.h @@ -50,7 +50,7 @@ #define THEME_PATH EDJDIR"/email-account-theme.edj" #define CONTROLBAR_ICON_COMPOSE IMGDIR"/M02_controlbar_icon_compose.png" -#define CONTROLBAR_ICON_UPDATE IMGDIR"/00_icon_refresh.png" +#define CONTROLBAR_ICON_UPDATE IMGDIR"/M02_title_icon_refresh.png" #define CONTROLBAR_ICON_ADD IMGDIR"/M02_controlbar_icon_add_folder.png" #define CONTROLBAR_ICON_RENAME IMGDIR"/M02_controlbar_icon_edit.png" #define CONTROLBAR_ICON_MOVE IMGDIR"/M02_controlbar_icon_move.png" diff --git a/images/00_icon_refresh.png b/images/M02_popup_icon_sender.png similarity index 52% rename from images/00_icon_refresh.png rename to images/M02_popup_icon_sender.png index f545ed3..feedcdf 100755 Binary files a/images/00_icon_refresh.png and b/images/M02_popup_icon_sender.png differ diff --git a/images/00_icon_folder.png b/images/M02_title_icon_folder.png similarity index 81% rename from images/00_icon_folder.png rename to images/M02_title_icon_folder.png index 73e8978..3b0a0d6 100755 Binary files a/images/00_icon_folder.png and b/images/M02_title_icon_folder.png differ diff --git a/images/M02_title_icon_refresh.png b/images/M02_title_icon_refresh.png new file mode 100755 index 0000000..a31a268 Binary files /dev/null and b/images/M02_title_icon_refresh.png differ diff --git a/mailbox/include/email-mailbox-controlbar.h b/mailbox/include/email-mailbox-controlbar.h index 332525a..9d2f7b3 100755 --- a/mailbox/include/email-mailbox-controlbar.h +++ b/mailbox/include/email-mailbox-controlbar.h @@ -20,7 +20,11 @@ void _create_controlbar(EmailMailboxUGD *mailbox_ugd); void _delete_controlbar(EmailMailboxUGD *mailbox_ugd); +void _create_controlbar_for_split_view(EmailMailboxUGD *mailbox_ugd); +void _delete_controlbar_for_split_view(EmailMailboxUGD *mailbox_ugd); void _hide_toolbar(EmailMailboxUGD *mailbox_ugd); void _show_toolbar(EmailMailboxUGD *mailbox_ugd); +void _hide_split_toolbar(EmailMailboxUGD *mailbox_ugd); +void _show_split_toolbar(EmailMailboxUGD *mailbox_ugd); #endif /* __DEF_EMAIL_MAILBOX_CONTROL_BAR_H_ */ diff --git a/mailbox/include/email-mailbox.h b/mailbox/include/email-mailbox.h index f0d33dc..985ac72 100755 --- a/mailbox/include/email-mailbox.h +++ b/mailbox/include/email-mailbox.h @@ -59,8 +59,8 @@ #define ICON_MARKUNREAD IMGDIR"/M02_controlbar_icon_mark_as_unread.png" #define ICON_CANCEL IMGDIR"/M02_controlbar_icon_cancel.png" #define ICON_COMPOSE IMGDIR"/M02_controlbar_icon_compose.png" -#define ICON_UPDATE IMGDIR"/00_icon_refresh.png" -#define ICON_FOLDERS IMGDIR"/00_icon_folder.png" +#define ICON_UPDATE IMGDIR"/M02_title_icon_refresh.png" +#define ICON_FOLDERS IMGDIR"/M02_title_icon_folder.png" #define ICON_SORTBY IMGDIR"/M02_controlbar_icon_sort_by.png" #define ICON_VIEWMODE IMGDIR"/M02_controlbar_icon_view_mode.png" #define ICON_MORE IMGDIR"/M02_controlbar_icon_more.png" @@ -221,6 +221,7 @@ typedef struct _MailboxAdvSearchViewInfo { Evas_Object *search_sender_address; Evas_Object *search_date_from; Evas_Object *search_date_to; + Evas_Object *search_list_popup; /* for search date popup */ char* str_title; char* str_sender_address; char* str_search_criteria; @@ -251,6 +252,14 @@ struct ug_data { Evas_Object *ly; Evas_Object *check; Evas_Object *navi_bar; + Evas_Object *split_ly; + Evas_Object *sub_layout_split; + Evas_Object *split_navi_bar; + Evas_Object *split_more_btn; + Evas_Object *split_lbtn; + Evas_Object *split_rbtn; + Elm_Object_Item *split_navi_it; + Evas_Object *split_back_btn; Evas_Object *controlbar_more_btn; Evas_Object *controlbar_lbtn; Evas_Object *controlbar_rbtn; @@ -271,6 +280,7 @@ struct ug_data { Evas_Object *folder_ctxpopup; Evas_Object *passwd_popup; Evas_Object *password_entry; + Evas_Object *flag_popup; GList *important_list; Evas_Object *selectioninfo_layout; Evas_Object *sub_layout[EMAIL_VIEW_MAX]; @@ -291,6 +301,7 @@ struct ug_data { Evas_Object *viewby_popup; Evas_Object *delete_popup; Evas_Object *searchby_ctx_popup; + Elm_Object_Item* navi_item_search; Evas_Object *account_dim; GList *folder_list; GList *selected_list; /* revised, used to move the mails selected in previous view */ @@ -301,6 +312,7 @@ struct ug_data { gint thread_id; gint thread_mail_count; gint total_count; + gint account_count; gint chk_cnt; gint unread_cnt; EmailSortType sort_type; @@ -321,6 +333,7 @@ struct ug_data { email_move_list *move_list; email_account_t *move_account_list; + int b_move_list_view; int move_account_cnt; int move_src_mailbox_id; int b_duplicated_node; @@ -436,8 +449,6 @@ void _main_back_clicked(void *data, Evas_Object *obj, void *event_info); void _update_navigationbar_title(EmailMailboxUGD *mailbox_ugd); ui_gadget_h create_composer_ug(char *ug_name, service_h service, void *data); ui_gadget_h create_setting_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, 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); @@ -450,5 +461,6 @@ void _create_email_no_content_view(EmailMailboxUGD *mailbox_ugd); void _reset_refer_item_and_idx(EmailMailboxUGD *mailbox_ugd); email_sort_type_t _mailbox_conv_sort_type(EmailSortType sort_type); void mailbox_create_password_changed_popup(void *data); +void _split_back_clicked(void *data, Evas_Object *obj, void *event_info); #endif /* __DEF_email-mailbox_H__ */ diff --git a/mailbox/src/email-mailbox-controlbar.c b/mailbox/src/email-mailbox-controlbar.c index a1e34e4..40808a3 100755 --- a/mailbox/src/email-mailbox-controlbar.c +++ b/mailbox/src/email-mailbox-controlbar.c @@ -32,10 +32,36 @@ typedef struct { } viewby_req_t; viewby_req_t viewby_req[VIEWBY_MAX]; +typedef enum { + POPUP__LIST_TYPE_UNKNOWN = -1, + MARK_AS_READ, + MARK_AS_UNREAD, + SET_AS_FAVOURITE, + SET_AS_UNFAVOURITE, + POPUP_LIST_TYPE_MAX, +} MailboxPopupListIndex; + +typedef enum { + MARK_READ_UNREAD_POPUP = MARK_AS_READ, + SET_FAVOURITE_UNFAVOURITE_POPUP = SET_AS_FAVOURITE, + POPUP_TYPE_MAX, +} MailboxPopupType; + extern Eina_List *edit_list; extern gboolean b_editmode; extern int ug_pushed; +#define MAILBOX_MORE_OPTION_SORT_BY IMGDIR"/M02_popup_icon_sort_by.png" +#define MAILBOX_MORE_OPTION_DELETE_ALL IMGDIR"/M02_popup_icon_delete_all.png" +#define MAILBOX_MORE_OPTION_MARK_UNREAD IMGDIR"/M02_popup_icon_mark_as_unread.png" +#define MAILBOX_MORE_OPTION_SET_FAVOURITE IMGDIR"/M02_icon_favorite_off_74x74.png" //To be modified +#define MAILBOX_MORE_OPTION_SET_FLAG IMGDIR"/M02_controlbar_icon_mark_as_unread.png" //To be modified +#define MAILBOX_MORE_OPTION_BLOCK IMGDIR"/M02_popup_icon_block.png" +#define MAILBOX_MORE_OPTION_MOVE IMGDIR"/M02_popup_icon_move.png" +#define MAILBOX_MORE_OPTION_VIEW_MODE IMGDIR"/M02_popup_icon_view_mode.png" +#define MAILBOX_MORE_OPTION_DOCUMENT IMGDIR"/M02_icon_popup_document.png" +#define MAILBOX_MORE_OPTION_ADD_ACCOUNT IMGDIR"/M02_popup_icon_add_account.png" + static Evas_Object *create_control_option(EmailMailboxUGD *ad); static Evas_Object *create_edit_control_option(EmailMailboxUGD *ad); @@ -52,10 +78,20 @@ static void _move_ctxpopup(Evas_Object *ctxpopup, Evas_Object *win); static void _move_mail_cb(void *data, Evas_Object *obj, void *event_info); static void _add_account_cb(void *data, Evas_Object *obj, void *event_info); static void _search_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); +static void _set_as_unfavourite_mail_cb(void *data, Evas_Object *obj, void *event_info); +static void _set_as_favourite_mail_cb(void *data, Evas_Object *obj, void *event_info); +static void _create_favourite_status_popup_cb(void *data, Evas_Object *obj, void *event_info); +static void _create_mark_status_popup_cb(void *data, Evas_Object *obj, void *event_info); +static void _create_mailbox_list_popup_cb(void *data, MailboxPopupType popup_type); +static void _mailbox_list_popup_canceled_cb(void *data, Evas_Object *obj, void *event_info); +static void _mailbox_list_popup_item_selected_cb(void *data, Evas_Object *obj, void *event_info); static Evas_Object *_create_toolbar_more_btn(Evas_Object *parent, Evas_Smart_Cb func, void *data); static Evas_Object *_create_toolbar_btn(Evas_Object *parent, const char *text, Evas_Smart_Cb func, void *data); +static Evas_Object *create_control_option_for_split_view(EmailMailboxUGD *mailbox_ugd); +static Evas_Object *create_edit_control_option_for_split_view(EmailMailboxUGD *mailbox_ugd); + static void _block_clicked_cb(void *data, Evas_Object *obj, void *event_info) { evas_object_del(obj); @@ -301,51 +337,101 @@ static void _more_toolbar_clicked_cb(void *data, Evas_Object *obj, void *event_i EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; Evas_Object* icon; - mailbox_ugd->ctxpopup = elm_ctxpopup_add(mailbox_ugd->navi_bar); + if(mailbox_ugd->isRotate){ + mailbox_ugd->ctxpopup = elm_ctxpopup_add(mailbox_ugd->split_navi_bar); + } else { + mailbox_ugd->ctxpopup = elm_ctxpopup_add(mailbox_ugd->navi_bar); + } + evas_object_smart_callback_add(mailbox_ugd->ctxpopup, "dismissed", _dismissed_cb, mailbox_ugd); - icon = elm_icon_add(mailbox_ugd->ctxpopup); - elm_image_file_set(icon, IMGDIR "/M02_popup_icon_sort_by.png", NULL); - elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_SK_SORT_BY"), icon, _viewby_cb, mailbox_ugd); + if (mailbox_ugd->view_type != EMAIL_VIEW_EDIT) { + icon = elm_icon_add(mailbox_ugd->ctxpopup); + elm_image_file_set(icon, MAILBOX_MORE_OPTION_SORT_BY, NULL); + elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_SK_SORT_BY"), icon, _viewby_cb, mailbox_ugd); + } if (mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { int i = 0; - bool read_mail_exist = false; + bool use_popup = false; + bool use_flag_opt = true; //If flag or favourites option is needed Eina_List *list = edit_list; int checked_count = eina_list_count(list); if (checked_count <= 0) return; - for (i = 0; i < checked_count; i++) { + Eina_List *first_list = eina_list_nth_list(list, 0); + list_data *first_ld = eina_list_data_get(first_list); + int first_read_status = first_ld->is_seen; + int first_favourite_status = first_ld->imp_sel; + int first_account_type = GET_ACCOUNT_SERVER_TYPE(first_ld->account_id); + + for (i = 1; i < checked_count; i++) { Eina_List *nth_list = eina_list_nth_list(list, i); list_data *ld = eina_list_data_get(nth_list); - if (ld->is_seen) - read_mail_exist = true; + if (ld->is_seen != first_read_status) { + use_popup = true; + break; + } } - if (read_mail_exist) { - icon = elm_icon_add(mailbox_ugd->ctxpopup); - elm_image_file_set(icon, IMGDIR "/M02_popup_icon_mark_as_unread.png", NULL); - elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_OPT_MARK_AS_UNREAD"), icon, _markunread_mail_cb, mailbox_ugd); + icon = elm_icon_add(mailbox_ugd->ctxpopup); + elm_image_file_set(icon, MAILBOX_MORE_OPTION_MARK_UNREAD, NULL); + + if(use_popup) { + elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, N_("Mark all as"), icon, _create_mark_status_popup_cb, mailbox_ugd); } else { - icon = elm_icon_add(mailbox_ugd->ctxpopup); - elm_image_file_set(icon, IMGDIR "/M02_popup_icon_mark_as_unread.png", NULL); - elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_OPT_MARK_AS_READ"), icon, _markread_mail_cb, mailbox_ugd); + if (first_read_status) { + elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_OPT_MARK_AS_UNREAD"), icon, _markunread_mail_cb, mailbox_ugd); + } else { + elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_OPT_MARK_AS_READ"), icon, _markread_mail_cb, mailbox_ugd); + } } - if (mailbox_ugd->isRotate) { + if(mailbox_ugd->mode != EMAIL_MAILBOX_MODE_MAILBOX) { + for (i = 1; i < checked_count; i++) { + Eina_List *nth_list = eina_list_nth_list(list, i); + list_data *ld = eina_list_data_get(nth_list); + + if (first_account_type != GET_ACCOUNT_SERVER_TYPE(ld->account_id)) { + use_flag_opt = false; + break; + } + } + } + + if(use_flag_opt) { + use_popup = false; + for (i = 1; i < checked_count; i++) { + Eina_List *nth_list = eina_list_nth_list(list, i); + list_data *ld = eina_list_data_get(nth_list); + + if (ld->imp_sel != first_favourite_status) { + use_popup = true; + break; + } + } + icon = elm_icon_add(mailbox_ugd->ctxpopup); - elm_image_file_set(icon, IMGDIR "/M02_popup_icon_move.png", NULL); - elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, dgettext("sys_string", "IDS_COM_BODY_MOVE"), icon, _move_mail_cb, mailbox_ugd); + elm_image_file_set(icon, MAILBOX_MORE_OPTION_SET_FAVOURITE, NULL); + if(use_popup) { + elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, N_("Set all as"), icon, _create_favourite_status_popup_cb, mailbox_ugd); + } else { + if (first_favourite_status) { + elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, N_("Set as unfavourites"), icon, _set_as_unfavourite_mail_cb, mailbox_ugd); + } else { + elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, N_("Set as favourites"), icon, _set_as_favourite_mail_cb, mailbox_ugd); + } + } } } else { icon = elm_icon_add(mailbox_ugd->ctxpopup); - elm_image_file_set(icon, IMGDIR "/M02_popup_icon_delete_all.png", NULL); + elm_image_file_set(icon, MAILBOX_MORE_OPTION_DELETE_ALL, NULL); elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_OPT_DELETE_ALL"), icon, _delete_all_emails_cb, mailbox_ugd); icon = elm_icon_add(mailbox_ugd->ctxpopup); - elm_image_file_set(icon, IMGDIR "/M02_popup_icon_add_account.png", NULL); + elm_image_file_set(icon, MAILBOX_MORE_OPTION_ADD_ACCOUNT, NULL); elm_ctxpopup_item_append(mailbox_ugd->ctxpopup, _("IDS_EMAIL_HEADER_ADD_ACCOUNT"), icon, _add_account_cb, mailbox_ugd); } @@ -572,6 +658,11 @@ static void _viewby_cb(void *data, Evas_Object *obj, void *event_info) ELM_GENLIST_ITEM_NONE, _gl_viewby_popup_sel, NULL); break; case VIEWBY_IMPORTANT: + if(mailbox_ugd->account_id != 0) + elm_genlist_item_append(genlist, &itc_popup, &viewby_req[index], NULL, + ELM_GENLIST_ITEM_NONE, _gl_viewby_popup_sel, NULL); + break; + case VIEWBY_PRIORITY: elm_genlist_item_append(genlist, &itc_popup, &viewby_req[index], NULL, ELM_GENLIST_ITEM_NONE, _gl_viewby_popup_sel, NULL); break; @@ -617,28 +708,158 @@ static void _add_account_cb(void *data, Evas_Object *obj, void *event_info) service_destroy(service); } -void _create_controlbar(EmailMailboxUGD *mailbox_ugd) +void _create_controlbar_for_split_view(EmailMailboxUGD *mailbox_ugd) { debug_log(""); - _delete_selection_info(mailbox_ugd); + if(mailbox_ugd) { + _delete_selection_info(mailbox_ugd); + + _delete_controlbar_for_split_view(mailbox_ugd); + + if(mailbox_ugd->view_type == EMAIL_VIEW_SEARCH + || mailbox_ugd->b_advanced_search_view || mailbox_ugd->b_move_list_view) { + _hide_split_toolbar(mailbox_ugd); + } else if(mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { + create_edit_control_option_for_split_view(mailbox_ugd); + } else { + create_control_option_for_split_view(mailbox_ugd); + } + } +} + +static Evas_Object *create_control_option_for_split_view(EmailMailboxUGD *mailbox_ugd) +{ + debug_log(""); + Evas_Object *more_btn, *btn1, *btn2; + + if(!mailbox_ugd->split_back_btn) { + Evas_Object *btn = elm_button_add(mailbox_ugd->split_navi_bar); + elm_object_style_set(btn, "naviframe/back_btn/default"); + evas_object_smart_callback_add(btn, "clicked", _split_back_clicked, mailbox_ugd); + mailbox_ugd->split_back_btn = btn; + elm_object_item_part_content_set(mailbox_ugd->split_navi_it, "prev_btn", mailbox_ugd->split_back_btn); + } + + more_btn = _create_toolbar_more_btn(mailbox_ugd->split_navi_bar, _more_toolbar_clicked_cb, mailbox_ugd); + elm_object_item_part_content_set(mailbox_ugd->split_navi_it, "toolbar_more_btn", more_btn); + mailbox_ugd->split_more_btn = more_btn; + + btn1 = _create_toolbar_btn(mailbox_ugd->split_navi_bar, _("IDS_EMAIL_SK_COMPOSE"), _compose_toolbar_clicked_cb, mailbox_ugd); + elm_object_item_part_content_set(mailbox_ugd->split_navi_it, "toolbar_button1", btn1); + mailbox_ugd->split_lbtn = btn1; + + btn2 = _create_toolbar_btn(mailbox_ugd->split_navi_bar, dgettext("sys_string", "IDS_COM_SK_SEARCH"), _search_button_clicked_cb, mailbox_ugd); + elm_object_item_part_content_set(mailbox_ugd->split_navi_it, "toolbar_button2", btn2); + mailbox_ugd->split_rbtn = btn2; + + return NULL; +} - _delete_controlbar(mailbox_ugd); +static Evas_Object *create_edit_control_option_for_split_view(EmailMailboxUGD *mailbox_ugd) +{ + debug_log(""); - switch (mailbox_ugd->view_type) { - case EMAIL_VIEW_DATE: - case EMAIL_VIEW_UNREAD: - case EMAIL_VIEW_IMPORTANT: - case EMAIL_VIEW_RECIPIENT: - case EMAIL_VIEW_ATTACHMENTS: - case EMAIL_VIEW_PRIORITY: - create_control_option(mailbox_ugd); - break; - case EMAIL_VIEW_EDIT: - create_edit_control_option(mailbox_ugd); - break; - default: - break; + Evas_Object *delete_btn, *move_btn, *more_btn; + + if(!mailbox_ugd->split_back_btn) { + Evas_Object *btn = elm_button_add(mailbox_ugd->split_navi_bar); + elm_object_style_set(btn, "naviframe/back_btn/default"); + evas_object_smart_callback_add(btn, "clicked", _split_back_clicked, mailbox_ugd); + mailbox_ugd->split_back_btn = btn; + elm_object_item_part_content_set(mailbox_ugd->split_navi_it, "prev_btn", mailbox_ugd->split_back_btn); + } + + more_btn = _create_toolbar_more_btn(mailbox_ugd->split_navi_bar, _more_toolbar_clicked_cb, mailbox_ugd); + elm_object_item_part_content_set(mailbox_ugd->split_navi_it, "toolbar_more_btn", more_btn); + mailbox_ugd->split_more_btn = more_btn; + + delete_btn = _create_toolbar_btn(mailbox_ugd->navi_bar, dgettext("sys_string", "IDS_COM_SK_DELETE"), _delete_mail_cb, mailbox_ugd); + elm_object_item_part_content_set(mailbox_ugd->split_navi_it, "toolbar_button1", delete_btn); + mailbox_ugd->split_lbtn = delete_btn; + + move_btn = _create_toolbar_btn(mailbox_ugd->navi_bar, dgettext("sys_string", "IDS_COM_BODY_MOVE"), _move_mail_cb, mailbox_ugd); + elm_object_item_part_content_set(mailbox_ugd->split_navi_it, "toolbar_button2", move_btn); + mailbox_ugd->split_rbtn = move_btn; + + return NULL; + +} +void _delete_controlbar_for_split_view(EmailMailboxUGD *mailbox_ugd) +{ + debug_log(""); + + if (mailbox_ugd->split_more_btn) { + evas_object_del(mailbox_ugd->split_more_btn); + mailbox_ugd->split_more_btn = NULL; + } + + if (mailbox_ugd->split_lbtn) { + evas_object_del(mailbox_ugd->split_lbtn); + mailbox_ugd->split_lbtn = NULL; + } + if (mailbox_ugd->split_rbtn) { + evas_object_del(mailbox_ugd->split_rbtn); + mailbox_ugd->split_rbtn = NULL; + } +} + +void _hide_split_toolbar(EmailMailboxUGD *mailbox_ugd) +{ + debug_log(""); + + if(mailbox_ugd) { + if(mailbox_ugd->split_back_btn) { + evas_object_del(mailbox_ugd->split_back_btn); + mailbox_ugd->split_back_btn = NULL; + } + _delete_controlbar_for_split_view(mailbox_ugd); + + elm_object_item_signal_emit(mailbox_ugd->split_navi_it, "elm,state,toolbar,close", ""); + } +} + +void _show_split_toolbar(EmailMailboxUGD *mailbox_ugd) +{ + debug_log(""); + + if(mailbox_ugd) { + if(!mailbox_ugd->split_back_btn) { + Evas_Object *btn = elm_button_add(mailbox_ugd->split_navi_bar); + elm_object_style_set(btn, "naviframe/back_btn/default"); + evas_object_smart_callback_add(btn, "clicked", _split_back_clicked, mailbox_ugd); + mailbox_ugd->split_back_btn = btn; + elm_object_item_part_content_set(mailbox_ugd->split_navi_it, "prev_btn", mailbox_ugd->split_back_btn); + } + _create_controlbar_for_split_view(mailbox_ugd); + + elm_object_item_signal_emit(mailbox_ugd->split_navi_it, "elm,state,toolbar,open", ""); + } +} + +void _create_controlbar(EmailMailboxUGD *mailbox_ugd) +{ + debug_log(""); + if(mailbox_ugd) { + + _delete_selection_info(mailbox_ugd); + _delete_controlbar(mailbox_ugd); + + switch (mailbox_ugd->view_type) { + case EMAIL_VIEW_DATE: + case EMAIL_VIEW_UNREAD: + case EMAIL_VIEW_IMPORTANT: + case EMAIL_VIEW_RECIPIENT: + case EMAIL_VIEW_ATTACHMENTS: + case EMAIL_VIEW_PRIORITY: + create_control_option(mailbox_ugd); + break; + case EMAIL_VIEW_EDIT: + create_edit_control_option(mailbox_ugd); + break; + default: + break; + } } } @@ -647,18 +868,15 @@ void _delete_controlbar(EmailMailboxUGD *mailbox_ugd) debug_log(""); if (mailbox_ugd->controlbar_more_btn) { - elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "toolbar_more_btn"); evas_object_del(mailbox_ugd->controlbar_more_btn); mailbox_ugd->controlbar_more_btn = NULL; mailbox_ugd->delete_all_button = NULL; } if (mailbox_ugd->controlbar_lbtn) { - elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "toolbar_button1"); evas_object_del(mailbox_ugd->controlbar_lbtn); mailbox_ugd->controlbar_lbtn = NULL; } if (mailbox_ugd->controlbar_rbtn) { - elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "toolbar_button2"); evas_object_del(mailbox_ugd->controlbar_rbtn); mailbox_ugd->controlbar_rbtn = NULL; } @@ -842,6 +1060,16 @@ static void _search_button_clicked_cb(void *data, Evas_Object *obj, void *event_ } EmailMailboxUGD* mailbox_ugd = (EmailMailboxUGD *)data; + //apply default search mode + Evas_Object *searchby_icon = elm_icon_add(mailbox_ugd->searchby_button); + Evas_Object *prev_searchby_btn = elm_object_content_get(mailbox_ugd->searchby_button); + evas_object_del(prev_searchby_btn); + mailbox_ugd->search_type = EMAIL_SEARCH_ALL; + elm_image_file_set(searchby_icon, IMGDIR"/M02_popup_icon_all.png", NULL); + elm_image_resizable_set(searchby_icon, EINA_TRUE, EINA_TRUE); + evas_object_image_smooth_scale_set(searchby_icon, 0); + elm_object_content_set(mailbox_ugd->searchby_button, searchby_icon); + if (evas_object_visible_get(mailbox_ugd->navi_title_ly)) { debug_log("title is visible, hide title"); elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "title"); @@ -860,44 +1088,298 @@ void _hide_toolbar(EmailMailboxUGD *mailbox_ugd) { debug_log(""); - if(mailbox_ugd->main_back_btn) { - evas_object_del(mailbox_ugd->main_back_btn); - mailbox_ugd->main_back_btn = NULL; + if(mailbox_ugd) { + if(mailbox_ugd->main_back_btn) { + evas_object_del(mailbox_ugd->main_back_btn); + mailbox_ugd->main_back_btn = NULL; + } + + if(mailbox_ugd->controlbar_lbtn) { + evas_object_del(mailbox_ugd->controlbar_lbtn); + mailbox_ugd->controlbar_lbtn = NULL; + } + if(mailbox_ugd->controlbar_rbtn) { + evas_object_del(mailbox_ugd->controlbar_rbtn); + mailbox_ugd->controlbar_rbtn = NULL; + } + if(mailbox_ugd->controlbar_more_btn) { + evas_object_del(mailbox_ugd->controlbar_more_btn); + mailbox_ugd->controlbar_more_btn = NULL; + } + + if(mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { + elm_object_item_signal_emit(mailbox_ugd->navibar_item[mailbox_ugd->previous_view], "elm,state,toolbar,close", ""); + } else { + elm_object_item_signal_emit(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "elm,state,toolbar,close", ""); + } } - elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "prev_btn"); +} - if(mailbox_ugd->controlbar_lbtn) { - evas_object_del(mailbox_ugd->controlbar_lbtn); - mailbox_ugd->controlbar_lbtn = NULL; - elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "toolbar_button1"); +void _show_toolbar(EmailMailboxUGD *mailbox_ugd) +{ + debug_log(""); + + if(mailbox_ugd) { + if(!mailbox_ugd->main_back_btn) { + Evas_Object *btn = elm_button_add(mailbox_ugd->navi_bar); + elm_object_style_set(btn, "naviframe/back_btn/default"); + evas_object_smart_callback_add(btn, "clicked", _main_back_clicked, mailbox_ugd); + mailbox_ugd->main_back_btn = btn; + } + + if(mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { + elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->previous_view], "prev_btn", mailbox_ugd->main_back_btn); + } else { + elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "prev_btn", mailbox_ugd->main_back_btn); + } + + _create_controlbar(mailbox_ugd); + + if(mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { + elm_object_item_signal_emit(mailbox_ugd->navibar_item[mailbox_ugd->previous_view], "elm,state,toolbar,open", ""); + } else { + elm_object_item_signal_emit(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "elm,state,toolbar,open", ""); + } } - if(mailbox_ugd->controlbar_rbtn) { - evas_object_del(mailbox_ugd->controlbar_rbtn); - mailbox_ugd->controlbar_rbtn = NULL; - elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "toolbar_more_btn"); + +} + +static void _create_mark_status_popup_cb(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + if (data == NULL) { + debug_log("data == NULL"); + return; } - if(mailbox_ugd->controlbar_more_btn) { - evas_object_del(mailbox_ugd->controlbar_more_btn); - mailbox_ugd->controlbar_more_btn = NULL; - elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "toolbar_button2"); + + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + + if (mailbox_ugd->ctxpopup) { + evas_object_del(mailbox_ugd->ctxpopup); + mailbox_ugd->ctxpopup = NULL; } - elm_object_item_signal_emit(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "elm,state,toolbar,close", ""); + + _create_mailbox_list_popup_cb(data, MARK_READ_UNREAD_POPUP); + } -void _show_toolbar(EmailMailboxUGD *mailbox_ugd) +static void _create_favourite_status_popup_cb(void *data, Evas_Object *obj, void *event_info) { debug_log(""); + if (data == NULL) { + debug_log("data == NULL"); + return; + } + + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + + if (mailbox_ugd->ctxpopup) { + evas_object_del(mailbox_ugd->ctxpopup); + mailbox_ugd->ctxpopup = NULL; + } + _create_mailbox_list_popup_cb(data, SET_FAVOURITE_UNFAVOURITE_POPUP); +} + +static void _set_as_favourite_mail_cb(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + if (data == NULL) { + debug_log("data == NULL"); + return; + } + + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + + if (mailbox_ugd->ctxpopup) { + evas_object_del(mailbox_ugd->ctxpopup); + mailbox_ugd->ctxpopup = NULL; + } + + int i = 0; + Eina_List *list = edit_list; + int checked_count = eina_list_count(list); + + if (checked_count <= 0) return; + + for (i = 0; i < checked_count; i++) { + Eina_List *nth_list = eina_list_nth_list(list, i); + + list_data *ld = eina_list_data_get(nth_list); + + //make it favourites state in all cases + int err = email_set_flags_field(ld->account_id, &(ld->mail_id), 1, EMAIL_FLAGS_FLAGGED_FIELD, 1, 1); + if (err != EMAIL_ERROR_NONE) + debug_log("email_set_flags_field - err(%d)", err); + } + + mailbox_ugd->view_type = mailbox_ugd->previous_view; + + edit_list = eina_list_free(edit_list); + + elm_genlist_decorate_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_FALSE); + elm_genlist_reorder_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_FALSE); + elm_genlist_select_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], ELM_OBJECT_SELECT_MODE_DEFAULT); + b_editmode = false; + elm_object_disabled_set(mailbox_ugd->folder_button, EINA_FALSE); + _update_navigationbar_title(mailbox_ugd); + + if (mailbox_ugd->isRotate == true) { + email_rotate_landscape(mailbox_ugd); + } + _refresh_mailbox(mailbox_ugd); +} + +static void _set_as_unfavourite_mail_cb(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + if (data == NULL) { + debug_log("data == NULL"); + return; + } + + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + + if (mailbox_ugd->ctxpopup) { + evas_object_del(mailbox_ugd->ctxpopup); + mailbox_ugd->ctxpopup = NULL; + } + + int i = 0; + Eina_List *list = edit_list; + int checked_count = eina_list_count(list); + + if (checked_count <= 0) return; + + for (i = 0; i < checked_count; i++) { + Eina_List *nth_list = eina_list_nth_list(list, i); + + list_data *ld = eina_list_data_get(nth_list); - if(!mailbox_ugd->main_back_btn) { - Evas_Object *btn = elm_button_add(mailbox_ugd->navi_bar); - elm_object_style_set(btn, "naviframe/end_btn/default"); - evas_object_smart_callback_add(btn, "clicked", _main_back_clicked, mailbox_ugd); - mailbox_ugd->main_back_btn = btn; + //make it unfavourites state in all cases + int err = email_set_flags_field(ld->account_id, &(ld->mail_id), 1, EMAIL_FLAGS_FLAGGED_FIELD, 0, 1); + if (err != EMAIL_ERROR_NONE) + debug_log("email_set_flags_field - err(%d)", err); } - elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "prev_btn", mailbox_ugd->main_back_btn); - _create_controlbar(mailbox_ugd); + mailbox_ugd->view_type = mailbox_ugd->previous_view; + + edit_list = eina_list_free(edit_list); - elm_object_item_signal_emit(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "elm,state,toolbar,open", ""); + elm_genlist_decorate_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_FALSE); + elm_genlist_reorder_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_FALSE); + elm_genlist_select_mode_set(mailbox_ugd->gl[mailbox_ugd->view_type], ELM_OBJECT_SELECT_MODE_DEFAULT); + b_editmode = false; + elm_object_disabled_set(mailbox_ugd->folder_button, EINA_FALSE); + _update_navigationbar_title(mailbox_ugd); + + if (mailbox_ugd->isRotate == true) { + email_rotate_landscape(mailbox_ugd); + } + + _refresh_mailbox(mailbox_ugd); } + + +static void _create_mailbox_list_popup_cb(void *data, MailboxPopupType popup_type) +{ + debug_log(""); + Evas_Object *popup; + int index = 0; + int max_item_cnt = 0; + Elm_Object_Item *item; + Evas_Object *btn1; + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + + popup = elm_popup_add(mailbox_ugd->win_main); + elm_object_style_set(popup,"menustyle"); + + if(popup_type == MARK_READ_UNREAD_POPUP) { + elm_object_part_text_set(popup, "title,text", N_("Mark all as")); + max_item_cnt = 2; + } + else if (popup_type == SET_FAVOURITE_UNFAVOURITE_POPUP) { + elm_object_part_text_set(popup, "title,text", N_("Set all as")); + max_item_cnt = 2; + } + + evas_object_smart_callback_add(popup, "block,clicked", _block_clicked_cb, NULL); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + btn1 = elm_button_add(popup); + elm_object_style_set(btn1, "popup_button/default"); + elm_object_text_set(btn1, dgettext("sys_string", "IDS_COM_SK_CANCEL")); + elm_object_part_content_set(popup, "button1", btn1); + mailbox_ugd->flag_popup = popup; + evas_object_smart_callback_add(btn1, "clicked", _mailbox_list_popup_canceled_cb, mailbox_ugd); + + char buf[4096]; + for (index = (int)popup_type; index < ((int)popup_type + max_item_cnt); index++) { + switch(index) { + case MARK_AS_READ: + snprintf(buf, sizeof(buf), "Read"); + break; + case MARK_AS_UNREAD: + snprintf(buf, sizeof(buf), "Unread"); + break; + case SET_AS_FAVOURITE: + snprintf(buf, sizeof(buf), "Favourites"); + break; + case SET_AS_UNFAVOURITE: + snprintf(buf, sizeof(buf), "Unfavourites"); + break; + } + item = elm_popup_item_append(popup, buf, NULL, _mailbox_list_popup_item_selected_cb, data); + debug_log("buf : %s index : %d", buf, index); + } + + evas_object_show(popup); +} + +static void _mailbox_list_popup_item_selected_cb(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + const char *label = elm_object_item_text_get((Elm_Object_Item *) event_info); + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + + if(!mailbox_ugd) { + debug_critical("mailbox_ugd is null"); + return; + } + + if(!label) { + if(mailbox_ugd->flag_popup) { + evas_object_del(mailbox_ugd->flag_popup); + mailbox_ugd->flag_popup = NULL; + } + debug_log("popup item string is null"); + return; + } + + debug_log("text(%s) is clicked\n", label); + + if(!g_strcmp0(label, N_("Read"))) + _markread_mail_cb(data, NULL, NULL); + else if (!g_strcmp0(label, N_("Unread"))) + _markunread_mail_cb(data, NULL, NULL); + else if (!g_strcmp0(label, N_("Favourites"))) + _set_as_favourite_mail_cb(data, NULL, NULL); + else if (!g_strcmp0(label, N_("Unfavourites"))) + _set_as_unfavourite_mail_cb(data, NULL, NULL); + + if(mailbox_ugd->flag_popup) { + evas_object_del(mailbox_ugd->flag_popup); + mailbox_ugd->flag_popup = NULL; + } + +} + +static void _mailbox_list_popup_canceled_cb(void *data, Evas_Object *obj, void *event_info) +{ + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + if(mailbox_ugd->flag_popup) { + evas_object_del(mailbox_ugd->flag_popup); + mailbox_ugd->flag_popup = NULL; + } +} + + diff --git a/mailbox/src/email-mailbox-list.c b/mailbox/src/email-mailbox-list.c index 3d2b0b6..d6cefe4 100755 --- a/mailbox/src/email-mailbox-list.c +++ b/mailbox/src/email-mailbox-list.c @@ -816,6 +816,13 @@ static Evas_Object *_gl_outbox_mail_item_content_get(void *data, Evas_Object *ob return (void *)icon; } } else if(!g_strcmp0(source, "elm.icon.4")) { + if(ld->is_attachment == true) { + icon = elm_icon_add(obj); + elm_image_file_set(icon, IMGDIR "/M02_icon_attach.png", NULL); + evas_object_size_hint_min_set(icon, 38, 38); + return icon; + } + } else if(!g_strcmp0(source, "elm.icon.5")) { Evas_Object *outbox_progress_part = NULL; if (ld->mailbox_ugd->mode == EMAIL_MAILBOX_MODE_MAILBOX && ld->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) { @@ -868,7 +875,7 @@ static char *_gl_mail_item_text_get(void *data, Evas_Object *obj, const char *pa //strcat(title, ""); return g_strdup(title); - } else if (!g_strcmp0(part, "elm.text.2")) { + } else if (!g_strcmp0(part, "elm.text.3")) { /* if (ld->from == NULL) { debug_log("from is NULL"); @@ -897,7 +904,7 @@ static char *_gl_mail_item_text_get(void *data, Evas_Object *obj, const char *pa return g_strdup(ld->alias); } - } else if (!g_strcmp0(part, "elm.text.3")) { + } else if (!g_strcmp0(part, "elm.text.2")) { if (ld->preview_body == NULL) { debug_log("preview text is NULL"); return NULL; @@ -948,7 +955,7 @@ static char *_gl_outbox_mail_item_text_get(void *data, Evas_Object *obj, const c strncat(title, ld->title, SUBJECT_LEN + TAG_LEN); /* search tag may be contained */ //strcat(title, ""); return g_strdup(title); - } else if (!g_strcmp0(part, "elm.text.2")) { + } else if (!g_strcmp0(part, "elm.text.3")) { /* if (ld->from == NULL) { debug_log("from is NULL"); @@ -976,7 +983,7 @@ static char *_gl_outbox_mail_item_text_get(void *data, Evas_Object *obj, const c else return g_strdup(ld->alias); } - } else if (!g_strcmp0(part, "elm.text.3")) { + } else if (!g_strcmp0(part, "elm.text.2")) { if (ld->preview_body == NULL) { debug_log("preview text is NULL"); return NULL; @@ -1143,7 +1150,7 @@ void mailbox_create_list_view(EmailMailboxUGD *mailbox_ugd) elm_scroller_policy_set(gl, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); elm_genlist_block_count_set(gl, BLOCK_COUNT); elm_genlist_homogeneous_set(gl, EINA_TRUE); - //elm_genlist_mode_set(gl, ELM_LIST_COMPRESS); //genlist is updated when rotate event is detected(Resize) + elm_genlist_mode_set(gl, ELM_LIST_COMPRESS); //compress mode should be used because of text block(should be check rotate sweep menu issue) elm_genlist_select_mode_set(gl, ELM_OBJECT_SELECT_MODE_ALWAYS); evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -1180,37 +1187,57 @@ void email_maillist_select_info(EmailMailboxUGD *mailbox_ugd) double dou_panes = elm_panes_content_left_size_get(mailbox_ugd->panes); debug_log("panes: %lf ", dou_panes); - if(!mailbox_ugd->selectioninfo_layout) - { - mailbox_ugd->selectioninfo_layout = elm_layout_add(mailbox_ugd->sub_layout[mailbox_ugd->previous_view]); - elm_object_part_content_set(mailbox_ugd->sub_layout[mailbox_ugd->previous_view], "selection_info", mailbox_ugd->selectioninfo_layout); - evas_object_size_hint_weight_set(mailbox_ugd->selectioninfo_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(mailbox_ugd->selectioninfo_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - } + if(!mailbox_ugd->isRotate) { + if(!mailbox_ugd->selectioninfo_layout) + { + mailbox_ugd->selectioninfo_layout = elm_layout_add(mailbox_ugd->sub_layout[mailbox_ugd->previous_view]); + elm_object_part_content_set(mailbox_ugd->sub_layout[mailbox_ugd->previous_view], "selection_info", mailbox_ugd->selectioninfo_layout); + evas_object_size_hint_weight_set(mailbox_ugd->selectioninfo_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(mailbox_ugd->selectioninfo_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + } - Eina_List *list = NULL; - int cnt = 0; - list = edit_list; - cnt = eina_list_count(list); + Eina_List *list = NULL; + int cnt = 0; + list = edit_list; + cnt = eina_list_count(list); - char text[128]; + char text[128]; - /* Set the layout theme */ - elm_layout_theme_set(mailbox_ugd->selectioninfo_layout, "standard", "selectioninfo", "center_text"); + /* Set the layout theme */ + elm_layout_theme_set(mailbox_ugd->selectioninfo_layout, "standard", "selectioninfo", "center_text"); - if (!cnt) { - elm_object_signal_emit(mailbox_ugd->sub_layout[mailbox_ugd->previous_view], "hide_selection_info", "elm"); - return; - } + if (!cnt) { + elm_object_signal_emit(mailbox_ugd->sub_layout[mailbox_ugd->previous_view], "hide_selection_info", "elm"); + return; + } - if (cnt == 1) - snprintf(text, sizeof(text), "%s (%d)", dgettext("sys_string", "IDS_COM_POP_SELECTED"), cnt); - else - snprintf(text, sizeof(text), "%s (%d)", dgettext("sys_string", "IDS_COM_POP_SELECTED"), cnt); + if (cnt == 1) + snprintf(text, sizeof(text), "%s (%d)", dgettext("sys_string", "IDS_COM_POP_SELECTED"), cnt); + else + snprintf(text, sizeof(text), "%s (%d)", dgettext("sys_string", "IDS_COM_POP_SELECTED"), cnt); - /* Set the text */ - elm_object_part_text_set(mailbox_ugd->selectioninfo_layout, "elm.text", text); - elm_object_signal_emit(mailbox_ugd->sub_layout[mailbox_ugd->previous_view], "show_selection_info", "elm"); + /* Set the text */ + elm_object_part_text_set(mailbox_ugd->selectioninfo_layout, "elm.text", text); + elm_object_signal_emit(mailbox_ugd->sub_layout[mailbox_ugd->previous_view], "show_selection_info", "elm"); + } else { + if(mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { + char tmp[MAX_STR_LEN] = { 0, }; + Eina_List *list = NULL; + int cnt = 0; + list = edit_list; + cnt = eina_list_count(list); + + if(mailbox_ugd->selectioninfo_layout) { + elm_object_signal_emit(mailbox_ugd->sub_layout[mailbox_ugd->previous_view], "hide_selection_info", "elm"); + } + + snprintf(tmp, sizeof(tmp), "%s (%d)", N_("Selected"), cnt); + elm_object_part_text_set(mailbox_ugd->split_nocontent, "elm.text", tmp); + } + else { + elm_object_part_text_set(mailbox_ugd->split_nocontent, "elm.text", N_("No email selected")); + } + } } @@ -1289,8 +1316,12 @@ static void _process_item_check_changed_cb(list_data *ld) mailbox_ugd->previous_view = mailbox_ugd->view_type; mailbox_ugd->view_type = EMAIL_VIEW_EDIT; - _create_controlbar(mailbox_ugd); - //elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->previous_view], "controlbar", mailbox_ugd->controlbar_btns); + if(mailbox_ugd->isRotate) { + _create_controlbar_for_split_view(mailbox_ugd); + } else { + _create_controlbar(mailbox_ugd); + } + elm_object_disabled_set(mailbox_ugd->folder_button, EINA_TRUE); } else if(cnt <= 0) @@ -1872,7 +1903,11 @@ void _make_mail_list(EmailMailboxUGD *mailbox_ugd, const EmailSearchData *search debug_log("COUNT: %d", mail_count); if( mail_count > FIRST_BLOCK_SIZE ) {/* add remainder list by using thread */ mail_remaining_list_t *req = MEM_ALLOC(req, 1); - if(!req) return; + if(!req) { + debug_critical("failure in memory allocation."); + FREE(mail_list); + return; + } *req = (mail_remaining_list_t) {mail_list, FIRST_BLOCK_SIZE, mail_count, mailbox_ugd->view_type, mailbox_ugd->mode, mailbox_ugd}; debug_log("Spawning thread"); @@ -2280,7 +2315,7 @@ void _mailbox_make_sorting_rule_list(EmailSortType sort_type, email_list_sorting break; case EMAIL_SORT_PRIORITY: sorting_rule_list[0].target_attribute = EMAIL_MAIL_ATTRIBUTE_PRIORITY; - sorting_rule_list[0].sort_order = EMAIL_SORT_ORDER_DESCEND; + sorting_rule_list[0].sort_order = EMAIL_SORT_ORDER_ASCEND; sorting_rule_list[0].force_boolean_check = false; break; case EMAIL_SORT_ATTACHMENTS: diff --git a/mailbox/src/email-mailbox-move.c b/mailbox/src/email-mailbox-move.c index d407b93..bef8654 100644 --- a/mailbox/src/email-mailbox-move.c +++ b/mailbox/src/email-mailbox-move.c @@ -18,6 +18,7 @@ #include "email-mailbox.h" #include "email-mailbox-list.h" #include "email-mailbox-item.h" +#include "email-mailbox-controlbar.h" #include "email-mailbox-move.h" extern gboolean _g_move_lock; @@ -81,6 +82,11 @@ int create_mailbox_move_list_view(void *data, int account_id) int err = EMAIL_ERROR_NONE; Elm_Object_Item *account_item = NULL; int src_type = GET_ACCOUNT_SERVER_TYPE(account_id); + mailbox_ugd->b_move_list_view = true; + + if(mailbox_ugd->isRotate) { + _hide_split_toolbar(mailbox_ugd); + } if(mailbox_ugd->move_account_list && mailbox_ugd->move_account_cnt > 0) { err = email_engine_free_account_list(&(mailbox_ugd->move_account_list), mailbox_ugd->move_account_cnt); @@ -216,6 +222,11 @@ static void _mailbox_list_move_cancel_cb(void *data, Evas_Object *obj, void *eve _stop_emf_job(mailbox_ugd, mailbox_ugd->emf_handle, true); elm_naviframe_item_pop(mailbox_ugd->navi_bar); + mailbox_ugd->b_move_list_view = false; + + if(mailbox_ugd->isRotate) { + _show_split_toolbar(mailbox_ugd); + } if(mailbox_ugd->selected_list) { g_list_free(mailbox_ugd->selected_list); @@ -477,6 +488,7 @@ FINISH: mailbox_ugd->selected_list = NULL; elm_naviframe_item_pop(mailbox_ugd->navi_bar); + mailbox_ugd->b_move_list_view = false; if(mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { @@ -752,6 +764,7 @@ static void _gl_exp_sel(void *data, Evas_Object *obj, void *event_info) mailbox_ugd->selected_list = NULL; elm_naviframe_item_pop(mailbox_ugd->navi_bar); + mailbox_ugd->b_move_list_view = false; if(mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { diff --git a/mailbox/src/email-mailbox-noti-mgr.c b/mailbox/src/email-mailbox-noti-mgr.c index aac0567..ea27f8a 100755 --- a/mailbox/src/email-mailbox-noti-mgr.c +++ b/mailbox/src/email-mailbox-noti-mgr.c @@ -464,6 +464,12 @@ static void _edbus_event_mailbox_receive(void *local_data, DBusMessage *message) case NOTI_ACCOUNT_DELETE: debug_log("account added or deleted during pause status"); + /* for update colorbar */ + if (subtype == NOTI_ACCOUNT_ADD) + mailbox_ugd->account_count++; + else if (subtype == NOTI_ACCOUNT_DELETE) + mailbox_ugd->account_count--; + /* destroy all top ug and refresh all emails */ if (mailbox_ugd->ug_account) { destroy_account_cb(mailbox_ugd->ug_account, mailbox_ugd); @@ -479,6 +485,17 @@ static void _edbus_event_mailbox_receive(void *local_data, DBusMessage *message) debug_log("no account exists"); ug_destroy_me(mailbox_ugd->ug); } else { + if (subtype == NOTI_ACCOUNT_ADD) { + EmailAccountInfo *account_info = NULL; + if (email_engine_get_account_info(data1, &account_info)) { + if (account_info && account_info->receiving_type == EMAIL_SERVER_TYPE_ACTIVE_SYNC) { + debug_log("EAS account added, cancel sync header"); + break; + } + if (account_info) + email_engine_free_account_info(&account_info); + } + } if (list_lock) { debug_log("locked"); if (!evas_object_visible_get(mailbox_ugd->gl[view_type])) @@ -961,13 +978,10 @@ static void _mailbox_remove_deleted_flag_mail(int mail_id, void *data) debug_log("Invalid parameter(mail_id)"); return; } - debug_log("mail_id : %d view_type : %d, mailbox_ugd->mode : %d", mail_id, view_type, mailbox_ugd->mode); list_data *ld = _find_mailinfo_by_mailid(mail_id, mailbox_ugd->list_data[view_type]); if(ld) { - debug_log("list data exist"); if(view_type != EMAIL_VIEW_EDIT && view_type != EMAIL_VIEW_SEARCH) { - debug_log("ld->mailbox_type %d ld->mailbox_id :%d, mailbox_ugd->mailbox_id : %d", ld->mailbox_type, ld->mailbox_id, mailbox_ugd->mailbox_id); if ((mailbox_ugd->mode == EMAIL_MAILBOX_MODE_ALL && mailbox_ugd->mailbox_type == ld->mailbox_type) || (mailbox_ugd->mode == EMAIL_MAILBOX_MODE_MAILBOX && ld->mailbox_id == mailbox_ugd->mailbox_id)) { debug_log("Remove mail from list mail_id : %d", ld->mail_id); diff --git a/mailbox/src/email-mailbox-search.c b/mailbox/src/email-mailbox-search.c index 1d151ab..439ec39 100755 --- a/mailbox/src/email-mailbox-search.c +++ b/mailbox/src/email-mailbox-search.c @@ -72,6 +72,8 @@ static void _searchbar_entry_unfocus_cb(void *data, Evas_Object *obj, void *even static void _searchbar_entry_changed_cb(void *data, Evas_Object *obj, void *event_info); static Eina_Bool _mailbox_create_search_criteria_view(int search_type, void *data); +static Eina_Bool _mailbox_create_date_search_view(int search_type, void *data); +static Eina_Bool _mailbox_create_advanced_search_view(int search_type, void *data); static void _mailbox_advanced_search_start_cb(void *data, Evas_Object *obj, void *event_info); static void _mailbox_advanced_search_cancel_cb(void *data, Evas_Object *obj, void *event_info); static void _mailbox_advanced_search_key_down_cb(void *data, Evas * e, Evas_Object * obj, void *event_info); @@ -87,6 +89,7 @@ static void _mailbox_search_from_date_changed_cb(void *data, Evas_Object *obj, v static void _mailbix_search_to_date_changed_cb(void *data, Evas_Object *obj, void *event_info); static void _mailbox_advanced_view_create_controlbar_button(Evas_Object *btn, char *label, char *style, void (*func) (void *data, Evas_Object *obj, void *event_info), void* data); void _mailbox_free_search_list_data(MailboxAdvSearchViewInfo *search_info); +static void _input_panel_state_changed_cb(void *data, Ecore_IMF_Context *ctx, int value); void mailbox_create_searchbar(EmailMailboxUGD *mailbox_ugd) { @@ -343,7 +346,7 @@ static void _searchbar_entry_focus_cb(void *data, Evas_Object *obj, void *event_ if (!mailbox_ugd->b_advanced_search_view && (mailbox_ugd->search_type == EMAIL_SEARCH_ADVANCED || mailbox_ugd->search_type == EMAIL_SEARCH_DATE)) { elm_entry_entry_set(mailbox_ugd->searchbar_en, ""); - _mailbox_create_search_criteria_view(mailbox_ugd->search_type, data); + _mailbox_create_search_criteria_view(mailbox_ugd->search_type, mailbox_ugd); return; } @@ -357,8 +360,11 @@ static void _searchbar_entry_focus_cb(void *data, Evas_Object *obj, void *event_ } elm_genlist_realized_items_update(mailbox_ugd->gl[mailbox_ugd->view_type]); - //_delete_controlbar(mailbox_ugd); - _hide_toolbar(mailbox_ugd); + + if(mailbox_ugd->isRotate) + _hide_split_toolbar(mailbox_ugd); + else + _hide_toolbar(mailbox_ugd); debug_log("view_type = %d", mailbox_ugd->view_type); @@ -368,8 +374,6 @@ static void _searchbar_entry_focus_cb(void *data, Evas_Object *obj, void *event_ _stop_emf_job(mailbox_ugd, mailbox_ugd->emf_handle, true); mailbox_ugd->gl[mailbox_ugd->view_type] = mailbox_ugd->gl[mailbox_ugd->previous_view]; - elm_object_disabled_set(mailbox_ugd->folder_button, EINA_TRUE); - g_focus_lock = true; evas_object_smart_callback_add(obj, "changed", _searchbar_entry_changed_cb, mailbox_ugd); evas_object_smart_callback_add(obj, "preedit,changed", _searchbar_entry_changed_cb, mailbox_ugd); @@ -415,7 +419,9 @@ static void _searchbar_cancel_clicked_cb(void *data, Evas_Object *obj, void *eve evas_object_smart_callback_del(mailbox_ugd->searchbar_en, "changed", _searchbar_entry_changed_cb); evas_object_smart_callback_del(mailbox_ugd->searchbar_en, "preedit,changed", _searchbar_entry_changed_cb); - elm_object_focus_set(mailbox_ugd->main_back_btn, EINA_TRUE); + if(!mailbox_ugd->isRotate) + elm_object_focus_set(mailbox_ugd->main_back_btn, EINA_TRUE); + mailbox_finish_search_mode(mailbox_ugd); } @@ -442,10 +448,12 @@ void mailbox_finish_search_mode(EmailMailboxUGD *mailbox_ugd) list_lock = false; - if (!evas_object_visible_get(mailbox_ugd->navi_title_ly)) { - debug_log("title is not visible, show title. view_type:%d, previous_view:%d", mailbox_ugd->view_type, mailbox_ugd->previous_view); - elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "title", mailbox_ugd->navi_title_ly); - evas_object_show(mailbox_ugd->navi_title_ly); + if(!mailbox_ugd->isRotate) { + if (!evas_object_visible_get(mailbox_ugd->navi_title_ly)) { + debug_log("title is not visible, show title. view_type:%d, previous_view:%d", mailbox_ugd->view_type, mailbox_ugd->previous_view); + elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "title", mailbox_ugd->navi_title_ly); + evas_object_show(mailbox_ugd->navi_title_ly); + } } @@ -458,7 +466,11 @@ void mailbox_finish_search_mode(EmailMailboxUGD *mailbox_ugd) evas_object_hide(mailbox_ugd->searchbar_layout); } - _show_toolbar(mailbox_ugd); + if(mailbox_ugd->isRotate) { + _show_split_toolbar(mailbox_ugd); + } else { + _show_toolbar(mailbox_ugd); + } _refresh_mailbox(mailbox_ugd); } @@ -539,17 +551,79 @@ static Eina_Bool _mailbox_create_search_criteria_view(int search_type, void *dat { debug_log(""); EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; - Elm_Object_Item* navi_item; + + if (!mailbox_ugd) { + debug_log("mailbox_ugd is null"); + return 0; + } + + if(search_type == EMAIL_SEARCH_ADVANCED) { + _mailbox_create_advanced_search_view(search_type, data); + } else if (search_type == EMAIL_SEARCH_DATE) { + _mailbox_create_date_search_view(search_type, data); + } else { + debug_log("_create_search_criteria_view failed search type is invalid\n"); + return 0; + } + return 0; +} + +static Eina_Bool _mailbox_create_date_search_view(int search_type, void *data) +{ + debug_log(""); + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + Evas_Object *popup; Evas_Object *btn_ok; Evas_Object *btn_cancel; - Evas_Object *btn_back; MailboxAdvSearchViewInfo *adv_search_info = NULL; - if (!mailbox_ugd || (search_type != EMAIL_SEARCH_ADVANCED && search_type != EMAIL_SEARCH_DATE)) { - debug_log("_create_search_criteria_view failed search type is invalid(or mailbox_ugd : null)\n"); + if(mailbox_ugd->adv_search_info) + _mailbox_free_search_list_data(mailbox_ugd->adv_search_info); + + adv_search_info = (MailboxAdvSearchViewInfo *) calloc(1, sizeof(MailboxAdvSearchViewInfo)); + + if (!adv_search_info) { + debug_log("adv_search_info: memory alloc failed!\n"); return 0; } + adv_search_info->mailbox_ugd = (EmailMailboxUGD *)data; + mailbox_ugd->adv_search_info = adv_search_info; + mailbox_ugd->b_advanced_search_view = true; + + popup = elm_popup_add(mailbox_ugd->win_main); + elm_object_style_set(popup, "menustyle"); + elm_object_part_text_set(popup, "title,text", _("IDS_EMAIL_HEADER_DATE_RANGE")); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + adv_search_info->search_list_popup = popup; + + genlist_for_search = elm_genlist_add(popup); + _mailbox_create_list_view_for_advanced_search(data, search_type); + elm_object_content_set(popup, genlist_for_search); + + btn_ok = elm_button_add(popup); + _mailbox_advanced_view_create_controlbar_button(btn_ok, dgettext("sys_string", "IDS_COM_SK_OK"), NULL, _mailbox_advanced_search_start_cb, data); + elm_object_part_content_set(popup, "button1", btn_ok); + + btn_cancel = elm_button_add(popup); + _mailbox_advanced_view_create_controlbar_button(btn_cancel, dgettext("sys_string", "IDS_COM_SK_CANCEL"), NULL, _mailbox_advanced_search_cancel_cb, data); + elm_object_part_content_set(popup, "button2", btn_cancel); + + evas_object_show(popup); + return 0; +} + +static Eina_Bool _mailbox_create_advanced_search_view(int search_type, void *data) +{ + debug_log(""); + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + Elm_Object_Item* navi_item; + Evas_Object *btn_ok; + Evas_Object *btn_cancel; + Evas_Object *btn_ok2; + Evas_Object *btn_cancel2; + MailboxAdvSearchViewInfo *adv_search_info = NULL; + if(mailbox_ugd->adv_search_info) _mailbox_free_search_list_data(mailbox_ugd->adv_search_info); @@ -560,6 +634,10 @@ static Eina_Bool _mailbox_create_search_criteria_view(int search_type, void *dat return 0; } + if(mailbox_ugd->isRotate) { + _hide_split_toolbar(mailbox_ugd); + } + adv_search_info->mailbox_ugd = (EmailMailboxUGD *)data; mailbox_ugd->adv_search_info = adv_search_info; mailbox_ugd->b_advanced_search_view = true; @@ -568,25 +646,36 @@ static Eina_Bool _mailbox_create_search_criteria_view(int search_type, void *dat _mailbox_create_list_view_for_advanced_search(data, search_type); - /* back button */ - btn_back = elm_button_add(mailbox_ugd->navi_bar); - evas_object_smart_callback_add(btn_back, "clicked", _mailbox_advanced_search_cancel_cb, data); - elm_object_style_set(btn_back, "naviframe/back_btn/default"); - - //should be replaced with new string - if ( search_type == EMAIL_SEARCH_ADVANCED ) { - navi_item = elm_naviframe_item_push(mailbox_ugd->navi_bar, _("IDS_EMAIL_OPT_ADVANCED"), btn_back, NULL, genlist_for_search, NULL); - } else if ( search_type == EMAIL_SEARCH_DATE ) { - navi_item = elm_naviframe_item_push(mailbox_ugd->navi_bar, _("IDS_EMAIL_HEADER_DATE_RANGE"), btn_back, NULL, genlist_for_search, NULL); - } - btn_ok = elm_button_add(mailbox_ugd->navi_bar); - _mailbox_advanced_view_create_controlbar_button(btn_ok, dgettext("sys_string", "IDS_COM_SK_OK"), NULL, _mailbox_advanced_search_start_cb, data); - elm_object_item_part_content_set(navi_item, "title_left_btn", btn_ok); + elm_object_style_set(btn_ok, "naviframe/toolbar/default"); + elm_object_text_set(btn_ok, dgettext("sys_string", "IDS_COM_SK_OK")); + evas_object_smart_callback_add(btn_ok, "clicked", _mailbox_advanced_search_start_cb, data); + evas_object_show(btn_ok); + + btn_ok2 = elm_button_add(mailbox_ugd->navi_bar); + elm_object_style_set(btn_ok2, "naviframe/toolbar/default"); + elm_object_text_set(btn_ok2, dgettext("sys_string", "IDS_COM_SK_OK")); + evas_object_smart_callback_add(btn_ok2, "clicked", _mailbox_advanced_search_start_cb, data); + evas_object_show(btn_ok2); btn_cancel = elm_button_add(mailbox_ugd->navi_bar); - _mailbox_advanced_view_create_controlbar_button(btn_cancel, dgettext("sys_string", "IDS_COM_SK_CANCEL"), NULL, _mailbox_advanced_search_cancel_cb, data); - elm_object_item_part_content_set(navi_item, "title_right_btn", btn_cancel); + elm_object_style_set(btn_cancel, "naviframe/end_btn/default"); + evas_object_smart_callback_add(btn_cancel, "clicked", _mailbox_advanced_search_cancel_cb, data); + evas_object_show(btn_cancel); + + btn_cancel2 = elm_button_add(mailbox_ugd->navi_bar); + elm_object_style_set(btn_cancel2, "naviframe/end_btn/default"); + evas_object_smart_callback_add(btn_cancel2, "clicked", _mailbox_advanced_search_cancel_cb, data); + evas_object_show(btn_cancel2); + + navi_item = elm_naviframe_item_push(mailbox_ugd->navi_bar, _("IDS_EMAIL_OPT_ADVANCED"), NULL, NULL, genlist_for_search, NULL); + + elm_object_item_part_content_set(navi_item, "title_toolbar_button1", btn_ok); + elm_object_item_part_content_set(navi_item, "title_prev_btn", btn_cancel); + elm_object_item_part_content_set(navi_item, "toolbar_button1", btn_ok2); + elm_object_item_part_content_set(navi_item, "prev_btn", btn_cancel2); + + mailbox_ugd->navi_item_search = navi_item; return 0; } @@ -620,8 +709,41 @@ static void _mailbox_advanced_search_cancel_cb(void *data, Evas_Object *obj, voi { debug_log(""); EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + Ecore_IMF_Context *imf_context = NULL; + + if(!mailbox_ugd) { + debug_log("mailbox_ugd is null"); + return; + } + if(mailbox_ugd->adv_search_info) { + MailboxAdvSearchViewInfo *adv_search_info = mailbox_ugd->adv_search_info; + if(adv_search_info->entry_title) { + imf_context = elm_entry_imf_context_get(adv_search_info->entry_title); + if (imf_context) { + ecore_imf_context_input_panel_hide(imf_context); + ecore_imf_context_input_panel_event_callback_del(imf_context, + ECORE_IMF_INPUT_PANEL_STATE_EVENT, _input_panel_state_changed_cb); + } + } + if(adv_search_info->entry_sender_address) { + imf_context = elm_entry_imf_context_get(adv_search_info->entry_sender_address); + if (imf_context) { + ecore_imf_context_input_panel_hide(imf_context); + ecore_imf_context_input_panel_event_callback_del(imf_context, + ECORE_IMF_INPUT_PANEL_STATE_EVENT, _input_panel_state_changed_cb); + } + } + } + + + if (mailbox_ugd->search_type == EMAIL_SEARCH_ADVANCED) + elm_naviframe_item_pop(mailbox_ugd->navi_bar); + else { + if (mailbox_ugd->adv_search_info && mailbox_ugd->adv_search_info->search_list_popup) + evas_object_del(mailbox_ugd->adv_search_info->search_list_popup); + mailbox_ugd->adv_search_info->search_list_popup = NULL; + } - elm_naviframe_item_pop(mailbox_ugd->navi_bar); mailbox_ugd->b_advanced_search_view = false; evas_object_smart_callback_del(mailbox_ugd->searchbar_en, "changed", _searchbar_entry_changed_cb); @@ -634,10 +756,15 @@ static void _mailbox_advanced_search_cancel_cb(void *data, Evas_Object *obj, voi } else { elm_object_focus_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_TRUE); - if (!evas_object_visible_get(mailbox_ugd->navi_title_ly)) { - debug_log("title is not visible, show title. view_type:%d, previous_view:%d", mailbox_ugd->view_type, mailbox_ugd->previous_view); - elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "title", mailbox_ugd->navi_title_ly); - evas_object_show(mailbox_ugd->navi_title_ly); + if(mailbox_ugd->isRotate) { + _show_split_toolbar(mailbox_ugd); + } else { + if (!evas_object_visible_get(mailbox_ugd->navi_title_ly)) { + debug_log("title is not visible, show title. view_type:%d, previous_view:%d", mailbox_ugd->view_type, mailbox_ugd->previous_view); + elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "title", mailbox_ugd->navi_title_ly); + evas_object_show(mailbox_ugd->navi_title_ly); + } + _show_toolbar(mailbox_ugd); } if (evas_object_visible_get(mailbox_ugd->searchbar_layout)) { @@ -648,7 +775,6 @@ static void _mailbox_advanced_search_cancel_cb(void *data, Evas_Object *obj, voi edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "hide_searchbar", "search"); evas_object_hide(mailbox_ugd->searchbar_layout); } - _show_toolbar(mailbox_ugd); } } @@ -657,15 +783,22 @@ static void _mailbox_advanced_search_start_cb(void *data, Evas_Object *obj, void debug_log(""); EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; MailboxAdvSearchViewInfo* search_info = NULL; + Ecore_IMF_Context *imf_context = NULL; struct tm tm_from; struct tm tm_to; if (mailbox_ugd) { - elm_naviframe_item_pop(mailbox_ugd->navi_bar); - search_info = mailbox_ugd->adv_search_info; + if (mailbox_ugd->search_type == EMAIL_SEARCH_ADVANCED) + elm_naviframe_item_pop(mailbox_ugd->navi_bar); + else { + if (search_info->search_list_popup) + evas_object_del(search_info->search_list_popup); + search_info->search_list_popup = NULL; + } + if (search_info) { localtime_r(&search_info->from_date, &tm_from); @@ -679,6 +812,23 @@ static void _mailbox_advanced_search_start_cb(void *data, Evas_Object *obj, void elm_entry_entry_set(mailbox_ugd->searchbar_en, search_info->str_search_criteria); debug_log("search_info->str_search_criteria[%s]",search_info->str_search_criteria); + + if(search_info->entry_title) { + imf_context = elm_entry_imf_context_get(search_info->entry_title); + if (imf_context) { + ecore_imf_context_input_panel_hide(imf_context); + ecore_imf_context_input_panel_event_callback_del(imf_context, + ECORE_IMF_INPUT_PANEL_STATE_EVENT, _input_panel_state_changed_cb); + } + } + if(search_info->entry_sender_address) { + imf_context = elm_entry_imf_context_get(search_info->entry_sender_address); + if (imf_context) { + ecore_imf_context_input_panel_hide(imf_context); + ecore_imf_context_input_panel_event_callback_del(imf_context, + ECORE_IMF_INPUT_PANEL_STATE_EVENT, _input_panel_state_changed_cb); + } + } } mailbox_ugd->b_advanced_search_view = false; @@ -725,14 +875,16 @@ static void _mailbox_create_list_view_for_advanced_search(void *data, int search i = 2; item_data[i].type = MAILBOX_SEARCH_LIST_TYPE_TITLE; item_data[i].search_info = mailbox_ugd->adv_search_info; - elm_genlist_item_append(genlist_for_search, &itc_search_view, &item_data[i], NULL, + item = elm_genlist_item_append(genlist_for_search, &itc_search_view, &item_data[i], NULL, ELM_GENLIST_ITEM_NONE, _gl_advanced_search_sel_cb, &item_data[i]); + elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_NONE); /* Sender */ i = 3; item_data[i].type = MAILBOX_SEARCH_LIST_TYPE_SENDER; item_data[i].search_info = mailbox_ugd->adv_search_info; - elm_genlist_item_append(genlist_for_search, &itc_search_view, &item_data[i], NULL, + item = elm_genlist_item_append(genlist_for_search, &itc_search_view, &item_data[i], NULL, ELM_GENLIST_ITEM_NONE, _gl_advanced_search_sel_cb, &item_data[i]); + elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_NONE); } else if (search_type == EMAIL_SEARCH_DATE) { item_data = (mailbox_search_list_item *)calloc(2, sizeof(mailbox_search_list_item)); } else { @@ -806,13 +958,15 @@ static Evas_Object *_gl_advanced_searcn_view_content_get_cb(void *data, Evas_Obj if (!g_strcmp0(part, "elm.icon")) { switch (item_data->type) { case MAILBOX_SEARCH_LIST_TYPE_TITLE: + { + Ecore_IMF_Context *imf_context = NULL; search_info->search_title = elm_layout_add(genlist_for_search); elm_layout_theme_set(search_info->search_title, "layout", "editfield", "title"); search_info->entry_title = elm_entry_add(genlist_for_search); elm_entry_scrollable_set(search_info->entry_title, EINA_TRUE); elm_entry_single_line_set(search_info->entry_title, EINA_TRUE); elm_entry_cnp_mode_set(search_info->entry_title, ELM_CNP_MODE_PLAINTEXT); - elm_entry_input_panel_layout_set(search_info->entry_title, ELM_INPUT_PANEL_LAYOUT_EMAIL); + elm_entry_input_panel_layout_set(search_info->entry_title, ELM_INPUT_PANEL_LAYOUT_NORMAL); elm_entry_editable_set(search_info->entry_title, TRUE); evas_object_event_callback_add(search_info->entry_title, EVAS_CALLBACK_KEY_DOWN, _mailbox_advanced_search_key_down_cb, data); evas_object_smart_callback_add(search_info->entry_title, "changed", _mailbox_advanced_search_backup_input_cb, data); @@ -821,6 +975,13 @@ static Evas_Object *_gl_advanced_searcn_view_content_get_cb(void *data, Evas_Obj evas_object_smart_callback_add(search_info->entry_title, "unfocused", _mailbox_advanced_edit_entry_unfocused_cb, search_info->search_title); evas_object_show(search_info->entry_title); + imf_context = elm_entry_imf_context_get(search_info->entry_title); + if (imf_context) + ecore_imf_context_input_panel_event_callback_add(imf_context, + ECORE_IMF_INPUT_PANEL_STATE_EVENT, + _input_panel_state_changed_cb, (void *)mailbox_ugd); + + elm_object_part_content_set(search_info->search_title, "elm.swallow.content", search_info->entry_title); elm_object_part_text_set(search_info->search_title, "elm.text", _("IDS_EMAIL_OPT_TITLE")); elm_object_signal_callback_add(search_info->search_title, "elm,eraser,clicked", "elm", _mailbox_advanced_edit_eraser_clicked_cb, search_info->entry_title); @@ -832,8 +993,10 @@ static Evas_Object *_gl_advanced_searcn_view_content_get_cb(void *data, Evas_Obj elm_entry_entry_set(search_info->entry_title, search_info->str_title); return search_info->search_title; - + } case MAILBOX_SEARCH_LIST_TYPE_SENDER: + { + Ecore_IMF_Context *imf_context = NULL; search_info->search_sender_address = elm_layout_add(genlist_for_search); elm_layout_theme_set(search_info->search_sender_address, "layout", "editfield", "title"); search_info->entry_sender_address = elm_entry_add(genlist_for_search); @@ -849,6 +1012,12 @@ static Evas_Object *_gl_advanced_searcn_view_content_get_cb(void *data, Evas_Obj evas_object_smart_callback_add(search_info->entry_sender_address, "unfocused", _mailbox_advanced_edit_entry_unfocused_cb, search_info->search_sender_address); evas_object_show(search_info->entry_sender_address); + imf_context = elm_entry_imf_context_get(search_info->entry_sender_address); + if (imf_context) + ecore_imf_context_input_panel_event_callback_add(imf_context, + ECORE_IMF_INPUT_PANEL_STATE_EVENT, + _input_panel_state_changed_cb, (void *)mailbox_ugd); + elm_object_part_content_set(search_info->search_sender_address, "elm.swallow.content", search_info->entry_sender_address); if ((mailbox_ugd->mailbox_type == EMAIL_MAILBOX_TYPE_SENTBOX) @@ -868,7 +1037,7 @@ static Evas_Object *_gl_advanced_searcn_view_content_get_cb(void *data, Evas_Obj elm_entry_entry_set(search_info->entry_sender_address, search_info->str_sender_address); return search_info->search_sender_address; - + } case MAILBOX_SEARCH_LIST_TYPE_FROM_DATE: search_info->search_date_from = elm_layout_add(genlist_for_search); elm_layout_file_set(search_info->search_date_from, THEME_PATH, "dialoguegroup/email_datetime"); @@ -1064,3 +1233,31 @@ static void _mailbix_search_to_date_changed_cb(void *data, Evas_Object *obj, voi search_info->to_date = mktime(&tm); debug_log("search_info->to_date : %d", search_info->to_date); } + +static void _input_panel_state_changed_cb(void *data, Ecore_IMF_Context *ctx, int value) +{ + debug_log(""); + + if (!data) { + debug_log("data is NULL"); + return; + } + + EmailMailboxUGD *mailbox_ugd = (EmailMailboxUGD *)data; + + int state = ecore_imf_context_input_panel_state_get(ctx); + + if (state == ECORE_IMF_INPUT_PANEL_STATE_SHOW) + debug_log("state:SHOW"); + else if (state == ECORE_IMF_INPUT_PANEL_STATE_HIDE) + debug_log("state HIDE"); + + if (state == ECORE_IMF_INPUT_PANEL_STATE_SHOW) { + debug_log("input panel show"); + elm_object_item_signal_emit(mailbox_ugd->navi_item_search, "elm,state,sip,shown", ""); + } else if (state == ECORE_IMF_INPUT_PANEL_STATE_HIDE) { + debug_log("input panel hide"); + elm_object_item_signal_emit(mailbox_ugd->navi_item_search, "elm,state,sip,hidden", ""); + } +} + diff --git a/mailbox/src/email-mailbox.c b/mailbox/src/email-mailbox.c index 35b9426..3cdb426 100755 --- a/mailbox/src/email-mailbox.c +++ b/mailbox/src/email-mailbox.c @@ -93,15 +93,17 @@ static Evas_Object *create_fullview(Evas_Object *parent, EmailMailboxUGD *mailbo static void layout_setting_cb(ui_gadget_h ug, enum ug_mode mode, void *priv); static void layout_account_cb(ui_gadget_h ug, enum ug_mode mode, void *priv); static void layout_viewer_cb(ui_gadget_h ug, enum ug_mode mode, void *priv); +static void layout_composer_cb(ui_gadget_h ug, enum ug_mode mode, void *priv); static void result_setting_cb(ui_gadget_h ug, service_h service, void *priv); static void result_cb(ui_gadget_h ug, service_h service, void *priv); +static void result_viewer_cb(ui_gadget_h ug, service_h service, void *priv); +static void result_composer_cb(ui_gadget_h ug, service_h service, void *priv); static void destroy_setting_cb(ui_gadget_h ug, void *priv); static void destroy_viewer_cb(ui_gadget_h ug, void *priv); static void destroy_composer_cb(ui_gadget_h ug, void *priv); static ui_gadget_h create_account_ug(char *ug_name, service_h service, void *data); static ui_gadget_h create_folder_ug(char *ug_name, service_h service, void *data); static ui_gadget_h create_viewer_ug(char *ug_name, service_h service, void *data); -static void result_viewer_cb(ui_gadget_h ug, service_h service, void *priv); static void _email_mailbox_timezone_change_cb(keynode_t *key, void *data); @@ -120,6 +122,8 @@ static void _password_entry_unfocused_cb(void *data, Evas_Object *obj, void *eve static void _password_entry_focused_cb(void *data, Evas_Object *obj, void *event_info); static void _password_entry_changed_cb(void *data, Evas_Object *obj, void *event_info); +void _split_back_clicked(void *data, Evas_Object *obj, void *event_info); + #if 0 struct timeval before_time; @@ -199,6 +203,8 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, voi debug_log(""); Evas_Object *parent; EmailMailboxUGD *mailbox_ugd; + int account_count; + email_account_t *account_list = NULL; if (!ug || !priv) return NULL; @@ -228,6 +234,13 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, voi mailbox_ugd->download_idx = 0; mailbox_ugd->isRotate = false; + if (email_engine_get_account_list(&account_count, &account_list)) + mailbox_ugd->account_count = account_count; + else + mailbox_ugd->account_count = 0; + if (account_list && account_count > 0) + email_engine_free_account_list(&account_list, account_count); + int w, h; ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h); debug_log("WINDOW W[%d] H[%d]", w, h); @@ -589,20 +602,20 @@ static void _mailbox_rotate_to_potrait(void *data, int angle) mailbox_ugd->passwd_popup = NULL; } - //elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "controlbar"); - _create_controlbar(mailbox_ugd); + if(mailbox_ugd->ctxpopup) { + evas_object_del(mailbox_ugd->ctxpopup); + mailbox_ugd->ctxpopup = NULL; + } + + if(mailbox_ugd->view_type != EMAIL_VIEW_SEARCH) + _show_toolbar(mailbox_ugd); elm_win_rotation_with_resize_set(mailbox_ugd->win_main, angle); - if (!evas_object_visible_get(mailbox_ugd->navi_title_ly)) { - debug_log("title is not visible, show title. view_type:%d, previous_view:%d", mailbox_ugd->view_type, mailbox_ugd->previous_view); - if (mailbox_ugd->view_type == EMAIL_VIEW_EDIT) - elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->previous_view], "title", mailbox_ugd->navi_title_ly); - else - elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "title", mailbox_ugd->navi_title_ly); - } + debug_log("show title. view_type:%d, previous_view:%d", mailbox_ugd->view_type, mailbox_ugd->previous_view); + elm_object_item_part_content_set(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "title", mailbox_ugd->navi_title_ly); - if (elm_object_part_content_get(mailbox_ugd->panes, "right") == mailbox_ugd->split_nocontent) { + if (elm_object_part_content_get(mailbox_ugd->panes, "right") == mailbox_ugd->split_ly) { elm_panes_content_left_size_set(mailbox_ugd->panes, 1.0); Evas_Object *r_content = elm_object_part_content_get(mailbox_ugd->panes, "right"); if (r_content) evas_object_hide(r_content); @@ -636,29 +649,12 @@ static void _mailbox_rotate_to_landscape(void *data, int angle) mailbox_ugd->passwd_popup = NULL; } - if (elm_panes_content_left_size_get(mailbox_ugd->panes) == 1.0) { - if(mailbox_ugd->b_advanced_search_view) { - debug_log("advanced search view exists. should be removed"); - elm_naviframe_item_pop(mailbox_ugd->navi_bar); - mailbox_ugd->b_advanced_search_view = false; - - if(!g_focus_lock) { - elm_object_focus_set(mailbox_ugd->gl[mailbox_ugd->view_type], EINA_TRUE); - - if (evas_object_visible_get(mailbox_ugd->searchbar_layout)) { - debug_log("search_bar is visible, hide search bar"); - elm_entry_entry_set(mailbox_ugd->searchbar_en, ""); - elm_object_focus_set(mailbox_ugd->searchbar_layout, EINA_FALSE); - elm_object_part_content_unset(mailbox_ugd->search_layout, "searchbar"); - edje_object_signal_emit(_EDJ(mailbox_ugd->search_layout), "hide_searchbar", "search"); - evas_object_hide(mailbox_ugd->searchbar_layout); - } - _show_toolbar(mailbox_ugd); - } - } + if(mailbox_ugd->ctxpopup) { + evas_object_del(mailbox_ugd->ctxpopup); + mailbox_ugd->ctxpopup = NULL; + } - if(mailbox_ugd->view_type == EMAIL_VIEW_SEARCH) - mailbox_finish_search_mode(mailbox_ugd); + if (elm_panes_content_left_size_get(mailbox_ugd->panes) == 1.0) { elm_win_rotation_with_resize_set(mailbox_ugd->win_main, angle); _create_email_no_content_view(mailbox_ugd); } @@ -675,28 +671,20 @@ static void _mailbox_rotate_to_landscape(void *data, int angle) if (!evas_object_visible_get(mailbox_ugd->gl[mailbox_ugd->view_type])) evas_object_show(mailbox_ugd->gl[mailbox_ugd->view_type]); + _hide_toolbar(mailbox_ugd); if (mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { - _create_controlbar(mailbox_ugd); email_maillist_select_info(mailbox_ugd); } - else - { - _delete_controlbar(mailbox_ugd); - } - - if (evas_object_visible_get(mailbox_ugd->navi_title_ly)) { - debug_log("title is visible, hide title"); - debug_log("title is not visible, show title. view_type:%d, previous_view:%d", mailbox_ugd->view_type, mailbox_ugd->previous_view); - if (mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { - elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->previous_view], "title"); - } else { - elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "title"); - } - evas_object_hide(mailbox_ugd->navi_title_ly); + debug_log("hide title"); + if (mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { + elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->previous_view], "title"); + } else { + elm_object_item_part_content_unset(mailbox_ugd->navibar_item[mailbox_ugd->view_type], "title"); } + evas_object_hide(mailbox_ugd->navi_title_ly); /* destroy account ug and create mailbox ug */ @@ -804,7 +792,8 @@ static void layout_account_cb(ui_gadget_h ug, enum ug_mode mode, void *priv) Evas_Object *blk; float scale_factor=0; - int acc_max_h=909, acc_w=688; + int acc_h = 150, acc_max_h = 909, acc_w = 688; + //int acc_h=150, acc_cnt=email_engine_get_count_account(); if (!ug || !priv) return; @@ -834,8 +823,18 @@ static void layout_account_cb(ui_gadget_h ug, enum ug_mode mode, void *priv) edje_object_signal_callback_add(blk, "action,click", "", _account_dim_clicked, ugd);/*when dim area is clicked this signal is sent*/ // create frame view + + acc_h = acc_h * ugd->account_count; + if(ugd->account_count > 1) + acc_h = acc_h + (120*2); // add account + all account + else + acc_h = acc_h + 120; // add account + + acc_h = ((acc_h > acc_max_h) ? acc_max_h: acc_h); + debug_log("acc_h [%d], acc_cnt [%d]", acc_h, ugd->account_count); + evas_object_raise(base); - evas_object_resize(base, acc_w, acc_max_h); + evas_object_resize(base, acc_w, acc_h); //evas_object_move(base, 16, 168); // indicator(50)+Navi(108) + 10(gap) evas_object_move(base, 16, 181); // indicator(60)+Navi(111) + 10(gap) @@ -853,7 +852,7 @@ static void layout_account_cb(ui_gadget_h ug, enum ug_mode mode, void *priv) } } -void layout_composer_cb(ui_gadget_h ug, enum ug_mode mode, void *priv) +static void layout_composer_cb(ui_gadget_h ug, enum ug_mode mode, void *priv) { debug_log(""); Evas_Object *base; @@ -1043,19 +1042,28 @@ static void result_viewer_cb(ui_gadget_h ug, service_h service, void *priv) if (NULL != mailbox_msg) { if (0 == g_strcmp0(mailbox_msg, "MAILBOX_RESIZE_FULL")) { debug_log("MAILBOX_RESIZE_FULL"); - if (elm_genlist_item_selected_get((Elm_Object_Item *)g_selected_item) == EINA_TRUE) - elm_genlist_item_selected_set((Elm_Object_Item *)g_selected_item, EINA_FALSE); - if (!evas_object_visible_get(mailbox_ugd->gl[mailbox_ugd->view_type])) - evas_object_show(mailbox_ugd->gl[mailbox_ugd->view_type]); + if(mailbox_ugd->isRotate) { + if (elm_genlist_item_selected_get((Elm_Object_Item *)g_selected_item) == EINA_TRUE) + elm_genlist_item_selected_set((Elm_Object_Item *)g_selected_item, EINA_FALSE); - elm_panes_content_left_size_set(mailbox_ugd->panes, 1.0); - if (mailbox_ugd->ly != NULL && elm_object_part_content_get(mailbox_ugd->panes, "left") == NULL) - elm_object_part_content_set(mailbox_ugd->panes, "left", mailbox_ugd->ly); + _create_email_no_content_view(mailbox_ugd); - Evas_Object *r_content = elm_object_part_content_get(mailbox_ugd->panes, "right"); - if (r_content) evas_object_hide(r_content); - elm_object_part_content_unset(mailbox_ugd->panes, "right"); + } else { + if (elm_genlist_item_selected_get((Elm_Object_Item *)g_selected_item) == EINA_TRUE) + elm_genlist_item_selected_set((Elm_Object_Item *)g_selected_item, EINA_FALSE); + + if (!evas_object_visible_get(mailbox_ugd->gl[mailbox_ugd->view_type])) + evas_object_show(mailbox_ugd->gl[mailbox_ugd->view_type]); + + elm_panes_content_left_size_set(mailbox_ugd->panes, 1.0); + if (mailbox_ugd->ly != NULL && elm_object_part_content_get(mailbox_ugd->panes, "left") == NULL) + elm_object_part_content_set(mailbox_ugd->panes, "left", mailbox_ugd->ly); + + Evas_Object *r_content = elm_object_part_content_get(mailbox_ugd->panes, "right"); + if (r_content) evas_object_hide(r_content); + elm_object_part_content_unset(mailbox_ugd->panes, "right"); + } } g_free(mailbox_msg); @@ -1064,7 +1072,7 @@ static void result_viewer_cb(ui_gadget_h ug, service_h service, void *priv) } } -void result_composer_cb(ui_gadget_h ug, service_h service, void *priv) +static void result_composer_cb(ui_gadget_h ug, service_h service, void *priv) { EmailMailboxUGD *mailbox_ugd; debug_log(""); @@ -1538,12 +1546,12 @@ static void _create_view(EmailMailboxUGD *mailbox_ugd) mailbox_ugd->search_layout = mailbox_ugd->sub_layout[mailbox_ugd->view_type]; Evas_Object *btn = elm_button_add(mailbox_ugd->navi_bar); - elm_object_style_set(btn, "naviframe/end_btn/default"); + elm_object_style_set(btn, "naviframe/back_btn/default"); evas_object_smart_callback_add(btn, "clicked", _main_back_clicked, mailbox_ugd); mailbox_ugd->main_back_btn = btn; // push the content to naviframe. - mailbox_ugd->navibar_item[mailbox_ugd->view_type] = elm_naviframe_item_push(mailbox_ugd->navi_bar, NULL, btn, NULL, mailbox_ugd->sub_layout[mailbox_ugd->view_type], "empty"); + mailbox_ugd->navibar_item[mailbox_ugd->view_type] = elm_naviframe_item_push(mailbox_ugd->navi_bar, NULL, mailbox_ugd->main_back_btn, NULL, mailbox_ugd->sub_layout[mailbox_ugd->view_type], "empty"); // Create custom style layout mailbox_ugd->navi_title_ly = elm_layout_add(mailbox_ugd->navi_bar); @@ -1688,7 +1696,34 @@ void _main_back_clicked(void *data, Evas_Object *obj, void *event_info) } } +void _split_back_clicked(void *data, Evas_Object *obj, void *event_info) +{ + debug_log(""); + + if (!data) { + debug_log("data is NULL"); + return; + } + EmailMailboxUGD *mailbox_ugd = data; + if (mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { + if(mailbox_ugd->split_nocontent) + elm_object_part_text_set(mailbox_ugd->split_nocontent, "elm.text", N_("No email selected")); + + _edit_back_cb(mailbox_ugd, NULL, NULL); + } + else { + Elm_Object_Item* it_sweep = NULL; + it_sweep = (Elm_Object_Item *)elm_genlist_decorated_item_get(mailbox_ugd->gl[mailbox_ugd->view_type]); + + if (it_sweep) { + elm_genlist_item_decorate_mode_set(it_sweep, "slide", EINA_FALSE); + elm_genlist_item_select_mode_set(it_sweep, ELM_OBJECT_SELECT_MODE_DEFAULT); + } + + elm_win_lower(ug_get_window()); + } +} static void _change_unread_icon_to_read_icon(Elm_Object_Item *item) @@ -1785,19 +1820,67 @@ void _create_email_no_content_view(EmailMailboxUGD *mailbox_ugd) { debug_log(""); - if (mailbox_ugd->split_nocontent == NULL) { - Evas_Object *no_content = elm_layout_add(mailbox_ugd->navi_bar); - elm_layout_theme_set(no_content, "layout", "nocontents", "full"); - elm_object_part_text_set(no_content, "elm.text", dgettext("sys_string", "IDS_COM_BODY_NO_CONTENTS")); + if(!mailbox_ugd->split_ly) { + mailbox_ugd->split_ly = elm_layout_add(mailbox_ugd->panes); + elm_layout_theme_set(mailbox_ugd->split_ly, "layout", "application", "noindicator"); + evas_object_size_hint_weight_set(mailbox_ugd->split_ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + } + + if (!mailbox_ugd->split_navi_bar) { + mailbox_ugd->split_navi_bar = _create_navigation_layout(mailbox_ugd->split_ly); + } + + if(!mailbox_ugd->sub_layout_split) { + mailbox_ugd->sub_layout_split = elm_layout_add(mailbox_ugd->split_navi_bar); + evas_object_size_hint_weight_set(mailbox_ugd->sub_layout_split, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_layout_file_set(mailbox_ugd->sub_layout_split, THEME_PATH, "layout.email.mailbox.hd"); + } + + if(!mailbox_ugd->split_nocontent) { + Evas_Object *no_content = elm_layout_add(mailbox_ugd->sub_layout_split); + elm_layout_theme_set(no_content, "layout", "nocontents", "text"); mailbox_ugd->split_nocontent = no_content; + elm_object_part_content_set(mailbox_ugd->sub_layout_split, "noc", mailbox_ugd->split_nocontent); } + if(mailbox_ugd->view_type == EMAIL_VIEW_EDIT) { + char tmp[MAX_STR_LEN] = { 0, }; + Eina_List *list = NULL; + int cnt = 0; + list = edit_list; + cnt = eina_list_count(list); + + snprintf(tmp, sizeof(tmp), "%s (%d)", N_("Selected"), cnt); + elm_object_part_text_set(mailbox_ugd->split_nocontent, "elm.text", tmp); + } + else { + elm_object_part_text_set(mailbox_ugd->split_nocontent, "elm.text", N_("No email selected")); + } + evas_object_show(mailbox_ugd->split_nocontent); + + if(!mailbox_ugd->split_navi_it) { + if(mailbox_ugd->split_back_btn) { + evas_object_del(mailbox_ugd->split_back_btn); + mailbox_ugd->split_back_btn = NULL; + } + Evas_Object *btn = elm_button_add(mailbox_ugd->split_navi_bar); + elm_object_style_set(btn, "naviframe/back_btn/default"); + evas_object_smart_callback_add(btn, "clicked", _split_back_clicked, mailbox_ugd); + mailbox_ugd->split_back_btn = btn; + elm_object_item_part_content_set(mailbox_ugd->split_navi_it, "prev_btn", mailbox_ugd->split_back_btn); + + mailbox_ugd->split_navi_it = elm_naviframe_item_push(mailbox_ugd->split_navi_bar, NULL, mailbox_ugd->split_back_btn, NULL, mailbox_ugd->split_nocontent, "empty"); + } + + _create_controlbar_for_split_view(mailbox_ugd); + Evas_Object *r_content = elm_object_part_content_get(mailbox_ugd->panes, "right"); if (r_content) evas_object_hide(r_content); elm_object_part_content_unset(mailbox_ugd->panes, "right"); - elm_object_part_content_set(mailbox_ugd->panes, "right", mailbox_ugd->split_nocontent); + elm_object_part_content_set(mailbox_ugd->panes, "right", mailbox_ugd->split_ly); elm_panes_content_left_size_set(mailbox_ugd->panes, 0.4); + evas_object_show(mailbox_ugd->split_ly); } static Evas_Object *_create_navigation_layout(Evas_Object *parent) diff --git a/setting/include/email-setting.h b/setting/include/email-setting.h index d579ebb..e4e80d7 100755 --- a/setting/include/email-setting.h +++ b/setting/include/email-setting.h @@ -60,7 +60,7 @@ #define ACCOUNT_ICON_OTHERS IMGDIR"/M02_list_icon_other.png" #define CBAR_ICON_ADD IMGDIR"/01_controlbar_icon_create_folder.png" -#define TITLE_ICON_REFRESH IMGDIR"/00_icon_refresh.png" +#define TITLE_ICON_REFRESH IMGDIR"/M02_title_icon_refresh.png" #define SP_XML_PATH RESDIR"/xml/sp_list.xml"