#include <contacts-ug.h>
#include <calendar-svc-provider.h>
#include <media-util-register.h>
-#include <media-util-err.h>
#include <app_service.h>
#include <status.h>
static void _attachment_bg_unset_cb(void *data, Evas * evas, Evas_Object *obj, void *event_info);
static void _mark_as_unread_cb(void *data, Evas_Object *obj, void *event_info);
static void _mark_as_read_cb(void *data, Evas_Object *obj, void *event_info);
+static void _save_email_cb(void *data, Evas_Object *obj, void *event_info);
+static Eina_Bool _save_email_prog_cb(void *data);
static void _ctxpopup_detail_contact_cb(void *data, Evas_Object *obj, void *event_info);
static void _ctxpopup_send_email_cb(void *data, Evas_Object *obj, void *event_info);
static void _outter_scroller_top_hit_cb(void *data, Evas_Object *obj, void *event_info);
static void _outter_scroller_scroll_cb(void *data, Evas_Object *obj, void *event_info);
+static void _mbe_focused_cb(void *data, Evas_Object *obj, void *event_info);
+static void _mbe_unfocused_cb(void *data, Evas_Object *obj, void *event_info);
static void _mbe_added_cb(void *data, Evas_Object *obj, void *event_info);
static void _mbe_selected_cb(void *data, Evas_Object *obj, void *event_info);
static void _destroy_down_progress_cb(void *data, Evas_Object *obj, void *event_info);
static void _gl_del(void *data, Evas_Object *obj);
static char *_gl_text_get(void *data, Evas_Object *obj, const char *part);
static Evas_Object *_gl_content_get(void *data, Evas_Object *obj, const char *part);
-static void _gl_sel(void *data, Evas_Object *obj, void *event_info);
-static char *_gl_sub_upper_text_get(void *data, Evas_Object *obj, const char *part);
-static Evas_Object *_gl_sub_upper_icon_get(void *data, Evas_Object *obj, const char *part);
-static void _gl_sub_upper_sel(void *data, Evas_Object *obj, void *event_info);
static void _move_here_cb(void *data, Evas_Object *obj, void *event_info);
static void _move_back_cb(void *data, Evas_Object *obj, void *event_info);
-static void _move_back_cb2(void *data, Evas_Object *obj, void *event_info);
UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops)
ug_data->webview_margin_landscape = 379;
} else if (w == 720) {
ug_data->webview_width = 710.0;
- ug_data->webview_height = 1009.0;
+ ug_data->webview_height = 1021.0;
ug_data->webview_width_landscape = 710.0;
ug_data->webview_height_landscape = 558.0;
ug_data->webview_margin = 1029;
case UG_EVENT_ROTATE_PORTRAIT:
case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN:
if (ug_data->b_internal && ug_data->isRotate == true) {
+ ewk_view_command_execute(ug_data->webview, "Unselect", NULL);
debug_log("In Full view - Showing navi bar");
elm_naviframe_item_title_visible_set(ug_data->navi_main_it, EINA_TRUE);
ug_data->move_cbar = NULL;
}
}
- if (ug_data->navi_move_it2) {
- debug_log("move2");
- Evas_Object *move_back_btn = elm_button_add(ug_data->navi_bar);
- elm_object_style_set(move_back_btn, "naviframe/back_btn/default");
- evas_object_smart_callback_add(move_back_btn, "clicked", _move_back_cb2, ug_data);
- elm_object_item_part_content_set(ug_data->navi_move_it2, "prev_btn", move_back_btn);
- elm_naviframe_item_title_visible_set(ug_data->navi_move_it2, EINA_TRUE);
- }
if (ug_data->b_btn) {
evas_object_smart_callback_del(ug_data->b_btn, "clicked", _back_cb);
evas_object_smart_callback_add(ug_data->b_btn, "clicked", _back_cb, ug_data);
elm_object_item_part_content_set(ug_data->navi_main_it, "prev_btn", ug_data->b_btn);
- int resized_w = ug_data->webview_width * ug_data->scale_factor;
- int resized_h = ug_data->webview_height * ug_data->scale_factor;
- evas_object_size_hint_min_set(ug_data->webview, resized_w, resized_h);
-
ug_data->isRotate = false;
}
case UG_EVENT_ROTATE_LANDSCAPE:
case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN:
if (ug_data->b_internal && ug_data->isRotate == false) {
+ ewk_view_command_execute(ug_data->webview, "Unselect", NULL);
debug_log("In Split view - Hiding navi bar");
elm_naviframe_item_title_visible_set(ug_data->navi_main_it, EINA_FALSE);
}
elm_naviframe_item_title_visible_set(ug_data->navi_move_it1, EINA_FALSE);
}
- if (ug_data->navi_move_it2) {
- debug_log("move2");
- Evas_Object *move_back_btn = elm_object_item_part_content_get(ug_data->navi_move_it2, "prev_btn");
- if (move_back_btn) {
- evas_object_smart_callback_del(move_back_btn, "clicked", _move_back_cb2);
- evas_object_del(move_back_btn);
- elm_object_item_part_content_set(ug_data->navi_move_it2, "prev_btn", NULL);
- }
- elm_naviframe_item_title_visible_set(ug_data->navi_move_it2, EINA_FALSE);
- }
if (ug_data->b_btn) {
evas_object_smart_callback_del(ug_data->b_btn, "clicked", _back_cb);
elm_object_item_part_content_set(ug_data->navi_main_it, "prev_btn", NULL);
}
- int resized_w = ug_data->webview_width_landscape * ug_data->scale_factor;
- int resized_h = ug_data->webview_height_landscape * ug_data->scale_factor;
- evas_object_size_hint_min_set(ug_data->webview, resized_w, resized_h);
-
ug_data->isRotate = true;
}
/* reset subject */
char *_subject = elm_entry_utf8_to_markup(prop->subject);
+ if (!g_strcmp0(_subject, "")) {
+ g_free(_subject);
+ _subject = g_strdup(_("IDS_EMAIL_BODY_NO_SUBJECT"));
+ }
char *_subject_concated = g_strconcat("<font_size=44><color=#000000FF>", _subject, "</color></font_size>", NULL);
elm_object_text_set(ug_data->lb_subject, _subject_concated);
elm_label_wrap_width_set(ug_data->lb_subject, ug_data->main_w - (int)(110 * ug_data->scale_factor));
evas_object_show(ug_data->ly_subject);
elm_box_pack_end(ug_data->main_bx, ug_data->ly_subject);
+ Evas_Object *edje = elm_layout_edje_get(ug_data->ly_subject);
+
+ if (!ug_data->to_list && !ug_data->cc_list && !ug_data->bcc_list) {
+ edje_object_signal_emit(edje, "elm,state,arrow_hidden", "elm");
+ }
+
if (prop->has_attachment)
ug_data->got_att = 1;
else
if (elm_naviframe_top_item_get(ug_data->navi_bar) != ug_data->navi_main_it) {
ug_data->navi_move_it1 = NULL;
- ug_data->navi_move_it2 = NULL;
elm_naviframe_item_pop_to(ug_data->navi_main_it);
}
ug_data->m_is_multi_touch = 0;
ug_data->navi_move_it1 = NULL;
- ug_data->navi_move_it2 = NULL;
/* Double_Scroller */
ug_data->b_noc = 1;
subject_label = elm_label_add(di);
elm_object_part_content_set(di, "elm.text", subject_label);
char *subject = elm_entry_utf8_to_markup(prop->subject);
+ if (!g_strcmp0(subject, "")) {
+ g_free(subject);
+ subject = g_strdup(_("IDS_EMAIL_BODY_NO_SUBJECT"));
+ }
char *subject_tagged = g_strconcat("<font_size=44><color=#000000FF>", subject, "</color></font_size>", NULL);
elm_object_text_set(subject_label, subject_tagged);
elm_label_wrap_width_set(subject_label, ug_data->main_w - (int)(110 * ug_data->scale_factor));
if (ug_data->to_list || ug_data->cc_list || ug_data->bcc_list) {
edje_object_signal_callback_add(edje, "elm,action,expand,toggle", "elm", _subject_detail_clicked_cb, di);
- edje_object_signal_callback_add(edje, "elm,action,toggle", "elm", _subject_favorite_clicked_cb, di);
} else {
edje_object_signal_emit(edje, "elm,state,arrow_hidden", "elm");
}
+ edje_object_signal_callback_add(edje, "elm,action,toggle", "elm", _subject_favorite_clicked_cb, di);
return di;
}
evas_object_smart_callback_add(to_mbe, "item,clicked", _mbe_selected_cb, ug_data);
evas_object_smart_callback_add(to_mbe, "item,added", _mbe_added_cb, ug_data);
+ evas_object_smart_callback_add(to_mbe, "focused", _mbe_focused_cb, ug_data);
+ evas_object_smart_callback_add(to_mbe, "unfocused", _mbe_unfocused_cb, ug_data);
elm_object_part_content_set(di, "elm.icon", to_mbe);
ug_data->to_mbe = to_mbe;
g_free(cc_str);
evas_object_smart_callback_add(cc_mbe, "item,clicked", _mbe_selected_cb, ug_data);
evas_object_smart_callback_add(cc_mbe, "item,added", _mbe_added_cb, ug_data);
+ evas_object_smart_callback_add(cc_mbe, "focused", _mbe_focused_cb, ug_data);
+ evas_object_smart_callback_add(cc_mbe, "unfocused", _mbe_unfocused_cb, ug_data);
elm_object_part_content_set(di, "elm.icon", cc_mbe);
ug_data->cc_mbe = cc_mbe;
g_free(bcc_str);
evas_object_smart_callback_add(bcc_mbe, "item,clicked", _mbe_selected_cb, ug_data);
evas_object_smart_callback_add(bcc_mbe, "item,added", _mbe_added_cb, ug_data);
+ evas_object_smart_callback_add(bcc_mbe, "focused", _mbe_focused_cb, ug_data);
+ evas_object_smart_callback_add(bcc_mbe, "unfocused", _mbe_unfocused_cb, ug_data);
elm_object_part_content_set(di, "elm.icon", bcc_mbe);
ug_data->bcc_mbe = bcc_mbe;
if (ug_data->webview_bx) {
_init_webview_data(ug_data);
+ ewk_view_scale_set(ug_data->webview, 1.0f, 0, 0);
+
if (prop->has_html) {
/* html mail */
ug_data->webview_data->body_type_prev = BODY_TYPE_HTML;
resized_w = ug_data->webview_width * ug_data->scale_factor;
resized_h = ug_data->webview_height * ug_data->scale_factor;
}
+ debug_log("resized_w:%d, resized_h:%d", resized_w, resized_h);
evas_object_size_hint_min_set(ug_data->webview, resized_w, resized_h);
/* Cancel the download in email-service */
if (index >= 0) {
debug_log("index[%d] download_all_cnt[%d] email_handle[%d]", index, priv->download_all_cnt, priv->download_all_email_handle[index]);
- if (priv->download_all_email_handle[index] > 0) {
+ if (priv->download_all_email_handle[index] != 0) {
email_engine_stop_working(ug_data->account_id, priv->download_all_email_handle[index]);
priv->download_all_email_handle[index] = 0;
}
EmailAttachmentType *info = (EmailAttachmentType *)LIST_ITER_GET_DATA(i, attachment_list);
if (info && !info->inline_content) {
debug_log("index[%d] download_all_cnt[%d] email_handle[%d]", i, priv->download_all_cnt, priv->download_all_email_handle[i]);
- if (priv->download_all_email_handle[i] > 0) {
+ if (priv->download_all_email_handle[i] != 0) {
email_engine_stop_working(ug_data->account_id, priv->download_all_email_handle[i]);
}
}
elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_MARK_AS_READ"), NULL, _mark_as_read_cb, ug_data);
elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_BODY_MOVE"), NULL, _move_cb, ug_data);
+ elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_SAVE_EMAIL_ABB"), NULL, _save_email_cb, ug_data);
elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_VIEW_CONTACT"), NULL, _ctxpopup_detail_contact_cb, g_strdup(index));
elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_ADD_TO_CALENDAR"), NULL, _add_to_calendar_cb, ug_data);
ug_data->more_ctx_block_item = elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, prop->sender);
elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_MARK_AS_READ"), NULL, _mark_as_read_cb, ug_data);
elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_BODY_MOVE"), NULL, _move_cb, ug_data);
+ elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_SAVE_EMAIL_ABB"), NULL, _save_email_cb, ug_data);
elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_OPT_ADD_TO_CONTACTS"), NULL, _ctxpopup_select_contact_mode_email_cb, prop->sender);
elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_ADD_TO_CALENDAR"), NULL, _add_to_calendar_cb, ug_data);
ug_data->more_ctx_block_item = elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, prop->sender);
ug_data->partial_dn_btn_bx = NULL;
}
- if (ug_data->cutlink_timer) {
- ecore_timer_del(ug_data->cutlink_timer);
- ug_data->cutlink_timer = NULL;
+ if (ug_data->waiting_timer) {
+ ecore_timer_del(ug_data->waiting_timer);
+ ug_data->waiting_timer = NULL;
}
if (ug_data->timer) {
ug_data->con_popup = NULL;
}
- Elm_Object_Item *git = NULL;
Evas_Object *gl = elm_genlist_add(ug_data->navi_bar);
evas_object_show(gl);
ug_data->itc1.func.state_get = _gl_state_get;
ug_data->itc1.func.del = _gl_del;
- ug_data->itc2.item_style = "1text.1icon.2";
- ug_data->itc2.func.text_get = _gl_sub_upper_text_get;
- ug_data->itc2.func.content_get = _gl_sub_upper_icon_get;
- ug_data->itc2.func.state_get = _gl_state_get;
- ug_data->itc2.func.del = NULL;
-
- ug_data->itc3.item_style = "grouptitle.dialogue.seperator";
- ug_data->itc3.func.text_get = NULL;
- ug_data->itc3.func.content_get = NULL;
- ug_data->itc3.func.state_get = _gl_state_get;
- ug_data->itc3.func.del = NULL;
-
Elm_Object_Item *navi_it = NULL;
navi_it = elm_naviframe_item_push(ug_data->navi_bar, dgettext("sys_string", "IDS_COM_BODY_MOVE"), NULL, NULL, gl, NULL);
ug_data->navi_move_it1 = navi_it;
ug_data->move_mailbox_list = mailbox_list;
ug_data->move_mailbox_count = mailbox_count;
- git = elm_genlist_item_append(gl, &(ug_data->itc3), NULL, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
- elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
-
for (i = 0; i < mailbox_count; i++) {
if (g_strcmp0(ug_data->mailbox_name, mailbox_list[i].mailbox_name) != 0) {
if (mailbox_list[i].mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX &&
mailbox_list[i].mailbox_type != EMAIL_MAILBOX_TYPE_ALL_EMAILS &&
mailbox_list[i].mailbox_type != EMAIL_MAILBOX_TYPE_SEARCH_RESULT)
if (g_strcmp0(mailbox_list[i].alias, "[Gmail]")) {
- elm_genlist_item_append(gl, &ug_data->itc1, (void *)&(mailbox_list[i]), git, ELM_GENLIST_ITEM_NONE, _gl_sel, (void *)&(mailbox_list[i]));
+ elm_genlist_item_append(gl, &ug_data->itc1, (void *)&(mailbox_list[i]), NULL, ELM_GENLIST_ITEM_NONE, _move_here_cb, (void *)&(mailbox_list[i]));
}
}
}
return;
}
- unsigned int handle;
+ int handle;
gboolean ret = 0;
EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
EmailViewerPrivate *priv = ug_data->email_data;
edje_object_signal_emit(_EDJ(item), "elm,state,expanded", "elm");
(ug_data->subject_onoff_flag)++;
- _create_to_addrs(_g_ug_data);
- _create_cc_addrs(_g_ug_data);
- _create_bcc_addrs(_g_ug_data);
+ _create_to_addrs(ug_data);
+ _create_cc_addrs(ug_data);
+ _create_bcc_addrs(ug_data);
} else {
edje_object_signal_emit(_EDJ(item), "elm,state,contracted", "elm");
(ug_data->subject_onoff_flag)--;
}
}
+static void _create_waiting_popup(EmailViewerUGD *ug_data, const char *title_text, const char *style)
+{
+ debug_enter();
+ Evas_Object *popup;
+ Evas_Object *progress;
+
+ if (title_text == NULL) {
+ debug_log("popup text is null");
+ return;
+ }
+
+ popup = elm_popup_add(ug_data->win_main);
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_part_text_set(popup, "title,text", title_text);
+
+ progress = elm_progressbar_add(popup);
+ elm_object_style_set(progress, style);
+ elm_progressbar_pulse_set(progress, EINA_TRUE);
+ elm_progressbar_pulse(progress, EINA_TRUE);
+ evas_object_show(progress);
+
+ elm_object_content_set(popup, progress);
+
+ ug_data->timeout_popup = popup;
+
+ evas_object_show(popup);
+}
+
+static void _save_email_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ debug_log("");
+ if (!data) {
+ debug_log("data is NULL");
+ return;
+ }
+
+ EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+
+ if (ug_data->con_popup) {
+ evas_object_del(ug_data->con_popup);
+ ug_data->con_popup = NULL;
+ }
+
+ _create_waiting_popup(ug_data, dgettext("sys_string", "IDS_COM_POP_SAVING_ING"), "pending_list"); //"list_process"
+
+ if (ug_data->waiting_timer) {
+ ecore_timer_del(ug_data->waiting_timer);
+ ug_data->waiting_timer = NULL;
+ }
+ ug_data->waiting_timer = ecore_timer_add(0.2, _save_email_prog_cb, ug_data);
+}
+
+static Eina_Bool _save_email_prog_cb(void *data)
+{
+ debug_log("");
+
+ EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+
+ int err = 0;
+ debug_log("ug_data->mail_id(%d), priv->mail_id(%d), mail_info->mail_id(%d))", ug_data->mail_id, ug_data->email_data->mail_id, ug_data->email_data->mail_info->mail_id);
+
+ email_mail_data_t *mail_t = NULL;
+ err = email_get_mail_data(ug_data->email_data->mail_id, &mail_t);
+ debug_log("email_get_mail_data - err (%d)", err);
+
+ if (mail_t == NULL) {
+ debug_log("mail_t is NULL");
+ return EINA_FALSE;
+ }
+
+ email_attachment_data_t *attachment_t = NULL;
+ int attachment_count = 0;
+ err = email_get_attachment_data_list(ug_data->email_data->mail_id, &attachment_t, &attachment_count);
+ debug_log("email_get_attachment_data_list - err (%d)", err);
+
+ char file_name[MAX_PATH_LEN] = { 0, };
+ snprintf(file_name, sizeof(file_name), "%s_%d_%d.%s", DIR_DEFAULT_MEDIA_PHONE"/Downloads/Others/email", ug_data->account_id, ug_data->mail_id, "eml");
+ char *output_file_path = g_strdup(file_name);
+ debug_log("output_file_path(%s)", file_name, output_file_path);
+
+ err = email_write_mime_file(mail_t, attachment_t, attachment_count, &output_file_path);
+ debug_log("email_write_mime_file - err(%d)", err);
+
+ g_free(output_file_path);
+
+ if (mail_t) {
+ email_free_mail_data(&(mail_t), 1);
+ mail_t = NULL;
+ }
+
+ if (attachment_t && attachment_count > 0) {
+ email_free_attachment_data(&(attachment_t), attachment_count);
+ attachment_t = NULL;
+ attachment_count = 0;
+ }
+
+ if (ug_data->timeout_popup) {
+ evas_object_del(ug_data->timeout_popup);
+ ug_data->timeout_popup = NULL;
+ }
+
+ if (err != EMAIL_ERROR_NONE) {
+ _create_notify(ug_data, _("IDS_EMAIL_POP_ALERT"),
+ dgettext("sys_string", "IDS_COM_POP_UNABLE_TO_SAVE"), 0,
+ NULL, NULL, NULL, NULL, _popup_response_cb);
+ } else {
+#ifdef _SMALL_NOTI
+ char str[128] = { 0, };
+ snprintf(str, sizeof(str), "%s", N_("Saved in My files"));
+ int ret = status_message_post(str);
+ if (ret)
+ debug_log("status_message_post failed: %d", ret);
+#else
+ _create_notify(ug_data, dgettext("sys_string", "IDS_COM_OPT_INFORMATION"),
+ N_("Saved in My files"), 0,
+ NULL, NULL, NULL, NULL, _popup_response_cb);
+#endif
+ }
+
+ if (ug_data->waiting_timer) {
+ ecore_timer_del(ug_data->waiting_timer);
+ ug_data->waiting_timer = NULL;
+ }
+
+ return EINA_FALSE;
+}
+
static void _ctxpopup_detail_contact_cb(void *data, Evas_Object *obj, void *event_info)
{
debug_log("");
EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
ug_data->m_is_multi_touch = TRUE;
-
if (ug_data->scroller_locked == FALSE) {
ug_data->scroller_locked = TRUE;
debug_log("<<lock scroller>>");
}
EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+ Ewk_Policy_Decision *policy_decision = (Ewk_Policy_Decision *)event_info;
+ Ewk_Policy_Navigation_Type pd_type = ewk_policy_decision_navigation_type_get(policy_decision);
+ debug_log("Ewk_Policy_Navigation_Type:%d", pd_type);
+
+ const char *uri = NULL;
+ uri = ewk_view_uri_get(ug_data->webview);
+ debug_log("ewk_view_uri_get(%s)", uri);
if (ug_data->b_load_finished == EINA_TRUE) {
- Ewk_Policy_Decision *policy_decision = (Ewk_Policy_Decision *)event_info;
ewk_policy_decision_ignore(policy_decision);
debug_log("url:%s", ewk_policy_decision_url_get(policy_decision));
ret = service_destroy(service);
debug_log("service_destroy: %d", ret);
}
+ } else {
+ if (ug_data->timeout_popup) {
+ evas_object_del(ug_data->timeout_popup);
+ ug_data->timeout_popup = NULL;
+ }
+ _create_waiting_popup(ug_data, _("IDS_EMAIL_POP_LOADING_CONTENTS_ING"), "list_process");
+
+ if (pd_type == EWK_POLICY_NAVIGATION_TYPE_LINK_CLICKED) {
+ debug_log("Link click is ignored.");
+ ewk_policy_decision_ignore(policy_decision);
+ return;
+ }
}
}
ug_data->is_main_scroller_scrolling = EINA_TRUE;
}
+static void _mbe_focused_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ debug_log("");
+ Elm_Object_Item *item = elm_multibuttonentry_selected_item_get(obj);
+ elm_multibuttonentry_item_selected_set(item, EINA_FALSE);
+}
+
+static void _mbe_unfocused_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ debug_log("");
+}
+
static void _mbe_added_cb(void *data, Evas_Object *obj, void *event_info)
{
debug_log("");
elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_VIEW_CONTACT"), NULL, _ctxpopup_detail_contact_cb, g_strdup(index));
elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_SEND_EMAIL"), NULL, _ctxpopup_send_email_cb, addrs_info->address);
- elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, addrs_info->address);
+ ug_data->ctx_block_item = elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, addrs_info->address);
_delete_contacts_list(contact_list_item);
} else {
elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_OPT_ADD_TO_CONTACTS"), NULL, _ctxpopup_select_contact_mode_email_cb, addrs_info->address);
elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_SEND_EMAIL"), NULL, _ctxpopup_send_email_cb, addrs_info->address);
- elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, addrs_info->address);
+ ug_data->ctx_block_item = elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, addrs_info->address);
+ }
+
+ int count, i;
+ email_rule_t *rule_list = NULL;
+
+ /* get the rule list from service */
+ if (email_get_rule_list(&rule_list, &count) < 0) {
+ debug_log("email_get_rule_list failed");
+ } else {
+ if (count > 0) {
+ for (i = 0; i < count; i++) {
+ if (rule_list[i].type == EMAIL_FILTER_FROM/*TYPE_BLOCK_ADDRESS*/) {
+ debug_log("block address %s", rule_list[i].value);
+
+ if (g_strcmp0(rule_list[i].value, addrs_info->address) == 0) {
+ debug_log("[%s] already blocked", rule_list[i].value);
+ if (ug_data->ctx_block_item)
+ elm_object_item_disabled_set(ug_data->ctx_block_item, EINA_TRUE);
+ }
+ }
+ }
+ }
+ /* free email rule_list */
+ email_free_rule(&rule_list, count);
}
evas_pointer_canvas_xy_get(ug_data->evas, &x, &y);
+ debug_log("canvas x:%d, y:%d", x, y);
evas_object_move(ug_data->con_popup, x, y);
evas_object_show(ug_data->con_popup);
}
}
if (!info->download_yn) {
- unsigned handle = 0;
+ int handle = 0;
gboolean res = FALSE;
if (ug_data->progress_bar[index + 1] != NULL) {
if (ret == EMAIL_EXT_SAVE_ERR_NONE) {
char str[128] = { 0, };
snprintf(str, sizeof(str), "%s", dgettext("sys_string", "IDS_COM_POP_SAVED"));
- /*_show_select_info(ug_data, str);*/
ret = status_message_post(str);
if (ret)
debug_log("status_message_post failed: %d", ret);
info->attach_id, info->index, info->name, info->path, (gint) info->size, info->download_yn, info->drm, info->inline_content);
if (!info->download_yn) {
- unsigned handle = 0;
+ int handle = 0;
gboolean res = FALSE;
debug_log("Need attachment download");
if (res == EMAIL_EXT_SAVE_ERR_NONE) {
char str[128] = { 0, };
snprintf(str, sizeof(str), "%s", dgettext("sys_string", "IDS_COM_POP_SAVED"));
- /*_show_select_info(ug_data, str);*/
int ret = status_message_post(str);
if (ret)
debug_log("status_message_post failed: %d", ret);
if (info && !info->inline_content) {
if (!info->download_yn) {
if (ug_data->progress_bar_ly[i + 1] == NULL) {
- unsigned handle = 0;
+ int handle = 0;
gboolean res = FALSE;
debug_log("Need attachment [%d] download", i);
char str[128] = { 0, };
snprintf(str, sizeof(str), "%s", dgettext("sys_string", "IDS_COM_BODY_DOWNLOADED"));
- /*_show_select_info(ug_data, str);*/
int ret = status_message_post(str);
if (ret)
debug_log("status_message_post failed: %d", ret);
EmailViewerProp *prop = ug_data->property;
if (val < 0.0) {
- debug_log("val(%f) is MINUS");
+ debug_log("val(%f) is MINUS", val);
return;
}
if (index < 0 || index >= ATTACH_MAX) {
- debug_log("index(%d) is overflowed");
+ debug_log("index(%d) is overflowed", index);
return;
}
return NULL;
}
-static void _gl_sel(void *data, Evas_Object *obj, void *event_info)
-{
- debug_log("");
-
- EmailViewerUGD *ug_data = _g_ug_data;
- email_mailbox_t *mailbox_list = NULL;
- mailbox_list = (email_mailbox_t *) data;
- Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- elm_genlist_item_selected_set(item, EINA_FALSE);
-
- Elm_Object_Item *git = NULL;
- Evas_Object *gl = elm_genlist_add(ug_data->navi_bar);
- evas_object_show(gl);
-
- git = elm_genlist_item_append(gl, &(ug_data->itc3), NULL, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
- elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- elm_genlist_item_append(gl, &ug_data->itc2, NULL, git, ELM_GENLIST_ITEM_NONE, _gl_sub_upper_sel, NULL);
-
- Evas_Object *cbar = elm_toolbar_add(ug_data->navi_bar);
- elm_toolbar_shrink_mode_set(cbar, ELM_TOOLBAR_SHRINK_EXPAND);
- elm_object_style_set(cbar, "naviframe");
- evas_object_show(cbar);
-
- elm_toolbar_item_append(cbar, NULL, _("IDS_EMAIL_SK3_MOVE_HERE"), _move_here_cb, mailbox_list);
- elm_object_item_disabled_set(elm_toolbar_item_append(cbar, NULL, "", NULL, NULL), EINA_TRUE);
-
- Elm_Object_Item *navi_it = NULL;
- navi_it = elm_naviframe_item_push(ug_data->navi_bar, dgettext("sys_string", "IDS_COM_BODY_MOVE"), NULL, NULL, gl, NULL);
- elm_object_item_part_content_set(navi_it, "controlbar", cbar);
- ug_data->navi_move_it2 = navi_it;
-
- Evas_Object *move_back_btn = NULL;
- if (ug_data->isRotate) {
- elm_naviframe_item_title_visible_set(navi_it, EINA_FALSE);
- move_back_btn = elm_object_item_part_content_get(navi_it, "prev_btn");
- if (move_back_btn) {
- evas_object_del(move_back_btn);
- elm_object_item_part_content_set(navi_it, "prev_btn", NULL);
- }
- } else {
- move_back_btn = elm_object_item_part_content_get(navi_it, "prev_btn");
- if (move_back_btn) {
- evas_object_del(move_back_btn);
- move_back_btn = elm_button_add(ug_data->navi_bar);
- elm_object_style_set(move_back_btn, "naviframe/back_btn/default");
- evas_object_smart_callback_add(move_back_btn, "clicked", _move_back_cb2, ug_data);
- elm_object_item_part_content_set(navi_it, "prev_btn", move_back_btn);
- }
- }
- return;
-}
-
-static char *_gl_sub_upper_text_get(void *data, Evas_Object *obj, const char *part)
-{
- debug_log("");
- email_mailbox_t *mailbox_list = NULL;
- mailbox_list = (email_mailbox_t *) data;
-
- if (g_strcmp0(part, "elm.text") == 0) {
- char buf[MAX_STR_LEN] = { 0, };
- snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_MBODY_MAILBOX_LIST"));
- return g_strdup(buf);
- }
-
- return NULL;
-}
-
-static Evas_Object *_gl_sub_upper_icon_get(void *data, Evas_Object *obj, const char *part)
-{
- debug_log("");
-
- if (g_strcmp0(part, "elm.icon") == 0) {
- Evas_Object *icon = elm_icon_add(obj);
- elm_icon_file_set(icon, IMGDIR "/U01_icon_upper_folder_focus.png", NULL);
- evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
-
- return icon;
- }
-
- return NULL;
-}
-
-static void _gl_sub_upper_sel(void *data, Evas_Object *obj, void *event_info)
-{
- debug_log("");
-
- EmailViewerUGD *ug_data = _g_ug_data;
-
- Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- elm_genlist_item_selected_set(item, EINA_FALSE);
-
- ug_data->navi_move_it2 = NULL;
- elm_naviframe_item_pop(ug_data->navi_bar);
-
- return;
-}
-
static void _move_here_cb(void *data, Evas_Object *obj, void *event_info)
{
debug_log("");
_move_email(ug_data, folder_id, FALSE);
ug_data->navi_move_it1 = NULL;
- ug_data->navi_move_it2 = NULL;
elm_naviframe_item_pop_to(ug_data->navi_main_it);
if (ug_data->isRotate == false && ug_data->b_internal) {
elm_naviframe_item_pop(ug_data->navi_bar);
ug_data->navi_move_it1 = NULL;
- ug_data->navi_move_it2 = NULL;
/*if (ug_data->b_internal)
elm_layout_theme_set(ug_data->layout_main, "layout", "controlbar", "default");
elm_layout_theme_set(ug_data->layout_main, "layout", "application", "controlbar");*/
}
-static void _move_back_cb2(void *data, Evas_Object *obj, void *event_info)
-{
- debug_log("");
-
- if (data == NULL || _g_ug_data == NULL) {
- debug_log("data is NULL");
- return;
- }
-
- EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-
- elm_naviframe_item_pop(ug_data->navi_bar);
- ug_data->navi_move_it2 = NULL;
-}
-
/* EOF */