ug_data->bg = elm_bg_add(ug_data->win);
evas_object_size_hint_weight_set(ug_data->bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(ug_data->win, ug_data->bg);
- evas_object_show(ug_data->bg);
+ //evas_object_show(ug_data->bg);
ug_data->ly = elm_layout_add(ug_data->win);
if (ug_data->ly == NULL) {
void mailbox_create_searchbar(EmailMailboxUGD *mailbox_ugd);
void mailbox_finish_search_mode(EmailMailboxUGD *mailbox_ugd);
-void mailbox_request_search_server(EmailMailboxUGD *mailbox_ugd);
-void mailbox_show_search_server_result(EmailMailboxUGD *mailbox_ugd);
-void mailbox_clear_search_server_result(EmailMailboxUGD *mailbox_ugd);
#endif /* __DEF_EMAIL_MAILBOX_SEARCH_H_ */
Evas_Object *sync_progress;
Elm_Object_Item *delete_all_button;
Evas_Object *ctxpopup;
- Evas_Object *motion_popup;
GList *important_list;
Elm_Object_Item *date_tab;
Evas_Object *selectioninfo_layout;
mailbox_ugd->mode == EMAIL_MAILBOX_MODE_MAILBOX ||
mailbox_ugd->b_thread_list == false)
{
+ debug_log("not Thread... previous_view[%d]", mailbox_ugd->previous_view);
int mail_id = ld->mail_id;
mailbox_ugd->selected_list =
g_list_prepend(mailbox_ugd->selected_list, GINT_TO_POINTER(mail_id));
static void _free_list_data(GList *list_data);
static void _handle_last_sending_email(EmailMailboxUGD *mailbox_ugd);
static void _parse_delete_mail_buf(char *inbuf, GList **mail_list);
-static int email_set_group(list_data *ld);
+static int email_set_group(list_data *ld, gboolean server_item);
static void insert_search_tag (char *dest, int dest_len, const char *src, const char *key);
static char *_gl_recipient_group_text_get(void *data, Evas_Object *obj, const char *part);
static void _remaining_finish_cb(void* data, Ecore_Thread *thd);
if (ld->is_attachment == true) {
elm_object_item_signal_emit(ld->item, "elm,state,attach", "elm");
}
- if(ld->priority != EMAIL_MAIL_PRIORITY_NORMAL) {
+ if(ld->priority != EMAIL_OPTION_PRIORITY_NORMAL) {
elm_object_item_signal_emit(ld->item, "elm,state,priority", "elm");
}
if(ld->reply_flag || ld->forward_flag) {
else if(!g_strcmp0(source, "elm.icon.priority"))
{
- if(ld->priority == EMAIL_MAIL_PRIORITY_HIGH) {
+ if(ld->priority == EMAIL_OPTION_PRIORITY_HIGH) {
Evas_Object *ic = elm_icon_add(obj);
elm_icon_file_set(ic, IMGDIR "/M02_email_icon_priority.png", NULL);
elm_icon_resizable_set(ic, 0, 0);
return (void *)ic;
}
#if 0 // support low priority message
- else if(ld->priority == EMAIL_MAIL_PRIORITY_LOW) {
+ else if(ld->priority == EMAIL_OPTION_PRIORITY_LOW) {
if(ld->item)
edje_object_signal_emit((Evas_Object *)elm_genlist_item_object_get(ld->item), "elm,state,priority", "elm");
Evas_Object *ic = elm_icon_add(obj);
#if 0
else if(!g_strcmp0(source, "elm.icon.appointment"))
{
- if(ld->priority == EMAIL_MAIL_PRIORITY_HIGH)
+ if(ld->priority == 1)
{
if(ld->item)
edje_object_signal_emit((Evas_Object *)elm_genlist_item_object_get(ld->item), "elm,state,priority", "elm");
mailbox_ugd->git[view_type][next->group_index],
ELM_GENLIST_ITEM_GROUP,
NULL, NULL);
+ elm_genlist_item_select_mode_set(mailbox_ugd->git[view_type][ld->group_index], ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
/* if there is no next node, this group item is placed at end of list */
else {
NULL,
ELM_GENLIST_ITEM_GROUP,
NULL, NULL);
+ elm_genlist_item_select_mode_set(mailbox_ugd->git[view_type][ld->group_index], ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
if( !mailbox_ugd->git[view_type][ld->group_index] ) {
}
-static int email_set_group(list_data *ld)
+static int email_set_group(list_data *ld, gboolean server_item)
{
int group_index = 0;
EmailMailboxUGD *mailbox_ugd = ld->mailbox_ugd;
#if 1
int type = 0;
- if(mailbox_ugd->view_type == EMAIL_VIEW_SEARCH ||mailbox_ugd->view_type == EMAIL_VIEW_EDIT)
+
+ if(mailbox_ugd->view_type == EMAIL_VIEW_EDIT)
type = mailbox_ugd->previous_view;
else
type = mailbox_ugd->view_type;
switch(mailbox_ugd->view_type)
#endif
{
+
+ case EMAIL_VIEW_SEARCH:
+ if(server_item == true){
+ group_index = 0;
+ ld->group_title = g_strdup(_("IDS_EMAIL_BODY_SERVER"));
+ }
+ else
+ {
+ group_index = 1;
+ ld->group_title = g_strdup(_("IDS_EMAIL_BODY_PHONE"));
+ }
+ ld->group_date = NULL;
+ break;
case EMAIL_VIEW_DATE:
group_index = email_get_group_title_str(ld->absolute_time, &ld->group_title, &ld->group_date);
break;
break;
case EMAIL_VIEW_PRIORITY:
- if(ld->priority == EMAIL_MAIL_PRIORITY_HIGH){
+ if(ld->priority == EMAIL_OPTION_PRIORITY_HIGH){
group_index = 0;
ld->group_title = g_strdup(_("IDS_EMAIL_BODY_HIGH_M_PRIORITY"));
}
- else if(ld->priority == EMAIL_MAIL_PRIORITY_NORMAL)
+ else if(ld->priority == EMAIL_OPTION_PRIORITY_NORMAL)
{
group_index = 1;
ld->group_title = g_strdup(_("IDS_EMAIL_BODY_NORMAL_M_EMAILPRIORITY"));
/* convert datetime format. */
ld->timeordate = email_get_str_datetime(ld->absolute_time);
//ld->group_index = email_get_group_title_str(ld->absolute_time, &ld->group_title, &ld->group_date);
- ld->group_index = email_set_group(ld);
+ ld->group_index = email_set_group(ld, false);
ld->chksel = EINA_FALSE;
debug_log("time %d [%s]", ld->absolute_time, ld->timeordate);
if (mailbox_ugd->view_type == EMAIL_VIEW_SEARCH) {
if (mailbox_ugd->mode == EMAIL_MAILBOX_MODE_ALL) {
- mail_data = _mailbox_get_mail_list_by_mailbox_type(0, mailbox_type, mailbox_ugd->sort_type, EMAIL_GET_MAIL_NORMAL, mailbox_ugd->search_type, search_data, mail_count);
+ mail_data = _mailbox_get_mail_list_by_mailbox_type(0, mailbox_type, EMAIL_SORT_DATE_RECENT, EMAIL_GET_MAIL_NORMAL, mailbox_ugd->search_type, search_data, mail_count);
} else {
- mail_data = _mailbox_get_mail_list_by_mailbox_id(mailbox_ugd->account_id, mailbox_ugd->mailbox_id, mailbox_ugd->sort_type, EMAIL_GET_MAIL_NORMAL, mailbox_ugd->search_type, search_data, mail_count);
+ mail_data = _mailbox_get_mail_list_by_mailbox_id(mailbox_ugd->account_id, mailbox_ugd->mailbox_id, EMAIL_SORT_DATE_RECENT, EMAIL_GET_MAIL_NORMAL, mailbox_ugd->search_type, search_data, mail_count);
}
} else {
if (mailbox_ugd->mode == EMAIL_MAILBOX_MODE_ALL) {
mailbox_ugd->list_data[mailbox_ugd->view_type] =
g_list_insert_sorted(mailbox_ugd->list_data[mailbox_ugd->view_type], ld, _compare_sort_rule_by_viewtype);
- if (mailbox_ugd->view_type == EMAIL_VIEW_RECIPIENT || (mailbox_ugd->view_type == EMAIL_VIEW_SEARCH && mailbox_ugd->previous_view == EMAIL_VIEW_RECIPIENT))
+ if (mailbox_ugd->view_type == EMAIL_VIEW_RECIPIENT)
{
_insert_mail_to_recipient_mailist(mailbox_ugd, ld);
}
NULL,
ELM_GENLIST_ITEM_GROUP,
NULL, NULL);
+ elm_genlist_item_select_mode_set(sender_group, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
alias = g_strdup(ld->alias);
}
NULL,
ELM_GENLIST_ITEM_GROUP,
NULL, NULL);
+ elm_genlist_item_select_mode_set(sender_group, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
alias = g_strdup(ld->alias);
// insert normal item
ld->item = elm_genlist_item_append(mailbox_ugd->gl[mailbox_ugd->view_type],
static void add_seed_mail_cb(void *data, Ecore_Thread *thd, void* msg_data);
static gint _find_insert_position(gconstpointer a, gconstpointer b);
static gint _find_next_group_position(gconstpointer a, gconstpointer b);
+static void _parse_set_flag_buf(char *inbuf, char **field_name, GList **mail_list);
static gint _find_next_group_position(gconstpointer a, gconstpointer b)
if(ld) {
email_mail_list_item_t* mail_info = NULL;
mail_info = get_mail_info(mailid);
- if(!mail_info) break;
- ld->is_attachment = mail_info->attachment_count;
- ld->preview_body = STRNDUP(mail_info->preview_text, MAX_PREVIEW_TEXT_LENGTH - 1);
- elm_genlist_item_update(ld->item);
+ if(!mail_info) break;
+ ld->is_attachment = mail_info->attachment_count;
+ if (ld->preview_body)
+ FREE(ld->preview_body);
+ ld->preview_body = STRNDUP(mail_info->preview_text, MAX_PREVIEW_TEXT_LENGTH - 1);
+ elm_genlist_item_update(ld->item);
FREE(mail_info);
}
} else if(type == UPDATE_EXTRA_FLAG) {
}
}
break;
+ case NOTI_MAIL_FIELD_UPDATE:
+ account_id = data1;
+ int update_type = data2;
+ int value = data4;
+ char *field_name = NULL; //Use data2 param instead of field_name
+ GList *mail_list = NULL;
+ GList* cur = NULL;
+ int *idx = NULL;
+
+ _parse_set_flag_buf(data3, &field_name, &mail_list);
+ debug_log("update_type : %d, value : %d size of mail_list : %d", update_type, value, g_list_length(mail_list));
+
+ switch (update_type)
+ {
+ case EMAIL_MAIL_ATTRIBUTE_FLAGS_SEEN_FIELD:
+ G_LIST_FOREACH(mail_list, cur, idx) {
+ debug_log("idx: [%d]", *idx);
+ list_data *ld = _find_mailinfo_by_mailid(*idx, mailbox_ugd->list_data[view_type]);
+ if(ld) {
+ ld->is_seen = value;
+ elm_genlist_item_update(ld->item);
+ }
+ }
+ break;
+ case EMAIL_MAIL_ATTRIBUTE_FLAGS_FLAGGED_FIELD:
+ G_LIST_FOREACH(mail_list, cur, idx) {
+ debug_log("idx: [%d]", *idx);
+ list_data *ld = _find_mailinfo_by_mailid(*idx, mailbox_ugd->list_data[view_type]);
+ if(ld) {
+ ld->followup_flag = value;
+ ld->imp_sel = value;
+ elm_genlist_item_update(ld->item);
+ }
+ }
+ break;
+ case EMAIL_MAIL_ATTRIBUTE_FLAGS_ANSWERED_FIELD:
+ G_LIST_FOREACH(mail_list, cur, idx) {
+ debug_log("idx: [%d]", *idx);
+ list_data *ld = _find_mailinfo_by_mailid(*idx, mailbox_ugd->list_data[view_type]);
+ if(ld) {
+ ld->reply_flag = value;
+ elm_genlist_item_update(ld->item);
+ }
+ }
+ break;
+ case EMAIL_MAIL_ATTRIBUTE_FLAGS_FORWARDED_FIELD:
+ G_LIST_FOREACH(mail_list, cur, idx) {
+ debug_log("idx: [%d]", *idx);
+ list_data *ld = _find_mailinfo_by_mailid(*idx, mailbox_ugd->list_data[view_type]);
+ if(ld) {
+ ld->forward_flag = value;
+ elm_genlist_item_update(ld->item);
+ }
+ }
+ break;
+ }
+ if(mail_list) {
+ G_LIST_FOREACH(mail_list, cur, idx) {
+ FREE(idx);
+ }
+ g_list_free(mail_list);
+ }
+ FREE(field_name);
+ break;
default:
debug_log("Uninterested notification");
}
debug_leave();
}
+static void _parse_set_flag_buf(char *inbuf, char **field_name, GList **mail_list)
+{
+ debug_enter();
+ if(!STR_VALID(inbuf)) {
+ return;
+ }
+ debug_log("inbuf = %s", inbuf);
+
+ /* notification format: <field_name><0x01><<mail_id><,><mail_id>>*/
+ gchar **outer_tok;
+ char delimiter[2] ={0x01, 0x00};
+ outer_tok = g_strsplit_set(inbuf, delimiter, -1);
+ if (outer_tok == NULL) {
+ debug_log("outer_tok == NULL");
+ return;
+ }
+ if (outer_tok[0] && strlen(outer_tok[0]) > 0)
+ *field_name = strdup(outer_tok[0]);
+ if(outer_tok[1] && strlen(outer_tok[1]) >0) {
+ gchar **inner_tok;
+ int i = 0;
+ inner_tok = g_strsplit_set(outer_tok[1], ",", -1);
+ if(g_strv_length(inner_tok) == 1) { // only one mail_id exists without ","
+ debug_log("outer_tok[1] : %s", outer_tok[1]);
+ int *mail_id = (int *)calloc(1, sizeof(int));
+ *mail_id = atoi(outer_tok[1]);
+ *mail_list = g_list_append(*mail_list, mail_id);
+ } else {
+ for(i = 0; i < g_strv_length(inner_tok) - 1; ++i) {
+ debug_log("%s", inner_tok[i]);
+ if(!strcmp(inner_tok[i], "\"")) /* skip the empty token */
+ continue;
+ else {
+ int *mail_id = (int *)calloc(1, sizeof(int));
+ *mail_id = atoi(inner_tok[i]);
+ *mail_list = g_list_append(*mail_list, mail_id);
+ }
+ }
+ }
+ g_strfreev(inner_tok);
+ }
+ g_strfreev(outer_tok);
+
+}
}
}
- else if (g_strcmp0(msg_type, EMAIL_BUNDLE_VAL_UNREAD) == 0) {
- list_data *ld = (list_data *)elm_object_item_data_get(g_selected_item);
- if(ld)
- {
- ld->is_seen = false;
- elm_genlist_item_update(g_selected_item);
- }
- }
- else if (g_strcmp0(msg_type, EMAIL_BUNDLE_VAL_READ) == 0) {
- list_data *ld = (list_data *)elm_object_item_data_get(g_selected_item);
- if(ld)
- {
- ld->is_seen = true;
- elm_genlist_item_update(g_selected_item);
- }
- }
g_free(msg_type);
g_free(c_do_delete);
}
}
}
- group { name: "email/popup_smartstay1_internal";
- parts {
- part { name: "elm.swallow.content1";
- type: SWALLOW;
- scale : 1;
- description { state: "default" 0.0;
- align: 0.0 0.0;
- rel2.relative: 1.0 0.0;
- }
- }
- part { name: "elm.content.bg";
- type: RECT;
- scale : 1;
- description { state: "default" 0.0;
- min: 0 443;
- visible: 0;
- align: 0.0 0.0;
- rel1 {
- relative: 0.0 1.0;
- to: "elm.swallow.content1";
- }
- rel2.to: "elm.swallow.content1";
- }
- }
- part { name: "elm.swallow.content2";
- type: SWALLOW;
- scale : 1;
- description { state: "default" 0.0;
- min: 390 390;
- max: 390 390;
- fixed: 1 1;
- aspect: 1.0 1.0;
- aspect_preference: VERTICAL;
- rel1.to: "elm.content.bg";
- rel2.to: "elm.content.bg";
- }
- }
- part { name: "elm.swallow.content3";
- type: SWALLOW;
- scale : 1;
- description { state: "default" 0.0;
- align: 0.0 1.0;
- rel1 {
- relative: 0.0 1.0;
- to: "elm.content.bg";
- }
- }
- }
- }
- }
- group { name: "email/popup_smartstay1";
- parts {
- part { name: "pad_t";
- scale: 1;
- mouse_events: 0;
- repeat_events: 1;
- description { state: "default" 0.0;
- align: 0.5 0.0;
- min: 0 5;
- fixed: 0 1;
- rel1 {
- relative: 1.0 0.0;to_x: "pad_l";
- }
- rel2 {
- relative: 0.0 0.0;to_x: "pad_r";
- }
- }
- }
- part { name: "pad_l";
- scale: 1;
- description { state: "default" 0.0;
- min : 32 0;
- fixed: 1 0;
- rel1 {
- relative: 0.0 0.0;
- }
- rel2 {
- relative: 0.0 1.0;
- }
- align: 0.0 0.0;
- }
- }
- part { name: "pad_r";
- scale: 1;
- description { state: "default" 0.0;
- min : 32 0;
- fixed: 1 0;
- rel1 {
- relative: 1.0 0.0;
- }
- rel2 {
- relative: 1.0 1.0;
- }
- align: 1.0 0.0;
- }
- }
- part { name:"elm.swallow.layout";
- type: SWALLOW;
- scale : 1;
- mouse_events: 1;
- repeat_events: 1;
- description { state: "default" 0.0;
- min: 0 600;
- align: 0.5 1.0;
- fixed: 1 0;
- rel1 {
- relative: 0.0 1.0;
- to: "pad_t";
- }
- rel2 {
- relative: 1.0 0.0;
- to: "pad_b";
- }
- }
- }
- part { name: "pad_b";
- scale : 1;
- mouse_events: 0;
- type: RECT;
- description { state: "default" 0.0;
- align: 0.5 1.0;
- min: 0 66;
- visible: 0;
- fixed: 0 1;
- rel1 {
- relative: 1.0 1.0;to_x: "pad_l";
- }
- rel2 {
- relative: 0.0 1.0;to_x: "pad_r";
- }
- }
- }
- part { name: "elm.swallow.check";
- type: SWALLOW;
- scale : 1;
- mouse_events: 1;
- repeat_events: 1;
- description { state: "default" 0.0;
- align: 0.0 0.5;
- min: 42 42;
- max: 42 42;
- fixed: 1 1;
- rel1 {
- relative: 0.0 0.0;
- to: "pad_b";
- }
- rel2 {
- relative: 0.0 1.0;
- to: "pad_b";
- }
- }
- }
- part { name: "elm.text";
- type: TEXT;
- scale : 1;
- description { state: "default" 0.0;
- text {
- font: "SLP:style=Medium";
- size: 38;
- min: 0 0;
- align: 0.0 0.5;
- }
- color: 0 0 0 255;
- align: 0.0 0.5;
- rel1 {
- relative: 1.0 0.0;
- to_x:"elm.swallow.check"; to_y: "pad_b";
- }
- rel2 {
- relative: 1.0 1.0;
- to: "pad_b";
- }
- }
- }
- }
- }
}