ug_data->update_button = elm_button_add(ug_data->navi_bar);
elm_object_style_set(ug_data->update_button, "naviframe/title/default");
Evas_Object *update_icon = elm_icon_add(ug_data->update_button);
- elm_icon_file_set(update_icon, CONTROLBAR_ICON_UPDATE, NULL);
- elm_icon_resizable_set(update_icon, 1, 1);
+ elm_image_file_set(update_icon, CONTROLBAR_ICON_UPDATE, NULL);
+ elm_image_resizable_set(update_icon, 1, 1);
evas_object_image_smooth_scale_set(update_icon, 0);
elm_object_content_set(ug_data->update_button, update_icon);
evas_object_smart_callback_add(ug_data->update_button, "clicked", _update_all_account_cb, ug_data);
ug_data->update_button = elm_button_add(ug_data->navi_bar);
elm_object_style_set(ug_data->update_button, "naviframe/title_icon");
Evas_Object *update_icon = elm_icon_add(ug_data->update_button);
- elm_icon_file_set(update_icon, CONTROLBAR_ICON_UPDATE, NULL);
- elm_icon_resizable_set(update_icon, 1, 1);
+ elm_image_file_set(update_icon, CONTROLBAR_ICON_UPDATE, NULL);
+ elm_image_resizable_set(update_icon, 1, 1);
evas_object_image_smooth_scale_set(update_icon, 0);
elm_object_content_set(ug_data->update_button, update_icon);
evas_object_smart_callback_add(ug_data->update_button, "clicked", _update_all_account_cb, ug_data);
// 2line title text
elm_object_part_text_set(ug_data->navi_title_ly, "txt_title", _("IDS_EMAIL_HEADER_FOLDERS"));
if (ug_data->account_id == 0) {
- elm_icon_file_set(ug_data->sp_icon, NULL, NULL);
+ elm_image_file_set(ug_data->sp_icon, NULL, NULL);
elm_object_part_text_set(ug_data->navi_title_ly, "txt_sub", _("IDS_EMAIL_HEADER_ALL_ACCOUNTS"));
}
else{
email_account_t *account;
email_get_account(ug_data->account_id, WITHOUT_OPTION, &account);
- elm_icon_file_set(ug_data->sp_icon, account->logo_icon_path, NULL);
+ elm_image_file_set(ug_data->sp_icon, account->logo_icon_path, NULL);
elm_object_part_text_set(ug_data->navi_title_ly, "txt_sub", account->account_name);
if (!strcmp(part, "elm.icon") || !strcmp(part, "elm.icon.1"))
{
Evas_Object *icon = elm_icon_add(obj);
- elm_icon_file_set(icon, FOLDER_ICON_PLUS_FOLDER_LIST, NULL);
+ elm_image_file_set(icon, FOLDER_ICON_PLUS_FOLDER_LIST, NULL);
evas_object_smart_callback_add(icon, "clicked", _folder_icon_clicked_cb, data);
evas_object_propagate_events_set(icon, EINA_FALSE);
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
if (!strcmp(part, "elm.icon") || !strcmp(part, "elm.icon.1"))
{
Evas_Object *icon = elm_icon_add(obj);
- elm_icon_file_set(icon, FOLDER_ICON_FOLDER_LIST, NULL);
+ elm_image_file_set(icon, FOLDER_ICON_FOLDER_LIST, NULL);
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
return icon;
{
Evas_Object *icon = elm_icon_add(obj);
- elm_icon_file_set(icon, alist->account_info->logo_icon_path, NULL);
+ elm_image_file_set(icon, alist->account_info->logo_icon_path, NULL);
debug_log("logo_icon_path:%s", alist->account_info->logo_icon_path);
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_genlist_item_expanded_set(item_data->it, !expanded);
if (expanded) {
- elm_icon_file_set(obj, FOLDER_ICON_PLUS_FOLDER_LIST, NULL);
+ elm_image_file_set(obj, FOLDER_ICON_PLUS_FOLDER_LIST, NULL);
} else {
- elm_icon_file_set(obj, FOLDER_ICON_MINUS_FOLDER_LIST, NULL);
+ elm_image_file_set(obj, FOLDER_ICON_MINUS_FOLDER_LIST, NULL);
}
}
if (!strcmp(part, "elm.icon"))
{
Evas_Object *icon = elm_icon_add(obj);
- elm_icon_file_set(icon, ACCOUNT_ICON_ALLACCOUNT, NULL);
+ elm_image_file_set(icon, ACCOUNT_ICON_ALLACCOUNT, NULL);
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
return icon;
}
if (!strcmp(part, "elm.icon"))
{
Evas_Object *icon = elm_icon_add(obj);
- elm_icon_file_set(icon, ACCOUNT_ICON_ADDACCOUNT, NULL);
+ elm_image_file_set(icon, ACCOUNT_ICON_ADDACCOUNT, NULL);
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
return icon;
}
{
Evas_Object *icon = elm_icon_add(obj);
- elm_icon_file_set(icon, alist->account_info->logo_icon_path, NULL);
+ elm_image_file_set(icon, alist->account_info->logo_icon_path, NULL);
debug_log("logo_icon_path:%s", alist->account_info->logo_icon_path);
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
err = email_get_account_list(&_account, &count);
if (err != EMAIL_ERROR_NONE) {
debug_critical("fail to get account list - err(%d)", err);
+ email_free_account(&_account, 1);
return FALSE;
}
COMPOSER_ERROR_TYPE_E eComposerErrorType;
- Eina_List *listOfImageUrls;
+ int inline_cnt;
+ Eina_List *attachment_inline_item_list;
Eina_Bool b_load_finished;
Eina_Bool need_download;
int total_size = 0;
if (EINA_TRUE == ugd->has_body_html) {
- debug_log("listOfImageUrls count : %d", eina_list_count(ugd->listOfImageUrls));
- if (eina_list_count(ugd->listOfImageUrls) > 0) {
+ debug_log("attachment_inline_item_list count : %d", eina_list_count(ugd->attachment_inline_item_list));
+ if (eina_list_count(ugd->attachment_inline_item_list) > 0) {
- Eina_List *list = ugd->listOfImageUrls;
+ Eina_List *list = ugd->attachment_inline_item_list;
Eina_List *l = NULL;
- char *recv = NULL;
+ email_attachment_data_t *attachment_data = NULL;
Eina_List *inline_list = NULL;
- EINA_LIST_FOREACH(list, l, recv) {
- if (strncmp(recv, "file://", 7) == 0) {
- debug_log("Inline image : %s", recv + 7);
- inline_list = eina_list_append(inline_list, recv + 7);
+ EINA_LIST_FOREACH(list, l, attachment_data) {
+ if (attachment_data != NULL) {
+ if (attachment_data->attachment_path != NULL) {
+ debug_log("Inline image : %s", attachment_data->attachment_path);
+ inline_list = eina_list_append(inline_list, attachment_data->attachment_path);
+ }
}
}
if (eina_list_count(inline_list) > 0 && (inline_list != NULL)) {
debug_log("file path : %s", filePath);
- if (strncmp(type, ATTACHMENT_MEDIA_IMAGE, 5) == 0 || strncmp(type, ATTACHMENT_MEDIA_VIDEO, 5) == 0) {
+ if (strncmp(type, ATTACHMENT_MEDIA_IMAGE, 5) == 0) {
+ strncpy(thumb_path, filePath, MAX_ATTACHMENT_FILE_LEN);
+ } else if (strncmp(type, ATTACHMENT_MEDIA_VIDEO, 5) == 0) {
int err = _composer_attachment_make_ethumb(filePath, thumb_path);
if (err != COMPOSER_ERROR_NONE)
free(type);
type = NULL;
}
-
if (temp) {
free(temp);
temp = NULL;
int _composer_attachment_make_ethumb(const char *source, char *target)
{
- debug_log("");
-
- debug_log("file path: %s", source);
- efreet_mime_init();
- char *type = (char *)efreet_mime_type_get(ecore_file_file_get(source));
- char *mime_type = g_strdup(type);
- debug_log("mime type: %s", mime_type);
- efreet_mime_shutdown();
-
- if (mime_type) {
- if (strncmp(mime_type, "image", 5) == 0) {
- strncpy(target, source, MAX_ATTACHMENT_FILE_LEN);
- } else if (strncmp(mime_type, "video", 5) == 0) {
- metadata_extractor_h metadata = NULL;
- int ret = METADATA_EXTRACTOR_ERROR_NONE;
- char *video_width = NULL;
- char *video_height = NULL;
- char *video_track_cnt = NULL;
- void *video_thumbnail = NULL;
- int video_thumbnail_len = 0;
- int video_w = 0;
- int video_h = 0;
-
- ret = metadata_extractor_create(&metadata);
- debug_log("metadata_extractor_create: %d", ret);
- if (!metadata) {
- debug_log("metadata extractor create failed");
- return COMPOSER_ERROR_ETHUMB_FAIL;
- }
-
- ret = metadata_extractor_set_path(metadata, source);
- debug_log("metadata_extractor_set_path: %d", ret);
-
- ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_WIDTH, &video_width);
- debug_log("metadata_extractor_get_metadata: %d [video_width:%s]", ret, video_width);
- ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_HEIGHT, &video_height);
- debug_log("metadata_extractor_get_metadata: %d [video_height:%s]", ret, video_height);
- ret = metadata_extractor_get_metadata(metadata, METADATA_HAS_VIDEO, &video_track_cnt);
- debug_log("metadata_extractor_get_metadata: %d [video_track_cnt:%s]", ret, video_track_cnt);
-
- ret = metadata_extractor_get_frame(metadata, &video_thumbnail, &video_thumbnail_len);
- debug_log("metadata_extractor_get_frame: %d (video_thumbnail_len:%d)", ret, video_thumbnail_len);
-
- if (video_thumbnail) {
- int mm_ret = 0;
- char filename[MAX_ATTACHMENT_FILE_LEN] = { 0, };
- char *file_name = NULL;
- char *file_ext = NULL;
-
- email_parse_get_filename_n_ext_from_path(source, &file_name, &file_ext);
- snprintf(filename, sizeof(filename), "%s%s%s%s", EMAIL_TMP_FOLDER"/", file_name, file_ext, ".jpg");
- g_free(file_name);
- g_free(file_ext);
-
- if (video_width)
- video_w = atoi(video_width);
- if (video_height)
- video_h = atoi(video_height);
- mm_ret = image_util_encode_jpeg(video_thumbnail,
- video_w, video_h,
- IMAGE_UTIL_COLORSPACE_RGB888, 70, filename);
-
- if (ecore_file_exists(filename)) {
- strncpy(target, filename, MAX_ATTACHMENT_FILE_LEN);
- debug_log("file : %s, thumb_path : %s", source, target);
- }
- g_free(video_thumbnail);
- }
-
- if (video_width)
- g_free(video_width);
- if (video_height)
- g_free(video_height);
- if (video_track_cnt)
- g_free(video_track_cnt);
+ debug_enter();
+
+ metadata_extractor_h metadata = NULL;
+ int ret = METADATA_EXTRACTOR_ERROR_NONE;
+ char *video_width = NULL;
+ char *video_height = NULL;
+ char *video_track_cnt = NULL;
+ void *video_thumbnail = NULL;
+ int video_thumbnail_len = 0;
+ int video_w = 0;
+ int video_h = 0;
+
+ ret = metadata_extractor_create(&metadata);
+ debug_log("metadata_extractor_create: %d", ret);
+ if (!metadata) {
+ debug_log("metadata extractor create failed");
+ return COMPOSER_ERROR_ETHUMB_FAIL;
+ }
- ret = metadata_extractor_destroy(metadata);
- debug_log("metadata_extractor_destroy: %d", ret);
+ ret = metadata_extractor_set_path(metadata, source);
+ debug_log("metadata_extractor_set_path: %d", ret);
+
+ ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_WIDTH, &video_width);
+ debug_log("metadata_extractor_get_metadata: %d [video_width:%s]", ret, video_width);
+ ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_HEIGHT, &video_height);
+ debug_log("metadata_extractor_get_metadata: %d [video_height:%s]", ret, video_height);
+ ret = metadata_extractor_get_metadata(metadata, METADATA_HAS_VIDEO, &video_track_cnt);
+ debug_log("metadata_extractor_get_metadata: %d [video_track_cnt:%s]", ret, video_track_cnt);
+
+ ret = metadata_extractor_get_frame(metadata, &video_thumbnail, &video_thumbnail_len);
+ debug_log("metadata_extractor_get_frame: %d (video_thumbnail_len:%d)", ret, video_thumbnail_len);
+
+ if (video_thumbnail) {
+ int mm_ret = 0;
+ char filename[MAX_ATTACHMENT_FILE_LEN] = { 0, };
+ char *file_name = NULL;
+ char *file_ext = NULL;
+
+ email_parse_get_filename_n_ext_from_path(source, &file_name, &file_ext);
+ snprintf(filename, sizeof(filename), "%s%s%s%s", EMAIL_TMP_FOLDER"/", file_name, file_ext, ".jpg");
+ g_free(file_name);
+ g_free(file_ext);
+
+ if (video_width)
+ video_w = atoi(video_width);
+ if (video_height)
+ video_h = atoi(video_height);
+ mm_ret = image_util_encode_jpeg(video_thumbnail,
+ video_w, video_h,
+ IMAGE_UTIL_COLORSPACE_RGB888, 70, filename);
+
+ if (ecore_file_exists(filename)) {
+ strncpy(target, filename, MAX_ATTACHMENT_FILE_LEN);
+ debug_log("file : %s, thumb_path : %s", source, target);
}
+ g_free(video_thumbnail);
}
- g_free(mime_type);
+ if (video_width)
+ g_free(video_width);
+ if (video_height)
+ g_free(video_height);
+ if (video_track_cnt)
+ g_free(video_track_cnt);
+
+ ret = metadata_extractor_destroy(metadata);
+ debug_log("metadata_extractor_destroy: %d", ret);
return COMPOSER_ERROR_NONE;
}
EmailComposerUGD *ugd = (EmailComposerUGD *)data;
if (obj == ugd->subject_entry) {
- _composer_check_entry_max(ugd, ugd->subject_entry, MAX_SUBJECT_LEN);
+ _composer_check_entry_max(ugd, ugd->subject_entry, MAX_SUBJECT_LEN + 1);
if (_composer_check_recipient_is_empty(ugd)) {
if (!ugd->bSendBtnDisabled) {
char *list = NULL;
EmailComposerUGD *ugd = (EmailComposerUGD *) data;
- if (ugd->listOfImageUrls) {
- eina_list_free(ugd->listOfImageUrls);
- ugd->listOfImageUrls = NULL;
+ if (ugd->attachment_inline_item_list) {
+ eina_list_free(ugd->attachment_inline_item_list);
+ ugd->attachment_inline_item_list = NULL;
}
if (result != NULL) {
- debug_log("listOFImageUrls => %s", result);
+ debug_log("attachment_inline_item_list => %s", result);
list = g_strdup(result);
-
- char *token = strtok(list, ",");
- while (token != NULL) {
- if (token) {
- ugd->listOfImageUrls = eina_list_append(ugd->listOfImageUrls, token);
- token = strtok(NULL, ",");
+ char *url = strtok(list, ",");
+ while (url != NULL) {
+ if (url) {
+ if (strncmp(url, "file://", 7) == 0) { /* add only local images(file://), not web images(http://) */
+ int return_stat;
+ gchar **tokens;
+ struct stat file_info;
+ debug_log("image = %s", url + 7);
+
+ if ((return_stat = stat(url + 7, &file_info)) == -1) {
+ debug_error("stat Error(%d): %s", return_stat, strerror(return_stat));
+ break;
+ }
+
+ tokens = g_strsplit(url + 7, "/", -1);
+
+ email_attachment_data_t *attachment_data = (email_attachment_data_t *)calloc(1, sizeof(email_attachment_data_t));
+ attachment_data->account_id = ugd->account_info->account_id;
+ attachment_data->attachment_id = 0;
+ attachment_data->attachment_name = COMPOSER_STRDUP(tokens[g_strv_length(tokens) - 1]);
+ attachment_data->attachment_path = COMPOSER_STRDUP(url + 7);
+ attachment_data->attachment_size = file_info.st_size;
+ attachment_data->drm_status = 0;
+ attachment_data->inline_content_status = 1;
+ attachment_data->mailbox_id = NULL;
+ attachment_data->mail_id = 0;
+ attachment_data->save_status = 1;
+ attachment_data->attachment_mime_type = NULL;
+ debug_log("attachment_name = %s, attachment_path = %s", attachment_data->attachment_name, attachment_data->attachment_path);
+ ugd->attachment_inline_item_list = eina_list_append(ugd->attachment_inline_item_list, attachment_data);
+ g_strfreev(tokens);
+ }
+ url = strtok(NULL, ",");
}
}
}
+
+ ugd->inline_cnt = eina_list_count(ugd->attachment_inline_item_list);
+ debug_log("ugd->inline_cnt : %d", ugd->inline_cnt);
+
+ if (list) {
+ free(list);
+ list = NULL;
+ }
}
else
elm_object_signal_emit(data, "elm,state,eraser,show", "elm");
}
+
+ if (!elm_entry_is_empty(obj))
+ elm_object_signal_emit(data, "elm,state,guidetext,hide", "elm");
}
static void _focused_cb(void *data, Evas_Object *obj, void *event_info) // Focused callback will show X marked button and hide guidetext.
debug_log("COMPOSER_JS_GET_ORIGINAL_HTML_CONTENT failed.");
if (ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_LATEST_INFO_CONTENT, _composer_set_original_info_content_cb, (void *)ugd) == EINA_FALSE)
debug_log("COMPOSER_JS_GET_ORIGINAL_INFO_CONTENT failed.");
+ if (EINA_FALSE == ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_IMAGE_LIST, _composer_get_image_list_cb, (void *)ugd)) {
+ debug_log("COMPOSER_JS_GET_IMAGE_LIST error.");
+ }
}
void _composer_webkit_loadFinished_cb(void *data, Evas_Object *obj, void *event_info)
ugd->selected_entry = ugd->body_ewkview;
evas_object_focus_set(ugd->body_ewkview, EINA_TRUE);
- ugd->focus_status = COMPOSER_FOCUS_STATUS_NONE; // focus handling when rte is clicked
+ ugd->focus_status = COMPOSER_FOCUS_STATUS_NONE;
_composer_attachment_contract_items(ugd);
elm_layout_sizing_eval(ugd->c_layout);
debug_log("\nhtml_content:\n%s", html_content);
-
- if (ugd->listOfImageUrls == NULL) {
+ if (ugd->attachment_inline_item_list == NULL) {
debug_log("No images found or ERROR");
html_content_processed = html_content;
} else {
-
- Eina_List *l = NULL;
- char *recv = NULL;
- Eina_List *inline_list = NULL;
-
- EINA_LIST_FOREACH(ugd->listOfImageUrls, l, recv) {
- debug_log("images_list: %s", recv);
- if (strncmp(recv, "file://", 7) == 0) { /* add only local images(file://), not web images(http://) */
- debug_log("image = %s", recv + 7);
- inline_list = eina_list_append(inline_list, recv + 7);
- }
- }
- if (inline_list != NULL) {
- if (!email_composer_change_image_paths_to_relative(html_content, &html_content_processed)) {
- debug_log("email_composer_change_image_paths_to_relative Failed");
- g_free(html_content);
- html_content = NULL;
- return COMPOSER_ERROR_MAKE_MAIL_FAIL;
- }
- debug_log("\nhtml_source_processed:\n%s", html_content_processed);
-
- _composer_attachment_create_list(ugd, inline_list, EINA_TRUE);
-
+ if (!email_composer_change_image_paths_to_relative(html_content, &html_content_processed)) {
+ debug_log("email_composer_change_image_paths_to_relative Failed");
g_free(html_content);
html_content = NULL;
- } else {
- html_content_processed = html_content;
+ return COMPOSER_ERROR_MAKE_MAIL_FAIL;
}
+ debug_log("\nhtml_source_processed:\n%s", html_content_processed);
+
+ g_free(html_content);
+ html_content = NULL;
}
if (EINA_FALSE == email_composer_save_file(ugd->saved_html_path, html_content_processed, strlen(html_content_processed))) {
int nAttachmentObjListCount = eina_list_count(ugd->attachment_item_obj_list);
debug_log("nAttachmentObjListCount : %d", nAttachmentObjListCount);
- if (nAttachmentObjListCount > 0) {
+ if ((nAttachmentObjListCount > 0) || (ugd->inline_cnt > 0)) {
if (ugd->new_mail_info->attachment_list) {
email_free_attachment_data(&ugd->new_mail_info->attachment_list, ugd->new_mail_info->mail_data->attachment_count);
}
}
}
+
+ it = eina_list_iterator_new(ugd->attachment_inline_item_list);
+
+ ugd->new_mail_info->mail_data->attachment_count += ugd->inline_cnt;
+
+ while (eina_iterator_next(it, (void **)&attachment_data)) {
+ if (attachment_data) {
+ if (attachment_data->save_status == 1) {
+ ugd->new_mail_info->attachment_list[nCount].inline_content_status = attachment_data->inline_content_status;
+ ugd->new_mail_info->attachment_list[nCount].attachment_id = attachment_data->attachment_id;
+ ugd->new_mail_info->attachment_list[nCount].attachment_size = attachment_data->attachment_size;
+ ugd->new_mail_info->attachment_list[nCount].save_status = attachment_data->save_status;
+ ugd->new_mail_info->attachment_list[nCount].attachment_name = COMPOSER_STRDUP(attachment_data->attachment_name);
+ ugd->new_mail_info->attachment_list[nCount].attachment_path = COMPOSER_STRDUP(attachment_data->attachment_path);
+
+ debug_log("attachment_name : %s", ugd->new_mail_info->attachment_list[nCount].attachment_name);
+ debug_log("attachment_path : %s", ugd->new_mail_info->attachment_list[nCount].attachment_path);
+ debug_log("attachment_id : %d", ugd->new_mail_info->attachment_list[nCount].attachment_id);
+ debug_log("attachment_size : %d", ugd->new_mail_info->attachment_list[nCount].attachment_size);
+ debug_log("save_status : %d", ugd->new_mail_info->attachment_list[nCount].save_status);
+ debug_log("inline_content_status : %d", ugd->new_mail_info->attachment_list[nCount].inline_content_status);
+
+ nCount++;
+ }
+ }
+ }
}
ugd->new_mail_info->mail_data->flags_draft_field = 1;
if (i >= MAX_ATTACHMENT_ITEM)
break;
- EMAIL_ATTACHMENT_INFO_S *attachment_info = (EMAIL_ATTACHMENT_INFO_S *) calloc(1, sizeof(EMAIL_ATTACHMENT_INFO_S));
+ EMAIL_ATTACHMENT_INFO_S *attachment_info = (EMAIL_ATTACHMENT_INFO_S *)calloc(1, sizeof(EMAIL_ATTACHMENT_INFO_S));
email_attachment_data_t *attachment_data = (email_attachment_data_t *)calloc(1, sizeof(email_attachment_data_t));
if (attachment_info) {
nTotalAttachmentSize = nTotalAttachmentSize + attachment_data->attachment_size;
}
- if (fwd_attachment_data_list[i].save_status && fwd_attachment_data_list[i].inline_content_status == EINA_FALSE)
+ if (fwd_attachment_data_list[i].inline_content_status == EINA_FALSE)
/* No need to add Inline images. They are added in _composer_attachment_create_list API. Line no:160. */
{
debug_log("fwd_attachment_data_list[%d] = %x", i, &fwd_attachment_data_list[i]);
} else {
attachment_data->attachment_name = COMPOSER_STRDUP(fwd_attachment_data_list[i].attachment_name);
attachment_data->attachment_path = COMPOSER_STRDUP(fwd_attachment_data_list[i].attachment_path);
- attachment_data->save_status = 1;
+ attachment_data->save_status = fwd_attachment_data_list[i].save_status;
attachment_data->attachment_size = fwd_attachment_data_list[i].attachment_size;
}
+ _composer_attachment_create_list_box(ugd, attachment_data);
}
- _composer_attachment_create_list_box(ugd, attachment_data);
}
if (ugd->existing_mail_info->mail_data->file_path_html) {
snprintf(recp_string, sizeof(recp_string), "<font_size=36><color=#000000>%s%s</color></font_size>", _("IDS_EMAIL_BODY_FROM"), ":");
elm_object_text_set(ugd->from_mbe, recp_string);
}
+ return;
case UG_EVENT_REGION_CHANGE:
case UG_EVENT_LOW_MEMORY:
case UG_EVENT_LOW_BATTERY:
g_free(ugd->saved_subject);
ugd->saved_subject = NULL;
}
- if (ugd->listOfImageUrls) {
- eina_list_free(ugd->listOfImageUrls);
- ugd->listOfImageUrls = NULL;
+ if (ugd->attachment_inline_item_list) {
+ eina_list_free(ugd->attachment_inline_item_list);
+ ugd->attachment_inline_item_list = NULL;
}
}
ugd->is_webview_scrolling = false;
ugd->focus_status = COMPOSER_FOCUS_STATUS_NONE;
- ugd->listOfImageUrls = NULL;
+ ugd->inline_cnt = 0;
+ ugd->attachment_inline_item_list = NULL;
ugd->b_load_finished = EINA_FALSE;
ugd->need_download = EINA_FALSE;
char folder_icon_path[1024] = { 0, };
Evas_Object *ic = elm_icon_add(obj);
snprintf(folder_icon_path, sizeof(folder_icon_path), IMGDIR "/U01_icon_folder.png");
- elm_icon_file_set(ic, folder_icon_path, NULL);
- elm_icon_resizable_set(ic, 0, 0);
+ elm_image_file_set(ic, folder_icon_path, NULL);
+ elm_image_resizable_set(ic, 0, 0);
evas_object_image_smooth_scale_set(ic, 0);
evas_object_show(ic);
{
case EMAIL_FLAG_TASK_STATUS_CLEAR:
ld->followup_flag = EMAIL_FLAG_TASK_STATUS_ACTIVE;
- elm_icon_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Active.png", NULL);
+ elm_image_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Active.png", NULL);
break;
case EMAIL_FLAG_TASK_STATUS_ACTIVE:
ld->followup_flag = EMAIL_FLAG_TASK_STATUS_COMPLETE;
- elm_icon_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Complete.png", NULL);
+ elm_image_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Complete.png", NULL);
break;
case EMAIL_FLAG_TASK_STATUS_COMPLETE:
ld->followup_flag = EMAIL_FLAG_TASK_STATUS_CLEAR;
- elm_icon_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Clear.png", NULL);
+ elm_image_file_set(ld->flag_ic, IMGDIR "/M02_email_Flag_Clear.png", NULL);
break;
default :
debug_log("mail item has no followup flag");
} else if(!g_strcmp0(source, "elm.icon.2")){
if(ld->priority == EMAIL_OPTION_PRIORITY_HIGH) {
icon = elm_icon_add(obj);
- elm_icon_file_set(icon, IMGDIR "/M02_email_icon_priority.png", NULL);
- elm_icon_resizable_set(icon, 0, 0);
+ elm_image_file_set(icon, IMGDIR "/M02_email_icon_priority.png", NULL);
+ elm_image_resizable_set(icon, 0, 0);
evas_object_image_smooth_scale_set(icon, 0);
evas_object_show(icon);
return (void *)icon;
} else if(ld->reply_flag) {
icon = elm_icon_add(obj);
- elm_icon_file_set(icon, IMGDIR "/M02_email_icon_reply.png", NULL);
- elm_icon_resizable_set(icon, 0, 0);
+ elm_image_file_set(icon, IMGDIR "/M02_email_icon_reply.png", NULL);
+ elm_image_resizable_set(icon, 0, 0);
evas_object_image_smooth_scale_set(icon, 0);
evas_object_show(icon);
return (void *)icon;
} else if (ld->forward_flag) {
icon = elm_icon_add(obj);
- elm_icon_file_set(icon, IMGDIR "/M02_email_icon_forward.png", NULL);
- elm_icon_resizable_set(icon, 0, 0);
+ elm_image_file_set(icon, IMGDIR "/M02_email_icon_forward.png", NULL);
+ elm_image_resizable_set(icon, 0, 0);
evas_object_image_smooth_scale_set(icon, 0);
evas_object_show(icon);
return (void *)icon;
if(ld->is_attachment == true)
{
icon = elm_icon_add(obj);
- elm_icon_file_set(icon, IMGDIR "/M02_email_icon_attach.png", NULL);
+ elm_image_file_set(icon, IMGDIR "/M02_email_icon_attach.png", NULL);
evas_object_size_hint_min_set(icon, 35, 35);
evas_object_show(icon);
elm_box_pack_start(box, icon);
{
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);
+ elm_image_file_set(ic, IMGDIR "/M02_email_icon_priority.png", NULL);
+ elm_image_resizable_set(ic, 0, 0);
evas_object_image_smooth_scale_set(ic, 0);
evas_object_show(ic);
return (void *)ic;
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);
- elm_icon_file_set(ic, IMGDIR "/M02_email_icon_priority.png", NULL);
- elm_icon_resizable_set(ic, 0, 0);
+ elm_image_file_set(ic, IMGDIR "/M02_email_icon_priority.png", NULL);
+ elm_image_resizable_set(ic, 0, 0);
evas_object_image_smooth_scale_set(ic, 0);
evas_object_show(ic);
return (void *)ic;
}
break;
}
- elm_icon_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL);
+ elm_image_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL);
elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", _("IDS_EMAIL_HEADER_ALL_ACCOUNTS"));
}
else {
int err = 0;
err = email_get_account(mailbox_ugd->account_id, EMAIL_ACC_GET_OPT_DEFAULT, &account);
if (err == EMAIL_ERROR_NONE) {
- elm_icon_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL);
+ elm_image_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL);
}
elm_object_part_text_set(mailbox_ugd->navi_title_ly, "txt_sub", mailbox_ugd->user_email);
if (account) {
- elm_icon_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL);
+ elm_image_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL);
email_free_account(&account, 1);
}
}
//searchbar category button
mailbox_ugd->searchby_button = elm_button_add(searchbar_layout);
Evas_Object *searchby_icon = elm_icon_add(mailbox_ugd->searchby_button);
- elm_icon_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_all_press.png", NULL);
- elm_icon_resizable_set(searchby_icon, 0, 0);
+ elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_all_press.png", NULL);
+ elm_image_resizable_set(searchby_icon, 0, 0);
evas_object_image_smooth_scale_set(searchby_icon, 0);
elm_object_content_set(mailbox_ugd->searchby_button, searchby_icon);
evas_object_smart_callback_add(mailbox_ugd->searchby_button, "clicked", _searchby_clicked_cb, mailbox_ugd);
Evas_Object* icon;
icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup);
- elm_icon_file_set(icon, IMGDIR "/M02_email_icon_popup_all.png", NULL);
+ elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_all.png", NULL);
elm_ctxpopup_item_append(mailbox_ugd->searchby_ctx_popup, dgettext("sys_string", "IDS_COM_BODY_ALL"), icon, _searchby_ctxpopup_cb, mailbox_ugd);
icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup);
- elm_icon_file_set(icon, IMGDIR "/M02_email_icon_popup_title.png", NULL);
+ elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_title.png", NULL);
elm_ctxpopup_item_append(mailbox_ugd->searchby_ctx_popup, dgettext("sys_string", "IDS_COM_BODY_DETAILS_TITLE"), icon, _searchby_ctxpopup_cb, mailbox_ugd);
icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup);
- elm_icon_file_set(icon, IMGDIR "/M02_email_icon_popup_sender.png", NULL);
+ elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_sender.png", NULL);
if ((mailbox_ugd->mailbox_type == EMAIL_MAILBOX_TYPE_SENTBOX)
|| (mailbox_ugd->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX)
}
icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup);
- elm_icon_file_set(icon, IMGDIR "/M02_email_icon_popup_date.png", NULL);
+ elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_date.png", NULL);
elm_ctxpopup_item_append(mailbox_ugd->searchby_ctx_popup, _("IDS_EMAIL_OPT_DATE"), icon, _searchby_ctxpopup_cb, mailbox_ugd);
icon = elm_icon_add(mailbox_ugd->searchby_ctx_popup);
- elm_icon_file_set(icon, IMGDIR "/M02_email_icon_popup_advanced.png", NULL);
+ elm_image_file_set(icon, IMGDIR "/M02_email_icon_popup_advanced.png", NULL);
elm_ctxpopup_item_append(mailbox_ugd->searchby_ctx_popup, _("IDS_EMAIL_OPT_ADVANCED"), icon, _searchby_ctxpopup_cb, mailbox_ugd);
_move_searchby_ctxpopup(mailbox_ugd->searchby_ctx_popup, obj);
if (search_type == EMAIL_SEARCH_ALL) // All
{
- elm_icon_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_all_press.png", NULL);
+ elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_all_press.png", NULL);
}
else if (search_type == EMAIL_SEARCH_SUBJECT) // SUBJECT
{
- elm_icon_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_title_press.png", NULL);
+ elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_title_press.png", NULL);
}
else if (search_type == EMAIL_SEARCH_FROM || search_type == EMAIL_SEARCH_TO) // FROM or Recipient(TO)
{
- elm_icon_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_sender_press.png", NULL);
+ elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_sender_press.png", NULL);
}
else if (search_type == EMAIL_SEARCH_DATE) // Date
{
- elm_icon_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_date_press.png", NULL);
+ elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_date_press.png", NULL);
}
else if (search_type == EMAIL_SEARCH_ADVANCED) // Advanced
{
- elm_icon_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_advanced_press.png", NULL);
+ elm_image_file_set(searchby_icon, IMGDIR"/M02_email_icon_popup_advanced_press.png", NULL);
}
- elm_icon_resizable_set(searchby_icon, 0, 0);
+ elm_image_resizable_set(searchby_icon, 0, 0);
evas_object_image_smooth_scale_set(searchby_icon, 0);
elm_object_content_set(mailbox_ugd->searchby_button, searchby_icon);
if (oh_opened)
{
- elm_icon_file_set(mailbox_ugd->title_arrow, ICON_CLOSE, NULL);
+ elm_image_file_set(mailbox_ugd->title_arrow, ICON_CLOSE, NULL);
elm_object_item_data_set(nf_it, (void *) (!oh_opened));
}
mailbox_ugd->folder_button = elm_button_add(mailbox_ugd->navi_bar);
elm_object_style_set(mailbox_ugd->folder_button, "naviframe/title_icon");
Evas_Object *folder_icon = elm_icon_add(mailbox_ugd->folder_button);
- elm_icon_file_set(folder_icon, ICON_FOLDERS, NULL);
- elm_icon_resizable_set(folder_icon, 1, 1);
+ elm_image_file_set(folder_icon, ICON_FOLDERS, NULL);
+ elm_image_resizable_set(folder_icon, 1, 1);
evas_object_image_smooth_scale_set(folder_icon, 0);
elm_object_content_set(mailbox_ugd->folder_button, folder_icon);
evas_object_smart_callback_add(mailbox_ugd->folder_button, "clicked", _folder_cb, mailbox_ugd);
mailbox_ugd->update_button = elm_button_add(mailbox_ugd->navi_bar);
elm_object_style_set(mailbox_ugd->update_button, "naviframe/title_icon");
Evas_Object *update_icon = elm_icon_add(mailbox_ugd->update_button);
- elm_icon_file_set(update_icon, ICON_UPDATE, NULL);
- elm_icon_resizable_set(update_icon, 1, 1);
+ elm_image_file_set(update_icon, ICON_UPDATE, NULL);
+ elm_image_resizable_set(update_icon, 1, 1);
evas_object_image_smooth_scale_set(update_icon, 0);
elm_object_content_set(mailbox_ugd->update_button, update_icon);
evas_object_smart_callback_add(mailbox_ugd->update_button, "clicked", _update_toolbar_clicked_cb, mailbox_ugd);
mailbox_ugd->sp_icon = elm_icon_add(mailbox_ugd->navi_title_ly);
evas_object_show(mailbox_ugd->sp_icon);
elm_object_part_content_set(mailbox_ugd->navi_title_ly, "sub_left_icon", mailbox_ugd->sp_icon);
- elm_icon_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL);
+ elm_image_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL);
// add expand/collapse icon
mailbox_ugd->title_arrow = elm_icon_add(mailbox_ugd->navi_title_ly);
evas_object_show(mailbox_ugd->title_arrow);
elm_object_part_content_set(mailbox_ugd->navi_title_ly, "sub_right_icon", mailbox_ugd->title_arrow);
- elm_icon_file_set(mailbox_ugd->title_arrow, ICON_CLOSE, NULL);
+ elm_image_file_set(mailbox_ugd->title_arrow, ICON_CLOSE, NULL);
_create_controlbar(mailbox_ugd);
if (oh_opened)
{
- elm_icon_file_set(mailbox_ugd->title_arrow, ICON_CLOSE, NULL);
+ elm_image_file_set(mailbox_ugd->title_arrow, ICON_CLOSE, NULL);
destroy_account_cb(mailbox_ugd->ug_account, mailbox_ugd);
elm_object_item_data_set(nf_it, (void *) (!oh_opened));
}
{
if (mailbox_ugd->view_type != EMAIL_VIEW_EDIT && mailbox_ugd->view_type != EMAIL_VIEW_SEARCH)
{
- elm_icon_file_set(mailbox_ugd->title_arrow, ICON_OPEN, NULL);
+ elm_image_file_set(mailbox_ugd->title_arrow, ICON_OPEN, NULL);
_account_cb(data, obj, NULL);
elm_object_item_data_set(nf_it, (void *) (!oh_opened));
}
if (mailbox_ugd->mode == EMAIL_MAILBOX_MODE_ALL) {
- elm_icon_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL);
+ elm_image_file_set(mailbox_ugd->sp_icon, ICON_TITLE_ALL_ACC, NULL);
switch(mailbox_ugd->mailbox_type)
{
email_account_t *account;
email_get_account(mailbox_ugd->account_id, 0, &account);
if (account) {
- elm_icon_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL);
+ elm_image_file_set(mailbox_ugd->sp_icon, account->logo_icon_path, NULL);
email_free_account(&account, 1);
}
}
Name: org.tizen.email
Summary: Native email application
-Version: 0.0.13
+Version: 0.0.14
Release: 1
Group: devel
License: Flora
debug_log("email_get_attachment_data_list - err (%d)", err);
if (err == EMAIL_ERROR_NONE) {
+ if (!email_check_dir_exist(DIR_DEFAULT_MEDIA_PHONE"/Saved Email")) {
+ int nErr = -1;
+ nErr = mkdir(DIR_DEFAULT_MEDIA_PHONE"/Saved Email", 0755);
+ debug_log("errno: %d", nErr);
+ if (nErr == -1) {
+ debug_log("Eml file folder creation failed");
+ return -1;
+ }
+ } else
+ debug_log("Eml file folder already exists.");
+
+ char *subject = elm_entry_utf8_to_markup(ug_data->property->subject);
+ if (!g_strcmp0(subject, "")) {
+ g_free(subject);
+ subject = g_strdup(_("IDS_EMAIL_BODY_NO_SUBJECT"));
+ }
+
+ tzset(); /* MUST BE. */
+
+ time_t now_time = time(NULL);
+
+ struct tm *dummy = localtime(&now_time);
+ struct tm now_tm;
+ memcpy(&now_tm, dummy, sizeof(struct tm));
+
+ char date[9] = { 0, };
+ if (now_tm.tm_mon + 1 < 10 && now_tm.tm_mday < 10)
+ snprintf(date, sizeof(date), "%d0%d0%d", now_tm.tm_year + 1900, now_tm.tm_mon + 1, now_tm.tm_mday);
+ else if (now_tm.tm_mon + 1 < 10 && now_tm.tm_mday >= 10)
+ snprintf(date, sizeof(date), "%d0%d%d", now_tm.tm_year + 1900, now_tm.tm_mon + 1, now_tm.tm_mday);
+ else if (now_tm.tm_mon + 1 >= 10 && now_tm.tm_mday < 10)
+ snprintf(date, sizeof(date), "%d%d0%d", now_tm.tm_year + 1900, now_tm.tm_mon + 1, now_tm.tm_mday);
+ else
+ snprintf(date, sizeof(date), "%d%d%d", now_tm.tm_year + 1900, now_tm.tm_mon + 1, now_tm.tm_mday);
+ debug_log("date(%s)", date);
+
char file_name[MAX_PATH_LEN] = { 0, };
- snprintf(file_name, sizeof(file_name), "%s_%d_%d.%s", DIR_DEFAULT_MEDIA_PHONE"/Downloads/email", ug_data->account_id, ug_data->mail_id, "eml");
+ snprintf(file_name, sizeof(file_name), "%s/%s_%d_%d_%s.%s", DIR_DEFAULT_MEDIA_PHONE"/Saved Email", subject, ug_data->account_id, ug_data->mail_id, date, "eml");
char *output_file_path = g_strdup(file_name);
debug_log("output_file_path(%s)", file_name, output_file_path);
debug_log("email_write_mime_file - err(%d)", err);
g_free(output_file_path);
+ g_free(subject);
}
if (mail_t) {
static void _ctxpopup_detail_contact_cb(void *data, Evas_Object *obj, void *event_info)
{
- debug_log("");
+ debug_log("data(%s)", data);
if (data == NULL || _g_ug_data == NULL) {
debug_log("data is NULL");
return;