TizenRefApp-5871 [Email] Replace UG data types & parameter/variable/member names... 61/60661/1
authorIgor Nazarov <i.nazarov@samsung.com>
Mon, 29 Feb 2016 16:55:54 +0000 (18:55 +0200)
committerIgor Nazarov <i.nazarov@samsung.com>
Mon, 29 Feb 2016 17:00:20 +0000 (19:00 +0200)
Change-Id: Ic32591d77988fcf05f6f4aad72d2b1ceb027c05a

25 files changed:
Project-Files/modules/viewer/inc/email-viewer-attachment.h
Project-Files/modules/viewer/inc/email-viewer-contents.h
Project-Files/modules/viewer/inc/email-viewer-eml.h
Project-Files/modules/viewer/inc/email-viewer-ext-gesture.h
Project-Files/modules/viewer/inc/email-viewer-header.h
Project-Files/modules/viewer/inc/email-viewer-more-menu.h
Project-Files/modules/viewer/inc/email-viewer-noti-mgr.h
Project-Files/modules/viewer/inc/email-viewer-scroller.h
Project-Files/modules/viewer/inc/email-viewer-types.h
Project-Files/modules/viewer/inc/email-viewer-util.h
Project-Files/modules/viewer/inc/email-viewer.h
Project-Files/modules/viewer/src/email-viewer-attachment.c
Project-Files/modules/viewer/src/email-viewer-contents.c
Project-Files/modules/viewer/src/email-viewer-eml.c
Project-Files/modules/viewer/src/email-viewer-ext-gesture.c
Project-Files/modules/viewer/src/email-viewer-header.c
Project-Files/modules/viewer/src/email-viewer-initial-data.c
Project-Files/modules/viewer/src/email-viewer-logic.c
Project-Files/modules/viewer/src/email-viewer-more-menu-callback.c
Project-Files/modules/viewer/src/email-viewer-more-menu.c
Project-Files/modules/viewer/src/email-viewer-noti-mgr.c
Project-Files/modules/viewer/src/email-viewer-recipient.c
Project-Files/modules/viewer/src/email-viewer-scroller.c
Project-Files/modules/viewer/src/email-viewer-util.c
Project-Files/modules/viewer/src/email-viewer.c

index ea815e7..77e0ea6 100644 (file)
 /**
  * @brief Provides attachment view
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void viewer_create_attachment_view(EmailViewerUGD *ug_data);
+void viewer_create_attachment_view(EmailViewerView *view);
 
 /**
  * @brief Provides process for downloading and preview, depends from current state
@@ -47,21 +47,21 @@ void viewer_set_attachment_state(EV_attachment_data *aid, EV_attachment_state ne
 /**
  * @brief Get attachment data
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  * @param[in]  info_index              Attachment ID
  *
  * @return Viewer attachment data on success or NULL if none or an error occurred
  */
-EV_attachment_data *viewer_get_attachment_data(EmailViewerUGD *ug_data, int info_index);
+EV_attachment_data *viewer_get_attachment_data(EmailViewerView *view, int info_index);
 
 /**
  * @brief Get attachment state for all attachments
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  * @return  Email viewer mutually attachment state enum
  */
-EV_all_attachment_state viewer_get_all_attachments_state(EmailViewerUGD *ug_data);
+EV_all_attachment_state viewer_get_all_attachments_state(EmailViewerView *view);
 
 /**
  * @brief Update attachment item info
index 29dab8b..47e336a 100644 (file)
@@ -39,19 +39,19 @@ void viewer_webkit_del_callbacks(void *data);
 /**
  * @brief Creats webview and set initial setings to it
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  * @return Evas_Object webview instance on success or NULL if an error occurred
  */
-Evas_Object *viewer_get_webview(EmailViewerUGD *ug_data);
+Evas_Object *viewer_get_webview(EmailViewerView *view);
 
 /**
  * @brief Set content to webview
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void viewer_set_webview_content(EmailViewerUGD *ug_data);
+void viewer_set_webview_content(EmailViewerView *view);
 
 /**
  * @brief Set initial webview height
@@ -80,10 +80,10 @@ void viewer_show_webview(void *data);
 /**
  * @brief Provides memory warning notification
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void viewer_webview_handle_mem_warning(EmailViewerUGD *ug_data, bool hard);
+void viewer_webview_handle_mem_warning(EmailViewerView *view, bool hard);
 
 #endif /* __EMAIL_VIEWER_CONTENTS_H__ */
 
index 84fddaf..e03533f 100644 (file)
 /**
  * @brief Create address info list
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  * @return Email addres info list on success or NULL if an error occurred
  */
-email_address_info_list_t *viewer_create_address_info_list(EmailViewerUGD *ug_data);
+email_address_info_list_t *viewer_create_address_info_list(EmailViewerView *view);
 
 /**
  * @brief Free address info list from Email address info list data
index e650e1b..049dedd 100644 (file)
@@ -21,7 +21,7 @@
 /**
  * @brief Set flick layer to viewer
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
 void viewer_set_flick_layer(void *data);
index 4722980..6b10cd8 100644 (file)
 /**
  * @brief Update attachment summary info
  *
- * @param[in]  ug_data         Email viewer data
+ * @param[in]  view            Email viewer data
  *
  */
-void header_update_attachment_summary_info(EmailViewerUGD *ug_data);
+void header_update_attachment_summary_info(EmailViewerView *view);
 
 /**
  * @brief Delete viewer header attachment preview
@@ -56,40 +56,40 @@ void header_update_view(void *data);
  * @param[in]  data            User data (Email viewer data)
  *
  */
-void header_update_date(EmailViewerUGD *ug_data);
+void header_update_date(EmailViewerView *view);
 
 /**
  * @brief Update viewer header response icon REPLY/FORWARD
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  * @param[in]  mail_info               Email mail data
  *
  */
-void header_update_response_icon(EmailViewerUGD *ug_data, email_mail_data_t *mail_info);
+void header_update_response_icon(EmailViewerView *view, email_mail_data_t *mail_info);
 
 /**
  * @brief Update viewer header favorite icon
  *
- * @param[in]  ug_data         Email viewer data
+ * @param[in]  view            Email viewer data
  *
  */
-void header_update_favorite_icon(EmailViewerUGD *ug_data);
+void header_update_favorite_icon(EmailViewerView *view);
 
 /**
  * @brief Set viewer header favorite icon
  *
- * @param[in]  ug_data         Email viewer data
+ * @param[in]  view            Email viewer data
  *
  */
-void header_set_favorite_icon(EmailViewerUGD *ug_data);
+void header_set_favorite_icon(EmailViewerView *view);
 
 /**
  * @brief Set viewer header sender name
  *
- * @param[in]  ug_data         Email viewer data
+ * @param[in]  view            Email viewer data
  *
  */
-void header_set_sender_name(EmailViewerUGD *ug_data);
+void header_set_sender_name(EmailViewerView *view);
 
 /**
  * @brief Unpack header layout from box
index b3ee311..82c2c7c 100644 (file)
@@ -40,10 +40,10 @@ void viewer_update_contact(void *data, char *contact_data);
 /**
  * @brief Create more ctxpopup
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void viewer_create_more_ctxpopup(EmailViewerUGD *ug_data);
+void viewer_create_more_ctxpopup(EmailViewerView *view);
 
 /**
  * @brief Upadte geometry position after rotation for ctxpopup
index 19bceef..057adfa 100644 (file)
@@ -30,9 +30,9 @@ Eina_Bool noti_mgr_dbus_receiver_setup(void *data);
 /**
  * @brief Remove module notification system
  *
- * @param[in]  ug_data         Email viewer data
+ * @param[in]  view            Email viewer data
  *
  */
-void noti_mgr_dbus_receiver_remove(EmailViewerUGD *ug_data);
+void noti_mgr_dbus_receiver_remove(EmailViewerView *view);
 
 #endif /* __EMAIL_VIEWER_NOTI_MGR_H__ */
index f15e6c7..73d4a15 100644 (file)
 /**
  * @brief Set vertical scroller position
  *
- * @param[in]  ug_data                         Email viewer data
+ * @param[in]  view                            Email viewer data
  *
  */
-void viewer_set_vertical_scroller_position(EmailViewerUGD *ug_data);
+void viewer_set_vertical_scroller_position(EmailViewerView *view);
 
 /**
  * @brief Set horizontal scroller size
  *
- * @param[in]  ug_data                         Email viewer data
+ * @param[in]  view                            Email viewer data
  *
  */
-void viewer_set_horizontal_scroller_size(EmailViewerUGD *ug_data);
+void viewer_set_horizontal_scroller_size(EmailViewerView *view);
 
 /**
  * @brief Set vertical scroller size
  *
- * @param[in]  ug_data                         Email viewer data
+ * @param[in]  view                            Email viewer data
  *
  */
-void viewer_set_vertical_scroller_size(EmailViewerUGD *ug_data);
+void viewer_set_vertical_scroller_size(EmailViewerView *view);
 
 /**
  * @brief Stop main scroller and start webkit scroller
index 836ab0f..2659bf0 100644 (file)
@@ -20,7 +20,7 @@
 
 #define CONCAT_FORMAT(x, y, z) ((x<<16) | (y<<8) | z)
 
-#define VIEWER_EVAS_DATA_NAME "ViewerUGD"
+#define VIEWER_EVAS_DATA_NAME "ViewerModule"
 
 #define _EDJ(o) elm_layout_edje_get(o)
 
@@ -167,7 +167,7 @@ struct _EmailViewerWebview {
 
 typedef struct _EmailViewerIdlerData EmailViewerIdlerData;
 struct _EmailViewerIdlerData {
-       void *ug_data;
+       void *view;
        void *data;
 };
 
index d85dd08..f79d49d 100644 (file)
@@ -51,7 +51,7 @@ Evas_Object *util_notify_genlist_add(Evas_Object *parent);
 /**
  * @brief Creates notification popup list and returns object itself
  *
- * @param[in]  ug_data                         Email viewer data
+ * @param[in]  view                            Email viewer data
  * @param[in]  t_header                        Email viewer string data for header
  * @param[in]  t_content                       Email viewer string data for content
  * @param[in]  btn_num                         Count of buttons in list
@@ -63,14 +63,14 @@ Evas_Object *util_notify_genlist_add(Evas_Object *parent);
  *
  * @return Evas_Object with suitable popup, otherwise NULL
  */
-Evas_Object *util_create_notify_with_list(EmailViewerUGD *ug_data, email_string_t t_header, email_string_t t_content,
+Evas_Object *util_create_notify_with_list(EmailViewerView *view, email_string_t t_header, email_string_t t_content,
                                                int btn_num, email_string_t t_btn1_lb, popup_cb resp_cb1,
                                                email_string_t t_btn2_lb, popup_cb resp_cb2, popup_cb resp_block_cb);
 
 /**
  * @brief Creates and show notification popup list
  *
- * @param[in]  ug_data                         Email viewer data
+ * @param[in]  view                            Email viewer data
  * @param[in]  t_header                        Email viewer string data for header
  * @param[in]  t_content                       Email viewer string data for content
  * @param[in]  btn_num                         Count of buttons in list
@@ -81,40 +81,40 @@ Evas_Object *util_create_notify_with_list(EmailViewerUGD *ug_data, email_string_
  * @param[in]  resp_block_cb           Response callback function for Blocked Event area
  *
  */
-void util_create_notify(EmailViewerUGD *ug_data, email_string_t t_header, email_string_t t_content,
+void util_create_notify(EmailViewerView *view, email_string_t t_header, email_string_t t_content,
                                                int btn_num, email_string_t t_btn1_lb, popup_cb resp_cb1,
                                                email_string_t t_btn2_lb, popup_cb resp_cb2, popup_cb resp_block_cb);
 
 /**
  * @brief Find folder ID using folder type
  *
- * @param[in]  ug_data                         Email viewer data
+ * @param[in]  view                            Email viewer data
  * @param[in]  mailbox_type            Email mailbox type enum
  *
  * @return 0 on success, otherwise a negative error value
  */
-int _find_folder_id_using_folder_type(EmailViewerUGD *ug_data, email_mailbox_type_e mailbox_type);
+int _find_folder_id_using_folder_type(EmailViewerView *view, email_mailbox_type_e mailbox_type);
 
 /**
  * @brief Move email to destination folder that represented by folder ID
  *
- * @param[in]  ug_data                         Email viewer data
+ * @param[in]  view                            Email viewer data
  * @param[in]  dest_folder_id          Folder ID
  * @param[in]  is_delete                       To specify which popop to show in case of failure
  * @param[in]  is_block                        To specify which popop to show in case of failure
  *
  * @return 0 on success, otherwise a negative error value
  */
-int viewer_move_email(EmailViewerUGD *ug_data, int dest_folder_id, gboolean is_delete, gboolean is_block);
+int viewer_move_email(EmailViewerView *view, int dest_folder_id, gboolean is_delete, gboolean is_block);
 
 /**
  * @brief Delete an email
  *
- * @param[in]  ug_data                         Email viewer data
+ * @param[in]  view                            Email viewer data
  *
  * @return 0 on success, otherwise a negative error value
  */
-int viewer_delete_email(EmailViewerUGD *ug_data);
+int viewer_delete_email(EmailViewerView *view);
 
 /**
  * @brief Create child module that defined by Email Module type
@@ -154,20 +154,20 @@ Evas_Object *viewer_load_edj(Evas_Object *parent, const char *file, const char *
 /**
  * @brief Launch browser by specifying URI operation
  *
- * @param[in]  ug_data                         Email viewer data
+ * @param[in]  view                            Email viewer data
  * @param[in]  link_uri                        URI to set operation
  *
  */
-void viewer_launch_browser(EmailViewerUGD *ug_data, const char *link_uri);
+void viewer_launch_browser(EmailViewerView *view, const char *link_uri);
 
 /**
  * @brief Create email
  *
- * @param[in]  ug_data                         Email viewer data
+ * @param[in]  view                            Email viewer data
  * @param[in]  email_address           Email address name
  *
  */
-void viewer_create_email(EmailViewerUGD *ug_data, const char *email_address);
+void viewer_create_email(EmailViewerView *view, const char *email_address);
 
 /**
  * @brief Save attached file to Downloads folder with progress notification
@@ -192,7 +192,7 @@ email_ext_save_err_type_e viewer_save_attachment_for_preview(EV_attachment_data
 /**
  * @brief Preview attachment
  *
- * @param[in]  ug_data                         Email viewer data
+ * @param[in]  view                            Email viewer data
  *
  */
 void viewer_show_attachment_preview(EV_attachment_data *aid);
@@ -209,10 +209,10 @@ int viewer_check_storage_full(unsigned int mb_size);
 /**
  * @brief Provides notification popup storage is full
  *
- * @param[in]  ug_data                         Email viewer data
+ * @param[in]  view                            Email viewer data
  *
  */
-void viewer_show_storage_full_popup(EmailViewerUGD *ug_data);
+void viewer_show_storage_full_popup(EmailViewerView *view);
 
 /**
  * @brief Callback performed after full storage detected
@@ -320,45 +320,45 @@ Eina_Bool viewer_check_body_download_status(int body_download_status, int status
 /**
  * @brief Create body button
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  * @param[in]  button_title    Button lable
  * @param[in]  cb                              Callback function for button response
  *
  */
-void viewer_create_body_button(EmailViewerUGD *ug_data, const char *button_title, Evas_Smart_Cb cb);
+void viewer_create_body_button(EmailViewerView *view, const char *button_title, Evas_Smart_Cb cb);
 
 /**
  * @brief Delete body button
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void viewer_delete_body_button(EmailViewerUGD *ug_data);
+void viewer_delete_body_button(EmailViewerView *view);
 
 /**
  * @brief Temporary folder /tmp/email is created when viewer is launched
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  * @return 0 on success, otherwise a negative error value
  */
-int viewer_create_temp_folder(EmailViewerUGD *ug_data);
+int viewer_create_temp_folder(EmailViewerView *view);
 
 /**
  * @brief Temporary folder '/tmp/email' and its contents are deleted when composer is destroyed
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void viewer_remove_temp_folders(EmailViewerUGD *ug_data);
+void viewer_remove_temp_folders(EmailViewerView *view);
 
 /**
  * @brief Delete files from temp viewer html file path
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void viewer_remove_temp_files(EmailViewerUGD *ug_data);
+void viewer_remove_temp_files(EmailViewerView *view);
 
 #endif /* __EMAIL_VIEWER_UTIL_H__ */
 /* EOF */
index ac0e562..c533f71 100644 (file)
@@ -92,12 +92,12 @@ void ewk_context_notify_low_memory(Ewk_Context *);
 
 typedef struct _ev_attachment_data_tag EV_attachment_data;
 
-typedef struct ug_data EmailViewerUGD;
+typedef struct _view_data EmailViewerView;
 
 /**
  * @brief Email viewer data
  */
-struct ug_data {
+struct _view_data {
        email_view_t base;
 
        /* base */
@@ -309,7 +309,7 @@ struct ug_data {
  */
 typedef struct {
        email_module_t base;
-       EmailViewerUGD view;
+       EmailViewerView view;
 } EmailViewerModule;
 
 /**
@@ -319,7 +319,7 @@ typedef struct {
        int index;
        char *font_text;
        Evas_Object *radio;
-       EmailViewerUGD *ug_data;
+       EmailViewerView *view;
 } FontsizeItem;
 
 /**
@@ -347,7 +347,7 @@ typedef enum {
 struct _ev_attachment_data_tag {
 
        /* Main fields */
-       EmailViewerUGD *ug_data;
+       EmailViewerView *view;
        Elm_Object_Item *it;
        EmailAttachmentType *attachment_info;
 
@@ -403,19 +403,19 @@ enum {
 /**
  * @brief Reset viewer view
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  * @param[in]  update_body             Flag specifies that need to update header body
  *
  */
-void _reset_view(EmailViewerUGD *ug_data, Eina_Bool update_body);
+void _reset_view(EmailViewerView *view, Eina_Bool update_body);
 
 /**
  * @brief Hide viewer view
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void _hide_view(EmailViewerUGD *ug_data);
+void _hide_view(EmailViewerView *view);
 
 /**
  * @brief Callback to reply
@@ -470,10 +470,10 @@ void _move_cb(void *data, Evas_Object *obj, void *event_info);
 /**
  * @brief Provides webviewe body creation
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void _create_body(EmailViewerUGD *ug_data);
+void _create_body(EmailViewerView *view);
 
 /**
  * @brief Provides download webviewe body
@@ -495,86 +495,86 @@ Eina_Bool viewer_check_body_download(void *data);
 /**
  * @brief Creates body progress and list process animation when body downloading
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void create_body_progress(EmailViewerUGD *ug_data);
+void create_body_progress(EmailViewerView *view);
 
 /**
  * @brief Provides resizing for webview
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  * @param[in]  height                  Heigh value to be setted
  *
  */
-void viewer_resize_webview(EmailViewerUGD *ug_data, int height);
+void viewer_resize_webview(EmailViewerView *view, int height);
 
 /**
  * @brief Initialize viewer's private data
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  * @return TRUE on success or FALSE if none or an error occurred
  *
  */
-Eina_Bool viewer_initialize_data(EmailViewerUGD *ug_data);
+Eina_Bool viewer_initialize_data(EmailViewerView *view);
 
 /**
  * @brief Delete all viewer internal timers and idlers
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void viewer_stop_ecore_running_apis(EmailViewerUGD *ug_data);
+void viewer_stop_ecore_running_apis(EmailViewerView *view);
 
 /**
  * @brief Reset all data belongs to mail
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  * @return Code from VIEWER_ERROR_TYPE_E enum about occurred error
  */
-int viewer_reset_mail_data(EmailViewerUGD *ug_data);
+int viewer_reset_mail_data(EmailViewerView *view);
 
 /**
  * @brief Deletes viewer's private data
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  * @param[in]  isHide                  Evas_Bool value
  *
  */
-void viewer_delete_evas_objects(EmailViewerUGD *ug_data, Eina_Bool isHide);
+void viewer_delete_evas_objects(EmailViewerView *view, Eina_Bool isHide);
 
 /**
  * @brief Unregister viewer from callbacks
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void viewer_remove_callback(EmailViewerUGD *ug_data);
+void viewer_remove_callback(EmailViewerView *view);
 
 /**
  * @brief Creates account data
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void viewer_create_account_data(EmailViewerUGD *ug_data);
+void viewer_create_account_data(EmailViewerView *view);
 
 /**
  * @brief Deletes account data
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void viewer_delete_account_data(EmailViewerUGD *ug_data);
+void viewer_delete_account_data(EmailViewerView *view);
 
 /**
  * @brief Back key press handler
  *
- * @param[in]  ug_data                 Email viewer data
+ * @param[in]  view                    Email viewer data
  *
  */
-void viewer_back_key_press_handler(EmailViewerUGD *ug_data);
+void viewer_back_key_press_handler(EmailViewerView *view);
 
 #endif /* __EMAIL_VIEWER_H__ */
index e49873d..09a6cca 100644 (file)
@@ -44,30 +44,30 @@ static void _destroy_view(email_view_t *self);
 static void _on_back_key(email_view_t *self);
 
 static void _popup_response_cb(void *data, Evas_Object *obj, void *event_info);
-static int _create_temp_preview_folder(EmailViewerUGD *ug_data);
-static char *_get_ellipsised_attachment_filename(EmailViewerUGD *ug_data, const char *org_filename, const char *file_size);
+static int _create_temp_preview_folder(EmailViewerView *view);
+static char *_get_ellipsised_attachment_filename(EmailViewerView *view, const char *org_filename, const char *file_size);
 
 static VIEWER_ERROR_TYPE_E _download_attachment(EV_attachment_data *aid);
 static VIEWER_ERROR_TYPE_E _save_and_preview_attachment(EV_attachment_data *aid);
 
-static VIEWER_ERROR_TYPE_E _ensure_save_thread(EmailViewerUGD *ug_data);
-static void _stop_save_thread(EmailViewerUGD *ug_data);
+static VIEWER_ERROR_TYPE_E _ensure_save_thread(EmailViewerView *view);
+static void _stop_save_thread(EmailViewerView *view);
 static void *_attachment_save_thread_run(void *data);
 static email_ext_save_err_type_e _viewer_save_attachment_on_disk(EV_attachment_data *aid);
 
-static VIEWER_ERROR_TYPE_E _ensure_update_timer(EmailViewerUGD *ug_data);
-static void _stop_update_timer(EmailViewerUGD *ug_data);
+static VIEWER_ERROR_TYPE_E _ensure_update_timer(EmailViewerView *view);
+static void _stop_update_timer(EmailViewerView *view);
 static Eina_Bool _attachment_update_timer_cb(void *data);
 
 static void _invalidate_attachment_item(EV_attachment_data *aid);
-static void _stop_update_job(EmailViewerUGD *ug_data);
+static void _stop_update_job(EmailViewerView *view);
 static void _attachment_update_job_cb(void *data);
 
 static void _cancel_attachment_task(EV_attachment_data *aid);
-static void _cancel_preview_task(EmailViewerUGD *ug_data, bool keep_download);
-static void _cancel_all_attachment_tasks(EmailViewerUGD *ug_data);
+static void _cancel_preview_task(EmailViewerView *view, bool keep_download);
+static void _cancel_all_attachment_tasks(EmailViewerView *view);
 
-static void _save_all_attachments(EmailViewerUGD *ug_data);
+static void _save_all_attachments(EmailViewerView *view);
 static void _attachment_download_save_all_cb(void *data, Evas_Object *obj, void *event_info);
 
 static void _viewer_attachment_cancel_cb(EV_attachment_data *aid);
@@ -88,7 +88,7 @@ static Evas_Object *_viewer_create_gl_item_icon_file_type(Evas_Object *parent, c
 static Evas_Object *_viewer_create_gl_item_download_button(Evas_Object *parent,  EV_attachment_data *attachment_data);
 static Evas_Object *_viewer_create_gl_item_label_filename(Evas_Object *parent);
 
-static void _update_attachment_save_cancel_all_buttons(EmailViewerUGD *ug_data);
+static void _update_attachment_save_cancel_all_buttons(EmailViewerView *view);
 
 static void _unpack_object_from_box(Evas_Object *box, Evas_Object *object);
 static void _pack_object_to_box(Evas_Object *box, Evas_Object *object);
@@ -99,10 +99,10 @@ static void _viewer_gl_attachment_update_filename_label_text(EV_attachment_data
 static void _viewer_update_gl_attachment_item(EV_attachment_data *attachment_data);
 
 static void _viewer_create_attachment_list(void *data);
-static void _destroy_attachment_list(EmailViewerUGD *ug_data);
+static void _destroy_attachment_list(EmailViewerView *view);
 static Evas_Object *_viewer_create_attachment_view_ly(void *data);
 static gboolean _viewer_notify_attachment_process_copy_cb(void *data, float percentage);
-Evas_Object *_viewer_attachment_create_save_cancel_toolbar_btn(Evas_Object *layout, EmailViewerUGD *ug_data);
+Evas_Object *_viewer_attachment_create_save_cancel_toolbar_btn(Evas_Object *layout, EmailViewerView *view);
 
 static email_string_t EMAIL_VIEWER_STRING_OK = { PACKAGE, "IDS_EMAIL_BUTTON_OK" };
 static email_string_t EMAIL_VIEWER_UNABLE_TO_DOWNLOAD_ATTACH = { PACKAGE, "IDS_EMAIL_HEADER_UNABLE_TO_DOWNLOAD_ATTACHMENT_ABB" };
@@ -117,21 +117,21 @@ static void _popup_response_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       DELETE_EVAS_OBJECT(view->notify);
        debug_leave();
 }
 
-static void _create_unable_to_save_attachment_popup(EmailViewerUGD *ug_data)
+static void _create_unable_to_save_attachment_popup(EmailViewerView *view)
 {
        email_string_t title = { PACKAGE, "IDS_EMAIL_HEADER_FAILED_TO_SAVE_ATTACHMENT_ABB" };
        email_string_t content = { PACKAGE, "IDS_EMAIL_POP_AN_UNKNOWN_ERROR_HAS_OCCURRED" };
-       util_create_notify(ug_data, title, content, 1, EMAIL_VIEWER_STRING_OK,
+       util_create_notify(view, title, content, 1, EMAIL_VIEWER_STRING_OK,
                        _popup_response_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
 }
 
-static char *_get_ellipsised_attachment_filename(EmailViewerUGD *ug_data, const char *org_filename, const char *file_size)
+static char *_get_ellipsised_attachment_filename(EmailViewerView *view, const char *org_filename, const char *file_size)
 {
        debug_enter();
 
@@ -148,16 +148,16 @@ static char *_get_ellipsised_attachment_filename(EmailViewerUGD *ug_data, const
        return filename;
 }
 
-EV_attachment_data *viewer_get_attachment_data(EmailViewerUGD *ug_data, int info_index)
+EV_attachment_data *viewer_get_attachment_data(EmailViewerView *view, int info_index)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, NULL, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, NULL, "Invalid parameter: view[NULL]");
 
        EV_attachment_data *result = NULL;
        Eina_List *l = NULL;
        EV_attachment_data *attachment_item_data = NULL;
 
-       EINA_LIST_FOREACH(ug_data->attachment_data_list, l, attachment_item_data) {
+       EINA_LIST_FOREACH(view->attachment_data_list, l, attachment_item_data) {
                if (attachment_item_data) {
                        if (attachment_item_data->attachment_info->index == info_index) {
                                result = attachment_item_data;
@@ -170,10 +170,10 @@ EV_attachment_data *viewer_get_attachment_data(EmailViewerUGD *ug_data, int info
        return result;
 }
 
-static int _create_temp_preview_folder(EmailViewerUGD *ug_data)
+static int _create_temp_preview_folder(EmailViewerView *view)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, -1, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, -1, "Invalid parameter: view[NULL]");
 
        int nErr = email_create_folder(email_get_viewer_tmp_dir());
        if (nErr == -1) {
@@ -182,9 +182,9 @@ static int _create_temp_preview_folder(EmailViewerUGD *ug_data)
        }
 
        pid_t pid = getpid();
-       ug_data->temp_preview_folder_path = g_strdup_printf("%s/preview_%d_%d_%d",
-                       email_get_viewer_tmp_dir(), pid, ug_data->account_id, ug_data->mail_id);
-       nErr = email_create_folder(ug_data->temp_preview_folder_path);
+       view->temp_preview_folder_path = g_strdup_printf("%s/preview_%d_%d_%d",
+                       email_get_viewer_tmp_dir(), pid, view->account_id, view->mail_id);
+       nErr = email_create_folder(view->temp_preview_folder_path);
        if (nErr == -1) {
                debug_error("email_create_folder(temp_preview_folder_path) failed!");
                return -1;
@@ -193,15 +193,15 @@ static int _create_temp_preview_folder(EmailViewerUGD *ug_data)
        return 0;
 }
 
-static void _update_attachment_save_cancel_all_buttons(EmailViewerUGD *ug_data)
+static void _update_attachment_save_cancel_all_buttons(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       if (!(ug_data->show_cancel_all_btn)) {
-               elm_object_domain_translatable_text_set(ug_data->save_all_btn, PACKAGE, "IDS_EMAIL_BUTTON_DOWNLOAD_ALL");
+       if (!(view->show_cancel_all_btn)) {
+               elm_object_domain_translatable_text_set(view->save_all_btn, PACKAGE, "IDS_EMAIL_BUTTON_DOWNLOAD_ALL");
        } else {
-               elm_object_domain_translatable_text_set(ug_data->save_all_btn, PACKAGE, "IDS_EMAIL_BUTTON_CANCEL");
+               elm_object_domain_translatable_text_set(view->save_all_btn, PACKAGE, "IDS_EMAIL_BUTTON_CANCEL");
        }
 }
 
@@ -217,17 +217,17 @@ static VIEWER_ERROR_TYPE_E _download_attachment(EV_attachment_data *aid)
                return VIEWER_ERROR_DOWNLOAD_FAIL;
        }
 
-       EmailViewerUGD *ug_data = aid->ug_data;
+       EmailViewerView *view = aid->view;
 
-       if ((ug_data->account_type == EMAIL_SERVER_TYPE_POP3) &&
-                       !viewer_check_body_download_status(ug_data->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED)) {
+       if ((view->account_type == EMAIL_SERVER_TYPE_POP3) &&
+                       !viewer_check_body_download_status(view->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED)) {
                return VIEWER_ERROR_BODY_NOT_DOWNLOADED;
        }
 
        int handle = 0;
 
        /* download attachment */
-       gboolean res = email_engine_attachment_download(ug_data->mail_id, info->index, &handle);
+       gboolean res = email_engine_attachment_download(view->mail_id, info->index, &handle);
        if (!res) {
                int ret = notification_status_message_post(_("IDS_EMAIL_POP_DOWNLOAD_FAILED"));
                debug_warning_if(ret != NOTIFICATION_ERROR_NONE, "notification_status_message_post() failed! ret:(%d)", ret);
@@ -266,12 +266,12 @@ VIEWER_ERROR_TYPE_E viewer_download_and_preview_save_attachment(EV_attachment_da
                        result = VIEWER_ERROR_NONE;
                        break;
                case VIEWER_ERROR_BODY_NOT_DOWNLOADED:
-                       util_create_notify(aid->ug_data, EMAIL_VIEWER_UNABLE_TO_DOWNLOAD_ATTACH,
+                       util_create_notify(aid->view, EMAIL_VIEWER_UNABLE_TO_DOWNLOAD_ATTACH,
                                        EMAIL_VIEWER_BODY_FIRST_DOWNLOAD_MESSAGE, 1,
                                        EMAIL_VIEWER_STRING_OK, _popup_response_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
                        break;
                default:
-                       _create_unable_to_save_attachment_popup(aid->ug_data);
+                       _create_unable_to_save_attachment_popup(aid->view);
                        break;
                }
 
@@ -287,7 +287,7 @@ void viewer_set_attachment_state(EV_attachment_data *aid, EV_attachment_state ne
 {
        debug_enter();
        retm_if(aid == NULL, "Invalid parameter: aid[NULL]");
-       EmailViewerUGD *ug_data = aid->ug_data;
+       EmailViewerView *view = aid->view;
 
        if (new_state != aid->state) {
 
@@ -299,7 +299,7 @@ void viewer_set_attachment_state(EV_attachment_data *aid, EV_attachment_state ne
                        break;
                case EV_ATT_STATE_IN_PROGRESS:
                        {
-                               VIEWER_ERROR_TYPE_E r = _ensure_update_timer(aid->ug_data);
+                               VIEWER_ERROR_TYPE_E r = _ensure_update_timer(aid->view);
                                if (r != VIEWER_ERROR_NONE) {
                                        debug_warning("_ensure_update_timer() failed: %d", r);
                                }
@@ -314,35 +314,35 @@ void viewer_set_attachment_state(EV_attachment_data *aid, EV_attachment_state ne
 
                _invalidate_attachment_item(aid);
 
-               switch (viewer_get_all_attachments_state(ug_data)) {
+               switch (viewer_get_all_attachments_state(view)) {
                case EV_ALL_ATT_STATE_IDLE:
-                       ug_data->show_cancel_all_btn = EINA_FALSE;
+                       view->show_cancel_all_btn = EINA_FALSE;
                        break;
                case EV_ALL_ATT_STATE_BUSY:
-                       ug_data->show_cancel_all_btn = EINA_TRUE;
+                       view->show_cancel_all_btn = EINA_TRUE;
                        break;
                default:
                        break;
                }
 
-               if (ug_data->save_all_btn) {
-                       _update_attachment_save_cancel_all_buttons(ug_data);
+               if (view->save_all_btn) {
+                       _update_attachment_save_cancel_all_buttons(view);
                }
        }
 
        debug_leave();
 }
 
-EV_all_attachment_state viewer_get_all_attachments_state(EmailViewerUGD *ug_data)
+EV_all_attachment_state viewer_get_all_attachments_state(EmailViewerView *view)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, EV_ALL_ATT_STATE_INVALID, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, EV_ALL_ATT_STATE_INVALID, "Invalid parameter: view[NULL]");
 
        EV_all_attachment_state result = EV_ALL_ATT_STATE_INVALID;
        Eina_List *l = NULL;
        EV_attachment_data *aid = NULL;
 
-       EINA_LIST_FOREACH(ug_data->attachment_data_list, l, aid) {
+       EINA_LIST_FOREACH(view->attachment_data_list, l, aid) {
                if (aid) {
                        EV_all_attachment_state all_state = (aid->state == EV_ATT_STATE_IDLE) ?
                                        EV_ALL_ATT_STATE_IDLE : EV_ALL_ATT_STATE_BUSY;
@@ -370,27 +370,27 @@ static VIEWER_ERROR_TYPE_E _save_and_preview_attachment(EV_attachment_data *aid)
        }
 
        EmailAttachmentType *info = aid->attachment_info;
-       EmailViewerUGD *ug_data = aid->ug_data;
+       EmailViewerView *view = aid->view;
 
        if (!info || STR_INVALID(info->path)) {
                debug_leave();
                return VIEWER_ERROR_INVALID_ARG;
        }
 
-       VIEWER_ERROR_TYPE_E r = _ensure_save_thread(ug_data);
+       VIEWER_ERROR_TYPE_E r = _ensure_save_thread(view);
        if (r != VIEWER_ERROR_NONE) {
                debug_error("_ensure_save_thread() failed: %d", r);
                return r;
        }
 
-       r = _ensure_update_timer(ug_data);
+       r = _ensure_update_timer(view);
        if (r != VIEWER_ERROR_NONE) {
                debug_error("_ensure_update_timer() failed: %d", r);
                return r;
        }
 
-       if (aid == ug_data->preview_aid) {
-               email_ext_save_err_type_e r =  email_prepare_temp_file_path(info->index, ug_data->temp_preview_folder_path, info->path, &aid->preview_path);
+       if (aid == view->preview_aid) {
+               email_ext_save_err_type_e r =  email_prepare_temp_file_path(info->index, view->temp_preview_folder_path, info->path, &aid->preview_path);
                if (r == EMAIL_EXT_SAVE_ERR_ALREADY_EXIST) {
                        debug_log("Already saved. Showing the preview...");
                        viewer_show_attachment_preview(aid);
@@ -413,28 +413,28 @@ static VIEWER_ERROR_TYPE_E _save_and_preview_attachment(EV_attachment_data *aid)
 
        aid->progress_val = 0;
 
-       pthread_mutex_lock(&ug_data->attachment_save_mutex);
+       pthread_mutex_lock(&view->attachment_save_mutex);
 
-       ug_data->attachment_data_list_to_save = eina_list_append(ug_data->attachment_data_list_to_save, aid);
+       view->attachment_data_list_to_save = eina_list_append(view->attachment_data_list_to_save, aid);
 
-       pthread_mutex_unlock(&ug_data->attachment_save_mutex);
-       pthread_cond_signal(&ug_data->attachment_save_cond);
+       pthread_mutex_unlock(&view->attachment_save_mutex);
+       pthread_cond_signal(&view->attachment_save_cond);
 
        debug_leave();
        return VIEWER_ERROR_NONE;
 }
 
-static VIEWER_ERROR_TYPE_E _ensure_save_thread(EmailViewerUGD *ug_data)
+static VIEWER_ERROR_TYPE_E _ensure_save_thread(EmailViewerView *view)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, VIEWER_ERROR_NULL_POINTER, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, VIEWER_ERROR_NULL_POINTER, "Invalid parameter: view[NULL]");
 
-       if (ug_data->attachment_save_thread == 0) {
-               int r = pthread_create(&ug_data->attachment_save_thread, NULL,
-                               _attachment_save_thread_run, ug_data);
+       if (view->attachment_save_thread == 0) {
+               int r = pthread_create(&view->attachment_save_thread, NULL,
+                               _attachment_save_thread_run, view);
                if (r != 0) {
                        debug_error("Failed to create thread: %d", r);
-                       ug_data->attachment_save_thread = 0;
+                       view->attachment_save_thread = 0;
                        return VIEWER_ERROR_FAIL;
                }
        }
@@ -443,18 +443,18 @@ static VIEWER_ERROR_TYPE_E _ensure_save_thread(EmailViewerUGD *ug_data)
        return VIEWER_ERROR_NONE;
 }
 
-static void _stop_save_thread(EmailViewerUGD *ug_data)
+static void _stop_save_thread(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       if (ug_data->attachment_save_thread != 0) {
-               pthread_t t = ug_data->attachment_save_thread;
+       if (view->attachment_save_thread != 0) {
+               pthread_t t = view->attachment_save_thread;
 
-               pthread_mutex_lock(&ug_data->attachment_save_mutex);
-               ug_data->attachment_save_thread = 0;
-               pthread_mutex_unlock(&ug_data->attachment_save_mutex);
-               pthread_cond_signal(&ug_data->attachment_save_cond);
+               pthread_mutex_lock(&view->attachment_save_mutex);
+               view->attachment_save_thread = 0;
+               pthread_mutex_unlock(&view->attachment_save_mutex);
+               pthread_cond_signal(&view->attachment_save_cond);
                pthread_join(t, NULL);
        }
 
@@ -465,29 +465,29 @@ static void *_attachment_save_thread_run(void *data)
 {
        debug_enter();
        retvm_if(data == NULL, NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = data;
+       EmailViewerView *view = data;
 
        bool need_exit = false;
        while (!need_exit) {
                EV_attachment_data *aid = NULL;
 
                debug_log("before lock");
-               pthread_mutex_lock(&ug_data->attachment_save_mutex);
+               pthread_mutex_lock(&view->attachment_save_mutex);
                debug_log("LOCKED");
 
-               if (ug_data->attachment_data_list_to_save) {
-                       aid = eina_list_data_get(ug_data->attachment_data_list_to_save);
-                       ug_data->attachment_data_list_to_save = eina_list_remove_list(
-                                       ug_data->attachment_data_list_to_save, ug_data->attachment_data_list_to_save);
-               } else if (ug_data->attachment_save_thread != 0) {
+               if (view->attachment_data_list_to_save) {
+                       aid = eina_list_data_get(view->attachment_data_list_to_save);
+                       view->attachment_data_list_to_save = eina_list_remove_list(
+                                       view->attachment_data_list_to_save, view->attachment_data_list_to_save);
+               } else if (view->attachment_save_thread != 0) {
                        debug_log("WAITING...");
-                       pthread_cond_wait(&ug_data->attachment_save_cond,
-                                       &ug_data->attachment_save_mutex);
+                       pthread_cond_wait(&view->attachment_save_cond,
+                                       &view->attachment_save_mutex);
                } else {
                        need_exit = true;
                }
 
-               pthread_mutex_unlock(&ug_data->attachment_save_mutex);
+               pthread_mutex_unlock(&view->attachment_save_mutex);
                debug_log("UNLOCKED");
 
                if (aid) {
@@ -522,15 +522,15 @@ static email_ext_save_err_type_e _viewer_save_attachment_on_disk(EV_attachment_d
        return EMAIL_EXT_SAVE_ERR_NONE;
 }
 
-static VIEWER_ERROR_TYPE_E _ensure_update_timer(EmailViewerUGD *ug_data)
+static VIEWER_ERROR_TYPE_E _ensure_update_timer(EmailViewerView *view)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, VIEWER_ERROR_NULL_POINTER, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, VIEWER_ERROR_NULL_POINTER, "Invalid parameter: view[NULL]");
 
-       if (!ug_data->attachment_update_timer) {
-               ug_data->attachment_update_timer = ecore_timer_add(
-                               ATTACHMENT_TIMER_UPDATE_INTERVAL, _attachment_update_timer_cb, ug_data);
-               if (!ug_data->attachment_update_timer) {
+       if (!view->attachment_update_timer) {
+               view->attachment_update_timer = ecore_timer_add(
+                               ATTACHMENT_TIMER_UPDATE_INTERVAL, _attachment_update_timer_cb, view);
+               if (!view->attachment_update_timer) {
                        debug_error("Failed to create update timer");
                        return VIEWER_ERROR_FAIL;
                }
@@ -540,14 +540,14 @@ static VIEWER_ERROR_TYPE_E _ensure_update_timer(EmailViewerUGD *ug_data)
        return VIEWER_ERROR_NONE;
 }
 
-static void _stop_update_timer(EmailViewerUGD *ug_data)
+static void _stop_update_timer(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       if (ug_data->attachment_update_timer) {
-               ecore_timer_del(ug_data->attachment_update_timer);
-               ug_data->attachment_update_timer = NULL;
+       if (view->attachment_update_timer) {
+               ecore_timer_del(view->attachment_update_timer);
+               view->attachment_update_timer = NULL;
        }
 
        debug_leave();
@@ -557,13 +557,13 @@ static Eina_Bool _attachment_update_timer_cb(void *data)
 {
        debug_enter();
        retvm_if(data == NULL, ECORE_CALLBACK_CANCEL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = data;
+       EmailViewerView *view = data;
 
        Eina_Bool result = ECORE_CALLBACK_CANCEL;
 
        Eina_List *l = NULL;
        EV_attachment_data *aid = NULL;
-       EINA_LIST_FOREACH(ug_data->attachment_data_list, l, aid) {
+       EINA_LIST_FOREACH(view->attachment_data_list, l, aid) {
                if (!aid) {
                        continue;
                }
@@ -585,7 +585,7 @@ static Eina_Bool _attachment_update_timer_cb(void *data)
 
                                if (!aid->saving_was_canceled) {
                                        if (aid->save_result == EMAIL_EXT_SAVE_ERR_NONE) {
-                                               if (aid == ug_data->preview_aid) {
+                                               if (aid == view->preview_aid) {
                                                        viewer_show_attachment_preview(aid);
                                                } else {
                                                        aid->is_saved = true;
@@ -593,7 +593,7 @@ static Eina_Bool _attachment_update_timer_cb(void *data)
                                                        debug_warning_if(ret != NOTIFICATION_ERROR_NONE, "notification_status_message_post() failed! ret:(%d)", ret);
                                                }
                                        } else if (aid->save_result == EMAIL_EXT_SAVE_ERR_NO_FREE_SPACE) {
-                                               viewer_show_storage_full_popup(ug_data);
+                                               viewer_show_storage_full_popup(view);
                                        }
                                }
 
@@ -617,7 +617,7 @@ static Eina_Bool _attachment_update_timer_cb(void *data)
        }
 
        if (result == ECORE_CALLBACK_CANCEL) {
-               ug_data->attachment_update_timer = NULL;
+               view->attachment_update_timer = NULL;
        }
 
        debug_leave();
@@ -628,25 +628,25 @@ static void _invalidate_attachment_item(EV_attachment_data *aid)
 {
        debug_enter();
        retm_if(aid == NULL, "Invalid parameter: aid[NULL]");
-       EmailViewerUGD *ug_data = aid->ug_data;
+       EmailViewerView *view = aid->view;
 
        aid->need_update = true;
 
-       if (!ug_data->attachment_update_job) {
-               ug_data->attachment_update_job = ecore_job_add(_attachment_update_job_cb, ug_data);
+       if (!view->attachment_update_job) {
+               view->attachment_update_job = ecore_job_add(_attachment_update_job_cb, view);
        }
 
        debug_leave();
 }
 
-static void _stop_update_job(EmailViewerUGD *ug_data)
+static void _stop_update_job(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       if (ug_data->attachment_update_job) {
-               ecore_job_del(ug_data->attachment_update_job);
-               ug_data->attachment_update_job = NULL;
+       if (view->attachment_update_job) {
+               ecore_job_del(view->attachment_update_job);
+               view->attachment_update_job = NULL;
        }
 
        debug_leave();
@@ -656,13 +656,13 @@ static void _attachment_update_job_cb(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = data;
+       EmailViewerView *view = data;
 
-       ug_data->attachment_update_job = NULL;
+       view->attachment_update_job = NULL;
 
        Eina_List *l = NULL;
        EV_attachment_data *aid = NULL;
-       EINA_LIST_FOREACH(ug_data->attachment_data_list, l, aid) {
+       EINA_LIST_FOREACH(view->attachment_data_list, l, aid) {
                if (aid && aid->need_update) {
                        if (aid->content_box) {
                                _viewer_update_gl_attachment_item(aid);
@@ -678,7 +678,7 @@ static void _cancel_attachment_task(EV_attachment_data *aid)
 {
        debug_enter();
        retm_if(aid == NULL, "Invalid parameter: aid[NULL]");
-       EmailViewerUGD *ug_data = aid->ug_data;
+       EmailViewerView *view = aid->view;
 
        if (aid->state == EV_ATT_STATE_IDLE) {
                debug_log("Already in idle state.");
@@ -686,7 +686,7 @@ static void _cancel_attachment_task(EV_attachment_data *aid)
        }
 
        if (aid->download_handle != 0) {
-               email_engine_stop_working(ug_data->account_id, aid->download_handle);
+               email_engine_stop_working(view->account_id, aid->download_handle);
                aid->download_handle = 0;
        }
 
@@ -696,18 +696,18 @@ static void _cancel_attachment_task(EV_attachment_data *aid)
                Eina_List *l = NULL;
                EV_attachment_data *aid_iter = NULL;
 
-               pthread_mutex_lock(&ug_data->attachment_save_mutex);
+               pthread_mutex_lock(&view->attachment_save_mutex);
 
-               EINA_LIST_FOREACH(ug_data->attachment_data_list_to_save, l, aid_iter) {
+               EINA_LIST_FOREACH(view->attachment_data_list_to_save, l, aid_iter) {
                        if (aid_iter == aid) {
-                               ug_data->attachment_data_list_to_save = eina_list_remove_list(
-                                               ug_data->attachment_data_list_to_save, l);
+                               view->attachment_data_list_to_save = eina_list_remove_list(
+                                               view->attachment_data_list_to_save, l);
                                was_removed = true;
                                break;
                        }
                }
 
-               pthread_mutex_unlock(&ug_data->attachment_save_mutex);
+               pthread_mutex_unlock(&view->attachment_save_mutex);
 
                if (was_removed) {
                        aid->is_saving = false;
@@ -717,8 +717,8 @@ static void _cancel_attachment_task(EV_attachment_data *aid)
                }
        }
 
-       if (aid == ug_data->preview_aid) {
-               ug_data->preview_aid = NULL;
+       if (aid == view->preview_aid) {
+               view->preview_aid = NULL;
        }
 
        viewer_set_attachment_state(aid, EV_ATT_STATE_IDLE);
@@ -726,47 +726,47 @@ static void _cancel_attachment_task(EV_attachment_data *aid)
        debug_leave();
 }
 
-static void _cancel_preview_task(EmailViewerUGD *ug_data, bool keep_download)
+static void _cancel_preview_task(EmailViewerView *view, bool keep_download)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       if (ug_data->preview_aid) {
-               if (!keep_download || ug_data->preview_aid->is_saving) {
-                       _cancel_attachment_task(ug_data->preview_aid);
+       if (view->preview_aid) {
+               if (!keep_download || view->preview_aid->is_saving) {
+                       _cancel_attachment_task(view->preview_aid);
                } else {
-                       ug_data->preview_aid = NULL;
+                       view->preview_aid = NULL;
                }
        }
 
        debug_leave();
 }
 
-static void _cancel_all_attachment_tasks(EmailViewerUGD *ug_data)
+static void _cancel_all_attachment_tasks(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
        Eina_List *l = NULL;
        EV_attachment_data *aid = NULL;
-       EINA_LIST_FOREACH(ug_data->attachment_data_list, l, aid) {
+       EINA_LIST_FOREACH(view->attachment_data_list, l, aid) {
                _cancel_attachment_task(aid);
        }
 
        debug_leave();
 }
 
-static void _save_all_attachments(EmailViewerUGD *ug_data)
+static void _save_all_attachments(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
        /* Cancel preview task only if already saving */
-       _cancel_preview_task(ug_data, true);
+       _cancel_preview_task(view, true);
 
        Eina_List *l = NULL;
        EV_attachment_data *aid = NULL;
-       EINA_LIST_FOREACH(ug_data->attachment_data_list, l, aid) {
+       EINA_LIST_FOREACH(view->attachment_data_list, l, aid) {
                if (aid && (aid->state == EV_ATT_STATE_IDLE)) {
                        VIEWER_ERROR_TYPE_E r = viewer_download_and_preview_save_attachment(aid);
                        if (r != VIEWER_ERROR_NONE) {
@@ -783,12 +783,12 @@ static void _attachment_download_save_all_cb(void *data, Evas_Object *obj, void
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *) data;
+       EmailViewerView *view = (EmailViewerView *) data;
 
-       if (!(ug_data->show_cancel_all_btn)) {
-               _save_all_attachments(ug_data);
+       if (!(view->show_cancel_all_btn)) {
+               _save_all_attachments(view);
        } else {
-               _cancel_all_attachment_tasks(ug_data);
+               _cancel_all_attachment_tasks(view);
        }
 
        debug_leave();
@@ -833,18 +833,18 @@ static void _viewer_attachment_button_clicked(void *data, Evas_Object *obj, cons
 
 static char *_gl_attachment_group_text_get(void *data, Evas_Object *obj, const char *part)
 {
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        if ((strcmp(part, "elm.text")) == 0) {
                char item_count_info[BUF_LEN_S];
-               if (ug_data->normal_att_count == 1) {
+               if (view->normal_att_count == 1) {
                        snprintf(item_count_info, sizeof(item_count_info), "%s", email_get_email_string("IDS_EMAIL_BODY_1_FILE_ABB"));
                } else {
-                       snprintf(item_count_info, sizeof(item_count_info), email_get_email_string("IDS_EMAIL_BODY_PD_FILES_ABB"), ug_data->normal_att_count);
+                       snprintf(item_count_info, sizeof(item_count_info), email_get_email_string("IDS_EMAIL_BODY_PD_FILES_ABB"), view->normal_att_count);
                }
 
                char *total_file_size = NULL;
-               total_file_size = email_get_file_size_string(ug_data->total_att_size);
+               total_file_size = email_get_file_size_string(view->total_att_size);
 
                strcat(strcat(strcat(item_count_info, " ("), total_file_size), ")");
                g_free(total_file_size);
@@ -957,7 +957,7 @@ static void _gl_attachment_sel(void *data, Evas_Object *obj, void *event_info)
        retm_if(!data, "Invalid parameter: data is NULL!");
 
        EV_attachment_data *attachment_item_data = (EV_attachment_data *)data;
-       EmailViewerUGD *ug_data = attachment_item_data->ug_data;
+       EmailViewerView *view = attachment_item_data->view;
        debug_log("Selected item info_index = %d", attachment_item_data->attachment_info->index);
 
        email_feedback_play_tap_sound();
@@ -969,15 +969,15 @@ static void _gl_attachment_sel(void *data, Evas_Object *obj, void *event_info)
        }
 
        /* When a user clicks attachment layout multiple times quickly, app launch requested is called multiple times. */
-       ret_if(ug_data->base.module->is_launcher_busy);
+       ret_if(view->base.module->is_launcher_busy);
 
        /* Cancel current (if any) preview task in any case */
-       _cancel_preview_task(ug_data, false);
+       _cancel_preview_task(view, false);
 
        /* Start new preview task */
-       ug_data->preview_aid = attachment_item_data;
+       view->preview_aid = attachment_item_data;
        if (viewer_download_and_preview_save_attachment(attachment_item_data) != VIEWER_ERROR_NONE) {
-               ug_data->preview_aid = NULL;
+               view->preview_aid = NULL;
        }
 
        debug_leave();
@@ -1125,7 +1125,7 @@ static void _viewer_gl_attachment_update_filename_label_text(EV_attachment_data
 {
        const gint64 size = attachment_data->attachment_info->size;
        gchar *file_size = email_get_file_size_string(size);
-       char *filename = _get_ellipsised_attachment_filename(attachment_data->ug_data,
+       char *filename = _get_ellipsised_attachment_filename(attachment_data->view,
                        attachment_data->attachment_info->name, file_size);
        elm_object_text_set(attachment_data->filename_label, filename);
        free(filename);
@@ -1202,7 +1202,7 @@ void viewer_update_attachment_item_info(void *data)
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
        EV_attachment_data *attachment_item_data = (EV_attachment_data *)data;
-       EmailViewerUGD *ug_data = attachment_item_data->ug_data;
+       EmailViewerView *view = attachment_item_data->view;
        EmailAttachmentType *info = attachment_item_data->attachment_info;
 
        info->path = email_engine_get_attachment_path(info->attach_id);
@@ -1210,13 +1210,13 @@ void viewer_update_attachment_item_info(void *data)
        if (email_check_file_exist(info->path)) {
                gint64 copy_size = info->size;
                info->size = email_get_file_size(info->path);
-               ug_data->total_att_size += (guint64) info->size - copy_size;
+               view->total_att_size += (guint64) info->size - copy_size;
                info->is_downloaded = TRUE;
 
                _viewer_gl_attachment_update_filename_label_text(attachment_item_data);
        }
 
-       elm_genlist_item_update(ug_data->attachment_group_item);
+       elm_genlist_item_update(view->attachment_group_item);
 
        debug_leave();
 }
@@ -1225,17 +1225,17 @@ static void _viewer_create_attachment_list(void *data)
 {
        debug_enter();
        retm_if(!data, "Invalid parameter: data is NULL!");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        int i = 0;
-       GList *attach_info_list = ug_data->attachment_info_list;
+       GList *attach_info_list = view->attachment_info_list;
        LIST_ITER_START(i, attach_info_list) {
                EmailAttachmentType *info = (EmailAttachmentType *)LIST_ITER_GET_DATA(i, attach_info_list);
-               if (viewer_is_normal_attachment(info) || (ug_data->is_smil_mail)) {
+               if (viewer_is_normal_attachment(info) || (view->is_smil_mail)) {
                        EV_attachment_data *attachment_item_data = NULL;
                        attachment_item_data = calloc(1, sizeof(EV_attachment_data));
                        retm_if(!attachment_item_data, "attachment_item_data is NULL!");
-                       attachment_item_data->ug_data = ug_data;
+                       attachment_item_data->view = view;
                        attachment_item_data->state = EV_ATT_STATE_IDLE;
                        attachment_item_data->download_handle = 0;
                        attachment_item_data->is_saving = false;
@@ -1247,37 +1247,37 @@ static void _viewer_create_attachment_list(void *data)
                        attachment_item_data->is_progress_info_packed = false;
                        debug_log("attachment_item_data->attachment_info :%p", attachment_item_data->attachment_info);
 
-                       if (!ug_data->attachment_group_item) {
-                               ug_data->attachment_group_itc = _viewer_attachment_create_group_item_class();
-                               ug_data->attachment_group_item = elm_genlist_item_append(ug_data->attachment_genlist, ug_data->attachment_group_itc, ug_data, NULL,
-                                                                               ELM_GENLIST_ITEM_NONE, _gl_attachment_group_sel, ug_data);
+                       if (!view->attachment_group_item) {
+                               view->attachment_group_itc = _viewer_attachment_create_group_item_class();
+                               view->attachment_group_item = elm_genlist_item_append(view->attachment_genlist, view->attachment_group_itc, view, NULL,
+                                                                               ELM_GENLIST_ITEM_NONE, _gl_attachment_group_sel, view);
                        }
-                       attachment_item_data->it = elm_genlist_item_append(ug_data->attachment_genlist, ug_data->attachment_itc, attachment_item_data, ug_data->attachment_group_item,
+                       attachment_item_data->it = elm_genlist_item_append(view->attachment_genlist, view->attachment_itc, attachment_item_data, view->attachment_group_item,
                                                                                ELM_GENLIST_ITEM_NONE, _gl_attachment_sel, attachment_item_data);
                        elm_genlist_item_select_mode_set(attachment_item_data->it, ELM_OBJECT_SELECT_MODE_ALWAYS);
 
-                       ug_data->attachment_data_list = eina_list_append(ug_data->attachment_data_list, attachment_item_data);
+                       view->attachment_data_list = eina_list_append(view->attachment_data_list, attachment_item_data);
                }
        }
 
        debug_leave();
 }
 
-static void _destroy_attachment_list(EmailViewerUGD *ug_data)
+static void _destroy_attachment_list(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(!ug_data, "Invalid parameter: ug_data[NULL]");
+       retm_if(!view, "Invalid parameter: view[NULL]");
 
        Eina_List *l = NULL;
        EV_attachment_data *aid = NULL;
-       EINA_LIST_FOREACH(ug_data->attachment_data_list, l, aid) {
+       EINA_LIST_FOREACH(view->attachment_data_list, l, aid) {
                free(aid->preview_path);
                free(aid);
        }
 
-       DELETE_LIST_OBJECT(ug_data->attachment_data_list);
-       DELETE_EVAS_OBJECT(ug_data->save_all_btn);
-       ug_data->save_all_btn = NULL;
+       DELETE_LIST_OBJECT(view->attachment_data_list);
+       DELETE_EVAS_OBJECT(view->save_all_btn);
+       view->save_all_btn = NULL;
        debug_leave();
 }
 
@@ -1285,9 +1285,9 @@ static Evas_Object *_viewer_create_attachment_view_ly(void *data)
 {
        debug_enter();
        retvm_if(!data, NULL, "Invalid parameter: data is NULL!");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       Evas_Object *parent = ug_data->base.module->navi;
+       Evas_Object *parent = view->base.module->navi;
 
        Evas_Object *ly = elm_layout_add(parent);
        elm_layout_theme_set(ly, "layout", "application", "noindicator");
@@ -1302,9 +1302,9 @@ static Evas_Object *_viewer_create_attachment_view_ly(void *data)
 static void _on_back_key(email_view_t *self)
 {
        debug_enter();
-       EmailViewerUGD *ug_data = &((EmailViewerModule *)self->module)->view;
+       EmailViewerView *view = &((EmailViewerModule *)self->module)->view;
 
-       email_module_exit_view(&ug_data->attachment_view);
+       email_module_exit_view(&view->attachment_view);
 
        debug_leave();
 }
@@ -1312,28 +1312,28 @@ static void _on_back_key(email_view_t *self)
 static void _destroy_view(email_view_t *self)
 {
        debug_enter();
-       EmailViewerUGD *ug_data = &((EmailViewerModule *)self->module)->view;
+       EmailViewerView *view = &((EmailViewerModule *)self->module)->view;
 
-       DELETE_EVAS_OBJECT(ug_data->attachment_genlist);
+       DELETE_EVAS_OBJECT(view->attachment_genlist);
 
-       EMAIL_GENLIST_ITC_FREE(ug_data->attachment_itc);
-       EMAIL_GENLIST_ITC_FREE(ug_data->attachment_group_itc);
+       EMAIL_GENLIST_ITC_FREE(view->attachment_itc);
+       EMAIL_GENLIST_ITC_FREE(view->attachment_group_itc);
 
-       _cancel_all_attachment_tasks(ug_data);
+       _cancel_all_attachment_tasks(view);
 
-       _stop_update_job(ug_data);
-       _stop_update_timer(ug_data);
-       _stop_save_thread(ug_data);
+       _stop_update_job(view);
+       _stop_update_timer(view);
+       _stop_save_thread(view);
 
-       _destroy_attachment_list(ug_data);
+       _destroy_attachment_list(view);
 
-       ug_data->attachment_group_item = NULL;
-       ug_data->preview_aid = NULL;
+       view->attachment_group_item = NULL;
+       view->preview_aid = NULL;
 
-       pthread_mutex_destroy(&ug_data->attachment_save_mutex);
-       pthread_cond_destroy(&ug_data->attachment_save_cond);
+       pthread_mutex_destroy(&view->attachment_save_mutex);
+       pthread_cond_destroy(&view->attachment_save_cond);
 
-       memset(&ug_data->attachment_view, 0, sizeof(ug_data->attachment_view));
+       memset(&view->attachment_view, 0, sizeof(view->attachment_view));
 
        debug_leave();
 }
@@ -1355,15 +1355,15 @@ static gboolean _viewer_notify_attachment_process_copy_cb(void *data, float perc
        return false;
 }
 
-void viewer_create_attachment_view(EmailViewerUGD *ug_data)
+void viewer_create_attachment_view(EmailViewerView *view)
 {
        debug_enter();
 
-       ug_data->attachment_view.create = _create_view;
-       ug_data->attachment_view.destroy = _destroy_view;
-       ug_data->attachment_view.on_back_key = _on_back_key;
+       view->attachment_view.create = _create_view;
+       view->attachment_view.destroy = _destroy_view;
+       view->attachment_view.on_back_key = _on_back_key;
 
-       int ret = email_module_create_view(ug_data->base.module, &ug_data->attachment_view);
+       int ret = email_module_create_view(view->base.module, &view->attachment_view);
        if (ret != 0) {
                debug_error("email_module_create_view(): failed (%d)", ret);
        }
@@ -1371,11 +1371,11 @@ void viewer_create_attachment_view(EmailViewerUGD *ug_data)
        debug_leave();
 }
 
-Evas_Object *_viewer_attachment_create_save_cancel_toolbar_btn(Evas_Object *layout, EmailViewerUGD *ug_data)
+Evas_Object *_viewer_attachment_create_save_cancel_toolbar_btn(Evas_Object *layout, EmailViewerView *view)
 {
        Evas_Object *btn = elm_button_add(layout);
        elm_object_style_set(btn, "bottom");
-       evas_object_smart_callback_add(btn, "clicked", _attachment_download_save_all_cb, ug_data);
+       evas_object_smart_callback_add(btn, "clicked", _attachment_download_save_all_cb, view);
 
        return btn;
 }
@@ -1383,39 +1383,39 @@ Evas_Object *_viewer_attachment_create_save_cancel_toolbar_btn(Evas_Object *layo
 static int _create_view(email_view_t *self)
 {
        debug_enter();
-       EmailViewerUGD *ug_data = &((EmailViewerModule *)self->module)->view;
+       EmailViewerView *view = &((EmailViewerModule *)self->module)->view;
 
-       pthread_mutex_init(&ug_data->attachment_save_mutex, NULL);
-       pthread_cond_init(&ug_data->attachment_save_cond, NULL);
+       pthread_mutex_init(&view->attachment_save_mutex, NULL);
+       pthread_cond_init(&view->attachment_save_cond, NULL);
 
-       self->content = _viewer_create_attachment_view_ly(ug_data);
-       ug_data->attachment_genlist = _viewer_attachment_create_genlist(self->content);
-       ug_data->attachment_itc = _viewer_attachment_create_item_class();
-       _viewer_create_attachment_list(ug_data);
-       elm_object_part_content_set(self->content, "elm.swallow.content", ug_data->attachment_genlist);
+       self->content = _viewer_create_attachment_view_ly(view);
+       view->attachment_genlist = _viewer_attachment_create_genlist(self->content);
+       view->attachment_itc = _viewer_attachment_create_item_class();
+       _viewer_create_attachment_list(view);
+       elm_object_part_content_set(self->content, "elm.swallow.content", view->attachment_genlist);
 
        Elm_Object_Item *attachment_navi_it = email_module_view_push(self, "IDS_EMAIL_HEADER_ATTACHMENTS_ABB", 0);
        elm_object_item_domain_text_translatable_set(attachment_navi_it, PACKAGE, EINA_TRUE);
 
-       int ret = _create_temp_preview_folder(ug_data);
+       int ret = _create_temp_preview_folder(view);
        retvm_if(ret == -1, -1, "_create_temp_preview_folder() is failed!");
 
-       if (ug_data->normal_att_count > 1) {
-               Evas_Object *ly = elm_layout_add(ug_data->base.content);
+       if (view->normal_att_count > 1) {
+               Evas_Object *ly = elm_layout_add(view->base.content);
                retvm_if(!ly, -1, "ly is NULL");
                elm_layout_file_set(ly, email_get_viewer_theme_path(), "ev/layout/toolbar_single_button");
                evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
 
-               ug_data->save_all_btn = _viewer_attachment_create_save_cancel_toolbar_btn(ly, ug_data);
-               retvm_if(!ug_data->save_all_btn, -1, "ug_data->save_all_btn is NULL");
+               view->save_all_btn = _viewer_attachment_create_save_cancel_toolbar_btn(ly, view);
+               retvm_if(!view->save_all_btn, -1, "view->save_all_btn is NULL");
 
-               elm_layout_content_set(ly, "ev.swallow.toolbar_single_button", ug_data->save_all_btn);
+               elm_layout_content_set(ly, "ev.swallow.toolbar_single_button", view->save_all_btn);
 
-               evas_object_show(ug_data->save_all_btn);
+               evas_object_show(view->save_all_btn);
                evas_object_show(ly);
                elm_object_item_part_content_set(attachment_navi_it, "toolbar", ly);
-               _update_attachment_save_cancel_all_buttons(ug_data);
+               _update_attachment_save_cancel_all_buttons(view);
        }
 
        debug_leave();
index 5179c75..3b4d64a 100644 (file)
@@ -75,8 +75,8 @@ static void _webview_magnifier_hide_cb(void *data, Evas_Object *obj, void *event
 
 static void _webview_btn_focused(void *data, Evas_Object *obj, void *event_info);
 static void _webview_btn_unfocused(void *data, Evas_Object *obj, void *event_info);
-static void _viewer_launch_smart_search(EmailViewerUGD *ug_data, char *link_url);
-static void _viewer_share_text(EmailViewerUGD *ug_data, char *share_text);
+static void _viewer_launch_smart_search(EmailViewerView *view, char *link_url);
+static void _viewer_share_text(EmailViewerView *view, char *share_text);
 static char *_viewer_convert_plain_text_body(EmailViewerWebview *wvd);
 
 static int _g_pos_x;
@@ -86,17 +86,17 @@ static int _g_pos_y;
  * Definition for static functions
  */
 
-static void _create_combined_scroller_and_resize_webview(EmailViewerUGD *ug_data)
+static void _create_combined_scroller_and_resize_webview(EmailViewerView *view)
 {
        /*create scroller*/
-       viewer_create_combined_scroller(ug_data);
+       viewer_create_combined_scroller(view);
 
        /*resize webview*/
-       double scale = ewk_view_scale_get(ug_data->webview);
+       double scale = ewk_view_scale_get(view->webview);
        int content_height = 0;
-       ewk_view_contents_size_get(ug_data->webview, NULL, &content_height);
+       ewk_view_contents_size_get(view->webview, NULL, &content_height);
        if (content_height) {
-               viewer_resize_webview(ug_data, content_height * scale);
+               viewer_resize_webview(view, content_height * scale);
        }
 }
 
@@ -119,11 +119,11 @@ static Eina_Bool _webview_show_page(void *data)
 {
        debug_enter();
        retvm_if(data == NULL, ECORE_CALLBACK_CANCEL, "Invalid parameter: data is NULL!");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       debug_log("scale:%f", ewk_view_scale_get(ug_data->webview));
+       debug_log("scale:%f", ewk_view_scale_get(view->webview));
 
-       elm_object_focus_allow_set(ug_data->en_subject, EINA_TRUE);
+       elm_object_focus_allow_set(view->en_subject, EINA_TRUE);
 
        debug_leave();
        return ECORE_CALLBACK_CANCEL;
@@ -134,7 +134,7 @@ static void _show_image_cb(void *data, Evas_Object *obj, void *event_info)
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        if (email_get_network_state() != EMAIL_NETWORK_STATUS_AVAILABLE) {
                int ret = notification_status_message_post(email_get_email_string("IDS_EMAIL_TPOP_FAILED_TO_CONNECT_TO_NETWORK"));
@@ -142,20 +142,20 @@ static void _show_image_cb(void *data, Evas_Object *obj, void *event_info)
                return;
        }
 
-       if (ug_data->body_download_status != EMAIL_BODY_DOWNLOAD_STATUS_NONE) {
+       if (view->body_download_status != EMAIL_BODY_DOWNLOAD_STATUS_NONE) {
                email_mail_attribute_value_t image_dn_status;
                debug_log("show_image_set");
-               image_dn_status.integer_type_value = ug_data->body_download_status | EMAIL_BODY_DOWNLOAD_STATUS_IMAGES_DOWNLOADED;
-               int err = email_update_mail_attribute(ug_data->account_id, &ug_data->mail_id, 1, EMAIL_MAIL_ATTRIBUTE_BODY_DOWNLOAD_STATUS, image_dn_status);
+               image_dn_status.integer_type_value = view->body_download_status | EMAIL_BODY_DOWNLOAD_STATUS_IMAGES_DOWNLOADED;
+               int err = email_update_mail_attribute(view->account_id, &view->mail_id, 1, EMAIL_MAIL_ATTRIBUTE_BODY_DOWNLOAD_STATUS, image_dn_status);
                debug_error_if(err != EMAIL_ERROR_NONE, "email_update_mail_attribute() failed! err:[%d]", err);
        }
 
-       if (ug_data->webview != NULL) {
-               viewer_delete_body_button(ug_data);
-               ug_data->b_show_remote_images = EINA_TRUE;
+       if (view->webview != NULL) {
+               viewer_delete_body_button(view);
+               view->b_show_remote_images = EINA_TRUE;
 
-               create_body_progress(ug_data);
-               _create_body(ug_data);
+               create_body_progress(view);
+               _create_body(view);
        }
 
        debug_leave();
@@ -164,17 +164,17 @@ static void _show_image_cb(void *data, Evas_Object *obj, void *event_info)
 static void _check_show_image_cb(Evas_Object *o, const char *result, void *data)
 {
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        if (result) {
                debug_secure("Is there any image in body content? [%s]", result);
                if (!g_strcmp0(result, "true")) {
                        debug_log("body content has one image at least");
-                       if (!ug_data->b_show_remote_images && (ug_data->viewer_type != EML_VIEWER) &&
-                                       viewer_check_body_download_status(ug_data->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED)) {
+                       if (!view->b_show_remote_images && (view->viewer_type != EML_VIEWER) &&
+                                       viewer_check_body_download_status(view->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED)) {
                                bool image_shown = false;
-                               if (viewer_check_body_download_status(ug_data->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_IMAGES_DOWNLOADED)) {
-                                       Ewk_Settings *ewk_settings = ewk_view_settings_get(ug_data->webview);
+                               if (viewer_check_body_download_status(view->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_IMAGES_DOWNLOADED)) {
+                                       Ewk_Settings *ewk_settings = ewk_view_settings_get(view->webview);
                                        if (ewk_settings_loads_images_automatically_set(ewk_settings, EINA_TRUE) == EINA_FALSE) {
                                                debug_log("SET show images is FAILED!");
                                        } else {
@@ -183,8 +183,8 @@ static void _check_show_image_cb(Evas_Object *o, const char *result, void *data)
                                }
                                if (!image_shown) {
 
-                                       viewer_create_body_button(ug_data, "IDS_EMAIL_MBODY_DISPLAY_IMAGES", _show_image_cb);
-                                       Evas_Object *content = evas_object_smart_parent_get(ug_data->base.content);
+                                       viewer_create_body_button(view, "IDS_EMAIL_MBODY_DISPLAY_IMAGES", _show_image_cb);
+                                       Evas_Object *content = evas_object_smart_parent_get(view->base.content);
 
                                        if (content) {
                                                edje_object_message_signal_process(content);
@@ -193,10 +193,10 @@ static void _check_show_image_cb(Evas_Object *o, const char *result, void *data)
                                        }
                                }
                        } else {
-                               if (ug_data->webview != NULL) {
-                                       Ewk_Settings *ewk_settings = ewk_view_settings_get(ug_data->webview);
-                                       debug_log("b_show_remote_images is %d", ug_data->b_show_remote_images);
-                                       if (ewk_settings_loads_images_automatically_set(ewk_settings, (ug_data->b_show_remote_images || (ug_data->viewer_type == EML_VIEWER))) == EINA_FALSE) {
+                               if (view->webview != NULL) {
+                                       Ewk_Settings *ewk_settings = ewk_view_settings_get(view->webview);
+                                       debug_log("b_show_remote_images is %d", view->b_show_remote_images);
+                                       if (ewk_settings_loads_images_automatically_set(ewk_settings, (view->b_show_remote_images || (view->viewer_type == EML_VIEWER))) == EINA_FALSE) {
                                                debug_log("SET show images is FAILED!");
                                        }
                                }
@@ -208,7 +208,7 @@ static void _check_show_image_cb(Evas_Object *o, const char *result, void *data)
         * _webview_load_noemptylayout_finished_cb, because toolbar is created in
         * this function and its height affects the webview height
         */
-       _create_combined_scroller_and_resize_webview(ug_data);
+       _create_combined_scroller_and_resize_webview(view);
 }
 
 static void _webview_load_started_cb(void *data, Evas_Object *obj, void *event_info)
@@ -225,10 +225,10 @@ static void _webview_load_finished_cb(void *data, Evas_Object *obj, void *event_
 #endif
 
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       retm_if(ug_data->mail_info == NULL, "ug_data->mail_info is NULL!");
+       EmailViewerView *view = (EmailViewerView *)data;
+       retm_if(view->mail_info == NULL, "view->mail_info is NULL!");
 
-       _webview_show_page(ug_data);
+       _webview_show_page(view);
 
        debug_leave();
 }
@@ -239,19 +239,19 @@ static Eina_Bool _handle_link_scheme(void *data, const char *link_uri, bool neww
        retvm_if(!data, EINA_FALSE, "Invalid parameter: data[NULL]");
        retvm_if(!link_uri, EINA_FALSE, "Invalid parameter: link_uri[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        if ((strncmp(link_uri, URI_SCHEME_HTTP, strlen(URI_SCHEME_HTTP)) == 0) ||
                        (strncmp(link_uri, URI_SCHEME_HTTPS, strlen(URI_SCHEME_HTTPS)) == 0) ||
                        (strncmp(link_uri, URI_SCHEME_FTP, strlen(URI_SCHEME_FTP)) == 0) ||
                        (strncmp(link_uri, URI_SCHEME_MMS, strlen(URI_SCHEME_MMS)) == 0) ||
                        (strncmp(link_uri, URI_SCHEME_WAP, strlen(URI_SCHEME_WAP)) == 0)) {
                debug_log("launch browser");
-               viewer_launch_browser(ug_data, link_uri);
+               viewer_launch_browser(view, link_uri);
                debug_leave();
                return EINA_TRUE;
        } else if (strncmp(link_uri, URI_SCHEME_MAILTO, strlen(URI_SCHEME_MAILTO)) == 0) {
                debug_log("launch email composer");
-               viewer_create_email(ug_data, link_uri);
+               viewer_create_email(view, link_uri);
                return EINA_TRUE;
        } else {
                debug_log("Unsupported link scheme");
@@ -265,19 +265,19 @@ static void _webview_policy_cb(void *data, Evas_Object *obj, void *event_info, b
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)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_url_get(ug_data->webview);
+       uri = ewk_view_url_get(view->webview);
        debug_secure("ewk_view_url_get(%s)", uri);
 
-       if (ug_data->b_load_finished == EINA_TRUE) {
-               if (ug_data->is_long_pressed == EINA_TRUE) {
+       if (view->b_load_finished == EINA_TRUE) {
+               if (view->is_long_pressed == EINA_TRUE) {
                        debug_log("Long pressed!!!");
-                       ug_data->is_long_pressed = EINA_FALSE;
+                       view->is_long_pressed = EINA_FALSE;
                        ewk_policy_decision_ignore(policy_decision);
                        return;
                }
@@ -341,34 +341,34 @@ static void _webview_load_noemptylayout_finished_cb(void *data, Evas_Object *obj
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        /* delay destroying viewer if message deleted from server */
-       ug_data->can_destroy_on_msg_delete = true;
-       if (ug_data->need_pending_destroy) {
+       view->can_destroy_on_msg_delete = true;
+       if (view->need_pending_destroy) {
                debug_log("email_module_make_destroy_request");
-               email_module_make_destroy_request(ug_data->base.module);
+               email_module_make_destroy_request(view->base.module);
                return;
        }
 
-       if (ewk_view_script_execute(ug_data->webview, VIEWER_JS_HAVE_IMAGES, _check_show_image_cb, ug_data) == EINA_FALSE) {
-               _create_combined_scroller_and_resize_webview(ug_data);
+       if (ewk_view_script_execute(view->webview, VIEWER_JS_HAVE_IMAGES, _check_show_image_cb, view) == EINA_FALSE) {
+               _create_combined_scroller_and_resize_webview(view);
                debug_log("VIEWER_JS_HAVE_IMAGES failed.");
        }
-       if (ug_data->list_progressbar != NULL) {
+       if (view->list_progressbar != NULL) {
                debug_log("destroy list_progressbar");
-               elm_object_part_content_unset(ug_data->base.content, "ev.swallow.progress");
-               DELETE_EVAS_OBJECT(ug_data->list_progressbar);
+               elm_object_part_content_unset(view->base.content, "ev.swallow.progress");
+               DELETE_EVAS_OBJECT(view->list_progressbar);
        }
 
-       if ((ug_data->webview_ly) && (ug_data->webview)) {
-               elm_object_part_content_set(ug_data->webview_ly, "elm.swallow.content", ug_data->webview);
-               evas_object_show(ug_data->webview_ly);
-               evas_object_show(ug_data->webview);
+       if ((view->webview_ly) && (view->webview)) {
+               elm_object_part_content_set(view->webview_ly, "elm.swallow.content", view->webview);
+               evas_object_show(view->webview_ly);
+               evas_object_show(view->webview);
        }
 
        debug_log("set b_load_finished");
-       ug_data->b_load_finished = EINA_TRUE;
+       view->b_load_finished = EINA_TRUE;
        debug_leave();
 }
 
@@ -377,8 +377,8 @@ static void _webview_load_progress_cb(void *data, Evas_Object *obj, void *event_
        double *progress = (double *)event_info;
        if (progress) {
                debug_log("===> load,progress: [%f]", *progress);
-               EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-               if (ug_data) ug_data->loading_progress = *progress;
+               EmailViewerView *view = (EmailViewerView *)data;
+               if (view) view->loading_progress = *progress;
        }
 }
 
@@ -387,11 +387,11 @@ static void _webview_edge_top_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       ug_data->is_top_webview_reached = EINA_TRUE;
+       view->is_top_webview_reached = EINA_TRUE;
 
-       viewer_stop_webkit_scroller_start_elm_scroller(ug_data);
+       viewer_stop_webkit_scroller_start_elm_scroller(view);
 
        debug_leave();
 }
@@ -400,11 +400,11 @@ static void _webview_edge_bottom_cb(void *data, Evas_Object *obj, void *event_in
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       ug_data->is_bottom_webview_reached = EINA_TRUE;
+       view->is_bottom_webview_reached = EINA_TRUE;
 
-       edje_object_part_drag_value_set(_EDJ(ug_data->combined_scroller), "elm.dragable.vbar", 0.0, 1.0);
+       edje_object_part_drag_value_set(_EDJ(view->combined_scroller), "elm.dragable.vbar", 0.0, 1.0);
 
        debug_leave();
 }
@@ -414,8 +414,8 @@ static void _webview_edge_left_cb(void *data, Evas_Object *obj, void *event_info
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       edje_object_part_drag_value_set(_EDJ(ug_data->combined_scroller), "elm.dragable.hbar", 0.0, 0.0);
+       EmailViewerView *view = (EmailViewerView *)data;
+       edje_object_part_drag_value_set(_EDJ(view->combined_scroller), "elm.dragable.hbar", 0.0, 0.0);
 
        debug_leave();
 }
@@ -425,8 +425,8 @@ static void _webview_edge_right_cb(void *data, Evas_Object *obj, void *event_inf
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       edje_object_part_drag_value_set(_EDJ(ug_data->combined_scroller), "elm.dragable.hbar", 1.0, 0.0);
+       EmailViewerView *view = (EmailViewerView *)data;
+       edje_object_part_drag_value_set(_EDJ(view->combined_scroller), "elm.dragable.hbar", 1.0, 0.0);
 
        debug_leave();
 }
@@ -434,14 +434,14 @@ static void _webview_edge_right_cb(void *data, Evas_Object *obj, void *event_inf
 static void _webview_mouse_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
 {
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       retm_if(ug_data->webview == NULL, "ug_data->webview is NULL.");
+       EmailViewerView *view = (EmailViewerView *)data;
+       retm_if(view->webview == NULL, "view->webview is NULL.");
 
        Evas_Event_Mouse_Down *mouse_info = (Evas_Event_Mouse_Down *)event_info;
        /*debug_log("output position: [%d, %d]", mouse_info->output.x, mouse_info->output.y);*/
        _g_pos_x = mouse_info->output.x;
        _g_pos_y = mouse_info->output.y;
-       ug_data->is_long_pressed = EINA_FALSE;
+       view->is_long_pressed = EINA_FALSE;
 }
 
 static void _webview_resize_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
@@ -453,10 +453,10 @@ static void _webview_zoom_started_cb(void *data, Evas_Object *obj, void *event_i
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       if (ug_data->scroller_locked == FALSE) {
-               ug_data->scroller_locked = TRUE;
+       if (view->scroller_locked == FALSE) {
+               view->scroller_locked = TRUE;
                debug_log("<<lock scroller>>");
                debug_log("<<unlock webview>>");
        }
@@ -468,29 +468,29 @@ static void _webview_zoom_finished_cb(void *data, Evas_Object *obj, void *event_
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       retm_if(!ug_data->b_load_finished, "loading is in progress");
+       retm_if(!view->b_load_finished, "loading is in progress");
 
-       if (ug_data->scroller_locked) {
-               ug_data->scroller_locked = FALSE;
+       if (view->scroller_locked) {
+               view->scroller_locked = FALSE;
                debug_log("<<unlock scroller>>");
                debug_log("<<lock webview>>");
        }
 
-       if (ug_data->webview && (ug_data->is_main_scroller_scrolling == EINA_TRUE)) {
+       if (view->webview && (view->is_main_scroller_scrolling == EINA_TRUE)) {
                Evas_Coord wx, wy;
-               ewk_view_scroll_pos_get(ug_data->webview, &wx, &wy);
+               ewk_view_scroll_pos_get(view->webview, &wx, &wy);
                debug_log("webkit scroller x[%d] y[%d]", wx, wy);
-               ewk_view_scroll_set(ug_data->webview, wx, 0);
+               ewk_view_scroll_set(view->webview, wx, 0);
        }
 
        /*changing webview size based on scale change*/
-       double scale = ewk_view_scale_get(ug_data->webview);
+       double scale = ewk_view_scale_get(view->webview);
        int content_height = 0;
-       ewk_view_contents_size_get(ug_data->webview, NULL, &content_height);
+       ewk_view_contents_size_get(view->webview, NULL, &content_height);
        if (content_height) {
-               viewer_resize_webview(ug_data, content_height * scale);
+               viewer_resize_webview(view, content_height * scale);
        }
 
        debug_log("scale:%f", scale);
@@ -601,13 +601,13 @@ static void _webview_contextmenu_customize_cb(void *data, Evas_Object *obj, void
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
        retm_if(event_info == NULL, "Invalid parameter: event_info[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        int i = 0, count = 0;
        Ewk_Context_Menu *contextmenu = (Ewk_Context_Menu *)event_info;
        Ewk_Context_Menu_Item *menu_item = NULL;
        Ewk_Context_Menu_Item_Tag menu_item_tag = EWK_CONTEXT_MENU_ITEM_TAG_NO_ACTION;
-       ug_data->is_long_pressed = EINA_TRUE;
+       view->is_long_pressed = EINA_TRUE;
 
        context_menu_type menu_type = _get_menu_type(contextmenu);
        debug_log("menu_type=%d", menu_type);
@@ -640,7 +640,7 @@ static void _webview_contextmenu_selected_cb(void *data, Evas_Object *webview, v
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
        retm_if(event_info == NULL, "Invalid parameter: event_info[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        Ewk_Context_Menu_Item *menu_item = (Ewk_Context_Menu_Item *)event_info;
        Ewk_Context_Menu_Item_Tag menu_item_tag = EWK_CONTEXT_MENU_ITEM_TAG_NO_ACTION;
@@ -654,7 +654,7 @@ static void _webview_contextmenu_selected_cb(void *data, Evas_Object *webview, v
        switch (menu_item_tag) {
        case CUSTOM_CONTEXT_MENU_ITEM_SMART_SEARCH:
                debug_log("SMART_SEARCH");
-               _viewer_launch_smart_search(ug_data, link_url);
+               _viewer_launch_smart_search(view, link_url);
        break;
 
        case CUSTOM_CONTEXT_MENU_ITEM_SHARE:
@@ -663,13 +663,13 @@ static void _webview_contextmenu_selected_cb(void *data, Evas_Object *webview, v
                const char *selected_text = NULL;
                char *share_text = NULL;
 
-               selected_text = ewk_view_text_selection_text_get(ug_data->webview);
+               selected_text = ewk_view_text_selection_text_get(view->webview);
                debug_secure("selected_text [%s]", selected_text);
                debug_secure("link_url [%s]", link_url);
                if (STR_LEN(selected_text) != 0) {
                        share_text = g_strdup(selected_text);
                        debug_secure("share_text [%s]", share_text);
-                       _viewer_share_text(ug_data, share_text);
+                       _viewer_share_text(view, share_text);
                        free(share_text);
                }
        }
@@ -683,7 +683,7 @@ static void _webview_contextmenu_selected_cb(void *data, Evas_Object *webview, v
        debug_leave();
 }
 
-static void _viewer_launch_smart_search(EmailViewerUGD *ug_data, char *link_url)
+static void _viewer_launch_smart_search(EmailViewerView *view, char *link_url)
 {
        debug_enter();
        retm_if(link_url == NULL, "Invalid parameter: link_url[NULL]");
@@ -691,7 +691,7 @@ static void _viewer_launch_smart_search(EmailViewerUGD *ug_data, char *link_url)
        int ret = 0;
        const char *selected_text = NULL;
        char *keyword = NULL;
-       selected_text = ewk_view_text_selection_text_get(ug_data->webview);
+       selected_text = ewk_view_text_selection_text_get(view->webview);
        debug_secure("selected_text [%s]", selected_text);
        debug_secure("link_url [%s]", link_url);
 
@@ -728,7 +728,7 @@ static void _viewer_launch_smart_search(EmailViewerUGD *ug_data, char *link_url)
        g_free(keyword);
 }
 
-static void _viewer_share_text(EmailViewerUGD *ug_data, char *share_text)
+static void _viewer_share_text(EmailViewerView *view, char *share_text)
 {
        debug_enter();
 
@@ -769,7 +769,7 @@ static void _viewer_share_text(EmailViewerUGD *ug_data, char *share_text)
        g_free(selected_text);
 }
 
-void viewer_launch_download_manager(EmailViewerUGD *ug_data, const char *download_uri, const char *cookie)
+void viewer_launch_download_manager(EmailViewerView *view, const char *download_uri, const char *cookie)
 {
        debug_enter();
        retm_if(download_uri == NULL, "Invalid parameter: download_uri[NULL]");
@@ -823,8 +823,8 @@ static void _webview_magnifier_show_cb(void *data, Evas_Object *obj, void *event
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       ug_data->is_magnifier_opened = EINA_TRUE;
+       EmailViewerView *view = (EmailViewerView *)data;
+       view->is_magnifier_opened = EINA_TRUE;
 
        debug_leave();
 }
@@ -833,8 +833,8 @@ static void _webview_magnifier_hide_cb(void *data, Evas_Object *obj, void *event
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       ug_data->is_magnifier_opened = EINA_FALSE;
+       EmailViewerView *view = (EmailViewerView *)data;
+       view->is_magnifier_opened = EINA_FALSE;
        debug_leave();
 }
 
@@ -848,18 +848,18 @@ static Eina_Bool _webview_scroll_region_bringin_idler(void *data)
        debug_enter();
 
        retvm_if(data == NULL, ECORE_CALLBACK_CANCEL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        Evas_Coord sc_width = 0, sc_height = 0;
        Evas_Coord subject_y = 0, web_y = 0;
 
-       ug_data->idler_regionbringin = NULL;
+       view->idler_regionbringin = NULL;
 
-       evas_object_geometry_get(ug_data->subject_ly, NULL, &subject_y, NULL, NULL);
-       evas_object_geometry_get(ug_data->webview_ly, NULL, &web_y, NULL, NULL);
+       evas_object_geometry_get(view->subject_ly, NULL, &subject_y, NULL, NULL);
+       evas_object_geometry_get(view->webview_ly, NULL, &web_y, NULL, NULL);
 
        Evas_Coord size_to_be_scrolled = web_y - subject_y;
-       elm_scroller_region_get(ug_data->scroller, 0, NULL, &sc_width, &sc_height);
-       elm_scroller_region_bring_in(ug_data->scroller, 0, size_to_be_scrolled, sc_width, sc_height);
+       elm_scroller_region_get(view->scroller, 0, NULL, &sc_width, &sc_height);
+       elm_scroller_region_bring_in(view->scroller, 0, size_to_be_scrolled, sc_width, sc_height);
        debug_log("size_to_be_scrolled :%d", size_to_be_scrolled);
 
        debug_leave();
@@ -871,20 +871,20 @@ static void _webview_contextmenu_willshow_cb(void *data, Evas_Object *obj, void
        debug_enter();
 
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        Evas_Point *pt = (Evas_Point *)event_info;
 
        Evas_Coord web_y = 0, top_coordinate_y = 0;
-       evas_object_geometry_get(ug_data->webview, NULL, &web_y, NULL, NULL);
-       evas_object_geometry_get(ug_data->scroller, NULL, &top_coordinate_y, NULL, NULL);
+       evas_object_geometry_get(view->webview, NULL, &web_y, NULL, NULL);
+       evas_object_geometry_get(view->scroller, NULL, &top_coordinate_y, NULL, NULL);
 
        debug_log("==> will show at [%d, %d]", pt->x, pt->y);
 
-       if ((top_coordinate_y != web_y) && ug_data->is_webview_text_selected) {
-               DELETE_IDLER_OBJECT(ug_data->idler_regionbringin);
-               ug_data->idler_regionbringin = ecore_idler_add(_webview_scroll_region_bringin_idler, ug_data);
+       if ((top_coordinate_y != web_y) && view->is_webview_text_selected) {
+               DELETE_IDLER_OBJECT(view->idler_regionbringin);
+               view->idler_regionbringin = ecore_idler_add(_webview_scroll_region_bringin_idler, view);
        }
-       ug_data->is_webview_text_selected = EINA_FALSE;
+       view->is_webview_text_selected = EINA_FALSE;
 
        debug_leave();
 }
@@ -895,11 +895,11 @@ static void _webview_textselection_mode_cb(void *data, Evas_Object *obj, void *e
 
        retm_if(!data || !event_info, "invalid data");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        bool *is_text_selection_mode = (bool *)event_info;
        debug_log("=> [%d]", *is_text_selection_mode);
 
-       ug_data->is_webview_text_selected = (Eina_Bool)*is_text_selection_mode;
+       view->is_webview_text_selected = (Eina_Bool)*is_text_selection_mode;
 
        debug_leave();
 }
@@ -908,40 +908,40 @@ void viewer_webkit_add_callbacks(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       if (ug_data->webview) {
-               evas_object_smart_callback_add(ug_data->webview, "edge,top", _webview_edge_top_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "edge,bottom", _webview_edge_bottom_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "edge,left", _webview_edge_left_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "edge,right", _webview_edge_right_cb, ug_data);
+       if (view->webview) {
+               evas_object_smart_callback_add(view->webview, "edge,top", _webview_edge_top_cb, view);
+               evas_object_smart_callback_add(view->webview, "edge,bottom", _webview_edge_bottom_cb, view);
+               evas_object_smart_callback_add(view->webview, "edge,left", _webview_edge_left_cb, view);
+               evas_object_smart_callback_add(view->webview, "edge,right", _webview_edge_right_cb, view);
 
-               evas_object_smart_callback_add(ug_data->webview, "load,started", _webview_load_started_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "load,finished", _webview_load_finished_cb, ug_data);
+               evas_object_smart_callback_add(view->webview, "load,started", _webview_load_started_cb, view);
+               evas_object_smart_callback_add(view->webview, "load,finished", _webview_load_finished_cb, view);
 #ifndef _EWK_LOAD_NONEMPTY_LAYOUT_FINISHED_CB_UNAVAILABLE_
-               evas_object_smart_callback_add(ug_data->webview, "load,nonemptylayout,finished", _webview_load_noemptylayout_finished_cb, ug_data);
+               evas_object_smart_callback_add(view->webview, "load,nonemptylayout,finished", _webview_load_noemptylayout_finished_cb, view);
 #endif
-               evas_object_smart_callback_add(ug_data->webview, "load,progress", _webview_load_progress_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "load,error", _webview_load_error_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "policy,navigation,decide", _webview_policy_navigation_decide_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "policy,newwindow,decide", _webview_policy_newwindow_decide_cb, ug_data);
-
-               evas_object_smart_callback_add(ug_data->webview, "contextmenu,customize", _webview_contextmenu_customize_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "contextmenu,selected", _webview_contextmenu_selected_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "contextmenu,willshow", _webview_contextmenu_willshow_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "textselection,mode", _webview_textselection_mode_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "magnifier,show", _webview_magnifier_show_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "magnifier,hide", _webview_magnifier_hide_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "zoom,started", _webview_zoom_started_cb, ug_data);
-               evas_object_smart_callback_add(ug_data->webview, "zoom,finished", _webview_zoom_finished_cb, ug_data);
-
-               evas_object_event_callback_add(ug_data->webview, EVAS_CALLBACK_MOUSE_DOWN, _webview_mouse_down_cb, ug_data);
-               evas_object_event_callback_add(ug_data->webview, EVAS_CALLBACK_RESIZE, _webview_resize_cb, ug_data);
-
-               evas_object_smart_callback_add(ug_data->webview_button, "focused", _webview_btn_focused, ug_data);
-               evas_object_smart_callback_add(ug_data->webview_button, "unfocused", _webview_btn_unfocused, ug_data);
+               evas_object_smart_callback_add(view->webview, "load,progress", _webview_load_progress_cb, view);
+               evas_object_smart_callback_add(view->webview, "load,error", _webview_load_error_cb, view);
+               evas_object_smart_callback_add(view->webview, "policy,navigation,decide", _webview_policy_navigation_decide_cb, view);
+               evas_object_smart_callback_add(view->webview, "policy,newwindow,decide", _webview_policy_newwindow_decide_cb, view);
+
+               evas_object_smart_callback_add(view->webview, "contextmenu,customize", _webview_contextmenu_customize_cb, view);
+               evas_object_smart_callback_add(view->webview, "contextmenu,selected", _webview_contextmenu_selected_cb, view);
+               evas_object_smart_callback_add(view->webview, "contextmenu,willshow", _webview_contextmenu_willshow_cb, view);
+               evas_object_smart_callback_add(view->webview, "textselection,mode", _webview_textselection_mode_cb, view);
+               evas_object_smart_callback_add(view->webview, "magnifier,show", _webview_magnifier_show_cb, view);
+               evas_object_smart_callback_add(view->webview, "magnifier,hide", _webview_magnifier_hide_cb, view);
+               evas_object_smart_callback_add(view->webview, "zoom,started", _webview_zoom_started_cb, view);
+               evas_object_smart_callback_add(view->webview, "zoom,finished", _webview_zoom_finished_cb, view);
+
+               evas_object_event_callback_add(view->webview, EVAS_CALLBACK_MOUSE_DOWN, _webview_mouse_down_cb, view);
+               evas_object_event_callback_add(view->webview, EVAS_CALLBACK_RESIZE, _webview_resize_cb, view);
+
+               evas_object_smart_callback_add(view->webview_button, "focused", _webview_btn_focused, view);
+               evas_object_smart_callback_add(view->webview_button, "unfocused", _webview_btn_unfocused, view);
 #ifdef _WEBKIT_CONSOLE_MESSAGE_LOG
-               evas_object_smart_callback_add(ug_data->webview, "console,message", _webview_console_message, ug_data);
+               evas_object_smart_callback_add(view->webview, "console,message", _webview_console_message, view);
 #endif
        }
        debug_leave();
@@ -951,40 +951,40 @@ void viewer_webkit_del_callbacks(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       if (ug_data->webview) {
-               evas_object_smart_callback_del_full(ug_data->webview, "edge,top", _webview_edge_top_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "edge,bottom", _webview_edge_bottom_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "edge,left", _webview_edge_left_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "edge,right", _webview_edge_right_cb, ug_data);
+       if (view->webview) {
+               evas_object_smart_callback_del_full(view->webview, "edge,top", _webview_edge_top_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "edge,bottom", _webview_edge_bottom_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "edge,left", _webview_edge_left_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "edge,right", _webview_edge_right_cb, view);
 
-               evas_object_smart_callback_del_full(ug_data->webview, "load,started", _webview_load_started_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "load,finished", _webview_load_finished_cb, ug_data);
+               evas_object_smart_callback_del_full(view->webview, "load,started", _webview_load_started_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "load,finished", _webview_load_finished_cb, view);
 #ifndef _EWK_LOAD_NONEMPTY_LAYOUT_FINISHED_CB_UNAVAILABLE_
-               evas_object_smart_callback_del_full(ug_data->webview, "load,nonemptylayout,finished", _webview_load_noemptylayout_finished_cb, ug_data);
+               evas_object_smart_callback_del_full(view->webview, "load,nonemptylayout,finished", _webview_load_noemptylayout_finished_cb, view);
 #endif
-               evas_object_smart_callback_del_full(ug_data->webview, "load,progress", _webview_load_progress_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "load,error", _webview_load_error_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "policy,navigation,decide", _webview_policy_navigation_decide_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "policy,newwindow,decide", _webview_policy_newwindow_decide_cb, ug_data);
-
-               evas_object_smart_callback_del_full(ug_data->webview, "contextmenu,customize", _webview_contextmenu_customize_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "contextmenu,selected", _webview_contextmenu_selected_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "contextmenu,willshow", _webview_contextmenu_willshow_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "textselection,mode", _webview_textselection_mode_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "magnifier,show", _webview_magnifier_show_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "magnifier,hide", _webview_magnifier_hide_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "zoom,started", _webview_zoom_started_cb, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview, "zoom,finished", _webview_zoom_finished_cb, ug_data);
-
-               evas_object_event_callback_del_full(ug_data->webview, EVAS_CALLBACK_MOUSE_DOWN, _webview_mouse_down_cb, ug_data);
-               evas_object_event_callback_del_full(ug_data->webview, EVAS_CALLBACK_RESIZE, _webview_resize_cb, ug_data);
-
-               evas_object_smart_callback_del_full(ug_data->webview_button, "focused", _webview_btn_focused, ug_data);
-               evas_object_smart_callback_del_full(ug_data->webview_button, "unfocused", _webview_btn_unfocused, ug_data);
+               evas_object_smart_callback_del_full(view->webview, "load,progress", _webview_load_progress_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "load,error", _webview_load_error_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "policy,navigation,decide", _webview_policy_navigation_decide_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "policy,newwindow,decide", _webview_policy_newwindow_decide_cb, view);
+
+               evas_object_smart_callback_del_full(view->webview, "contextmenu,customize", _webview_contextmenu_customize_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "contextmenu,selected", _webview_contextmenu_selected_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "contextmenu,willshow", _webview_contextmenu_willshow_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "textselection,mode", _webview_textselection_mode_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "magnifier,show", _webview_magnifier_show_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "magnifier,hide", _webview_magnifier_hide_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "zoom,started", _webview_zoom_started_cb, view);
+               evas_object_smart_callback_del_full(view->webview, "zoom,finished", _webview_zoom_finished_cb, view);
+
+               evas_object_event_callback_del_full(view->webview, EVAS_CALLBACK_MOUSE_DOWN, _webview_mouse_down_cb, view);
+               evas_object_event_callback_del_full(view->webview, EVAS_CALLBACK_RESIZE, _webview_resize_cb, view);
+
+               evas_object_smart_callback_del_full(view->webview_button, "focused", _webview_btn_focused, view);
+               evas_object_smart_callback_del_full(view->webview_button, "unfocused", _webview_btn_unfocused, view);
 #ifdef _WEBKIT_CONSOLE_MESSAGE_LOG
-               evas_object_smart_callback_del_full(ug_data->webview, "console,message", _webview_console_message, ug_data);
+               evas_object_smart_callback_del_full(view->webview, "console,message", _webview_console_message, view);
 #endif
        }
        debug_leave();
@@ -994,10 +994,10 @@ static void _webview_btn_focused(void *data, Evas_Object *obj, void *event_info)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       if (ug_data->webview) {
-               if (!evas_object_focus_get(ug_data->webview)) {
-                       evas_object_focus_set(ug_data->webview, EINA_TRUE);
+       EmailViewerView *view = (EmailViewerView *)data;
+       if (view->webview) {
+               if (!evas_object_focus_get(view->webview)) {
+                       evas_object_focus_set(view->webview, EINA_TRUE);
                }
        }
 
@@ -1008,8 +1008,8 @@ static void _webview_btn_unfocused(void *data, Evas_Object *obj, void *event_inf
 {
        debug_enter();
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       evas_object_focus_set(ug_data->webview, EINA_FALSE);
+       EmailViewerView *view = (EmailViewerView *)data;
+       evas_object_focus_set(view->webview, EINA_FALSE);
 
        debug_leave();
 }
@@ -1020,7 +1020,7 @@ void _viewer_download_start_cb(const char *download_uri, void *data)
        debug_secure("download_uri = [%s]", download_uri);
        retm_if(!download_uri, "Invalid parameter: download_uri[NULL]");
        retm_if(!data, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        if (strncmp(download_uri, URI_SCHEME_HTTP, strlen(URI_SCHEME_HTTP)) && strncmp(download_uri, URI_SCHEME_HTTPS, strlen(URI_SCHEME_HTTPS))) {
                debug_log("Only http or https URLs can be downloaded");
@@ -1029,17 +1029,17 @@ void _viewer_download_start_cb(const char *download_uri, void *data)
                return;
        } else {
                char *cookie = NULL;
-               /*cookie = ewk_view_cookies_get(ug_data->webview, download_uri);*/ /* ewk_view_cookies_get_for_url */
-               viewer_launch_download_manager(ug_data, download_uri, cookie); /* cookie can be NULL. */
+               /*cookie = ewk_view_cookies_get(view->webview, download_uri);*/ /* ewk_view_cookies_get_for_url */
+               viewer_launch_download_manager(view, download_uri, cookie); /* cookie can be NULL. */
        }
 }
 
-Evas_Object *viewer_get_webview(EmailViewerUGD *ug_data)
+Evas_Object *viewer_get_webview(EmailViewerView *view)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, NULL, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, NULL, "Invalid parameter: view[NULL]");
 
-       Evas_Object *ewk_view = ewk_view_add(evas_object_evas_get(ug_data->webview_ly));
+       Evas_Object *ewk_view = ewk_view_add(evas_object_evas_get(view->webview_ly));
 
        /**
         * To modify background color of webkit, following parts should be modified as well.
@@ -1049,54 +1049,54 @@ Evas_Object *viewer_get_webview(EmailViewerUGD *ug_data)
         */
 
        evas_object_color_set(ewk_view, COLOR_WHITE);
-       if (elm_win_focus_highlight_enabled_get(ug_data->base.module->win)) {
+       if (elm_win_focus_highlight_enabled_get(view->base.module->win)) {
                elm_object_focus_allow_set(ewk_view, EINA_TRUE);
        } else {
                elm_object_focus_allow_set(ewk_view, EINA_FALSE);
        }
-       ug_data->webview = ewk_view;
-       Ewk_Settings *ewk_settings = ewk_view_settings_get(ug_data->webview);
+       view->webview = ewk_view;
+       Ewk_Settings *ewk_settings = ewk_view_settings_get(view->webview);
        ewk_settings_extra_feature_set(ewk_settings, "selection,magnifier", EINA_FALSE);
        ewk_settings_extra_feature_set(ewk_settings, "scrollbar,visibility", EINA_FALSE);
        ewk_settings_auto_fitting_set(ewk_settings, EINA_FALSE);
-       if (ewk_settings_loads_images_automatically_set(ewk_settings, ug_data->b_show_remote_images) == EINA_FALSE) {
+       if (ewk_settings_loads_images_automatically_set(ewk_settings, view->b_show_remote_images) == EINA_FALSE) {
                /* ewk_settings_load_remote_images_set for remote image */
                debug_log("SET show images is FAILED!");
        }
 
-       /*ewk_view_unfocus_allow_callback_set(ug_data->webview, _viewer_webkit_unfocused_cb, ug_data);*/
+       /*ewk_view_unfocus_allow_callback_set(view->webview, _viewer_webkit_unfocused_cb, view);*/
        evas_object_propagate_events_set(ewk_view, EINA_FALSE);
 
-       evas_object_repeat_events_set(ug_data->webview, EINA_FALSE);
+       evas_object_repeat_events_set(view->webview, EINA_FALSE);
 
-       Ewk_Context *context = ewk_view_context_get(ug_data->webview);
-       ewk_context_did_start_download_callback_set(context, _viewer_download_start_cb, ug_data);
+       Ewk_Context *context = ewk_view_context_get(view->webview);
+       ewk_context_did_start_download_callback_set(context, _viewer_download_start_cb, view);
 
        /* Double_Scroller */
-       ewk_view_vertical_panning_hold_set(ug_data->webview, EINA_TRUE);
-       viewer_webkit_add_callbacks(ug_data);
+       ewk_view_vertical_panning_hold_set(view->webview, EINA_TRUE);
+       viewer_webkit_add_callbacks(view);
 
-       int angle = elm_win_rotation_get(ug_data->base.module->win);
+       int angle = elm_win_rotation_get(view->base.module->win);
        switch (angle) {
        case APP_DEVICE_ORIENTATION_90:
-               ewk_view_orientation_send(ug_data->webview, -90);
+               ewk_view_orientation_send(view->webview, -90);
                break;
        case APP_DEVICE_ORIENTATION_270:
-               ewk_view_orientation_send(ug_data->webview, 90);
+               ewk_view_orientation_send(view->webview, 90);
                break;
        case APP_DEVICE_ORIENTATION_180:
-               ewk_view_orientation_send(ug_data->webview, 180);
+               ewk_view_orientation_send(view->webview, 180);
                break;
        case APP_DEVICE_ORIENTATION_0: /* fall through */
        default:
-               ewk_view_orientation_send(ug_data->webview, 0);
+               ewk_view_orientation_send(view->webview, 0);
                break;
        }
-       evas_object_show(ug_data->webview);
-       ug_data->loading_progress = 0.0;
+       evas_object_show(view->webview);
+       view->loading_progress = 0.0;
 
        debug_leave();
-       return ug_data->webview;
+       return view->webview;
 }
 
 static char *_viewer_apply_template(const char *tpl_file, GHashTable *table)
@@ -1155,29 +1155,29 @@ static void _viewer_remove_trailing_open_tag(char *html)
        }
 }
 
-void viewer_set_webview_content(EmailViewerUGD *ug_data)
+void viewer_set_webview_content(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
-       retm_if(ug_data->webview == NULL, "Invalid parameter: ug_data->webview[NULL]");
-       retm_if(ug_data->webview_data == NULL, "Invalid parameter: ug_data->webview_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
+       retm_if(view->webview == NULL, "Invalid parameter: view->webview[NULL]");
+       retm_if(view->webview_data == NULL, "Invalid parameter: view->webview_data[NULL]");
 
        debug_log("unset b_load_finished");
-       ug_data->b_load_finished = EINA_FALSE;
+       view->b_load_finished = EINA_FALSE;
 
-       EmailViewerWebview *wvd = ug_data->webview_data;
+       EmailViewerWebview *wvd = view->webview_data;
 
        /* webview should be set to swallow part of webview_ly. If not, it will not
         * display correctly when autofit off.
         */
-       elm_object_part_content_set(ug_data->webview_ly, "elm.swallow.content", ug_data->webview);
+       elm_object_part_content_set(view->webview_ly, "elm.swallow.content", view->webview);
 
        /* ewk_settings_loads_images_automatically_set should be called before calling
         * ewk_view_html_contents_set to show wide images correctly when autofit is on */
-       Ewk_Settings *ewk_settings = ewk_view_settings_get(ug_data->webview);
+       Ewk_Settings *ewk_settings = ewk_view_settings_get(view->webview);
 
-       bool show_image = ug_data->b_show_remote_images ||
-                       viewer_check_body_download_status(ug_data->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_IMAGES_DOWNLOADED);
+       bool show_image = view->b_show_remote_images ||
+                       viewer_check_body_download_status(view->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_IMAGES_DOWNLOADED);
        if (ewk_settings_loads_images_automatically_set(ewk_settings, show_image) == EINA_FALSE) { /* ewk_settings_load_remote_images_set for remote image */
                debug_log("SET show images is FAILED!");
        }
@@ -1202,7 +1202,7 @@ void viewer_set_webview_content(EmailViewerUGD *ug_data)
                                snprintf(tmp_file_path, sizeof(tmp_file_path), "file://%s", email_get_default_html_path());
                                debug_secure("tmp_file_path [%s]", tmp_file_path);
                                /* If encoding(5th parameter) is missing, "UTF-8" is used to display contents. */
-                               ewk_view_contents_set(ug_data->webview, file_stream, strlen(file_stream), NULL, NULL, tmp_file_path);
+                               ewk_view_contents_set(view->webview, file_stream, strlen(file_stream), NULL, NULL, tmp_file_path);
                                g_free(file_stream);
                                return;
                        }
@@ -1215,7 +1215,7 @@ void viewer_set_webview_content(EmailViewerUGD *ug_data)
        retm_if(hashtable == NULL, "hashtable is null");
        if (wvd->body_type == BODY_TYPE_TEXT) {
                /* generate temporary html file for viewing */
-               retm_if(ug_data->temp_viewer_html_file_path == NULL, "ug_data->temp_viewer_html_file_path is NULL.");
+               retm_if(view->temp_viewer_html_file_path == NULL, "view->temp_viewer_html_file_path is NULL.");
 
                g_hash_table_insert(hashtable, g_strdup("BODY"), _viewer_convert_plain_text_body(wvd));
        }
@@ -1224,9 +1224,9 @@ void viewer_set_webview_content(EmailViewerUGD *ug_data)
        if (wvd->body_type == BODY_TYPE_HTML) {
                char *file_buffer = email_get_buff_from_file(wvd->uri, 0);
                        _viewer_remove_trailing_open_tag(file_buffer);
-               if (ug_data->charset) {
+               if (view->charset) {
                        char *encoded_text = NULL;
-                       encoded_text = email_body_encoding_convert(file_buffer, ug_data->charset, DEFAULT_CHARSET);
+                       encoded_text = email_body_encoding_convert(file_buffer, view->charset, DEFAULT_CHARSET);
                        if (encoded_text) {
                                g_free(file_buffer);
                                file_buffer = encoded_text;
@@ -1239,8 +1239,8 @@ void viewer_set_webview_content(EmailViewerUGD *ug_data)
        g_hash_table_insert(hashtable, g_strdup("CSSDIR"), g_strdup(email_get_misc_dir()));
 
        char basetime[100];
-       if (ug_data->mail_info)
-               snprintf(basetime, sizeof(basetime), "%ld", ug_data->mail_info->date_time);
+       if (view->mail_info)
+               snprintf(basetime, sizeof(basetime), "%ld", view->mail_info->date_time);
 
        if (wvd->body_type == BODY_TYPE_TEXT) {
                file_stream = _viewer_apply_template(email_get_template_html_text_path(), hashtable);
@@ -1250,33 +1250,33 @@ void viewer_set_webview_content(EmailViewerUGD *ug_data)
        g_hash_table_destroy(hashtable);
        hashtable = NULL;
 
-       if (ug_data->temp_viewer_html_file_path == NULL) {
+       if (view->temp_viewer_html_file_path == NULL) {
                G_FREE(file_stream);
-               retm_if(ug_data->temp_viewer_html_file_path == NULL, "ug_data->temp_viewer_html_file_path is NULL.");
+               retm_if(view->temp_viewer_html_file_path == NULL, "view->temp_viewer_html_file_path is NULL.");
        }
 
-       if (email_file_exists(ug_data->temp_viewer_html_file_path)) {
-               int r = email_file_remove(ug_data->temp_viewer_html_file_path);
+       if (email_file_exists(view->temp_viewer_html_file_path)) {
+               int r = email_file_remove(view->temp_viewer_html_file_path);
                if (r == -1) {
                        debug_error("remove(temp_viewer_html_file_path) failed! (%d): %s", r, strerror(errno));
                }
        }
 
-       FILE *fp = fopen(ug_data->temp_viewer_html_file_path, "w");
+       FILE *fp = fopen(view->temp_viewer_html_file_path, "w");
        if (fp != NULL) {
                if (file_stream != NULL)
                        fputs(file_stream, fp);
                fclose(fp);
        }
 
-       snprintf(tmp_file_path, sizeof(tmp_file_path), "file://%s", ug_data->temp_viewer_html_file_path);
+       snprintf(tmp_file_path, sizeof(tmp_file_path), "file://%s", view->temp_viewer_html_file_path);
        debug_secure("tmp_file_path [%s]", tmp_file_path);
        size_t contents_size = 0;
 
        if (STR_VALID(file_stream)) {
                contents_size = STR_LEN(file_stream);
        }
-       ewk_view_contents_set(ug_data->webview, file_stream, contents_size, NULL, DEFAULT_CHARSET, tmp_file_path);
+       ewk_view_contents_set(view->webview, file_stream, contents_size, NULL, DEFAULT_CHARSET, tmp_file_path);
 
        g_free(file_stream);
        file_stream = NULL;
@@ -1312,10 +1312,10 @@ void viewer_hide_webview(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       if (ug_data->webview) {
-               if (!ewk_view_visibility_set(ug_data->webview, EINA_FALSE)) {
+       if (view->webview) {
+               if (!ewk_view_visibility_set(view->webview, EINA_FALSE)) {
                        debug_error("set visibility as FALSE failed");
                        return;
                }
@@ -1327,10 +1327,10 @@ void viewer_show_webview(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       if (ug_data->webview) {
-               if (!ewk_view_visibility_set(ug_data->webview, EINA_TRUE)) {
+       if (view->webview) {
+               if (!ewk_view_visibility_set(view->webview, EINA_TRUE)) {
                        debug_error("set visibility as TRUE failed");
                        return;
                }
@@ -1338,28 +1338,28 @@ void viewer_show_webview(void *data)
        }
 }
 
-void viewer_webview_handle_mem_warning(EmailViewerUGD *ug_data, bool hard)
+void viewer_webview_handle_mem_warning(EmailViewerView *view, bool hard)
 {
        debug_enter();
-       retm_if(!ug_data || !ug_data->webview, "no webview");
+       retm_if(!view || !view->webview, "no webview");
 
-       Ewk_Context *context = ewk_view_context_get(ug_data->webview);
+       Ewk_Context *context = ewk_view_context_get(view->webview);
        retm_if(!context, "no context");
 
        if (hard) {
                debug_log("hard warning");
-               viewer_webview_handle_mem_warning(ug_data, false);
+               viewer_webview_handle_mem_warning(view, false);
 
-               if (ug_data->loading_progress > 0.5) {
-                       if (ug_data->loading_progress < 1.0) {
-                               debug_log("stop page loading %.2f", ug_data->loading_progress);
-                               ewk_view_stop(ug_data->webview);
-                               _webview_load_finished_cb(ug_data, NULL, NULL);
+               if (view->loading_progress > 0.5) {
+                       if (view->loading_progress < 1.0) {
+                               debug_log("stop page loading %.2f", view->loading_progress);
+                               ewk_view_stop(view->webview);
+                               _webview_load_finished_cb(view, NULL, NULL);
                        }
                } else {
                        debug_log("destroy me");
                        notification_status_message_post(_("IDS_EMAIL_HEADER_UNABLE_TO_PERFORM_ACTION_ABB"));
-                       email_module_make_destroy_request(ug_data->base.module);
+                       email_module_make_destroy_request(view->base.module);
                }
        } else {
                debug_log("soft warning");
index d8e6aab..3350556 100644 (file)
 #include "email-viewer-eml.h"
 #include "email-viewer-util.h"
 
-static GList *_viewer_get_recipient_list(EmailViewerUGD *ug_data, email_address_type_t address_type)
+static GList *_viewer_get_recipient_list(EmailViewerView *view, email_address_type_t address_type)
 {
        debug_enter();
-       retvm_if(!ug_data, NULL, "Invalid parameter: ug_data[NULL]");
+       retvm_if(!view, NULL, "Invalid parameter: view[NULL]");
 
        debug_secure("addr type[%d]", address_type);
        const gchar *addr_list = NULL;
 
        switch (address_type) {
        case EMAIL_ADDRESS_TYPE_FROM:
-               if (ug_data->mail_info) {
-                       addr_list = ug_data->mail_info->full_address_from;
+               if (view->mail_info) {
+                       addr_list = view->mail_info->full_address_from;
                }
                break;
        case EMAIL_ADDRESS_TYPE_TO:
-               if (ug_data->mail_info) {
-                       addr_list = ug_data->mail_info->full_address_to;
+               if (view->mail_info) {
+                       addr_list = view->mail_info->full_address_to;
                }
                break;
        case EMAIL_ADDRESS_TYPE_CC:
-               if (ug_data->mail_info) {
-                       addr_list = ug_data->mail_info->full_address_cc;
+               if (view->mail_info) {
+                       addr_list = view->mail_info->full_address_cc;
                }
                break;
        case EMAIL_ADDRESS_TYPE_BCC:
-               if (ug_data->mail_info) {
-                       addr_list = ug_data->mail_info->full_address_bcc;
+               if (view->mail_info) {
+                       addr_list = view->mail_info->full_address_bcc;
                }
                break;
        default:
@@ -107,22 +107,22 @@ static GList *_viewer_get_recipient_list(EmailViewerUGD *ug_data, email_address_
        return list;
 }
 
-email_address_info_list_t *viewer_create_address_info_list(EmailViewerUGD *ug_data)
+email_address_info_list_t *viewer_create_address_info_list(EmailViewerView *view)
 {
        debug_enter();
-       retvm_if(!ug_data, NULL, "Invalid parameter: ug_data[NULL]");
+       retvm_if(!view, NULL, "Invalid parameter: view[NULL]");
 
-       email_mail_data_t *mail_info = ug_data->mail_info;
+       email_mail_data_t *mail_info = view->mail_info;
        retvm_if(mail_info == NULL, 0, "mail_info is NULL");
        email_address_info_list_t *address_info_list = NULL;
 
        address_info_list = (email_address_info_list_t *)calloc(1, sizeof(email_address_info_list_t));
        retvm_if(address_info_list == NULL, NULL, "calloc failed");
 
-       address_info_list->from = _viewer_get_recipient_list(ug_data, EMAIL_ADDRESS_TYPE_FROM);
-       address_info_list->to = _viewer_get_recipient_list(ug_data, EMAIL_ADDRESS_TYPE_TO);
-       address_info_list->cc = _viewer_get_recipient_list(ug_data, EMAIL_ADDRESS_TYPE_CC);
-       address_info_list->bcc = _viewer_get_recipient_list(ug_data, EMAIL_ADDRESS_TYPE_BCC);
+       address_info_list->from = _viewer_get_recipient_list(view, EMAIL_ADDRESS_TYPE_FROM);
+       address_info_list->to = _viewer_get_recipient_list(view, EMAIL_ADDRESS_TYPE_TO);
+       address_info_list->cc = _viewer_get_recipient_list(view, EMAIL_ADDRESS_TYPE_CC);
+       address_info_list->bcc = _viewer_get_recipient_list(view, EMAIL_ADDRESS_TYPE_BCC);
 
        debug_leave();
        return address_info_list;
index 8d71e3d..21eb75b 100644 (file)
@@ -42,18 +42,18 @@ void __email_viewer_got_next_prev_message(void *data, gboolean next)
                return;
        }
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       _hide_view(ug_data);
+       _hide_view(view);
 
        email_params_h params = NULL;
 
        if (email_params_create(&params) &&
-               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAIL_INDEX, ug_data->mail_id) &&
+               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAIL_INDEX, view->mail_id) &&
                email_params_add_str(params, EMAIL_BUNDLE_KEY_MSG,
                                (next ? EMAIL_BUNDLE_VAL_PREV_MSG : EMAIL_BUNDLE_VAL_NEXT_MSG))) {
 
-               email_module_send_result(ug_data->base.module, params);
+               email_module_send_result(view->base.module, params);
        }
 
        email_params_free(&params);
@@ -64,13 +64,13 @@ void __email_viewer_got_next_prev_message(void *data, gboolean next)
 static Evas_Event_Flags _onGestureStart(void *data, void *eventInfo)
 {
        debug_enter();
-       EmailViewerUGD *ug_data = (EmailViewerUGD *) data;
+       EmailViewerView *view = (EmailViewerView *) data;
 
        int ewk_sc_x = 0;
        int ewk_sc_y = 0;
 
-       ewk_view_scroll_pos_get(ug_data->webview, &ewk_sc_x, &ewk_sc_y);
-       ug_data->webkit_old_x = ewk_sc_x;
+       ewk_view_scroll_pos_get(view->webview, &ewk_sc_x, &ewk_sc_y);
+       view->webkit_old_x = ewk_sc_x;
 
        return EVAS_EVENT_FLAG_NONE;
 }
@@ -78,7 +78,7 @@ static Evas_Event_Flags _onGestureStart(void *data, void *eventInfo)
 static Evas_Event_Flags _onGestureEnd(void *data, void *eventInfo)
 {
        debug_enter();
-       EmailViewerUGD *ug_data = (EmailViewerUGD *) data;
+       EmailViewerView *view = (EmailViewerView *) data;
        Elm_Gesture_Line_Info *event = (Elm_Gesture_Line_Info *) eventInfo;
 
        Evas_Coord ewk_ct_w = 0;
@@ -90,14 +90,14 @@ static Evas_Event_Flags _onGestureEnd(void *data, void *eventInfo)
                return EVAS_EVENT_FLAG_NONE;
        }
 
-       ewk_view_scroll_size_get(ug_data->webview, &ewk_ct_w, &ewk_ct_h);
+       ewk_view_scroll_size_get(view->webview, &ewk_ct_w, &ewk_ct_h);
 
        if (event->momentum.mx > 0) { /* right//next */
-               if (ug_data->webkit_old_x == 0) {
+               if (view->webkit_old_x == 0) {
                        __email_viewer_got_next_prev_message(data, true);
                }
        } else { /* left//prevous */
-               if (ug_data->webkit_old_x == ewk_ct_w) {
+               if (view->webkit_old_x == ewk_ct_w) {
                        __email_viewer_got_next_prev_message(data, false);
                }
        }
@@ -116,16 +116,16 @@ void viewer_set_flick_layer(void *data)
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *) data;
+       EmailViewerView *view = (EmailViewerView *) data;
 
-       Evas_Object *gesture_obj = elm_gesture_layer_add(ug_data->scroller);
+       Evas_Object *gesture_obj = elm_gesture_layer_add(view->scroller);
        retm_if(gesture_obj == NULL, "elm_gesture_layer_add() failed!");
 
-       elm_gesture_layer_attach(gesture_obj, ug_data->scroller);
+       elm_gesture_layer_attach(gesture_obj, view->scroller);
        elm_gesture_layer_continues_enable_set(gesture_obj, EINA_FALSE);
 
-       elm_gesture_layer_cb_set(gesture_obj, ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_START, _onGestureStart, ug_data);
-       elm_gesture_layer_cb_set(gesture_obj, ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_END, _onGestureEnd, ug_data);
+       elm_gesture_layer_cb_set(gesture_obj, ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_START, _onGestureStart, view);
+       elm_gesture_layer_cb_set(gesture_obj, ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_END, _onGestureEnd, view);
 
        debug_leave();
 }
index a8d2353..96195f2 100644 (file)
@@ -49,11 +49,11 @@ static Elm_Genlist_Item_Class reply_popup_itc;
  */
 
 /*header layouts*/
-static void _header_create_subject(EmailViewerUGD *ug_data);
-static void _header_update_subject(EmailViewerUGD *ug_data, email_mail_data_t *mail_info);
-static void _header_create_sender(EmailViewerUGD *ug_data);
-static void _header_create_divider(EmailViewerUGD *ug_data);
-static void _header_update_sender(EmailViewerUGD *ug_data);
+static void _header_create_subject(EmailViewerView *view);
+static void _header_update_subject(EmailViewerView *view, email_mail_data_t *mail_info);
+static void _header_create_sender(EmailViewerView *view);
+static void _header_create_divider(EmailViewerView *view);
+static void _header_update_sender(EmailViewerView *view);
 static void _header_create_attachment_preview(void *data);
 static void _header_update_attachments_preview(void *data);
 static void _header_pack_attachment_preview(void *data);
@@ -68,7 +68,7 @@ static void _header_pack_recipient_ly(void *data, VIEWER_TO_CC_BCC_LY recipient)
 /*reply, favrourite and priority icon logic*/
 static void _header_popup_response_cb(void *data, Evas_Object *obj, void *event_info);
 static void _header_favorite_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
-static void _header_set_reply_icon(EmailViewerUGD *ug_data, const char *part);
+static void _header_set_reply_icon(EmailViewerView *view, const char *part);
 static void _header_reply_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
 static char *_header_reply_popup_text_get(void *data, Evas_Object *obj, const char *part);
 
@@ -93,18 +93,18 @@ static void _header_back_key_cb_clicked(void *data, Evas_Object *obj, void *even
                return;
        }
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       viewer_back_key_press_handler(ug_data);
+       EmailViewerView *view = (EmailViewerView *)data;
+       viewer_back_key_press_handler(view);
        debug_leave();
 }
 
-static void _header_update_subject(EmailViewerUGD *ug_data, email_mail_data_t *mail_info)
+static void _header_update_subject(EmailViewerView *view, email_mail_data_t *mail_info)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
        retm_if(!mail_info, "invalid data");
 
-       char *subject_txt = elm_entry_utf8_to_markup(ug_data->subject);
+       char *subject_txt = elm_entry_utf8_to_markup(view->subject);
        if (!g_strcmp0(subject_txt, "")) {
                g_free(subject_txt);
                subject_txt = g_strdup(email_get_email_string("IDS_EMAIL_SBODY_NO_SUBJECT_M_NOUN"));
@@ -116,126 +116,126 @@ static void _header_update_subject(EmailViewerUGD *ug_data, email_mail_data_t *m
                appended_text = g_strdup_printf(HEAD_SUBJ_TEXT_WITH_ICON_STYLE, HEAD_SUBJ_ICON_WIDTH, HEAD_SUBJ_ICON_HEIGHT,
                                email_get_img_dir(), icon,
                                HEAD_SUBJ_FONT_SIZE, VIEWER_SUBJECT_FONT_COLOR, subject_txt);
-               elm_object_text_set(ug_data->en_subject, appended_text);
+               elm_object_text_set(view->en_subject, appended_text);
 
        } else {
                appended_text = g_strdup_printf(HEAD_SUBJ_TEXT_STYLE,
                                HEAD_SUBJ_FONT_SIZE, VIEWER_SUBJECT_FONT_COLOR, subject_txt);
-               elm_object_text_set(ug_data->en_subject, appended_text);
+               elm_object_text_set(view->en_subject, appended_text);
        }
 
-       evas_object_show(ug_data->subject_ly);
+       evas_object_show(view->subject_ly);
        g_free(appended_text);
        g_free(subject_txt);
 
        debug_leave();
 }
 
-static void _header_update_sender(EmailViewerUGD *ug_data)
+static void _header_update_sender(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       header_set_sender_name(ug_data);
+       header_set_sender_name(view);
 
        /* priority sender image */
-       if (recipient_is_priority_email_address(ug_data->sender_address)) {
-               Evas_Object *priority_image = elm_layout_add(ug_data->sender_ly);
+       if (recipient_is_priority_email_address(view->sender_address)) {
+               Evas_Object *priority_image = elm_layout_add(view->sender_ly);
                elm_layout_file_set(priority_image, email_get_common_theme_path(), EMAIL_IMAGE_ICON_PRIO_SENDER);
-               elm_object_part_content_set(ug_data->sender_ly, "sender.priority.icon", priority_image);
-               elm_layout_signal_emit(ug_data->sender_ly, "set.priority.sender", "elm");
+               elm_object_part_content_set(view->sender_ly, "sender.priority.icon", priority_image);
+               elm_layout_signal_emit(view->sender_ly, "set.priority.sender", "elm");
                evas_object_show(priority_image);
-               ug_data->priority_sender_image = priority_image;
+               view->priority_sender_image = priority_image;
        } else {
-               elm_layout_signal_emit(ug_data->sender_ly, "remove.priority.sender", "elm");
+               elm_layout_signal_emit(view->sender_ly, "remove.priority.sender", "elm");
        }
 
        debug_leave();
 }
 
-static void _header_create_subject(EmailViewerUGD *ug_data)
+static void _header_create_subject(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       if (ug_data->subject_ly) {
-               elm_object_part_content_unset(ug_data->base.content, "ev.swallow.subject");
-               DELETE_EVAS_OBJECT(ug_data->subject_ly);
+       if (view->subject_ly) {
+               elm_object_part_content_unset(view->base.content, "ev.swallow.subject");
+               DELETE_EVAS_OBJECT(view->subject_ly);
        }
        /*create subject layout*/
-       ug_data->subject_ly = viewer_load_edj(ug_data->base.content, email_get_viewer_theme_path(), "ev/subject/base", EVAS_HINT_EXPAND, 0.0);
-       evas_object_size_hint_align_set(ug_data->subject_ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       view->subject_ly = viewer_load_edj(view->base.content, email_get_viewer_theme_path(), "ev/subject/base", EVAS_HINT_EXPAND, 0.0);
+       evas_object_size_hint_align_set(view->subject_ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
 
-       ug_data->en_subject = elm_label_add(ug_data->subject_ly);
-       elm_label_line_wrap_set(ug_data->en_subject, ELM_WRAP_MIXED);
-       elm_label_ellipsis_set(ug_data->en_subject, EINA_TRUE);
-       elm_object_style_set(ug_data->en_subject, "subject_text");
+       view->en_subject = elm_label_add(view->subject_ly);
+       elm_label_line_wrap_set(view->en_subject, ELM_WRAP_MIXED);
+       elm_label_ellipsis_set(view->en_subject, EINA_TRUE);
+       elm_object_style_set(view->en_subject, "subject_text");
 
 
-       evas_object_show(ug_data->en_subject);
-       elm_object_part_content_set(ug_data->subject_ly, "ev.swallow.subject_label", ug_data->en_subject);
+       evas_object_show(view->en_subject);
+       elm_object_part_content_set(view->subject_ly, "ev.swallow.subject_label", view->en_subject);
 
-       Evas_Object *back_btn = elm_button_add(ug_data->subject_ly);
+       Evas_Object *back_btn = elm_button_add(view->subject_ly);
        elm_object_style_set(back_btn, "naviframe/back_btn/default");
-       evas_object_smart_callback_add(back_btn, "clicked", _header_back_key_cb_clicked, ug_data);
+       evas_object_smart_callback_add(back_btn, "clicked", _header_back_key_cb_clicked, view);
 
-       elm_object_part_content_set(ug_data->subject_ly, "ev.swallow.back_button", back_btn);
-       elm_object_part_content_set(ug_data->base.content, "ev.swallow.subject", ug_data->subject_ly);
+       elm_object_part_content_set(view->subject_ly, "ev.swallow.back_button", back_btn);
+       elm_object_part_content_set(view->base.content, "ev.swallow.subject", view->subject_ly);
        debug_leave();
 }
 
-static void _header_set_reply_icon(EmailViewerUGD *ug_data, const char *part)
+static void _header_set_reply_icon(EmailViewerView *view, const char *part)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       Evas_Object *ly = elm_layout_add(ug_data->sender_ly);
+       Evas_Object *ly = elm_layout_add(view->sender_ly);
        elm_layout_file_set(ly, email_get_viewer_theme_path(), "elm/layout/reply.icon/default");
-       elm_object_part_content_set(ug_data->sender_ly, part, ly);
-       edje_object_signal_callback_add(_EDJ(ly), "clicked", "edje", _header_reply_clicked_cb, ug_data);
+       elm_object_part_content_set(view->sender_ly, part, ly);
+       edje_object_signal_callback_add(_EDJ(ly), "clicked", "edje", _header_reply_clicked_cb, view);
 
        debug_leave();
 }
 
-static void _header_create_sender(EmailViewerUGD *ug_data)
+static void _header_create_sender(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
        /* append sender */
-       ug_data->sender_ly = viewer_load_edj(ug_data->base.content, email_get_viewer_theme_path(), "ev/sender/base", EVAS_HINT_EXPAND, 0.0);
-       evas_object_size_hint_align_set(ug_data->sender_ly, EVAS_HINT_FILL, 0.0);
-       evas_object_show(ug_data->sender_ly);
+       view->sender_ly = viewer_load_edj(view->base.content, email_get_viewer_theme_path(), "ev/sender/base", EVAS_HINT_EXPAND, 0.0);
+       evas_object_size_hint_align_set(view->sender_ly, EVAS_HINT_FILL, 0.0);
+       evas_object_show(view->sender_ly);
 
-       if ((ug_data->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) && (ug_data->viewer_type == EMAIL_VIEWER)) {
-               header_set_favorite_icon(ug_data);
+       if ((view->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) && (view->viewer_type == EMAIL_VIEWER)) {
+               header_set_favorite_icon(view);
                bool reply_allowed = true;
                if (reply_allowed) {
-                       _header_set_reply_icon(ug_data, "sender.rep.event");
+                       _header_set_reply_icon(view, "sender.rep.event");
                }
        }
-       if (ug_data->viewer_type == EML_VIEWER) {
-               edje_object_signal_emit(_EDJ(ug_data->sender_ly), "set.eml.viewer", "");
-               _header_set_reply_icon(ug_data, "sender.fav.event");
+       if (view->viewer_type == EML_VIEWER) {
+               edje_object_signal_emit(_EDJ(view->sender_ly), "set.eml.viewer", "");
+               _header_set_reply_icon(view, "sender.fav.event");
        }
 
-       if (ug_data->to_recipients_cnt + ug_data->cc_recipients_cnt + ug_data->bcc_recipients_cnt > 0) {
-               _header_show_hide_details_text_set(ug_data, EINA_FALSE);
+       if (view->to_recipients_cnt + view->cc_recipients_cnt + view->bcc_recipients_cnt > 0) {
+               _header_show_hide_details_text_set(view, EINA_FALSE);
        }
        debug_leave();
 }
 
-static void _header_create_divider(EmailViewerUGD *ug_data)
+static void _header_create_divider(EmailViewerView *view)
 {
        debug_enter();
 
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       ug_data->header_divider = evas_object_rectangle_add(ug_data->sender_ly);
-       evas_object_size_hint_fill_set(ug_data->header_divider, EVAS_HINT_FILL, EVAS_HINT_FILL);
-       evas_object_color_set(ug_data->header_divider, AO005_ON_WHITE);
-       evas_object_size_hint_min_set(ug_data->header_divider, 0, VIEWER_HEADER_DIVIDER_HEIGHT);
-       evas_object_show(ug_data->header_divider);
+       view->header_divider = evas_object_rectangle_add(view->sender_ly);
+       evas_object_size_hint_fill_set(view->header_divider, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_color_set(view->header_divider, AO005_ON_WHITE);
+       evas_object_size_hint_min_set(view->header_divider, 0, VIEWER_HEADER_DIVIDER_HEIGHT);
+       evas_object_show(view->header_divider);
 
        debug_leave();
 }
@@ -245,11 +245,11 @@ static void _header_delete_recipient_idler(void *data)
        debug_enter();
 
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_IDLER_OBJECT(ug_data->to_recipient_idler);
-       DELETE_IDLER_OBJECT(ug_data->cc_recipient_idler);
-       DELETE_IDLER_OBJECT(ug_data->bcc_recipient_idler);
+       DELETE_IDLER_OBJECT(view->to_recipient_idler);
+       DELETE_IDLER_OBJECT(view->cc_recipient_idler);
+       DELETE_IDLER_OBJECT(view->bcc_recipient_idler);
 
        debug_leave();
 }
@@ -258,16 +258,16 @@ static void _header_show_hide_details_text_set(void *data, Eina_Bool is_opened)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       if (ug_data->details_button == NULL) {
-               Evas_Object *details_btn = elm_button_add(ug_data->sender_ly);
+       if (view->details_button == NULL) {
+               Evas_Object *details_btn = elm_button_add(view->sender_ly);
                elm_object_style_set(details_btn, "default");
                elm_object_scale_set(details_btn, EXPAND_BUTTON_SCALE);
-               evas_object_smart_callback_add(details_btn, "clicked", _header_expand_button_clicked_cb, ug_data);
-               elm_object_part_content_set(ug_data->sender_ly, "sender.expand.btn", details_btn);
+               evas_object_smart_callback_add(details_btn, "clicked", _header_expand_button_clicked_cb, view);
+               elm_object_part_content_set(view->sender_ly, "sender.expand.btn", details_btn);
                evas_object_show(details_btn);
-               ug_data->details_button = details_btn;
+               view->details_button = details_btn;
        }
 
        char *btn_text = NULL;
@@ -279,7 +279,7 @@ static void _header_show_hide_details_text_set(void *data, Eina_Bool is_opened)
 
        char buff[BUF_LEN_M] = { 0 };
        snprintf(buff, BUF_LEN_M, "<font_size=%d>%s</font_size>", EXPAND_BUTTON_TEXT_SIZE, btn_text);
-       elm_object_text_set(ug_data->details_button, buff);
+       elm_object_text_set(view->details_button, buff);
        debug_leave();
 }
 
@@ -287,25 +287,25 @@ static void _header_pack_recipient_ly(void *data, VIEWER_TO_CC_BCC_LY recipient)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        switch (recipient) {
                case EMAIL_VIEWER_TO_LAYOUT:
-                       elm_box_pack_after(ug_data->main_bx, ug_data->to_ly, ug_data->sender_ly);
+                       elm_box_pack_after(view->main_bx, view->to_ly, view->sender_ly);
                        break;
                case EMAIL_VIEWER_CC_LAYOUT:
-                       if (ug_data->to_ly)
-                               elm_box_pack_after(ug_data->main_bx, ug_data->cc_ly, ug_data->to_ly);
+                       if (view->to_ly)
+                               elm_box_pack_after(view->main_bx, view->cc_ly, view->to_ly);
                        else
-                               elm_box_pack_after(ug_data->main_bx, ug_data->cc_ly, ug_data->sender_ly);
+                               elm_box_pack_after(view->main_bx, view->cc_ly, view->sender_ly);
                        break;
                case EMAIL_VIEWER_BCC_LAYOUT:
-                       if (ug_data->cc_ly)
-                               elm_box_pack_after(ug_data->main_bx, ug_data->bcc_ly, ug_data->cc_ly);
-                       else if (ug_data->to_ly)
-                               elm_box_pack_after(ug_data->main_bx, ug_data->bcc_ly, ug_data->to_ly);
+                       if (view->cc_ly)
+                               elm_box_pack_after(view->main_bx, view->bcc_ly, view->cc_ly);
+                       else if (view->to_ly)
+                               elm_box_pack_after(view->main_bx, view->bcc_ly, view->to_ly);
                        else
-                               elm_box_pack_after(ug_data->main_bx, ug_data->bcc_ly, ug_data->sender_ly);
+                               elm_box_pack_after(view->main_bx, view->bcc_ly, view->sender_ly);
                        break;
                default:
                        break;
@@ -317,59 +317,59 @@ static void _header_expand_button_clicked_cb(void *data, Evas_Object *obj, void
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       if (!(ug_data->is_recipient_ly_shown)) {
-               (ug_data->is_recipient_ly_shown)++;
+       if (!(view->is_recipient_ly_shown)) {
+               (view->is_recipient_ly_shown)++;
 
                email_address_info_list_t *addrs_info_list = NULL;
-               addrs_info_list = viewer_create_address_info_list(ug_data);
+               addrs_info_list = viewer_create_address_info_list(view);
                if (addrs_info_list) {
-                       ug_data->to_recipients_cnt = g_list_length(addrs_info_list->to);
-                       ug_data->cc_recipients_cnt = g_list_length(addrs_info_list->cc);
-                       ug_data->bcc_recipients_cnt = g_list_length(addrs_info_list->bcc);
-                       debug_log("bcc_recipients_cnt [%d]", ug_data->bcc_recipients_cnt);
+                       view->to_recipients_cnt = g_list_length(addrs_info_list->to);
+                       view->cc_recipients_cnt = g_list_length(addrs_info_list->cc);
+                       view->bcc_recipients_cnt = g_list_length(addrs_info_list->bcc);
+                       debug_log("bcc_recipients_cnt [%d]", view->bcc_recipients_cnt);
                }
-               if (!ug_data->to_ly && ug_data->to_recipients_cnt) {
-                       ug_data->to_ly = recipient_create_address(ug_data, addrs_info_list, EMAIL_VIEWER_TO_LAYOUT);
-                       _header_pack_recipient_ly(ug_data, EMAIL_VIEWER_TO_LAYOUT);
+               if (!view->to_ly && view->to_recipients_cnt) {
+                       view->to_ly = recipient_create_address(view, addrs_info_list, EMAIL_VIEWER_TO_LAYOUT);
+                       _header_pack_recipient_ly(view, EMAIL_VIEWER_TO_LAYOUT);
                }
-               if (!ug_data->cc_ly && ug_data->cc_recipients_cnt) {
-                       ug_data->cc_ly = recipient_create_address(ug_data, addrs_info_list, EMAIL_VIEWER_CC_LAYOUT);
-                       _header_pack_recipient_ly(ug_data, EMAIL_VIEWER_CC_LAYOUT);
+               if (!view->cc_ly && view->cc_recipients_cnt) {
+                       view->cc_ly = recipient_create_address(view, addrs_info_list, EMAIL_VIEWER_CC_LAYOUT);
+                       _header_pack_recipient_ly(view, EMAIL_VIEWER_CC_LAYOUT);
                }
-               if (!ug_data->bcc_ly && ug_data->bcc_recipients_cnt) {
-                       ug_data->bcc_ly = recipient_create_address(ug_data, addrs_info_list, EMAIL_VIEWER_BCC_LAYOUT);
-                       _header_pack_recipient_ly(ug_data, EMAIL_VIEWER_BCC_LAYOUT);
+               if (!view->bcc_ly && view->bcc_recipients_cnt) {
+                       view->bcc_ly = recipient_create_address(view, addrs_info_list, EMAIL_VIEWER_BCC_LAYOUT);
+                       _header_pack_recipient_ly(view, EMAIL_VIEWER_BCC_LAYOUT);
                }
 
                viewer_free_address_info_list(addrs_info_list);
                addrs_info_list = NULL;
 
-               _header_show_hide_details_text_set(ug_data, EINA_TRUE);
+               _header_show_hide_details_text_set(view, EINA_TRUE);
        } else {
-               (ug_data->is_recipient_ly_shown)--;
-
-               _header_delete_recipient_idler(ug_data);
-
-               _header_show_hide_details_text_set(ug_data, EINA_FALSE);
-               recipient_clear_multibuttonentry_data(ug_data->to_mbe);
-               recipient_clear_multibuttonentry_data(ug_data->cc_mbe);
-               recipient_clear_multibuttonentry_data(ug_data->bcc_mbe);
-               DELETE_EVAS_OBJECT(ug_data->to_mbe);
-               DELETE_EVAS_OBJECT(ug_data->cc_mbe);
-               DELETE_EVAS_OBJECT(ug_data->bcc_mbe);
-               if (ug_data->to_ly) {
-                       elm_box_unpack(ug_data->main_bx, ug_data->to_ly);
-                       DELETE_EVAS_OBJECT(ug_data->to_ly);
+               (view->is_recipient_ly_shown)--;
+
+               _header_delete_recipient_idler(view);
+
+               _header_show_hide_details_text_set(view, EINA_FALSE);
+               recipient_clear_multibuttonentry_data(view->to_mbe);
+               recipient_clear_multibuttonentry_data(view->cc_mbe);
+               recipient_clear_multibuttonentry_data(view->bcc_mbe);
+               DELETE_EVAS_OBJECT(view->to_mbe);
+               DELETE_EVAS_OBJECT(view->cc_mbe);
+               DELETE_EVAS_OBJECT(view->bcc_mbe);
+               if (view->to_ly) {
+                       elm_box_unpack(view->main_bx, view->to_ly);
+                       DELETE_EVAS_OBJECT(view->to_ly);
                }
-               if (ug_data->cc_ly) {
-                       elm_box_unpack(ug_data->main_bx, ug_data->cc_ly);
-                       DELETE_EVAS_OBJECT(ug_data->cc_ly);
+               if (view->cc_ly) {
+                       elm_box_unpack(view->main_bx, view->cc_ly);
+                       DELETE_EVAS_OBJECT(view->cc_ly);
                }
-               if (ug_data->bcc_ly) {
-                       elm_box_unpack(ug_data->main_bx, ug_data->bcc_ly);
-                       DELETE_EVAS_OBJECT(ug_data->bcc_ly);
+               if (view->bcc_ly) {
+                       elm_box_unpack(view->main_bx, view->bcc_ly);
+                       DELETE_EVAS_OBJECT(view->bcc_ly);
                }
        }
        debug_leave();
@@ -379,8 +379,8 @@ static void _header_popup_response_cb(void *data, Evas_Object *obj, void *event_
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       EmailViewerView *view = (EmailViewerView *)data;
+       DELETE_EVAS_OBJECT(view->notify);
        debug_leave();
 }
 
@@ -390,11 +390,11 @@ static void _header_reply_clicked_cb(void *data, Evas_Object *obj,
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
 
-       ug_data->notify = util_create_notify_with_list(ug_data, EMAIL_VIEWER_STR_REPLY_OPTIONS, EMAIL_VIEWER_STRING_NULL, 1, EMAIL_VIEWER_BUTTON_CANCEL,
+       view->notify = util_create_notify_with_list(view, EMAIL_VIEWER_STR_REPLY_OPTIONS, EMAIL_VIEWER_STRING_NULL, 1, EMAIL_VIEWER_BUTTON_CANCEL,
                        _header_popup_response_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
 
        reply_popup_itc.item_style = "type1";
@@ -403,34 +403,34 @@ static void _header_reply_clicked_cb(void *data, Evas_Object *obj,
        reply_popup_itc.func.state_get = NULL;
        reply_popup_itc.func.del = NULL;
 
-       Evas_Object *reply_popup_genlist = util_notify_genlist_add(ug_data->notify);
-       evas_object_data_set(reply_popup_genlist, VIEWER_EVAS_DATA_NAME, ug_data);
+       Evas_Object *reply_popup_genlist = util_notify_genlist_add(view->notify);
+       evas_object_data_set(reply_popup_genlist, VIEWER_EVAS_DATA_NAME, view);
 
-       bool reply_allowed = (ug_data->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX);
+       bool reply_allowed = (view->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX);
        if (reply_allowed) {
                elm_genlist_item_append(reply_popup_genlist, &reply_popup_itc,
                                "IDS_EMAIL_OPT_REPLY", NULL, ELM_GENLIST_ITEM_NONE, _reply_cb,
-                               (void *)ug_data);
+                               (void *)view);
        }
 
-       if (ug_data->to_recipients_cnt + ug_data->cc_recipients_cnt + ug_data->bcc_recipients_cnt > 1) {
-               bool reply_all_allowed = (ug_data->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX);
+       if (view->to_recipients_cnt + view->cc_recipients_cnt + view->bcc_recipients_cnt > 1) {
+               bool reply_all_allowed = (view->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX);
                if (reply_all_allowed) {
                        elm_genlist_item_append(reply_popup_genlist, &reply_popup_itc,
                                        "IDS_EMAIL_OPT_REPLY_ALL", NULL, ELM_GENLIST_ITEM_NONE,
-                                       _reply_all_cb, (void *)ug_data);
+                                       _reply_all_cb, (void *)view);
                }
        }
 
-       bool fwd_allowed = (ug_data->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX);
+       bool fwd_allowed = (view->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX);
        if (fwd_allowed) {
                elm_genlist_item_append(reply_popup_genlist, &reply_popup_itc,
                                "IDS_EMAIL_OPT_FORWARD", NULL, ELM_GENLIST_ITEM_NONE, _forward_cb,
-                               (void *)ug_data);
+                               (void *)view);
        }
 
-       elm_object_content_set(ug_data->notify, reply_popup_genlist);
-       evas_object_show(ug_data->notify);
+       elm_object_content_set(view->notify, reply_popup_genlist);
+       evas_object_show(view->notify);
        debug_leave();
 }
 
@@ -439,29 +439,29 @@ static void _header_favorite_clicked_cb(void *data, Evas_Object *obj, const char
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        int err = EMAIL_ERROR_NONE;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
 
-       debug_log("Before ug_data->favorite: %d", ug_data->favorite);
-       switch (ug_data->favorite) {
+       debug_log("Before view->favorite: %d", view->favorite);
+       switch (view->favorite) {
                case EMAIL_FLAG_NONE:
-                       ug_data->favorite = EMAIL_FLAG_FLAGED;
+                       view->favorite = EMAIL_FLAG_FLAGED;
                        break;
                case EMAIL_FLAG_FLAGED:
-                       ug_data->favorite = EMAIL_FLAG_NONE;
+                       view->favorite = EMAIL_FLAG_NONE;
                        break;
                default:
                        debug_log("Never here");
        }
-       debug_log("After ug_data->favorite: %d", ug_data->favorite);
+       debug_log("After view->favorite: %d", view->favorite);
 
-       err = email_set_flags_field(ug_data->account_id, &ug_data->mail_id, 1, EMAIL_FLAGS_FLAGGED_FIELD, ug_data->favorite, 1);
+       err = email_set_flags_field(view->account_id, &view->mail_id, 1, EMAIL_FLAGS_FLAGGED_FIELD, view->favorite, 1);
 
        if (err != EMAIL_ERROR_NONE) {
-               if ((ug_data->favorite == EMAIL_FLAG_NONE) || (ug_data->favorite == EMAIL_FLAG_FLAGED)) {
-                       util_create_notify(ug_data, EMAIL_VIEWER_POP_ERROR,
+               if ((view->favorite == EMAIL_FLAG_NONE) || (view->favorite == EMAIL_FLAG_FLAGED)) {
+                       util_create_notify(view, EMAIL_VIEWER_POP_ERROR,
                                        EMAIL_VIEWER_STR_FAILED_TO_SET_FAVOURITE, 1,
                                        EMAIL_VIEWER_STRING_OK, _header_popup_response_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
                } else {
@@ -470,7 +470,7 @@ static void _header_favorite_clicked_cb(void *data, Evas_Object *obj, const char
                return;
        }
 
-       header_update_favorite_icon(ug_data);
+       header_update_favorite_icon(view);
 
        debug_leave();
 }
@@ -480,8 +480,8 @@ static char *_header_reply_popup_text_get(void *data, Evas_Object *obj, const ch
        debug_enter();
        retvm_if(obj == NULL, NULL, "Invalid parameter: obj[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)evas_object_data_get(obj, VIEWER_EVAS_DATA_NAME);
-       retvm_if(ug_data == NULL, NULL, "Invalid parameter: ug_data[NULL]");
+       EmailViewerView *view = (EmailViewerView *)evas_object_data_get(obj, VIEWER_EVAS_DATA_NAME);
+       retvm_if(view == NULL, NULL, "Invalid parameter: view[NULL]");
 
        if (!strcmp(part, "elm.text")) {
                const char *text = data ? _(data) : NULL;
@@ -495,19 +495,19 @@ static void _header_pack_attachment_preview(void *data)
 {
        debug_enter();
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       Evas_Object *bottom_ly = ug_data->header_divider;
-       if (!ug_data->is_recipient_ly_shown) {
-               elm_box_pack_after(ug_data->main_bx, ug_data->attachment_ly, bottom_ly);
+       EmailViewerView *view = (EmailViewerView *)data;
+       Evas_Object *bottom_ly = view->header_divider;
+       if (!view->is_recipient_ly_shown) {
+               elm_box_pack_after(view->main_bx, view->attachment_ly, bottom_ly);
        } else {
-               if (ug_data->bcc_ly) {
-                       elm_box_pack_after(ug_data->main_bx, ug_data->attachment_ly, ug_data->bcc_ly);
-               } else if (ug_data->cc_ly) {
-                       elm_box_pack_after(ug_data->main_bx, ug_data->attachment_ly, ug_data->cc_ly);
-               } else if (ug_data->to_ly) {
-                       elm_box_pack_after(ug_data->main_bx, ug_data->attachment_ly, ug_data->to_ly);
+               if (view->bcc_ly) {
+                       elm_box_pack_after(view->main_bx, view->attachment_ly, view->bcc_ly);
+               } else if (view->cc_ly) {
+                       elm_box_pack_after(view->main_bx, view->attachment_ly, view->cc_ly);
+               } else if (view->to_ly) {
+                       elm_box_pack_after(view->main_bx, view->attachment_ly, view->to_ly);
                } else {
-                       elm_box_pack_after(ug_data->main_bx, ug_data->attachment_ly, bottom_ly);
+                       elm_box_pack_after(view->main_bx, view->attachment_ly, bottom_ly);
                }
        }
        debug_leave();
@@ -518,48 +518,48 @@ static void _header_attachment_clicked_edje_cb(void *data, Evas_Object *obj, con
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       retm_if(ug_data->attachment_genlist != NULL, "Attachment view already created");
+       EmailViewerView *view = (EmailViewerView *)data;
+       retm_if(view->attachment_genlist != NULL, "Attachment view already created");
 
-       viewer_create_attachment_view(ug_data);
+       viewer_create_attachment_view(view);
 
        debug_leave();
 }
 
-void header_update_response_icon(EmailViewerUGD *ug_data, email_mail_data_t *mail_info)
+void header_update_response_icon(EmailViewerView *view, email_mail_data_t *mail_info)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
        retm_if(mail_info == NULL, "Invalid parameter: mail_info[NULL]");
-       retm_if(ug_data->viewer_type != EMAIL_VIEWER, "Not needed in this view");
+       retm_if(view->viewer_type != EMAIL_VIEWER, "Not needed in this view");
 
        if (mail_info->flags_answered_field || mail_info->flags_forwarded_field) {
-               _header_update_subject(ug_data, mail_info);
+               _header_update_subject(view, mail_info);
        }
 
        debug_leave();
 }
 
-void header_update_attachment_summary_info(EmailViewerUGD *ug_data)
+void header_update_attachment_summary_info(EmailViewerView *view)
 {
        debug_enter();
 
        /*set file count*/
        char file_count[BUF_LEN_S];
-       if (ug_data->normal_att_count == 1) {
+       if (view->normal_att_count == 1) {
                snprintf(file_count, sizeof(file_count), "%s", email_get_email_string("IDS_EMAIL_BODY_1_FILE_ABB"));
        } else {
-               snprintf(file_count, sizeof(file_count), email_get_email_string("IDS_EMAIL_BODY_PD_FILES_ABB"), ug_data->normal_att_count);
+               snprintf(file_count, sizeof(file_count), email_get_email_string("IDS_EMAIL_BODY_PD_FILES_ABB"), view->normal_att_count);
        }
 
        /*set file size*/
        char *_total_file_size = NULL;
-       _total_file_size = email_get_file_size_string(ug_data->total_att_size);
+       _total_file_size = email_get_file_size_string(view->total_att_size);
 
        char attachment_info[MAX_STR_LEN];
        snprintf(attachment_info, sizeof(attachment_info), "%s (%s)", file_count, _total_file_size);
 
-       elm_object_part_text_set(ug_data->attachment_ly, "attachment.info.text", attachment_info);
+       elm_object_part_text_set(view->attachment_ly, "attachment.info.text", attachment_info);
 
        g_free(_total_file_size);
 
@@ -570,11 +570,11 @@ void _header_delete_attachment_preview(void *data)
 {
        debug_enter();
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       elm_box_unpack(ug_data->main_bx, ug_data->attachment_ly);
-       evas_object_hide(ug_data->attachment_ly);
-       DELETE_EVAS_OBJECT(ug_data->attachment_ly);
+       elm_box_unpack(view->main_bx, view->attachment_ly);
+       evas_object_hide(view->attachment_ly);
+       DELETE_EVAS_OBJECT(view->attachment_ly);
        debug_leave();
 }
 
@@ -582,49 +582,49 @@ static void _header_create_attachment_preview(void *data)
 {
        debug_enter();
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       Evas_Object *attachment_ly = viewer_load_edj(ug_data->base.content, email_get_viewer_theme_path(), "ev/attachment/base", EVAS_HINT_EXPAND, 0.0);
+       Evas_Object *attachment_ly = viewer_load_edj(view->base.content, email_get_viewer_theme_path(), "ev/attachment/base", EVAS_HINT_EXPAND, 0.0);
        evas_object_size_hint_align_set(attachment_ly, EVAS_HINT_FILL, 0.0);
        evas_object_show(attachment_ly);
-       ug_data->attachment_ly = attachment_ly;
+       view->attachment_ly = attachment_ly;
 
-       _header_pack_attachment_preview(ug_data);
-       header_update_attachment_summary_info(ug_data);
+       _header_pack_attachment_preview(view);
+       header_update_attachment_summary_info(view);
 
-       edje_object_signal_callback_add(_EDJ(attachment_ly), "attachment.clicked", "edje", _header_attachment_clicked_edje_cb, ug_data);
+       edje_object_signal_callback_add(_EDJ(attachment_ly), "attachment.clicked", "edje", _header_attachment_clicked_edje_cb, view);
 
        debug_leave();
 }
 
-void header_set_sender_name(EmailViewerUGD *ug_data)
+void header_set_sender_name(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
        /* sender name */
-       if (STR_VALID(ug_data->sender_display_name)) {
+       if (STR_VALID(view->sender_display_name)) {
                /* 1. Show display name obtained form email server */
-               char *markup_name = elm_entry_utf8_to_markup(ug_data->sender_display_name);
-               elm_object_part_text_set(ug_data->sender_ly, "sender.name.text", markup_name);
+               char *markup_name = elm_entry_utf8_to_markup(view->sender_display_name);
+               elm_object_part_text_set(view->sender_ly, "sender.name.text", markup_name);
                FREE(markup_name);
 
-       } else if (STR_VALID(ug_data->sender_address)) {
+       } else if (STR_VALID(view->sender_address)) {
                /* 2. If there is no sender name show email address */
-               elm_object_part_text_set(ug_data->sender_ly, "sender.name.text", ug_data->sender_address);
+               elm_object_part_text_set(view->sender_ly, "sender.name.text", view->sender_address);
        }
 
        /* sender email */
-       if (STR_VALID(ug_data->sender_address)) {
-               elm_object_part_text_set(ug_data->sender_ly, "sender.email.text", ug_data->sender_address);
+       if (STR_VALID(view->sender_address)) {
+               elm_object_part_text_set(view->sender_ly, "sender.email.text", view->sender_address);
        }
 
-       if (!STR_VALID(ug_data->sender_display_name) && !STR_VALID(ug_data->sender_address)) {
+       if (!STR_VALID(view->sender_display_name) && !STR_VALID(view->sender_address)) {
                /* 3. Show text for no address */
-               elm_object_domain_translatable_part_text_set(ug_data->sender_ly, "sender.name.text", PACKAGE, "IDS_EMAIL_MBODY_NO_EMAIL_ADDRESS_OR_NAME");
+               elm_object_domain_translatable_part_text_set(view->sender_ly, "sender.name.text", PACKAGE, "IDS_EMAIL_MBODY_NO_EMAIL_ADDRESS_OR_NAME");
        }
 
-       evas_object_show(ug_data->sender_ly);
+       evas_object_show(view->sender_ly);
        debug_leave();
 }
 
@@ -632,12 +632,12 @@ void header_create_view(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       _header_create_subject(ug_data);
-       _header_create_sender(ug_data);
-       _header_create_divider(ug_data);
+       EmailViewerView *view = (EmailViewerView *)data;
+       _header_create_subject(view);
+       _header_create_sender(view);
+       _header_create_divider(view);
 
-       header_layout_pack(ug_data);
+       header_layout_pack(view);
        debug_leave();
 }
 
@@ -645,20 +645,20 @@ void header_update_view(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       retm_if(ug_data->eViewerErrorType != VIEWER_ERROR_NONE, "Some Error occurred");
+       EmailViewerView *view = (EmailViewerView *)data;
+       retm_if(view->eViewerErrorType != VIEWER_ERROR_NONE, "Some Error occurred");
 
-       _header_update_subject(ug_data, ug_data->mail_info);
-       _header_update_sender(ug_data);
-       header_update_date(ug_data);
+       _header_update_subject(view, view->mail_info);
+       _header_update_sender(view);
+       header_update_date(view);
 
-       if (!ug_data->is_recipient_ly_shown) {
-               _header_show_hide_details_text_set(ug_data, EINA_FALSE);
+       if (!view->is_recipient_ly_shown) {
+               _header_show_hide_details_text_set(view, EINA_FALSE);
        } else {
-               _header_show_hide_details_text_set(ug_data, EINA_TRUE);
+               _header_show_hide_details_text_set(view, EINA_TRUE);
        }
 
-       _header_update_attachments_preview(ug_data);
+       _header_update_attachments_preview(view);
 
        debug_leave();
 }
@@ -668,27 +668,27 @@ void header_layout_unpack(void *data)
        debug_enter();
 
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       elm_box_unpack(ug_data->main_bx, ug_data->sender_ly);
+       elm_box_unpack(view->main_bx, view->sender_ly);
 
-       if (ug_data->has_attachment && ug_data->attachment_ly) {
-               elm_box_unpack(ug_data->main_bx, ug_data->attachment_ly);
+       if (view->has_attachment && view->attachment_ly) {
+               elm_box_unpack(view->main_bx, view->attachment_ly);
        }
 
-       if (ug_data->is_recipient_ly_shown) {
-               if (ug_data->to_ly) {
-                       elm_box_unpack(ug_data->main_bx, ug_data->to_ly);
+       if (view->is_recipient_ly_shown) {
+               if (view->to_ly) {
+                       elm_box_unpack(view->main_bx, view->to_ly);
                }
-               if (ug_data->cc_ly) {
-                       elm_box_unpack(ug_data->main_bx, ug_data->cc_ly);
+               if (view->cc_ly) {
+                       elm_box_unpack(view->main_bx, view->cc_ly);
                }
-               if (ug_data->bcc_ly) {
-                       elm_box_unpack(ug_data->main_bx, ug_data->bcc_ly);
+               if (view->bcc_ly) {
+                       elm_box_unpack(view->main_bx, view->bcc_ly);
                }
        }
 
-       elm_box_unpack(ug_data->main_bx, ug_data->header_divider);
+       elm_box_unpack(view->main_bx, view->header_divider);
 
        debug_leave();
 }
@@ -698,45 +698,45 @@ void header_layout_pack(void *data)
        debug_enter();
 
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        /* 1. sender */
-       elm_box_pack_start(ug_data->main_bx, ug_data->sender_ly);
-       Evas_Object *bottom_ly = ug_data->sender_ly;
+       elm_box_pack_start(view->main_bx, view->sender_ly);
+       Evas_Object *bottom_ly = view->sender_ly;
        /* 2-2. recipient */
-       if (ug_data->is_recipient_ly_shown) {
-               if (ug_data->to_ly) {
-                       elm_box_pack_before(ug_data->main_bx, ug_data->to_ly, ug_data->sender_ly);
-                       bottom_ly = ug_data->to_ly;
+       if (view->is_recipient_ly_shown) {
+               if (view->to_ly) {
+                       elm_box_pack_before(view->main_bx, view->to_ly, view->sender_ly);
+                       bottom_ly = view->to_ly;
                }
 
-               if (ug_data->cc_ly) {
-                       if (ug_data->to_ly && ug_data->cc_ly) {
-                               elm_box_pack_after(ug_data->main_bx, ug_data->cc_ly, ug_data->to_ly);
-                       } else if (ug_data->cc_ly) {
-                               elm_box_pack_after(ug_data->main_bx, ug_data->cc_ly, ug_data->sender_ly);
+               if (view->cc_ly) {
+                       if (view->to_ly && view->cc_ly) {
+                               elm_box_pack_after(view->main_bx, view->cc_ly, view->to_ly);
+                       } else if (view->cc_ly) {
+                               elm_box_pack_after(view->main_bx, view->cc_ly, view->sender_ly);
                        }
-                       bottom_ly = ug_data->cc_ly;
+                       bottom_ly = view->cc_ly;
                }
-               if (ug_data->bcc_ly) {
-                       if (ug_data->cc_ly) {
-                               elm_box_pack_after(ug_data->main_bx, ug_data->bcc_ly, ug_data->cc_ly);
+               if (view->bcc_ly) {
+                       if (view->cc_ly) {
+                               elm_box_pack_after(view->main_bx, view->bcc_ly, view->cc_ly);
                        }
-                       if (ug_data->to_ly && ug_data->cc_ly == NULL) {
-                               elm_box_pack_after(ug_data->main_bx, ug_data->bcc_ly, ug_data->to_ly);
+                       if (view->to_ly && view->cc_ly == NULL) {
+                               elm_box_pack_after(view->main_bx, view->bcc_ly, view->to_ly);
                        }
-                       if (ug_data->to_ly == NULL && ug_data->cc_ly == NULL) {
-                               elm_box_pack_after(ug_data->main_bx, ug_data->bcc_ly, ug_data->sender_ly);
+                       if (view->to_ly == NULL && view->cc_ly == NULL) {
+                               elm_box_pack_after(view->main_bx, view->bcc_ly, view->sender_ly);
                        }
-                       bottom_ly = ug_data->bcc_ly;
+                       bottom_ly = view->bcc_ly;
                }
        }
 
-       elm_box_pack_after(ug_data->main_bx, ug_data->header_divider, bottom_ly);
-       bottom_ly = ug_data->header_divider;
+       elm_box_pack_after(view->main_bx, view->header_divider, bottom_ly);
+       bottom_ly = view->header_divider;
 
-       if (ug_data->has_attachment && ug_data->attachment_ly) {
-               elm_box_pack_after(ug_data->main_bx, ug_data->attachment_ly, bottom_ly);
+       if (view->has_attachment && view->attachment_ly) {
+               elm_box_pack_after(view->main_bx, view->attachment_ly, bottom_ly);
        }
 
        debug_leave();
@@ -747,22 +747,22 @@ static void _header_update_attachments_preview(void *data)
        debug_enter();
 
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       if (ug_data->has_attachment) {
-               _header_delete_attachment_preview(ug_data);
-               _header_create_attachment_preview(ug_data);
+       if (view->has_attachment) {
+               _header_delete_attachment_preview(view);
+               _header_create_attachment_preview(view);
        } else {
-               _header_delete_attachment_preview(ug_data);
+               _header_delete_attachment_preview(view);
        }
 
        debug_leave();
 }
 
-void header_update_date(EmailViewerUGD *ug_data)
+void header_update_date(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
        viewer_close_pattern_generator();
        viewer_open_pattern_generator();
@@ -770,36 +770,36 @@ void header_update_date(EmailViewerUGD *ug_data)
        char *formatted_date = NULL;
        char date_time[MAX_STR_LEN] = { 0, };
 
-       formatted_date = email_get_date_text_with_formatter(viewer_date_formatter, &(ug_data->mktime));
+       formatted_date = email_get_date_text_with_formatter(viewer_date_formatter, &(view->mktime));
        if (formatted_date != NULL) {
                snprintf(date_time, MAX_STR_LEN, "%s", formatted_date);
                FREE(formatted_date);
        }
 
-       elm_object_part_text_set(ug_data->sender_ly, "sender.date.text", date_time);
+       elm_object_part_text_set(view->sender_ly, "sender.date.text", date_time);
 
-       if ((ug_data->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) && (ug_data->viewer_type == EMAIL_VIEWER)) {
-               header_set_favorite_icon(ug_data);
+       if ((view->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) && (view->viewer_type == EMAIL_VIEWER)) {
+               header_set_favorite_icon(view);
        }
 
        debug_leave();
 }
 
-void header_update_favorite_icon(EmailViewerUGD *ug_data)
+void header_update_favorite_icon(EmailViewerView *view)
 {
-       header_set_favorite_icon(ug_data);
+       header_set_favorite_icon(view);
 }
 
-void header_set_favorite_icon(EmailViewerUGD *ug_data)
+void header_set_favorite_icon(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       Evas_Object *ly = elm_layout_add(ug_data->sender_ly);
+       Evas_Object *ly = elm_layout_add(view->sender_ly);
 
-       debug_log("favorite: %d", ug_data->favorite);
+       debug_log("favorite: %d", view->favorite);
 
-       switch (ug_data->favorite) {
+       switch (view->favorite) {
                case EMAIL_FLAG_NONE:
                        elm_layout_file_set(ly, email_get_viewer_theme_path(), "elm/layout/flag.none.icon/default");
                        break;
@@ -807,8 +807,8 @@ void header_set_favorite_icon(EmailViewerUGD *ug_data)
                        elm_layout_file_set(ly, email_get_viewer_theme_path(), "elm/layout/flag.star.icon/default");
                        break;
        }
-       elm_object_part_content_set(ug_data->sender_ly, "sender.fav.event", ly);
-       edje_object_signal_callback_add(_EDJ(ly), "clicked", "edje", _header_favorite_clicked_cb, ug_data);
+       elm_object_part_content_set(view->sender_ly, "sender.fav.event", ly);
+       edje_object_signal_callback_add(_EDJ(ly), "clicked", "edje", _header_favorite_clicked_cb, view);
 
        debug_leave();
 }
index d4d682e..23a240b 100644 (file)
@@ -25,7 +25,7 @@ int viewer_initial_data_pre_parse_arguments(void *data, email_params_h params)
        retvm_if(!data, VIEWER_ERROR_INVALID_ARG, "Invalid parameter: data is NULL!");
        retvm_if(!params, VIEWER_ERROR_INVALID_ARG, "Invalid parameter: params is NULL!");
 
-       EmailViewerUGD *temp_data = (EmailViewerUGD *)data;
+       EmailViewerView *temp_data = (EmailViewerView *)data;
 
        if (email_params_get_int(params, EMAIL_BUNDLE_KEY_ACCOUNT_ID, &temp_data->account_id)) {
                viewer_create_account_data(temp_data);
@@ -44,12 +44,12 @@ int viewer_initial_data_pre_parse_arguments(void *data, email_params_h params)
        const char *uri = NULL;
 
        if (email_params_get_str(params, EMAIL_BUNDLE_KEY_MYFILE_PATH, &file_path)) {
-               debug_log("ug called by app-control request");
+               debug_log("module created by app-control request");
                temp_data->eml_file_path = g_strdup(file_path);
                temp_data->viewer_type = EML_VIEWER;
                debug_secure("eml_file_path: %s", temp_data->eml_file_path);
        } else if (email_params_get_uri(params, &uri)) {
-               debug_log("ug called by app-control request");
+               debug_log("module created by app-control request");
                if (g_str_has_prefix(uri, URI_SCHEME_FILE)) {
                        temp_data->eml_file_path = g_strndup(uri + strlen(URI_SCHEME_FILE), strlen(uri) - strlen(URI_SCHEME_FILE));
                } else {
@@ -68,35 +68,35 @@ int viewer_initial_data_pre_parse_arguments(void *data, email_params_h params)
 Eina_Bool viewer_free_viewer_data(void *data)
 {
        retvm_if(!data, EINA_FALSE, "Invalid parameter: data is NULL!");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        Eina_Bool ret = EINA_TRUE;
 
        /* stop engine */
-       if (ug_data->email_handle != 0) {
-               email_engine_stop_working(ug_data->account_id, ug_data->email_handle);
-               ug_data->email_handle = 0;
+       if (view->email_handle != 0) {
+               email_engine_stop_working(view->account_id, view->email_handle);
+               view->email_handle = 0;
        }
 
        debug_log("free mail_info");
-       if (ug_data->mail_info) {
-               email_free_mail_data(&(ug_data->mail_info), 1);
-               ug_data->mail_info = NULL;
+       if (view->mail_info) {
+               email_free_mail_data(&(view->mail_info), 1);
+               view->mail_info = NULL;
        }
 
-       if (ug_data->attachment_info && ug_data->attachment_count > 0) {
-               email_free_attachment_data(&(ug_data->attachment_info), ug_data->attachment_count);
-               ug_data->attachment_info = NULL;
-               ug_data->attachment_count = 0;
+       if (view->attachment_info && view->attachment_count > 0) {
+               email_free_attachment_data(&(view->attachment_info), view->attachment_count);
+               view->attachment_info = NULL;
+               view->attachment_count = 0;
        }
 
-       ug_data->eml_file_path = NULL;
-       FREE(ug_data->file_id);
+       view->eml_file_path = NULL;
+       FREE(view->file_id);
 
-       viewer_remove_internal_mail(ug_data);
+       viewer_remove_internal_mail(view);
 
-       FREE(ug_data->webview_data);
+       FREE(view->webview_data);
 
-       FREE(ug_data->account_email_address);
+       FREE(view->account_email_address);
 
        return ret;
 }
index 06d1b33..c53776b 100644 (file)
@@ -53,58 +53,58 @@ gboolean viewer_get_internal_mail_info(void *data)
 {
        debug_enter();
        retvm_if(data == NULL, EINA_FALSE, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *) data;
+       EmailViewerView *view = (EmailViewerView *) data;
 
        int err = 0;
 
-       if (ug_data->mail_info) {
+       if (view->mail_info) {
                debug_log("mail_info freed");
-               email_free_mail_data(&(ug_data->mail_info), 1);
-               ug_data->mail_info = NULL;
+               email_free_mail_data(&(view->mail_info), 1);
+               view->mail_info = NULL;
        }
 
-       if (ug_data->attachment_info && ug_data->attachment_count > 0) {
-               debug_log("attachment_info freed p[%p] n[%d]", ug_data->attachment_info, ug_data->attachment_count);
-               email_free_attachment_data(&(ug_data->attachment_info), ug_data->attachment_count);
-               ug_data->attachment_info = NULL;
-               ug_data->attachment_count = 0;
+       if (view->attachment_info && view->attachment_count > 0) {
+               debug_log("attachment_info freed p[%p] n[%d]", view->attachment_info, view->attachment_count);
+               email_free_attachment_data(&(view->attachment_info), view->attachment_count);
+               view->attachment_info = NULL;
+               view->attachment_count = 0;
        }
 
-       debug_secure("ug_data->eml_file_path:%s", ug_data->eml_file_path);
-       if (ug_data->eml_file_path == NULL) {
-               if ((err = email_get_mail_data(ug_data->mail_id, &(ug_data->mail_info))) != EMAIL_ERROR_NONE) {
+       debug_secure("view->eml_file_path:%s", view->eml_file_path);
+       if (view->eml_file_path == NULL) {
+               if ((err = email_get_mail_data(view->mail_id, &(view->mail_info))) != EMAIL_ERROR_NONE) {
                        debug_log("fail to get mail data - err (%d)", err);
-                       email_free_mail_data(&ug_data->mail_info, 1);
+                       email_free_mail_data(&view->mail_info, 1);
                        return FALSE;
                }
 
-               retvm_if(ug_data->mail_info == NULL, FALSE, "mail_info is NULL");
+               retvm_if(view->mail_info == NULL, FALSE, "mail_info is NULL");
 
-               if ((err = email_get_attachment_data_list(ug_data->mail_id, &(ug_data->attachment_info), &(ug_data->attachment_count))) != EMAIL_ERROR_NONE) {
+               if ((err = email_get_attachment_data_list(view->mail_id, &(view->attachment_info), &(view->attachment_count))) != EMAIL_ERROR_NONE) {
                        debug_log("fail to get attachment data - err (%d)", err);
-                       email_free_attachment_data(&(ug_data->attachment_info), ug_data->attachment_count);
+                       email_free_attachment_data(&(view->attachment_info), view->attachment_count);
                        return FALSE;
                }
        } else {
-               if (email_get_file_size(ug_data->eml_file_path) == 0) {
+               if (email_get_file_size(view->eml_file_path) == 0) {
                        debug_log("eml file size: zero");
                        return FALSE;
                }
-               if ((err = email_parse_mime_file(ug_data->eml_file_path, &(ug_data->mail_info), &(ug_data->attachment_info), &(ug_data->attachment_count))) != EMAIL_ERROR_NONE) {
+               if ((err = email_parse_mime_file(view->eml_file_path, &(view->mail_info), &(view->attachment_info), &(view->attachment_count))) != EMAIL_ERROR_NONE) {
                        debug_log("email_parse_mime_file failed - err (%d)", err);
                        return FALSE;
                }
 
-               retvm_if(ug_data->mail_info == NULL, FALSE, "mail_info is NULL");
+               retvm_if(view->mail_info == NULL, FALSE, "mail_info is NULL");
        }
 
-       debug_secure("sender address :%s", ug_data->mail_info->email_address_sender);
-       debug_log("ug_data - ATTACH[%d], INLINE[%d]", ug_data->mail_info->attachment_count, ug_data->mail_info->inline_content_count);
-       debug_log("Total attachment count of ug_data->mail_info [%d]", ug_data->mail_info->attachment_count + ug_data->mail_info->inline_content_count);
-       debug_log("ug_data->attachment_info :%p", ug_data->attachment_info);
-       debug_log("ug_data->attachment_count [%d]", ug_data->attachment_count);
-       if (ug_data->attachment_info) {
-               debug_log("ug_data->attachment_info->attachment_size :%d", ug_data->attachment_info->attachment_size);
+       debug_secure("sender address :%s", view->mail_info->email_address_sender);
+       debug_log("view - ATTACH[%d], INLINE[%d]", view->mail_info->attachment_count, view->mail_info->inline_content_count);
+       debug_log("Total attachment count of view->mail_info [%d]", view->mail_info->attachment_count + view->mail_info->inline_content_count);
+       debug_log("view->attachment_info :%p", view->attachment_info);
+       debug_log("view->attachment_count [%d]", view->attachment_count);
+       if (view->attachment_info) {
+               debug_log("view->attachment_info->attachment_size :%d", view->attachment_info->attachment_size);
        }
 
        debug_leave();
@@ -115,31 +115,31 @@ void viewer_make_internal_mail(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       email_mail_data_t *mail_info = ug_data->mail_info;
+       EmailViewerView *view = (EmailViewerView *)data;
+       email_mail_data_t *mail_info = view->mail_info;
        retm_if(mail_info == NULL, "mail_info is NULL");
 
        /* mail flags */
-       _set_mail_flags(ug_data);
+       _set_mail_flags(view);
 
        /* sender */
-       _make_internal_sender(ug_data);
+       _make_internal_sender(view);
 
        /* datetime */
-       _make_internal_date(ug_data);
+       _make_internal_date(view);
 
        /* subject */
-       _make_internal_subject(ug_data);
+       _make_internal_subject(view);
 
        /* body */
-       _make_internal_body(ug_data);
+       _make_internal_body(view);
 
        /* html body */
-       _make_internal_html_body(ug_data);
+       _make_internal_html_body(view);
 
        /* attachment */
-       _make_internal_attachments(ug_data);
-       debug_log("total_att_count(%d), normal_att_count(%d), has_attachment(%d)", ug_data->total_att_count, ug_data->normal_att_count, ug_data->has_attachment);
+       _make_internal_attachments(view);
+       debug_log("total_att_count(%d), normal_att_count(%d), has_attachment(%d)", view->total_att_count, view->normal_att_count, view->has_attachment);
 
        debug_leave();
 }
@@ -148,19 +148,19 @@ void viewer_remove_internal_mail(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        /* sender */
-       _remove_internal_sender(ug_data);
+       _remove_internal_sender(view);
 
        /* subject */
-       _remove_internal_subject(ug_data);
+       _remove_internal_subject(view);
 
        /* body & html body */
-       _remove_internal_body(ug_data);
+       _remove_internal_body(view);
 
        /* attachment */
-       _remove_internal_attachments(ug_data);
+       _remove_internal_attachments(view);
 
        debug_leave();
 }
@@ -169,9 +169,9 @@ void viewer_set_mail_seen(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       email_mail_data_t *mail_info = ug_data->mail_info;
-       retm_if(mail_info == NULL, "ug_data->mail_info is NULL");
+       EmailViewerView *view = (EmailViewerView *)data;
+       email_mail_data_t *mail_info = view->mail_info;
+       retm_if(mail_info == NULL, "view->mail_info is NULL");
 
        int err = 0;
 
@@ -192,78 +192,78 @@ static void _set_mail_flags(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       _set_status(ug_data);
-       _set_favorite(ug_data);
-       _set_request_report(ug_data);
-       _set_body_download(ug_data);
+       _set_status(view);
+       _set_favorite(view);
+       _set_request_report(view);
+       _set_body_download(view);
        debug_leave();
 }
 
 static void _set_status(void *data)
 {
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       email_mail_data_t *mail_info = ug_data->mail_info;
+       EmailViewerView *view = (EmailViewerView *)data;
+       email_mail_data_t *mail_info = view->mail_info;
        retm_if(mail_info == NULL, "mail_info is NULL");
 
        if (mail_info->flags_answered_field) {
-               ug_data->mail_type |= EMAIL_STATUS_REPLY;
+               view->mail_type |= EMAIL_STATUS_REPLY;
        }
 
        if (mail_info->flags_forwarded_field) {
-               ug_data->mail_type |= EMAIL_STATUS_FORWARD;
+               view->mail_type |= EMAIL_STATUS_FORWARD;
        }
 
-       ug_data->save_status = mail_info->save_status;
-       debug_log("EMAIL_STATUS_REPLY(%d), EMAIL_STATUS_FORWARD(%d), save_status(%d)", (ug_data->mail_type & EMAIL_STATUS_REPLY), (ug_data->mail_type & EMAIL_STATUS_FORWARD), ug_data->save_status);
+       view->save_status = mail_info->save_status;
+       debug_log("EMAIL_STATUS_REPLY(%d), EMAIL_STATUS_FORWARD(%d), save_status(%d)", (view->mail_type & EMAIL_STATUS_REPLY), (view->mail_type & EMAIL_STATUS_FORWARD), view->save_status);
 }
 
 static void _set_favorite(void *data)
 {
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       email_mail_data_t *mail_info = ug_data->mail_info;
+       EmailViewerView *view = (EmailViewerView *)data;
+       email_mail_data_t *mail_info = view->mail_info;
        retm_if(mail_info == NULL, "mail_info is NULL");
 
-       ug_data->favorite = mail_info->flags_flagged_field;
-       debug_log("favorite (%d)", ug_data->favorite);
+       view->favorite = mail_info->flags_flagged_field;
+       debug_log("favorite (%d)", view->favorite);
 }
 
 static void _set_request_report(void *data)
 {
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       email_mail_data_t *mail_info = ug_data->mail_info;
+       EmailViewerView *view = (EmailViewerView *)data;
+       email_mail_data_t *mail_info = view->mail_info;
        retm_if(mail_info == NULL, "mail_info is NULL");
 
-       ug_data->request_report = (mail_info->report_status & EMAIL_MAIL_REQUEST_MDN) ? TRUE : FALSE;
-       debug_log("request_report (%d)", ug_data->request_report);
+       view->request_report = (mail_info->report_status & EMAIL_MAIL_REQUEST_MDN) ? TRUE : FALSE;
+       debug_log("request_report (%d)", view->request_report);
 }
 
 static void _set_body_download(void *data)
 {
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       email_mail_data_t *mail_info = ug_data->mail_info;
+       EmailViewerView *view = (EmailViewerView *)data;
+       email_mail_data_t *mail_info = view->mail_info;
        retm_if(mail_info == NULL, "mail_info is NULL");
 
-       ug_data->body_download_status = mail_info->body_download_status;
-       debug_log("body_download_status (%d)", ug_data->body_download_status);
+       view->body_download_status = mail_info->body_download_status;
+       debug_log("body_download_status (%d)", view->body_download_status);
 }
 
 static void _make_internal_sender(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       email_mail_data_t *mail_info = ug_data->mail_info;
+       EmailViewerView *view = (EmailViewerView *)data;
+       email_mail_data_t *mail_info = view->mail_info;
        retm_if(mail_info == NULL, "mail_info is NULL");
 
        if (STR_VALID(mail_info->full_address_from)) {
-               if (STR_VALID(ug_data->sender_address)) {
-                       FREE(ug_data->sender_address);
+               if (STR_VALID(view->sender_address)) {
+                       FREE(view->sender_address);
                }
                debug_secure("head from (%s)", mail_info->full_address_from);
                gchar *nick = NULL;
@@ -276,37 +276,37 @@ static void _make_internal_sender(void *data)
                }
                debug_secure("nick [%s], addr [%s]", nick, addr);
 
-               ug_data->sender_display_name = g_strdup(nick);
-               ug_data->sender_address = g_strdup(addr);
+               view->sender_display_name = g_strdup(nick);
+               view->sender_address = g_strdup(addr);
 
                g_free(addr);
                g_free(nick);
 
                debug_secure("mail_data: alias_sender (%s), email_address_sender (%s)", mail_info->alias_sender, mail_info->email_address_sender);
-               debug_secure("ug_data: sender name (%s), sender address (%s)", ug_data->sender_display_name, ug_data->sender_address);
+               debug_secure("view: sender name (%s), sender address (%s)", view->sender_display_name, view->sender_address);
        }
-       debug_secure("sender_address (%s)", ug_data->sender_address ? ug_data->sender_address : "@niL");
+       debug_secure("sender_address (%s)", view->sender_address ? view->sender_address : "@niL");
        debug_leave();
 }
 
 static void _make_internal_date(void *data)
 {
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       email_mail_data_t *mail_info = ug_data->mail_info;
+       EmailViewerView *view = (EmailViewerView *)data;
+       email_mail_data_t *mail_info = view->mail_info;
        retm_if(mail_info == NULL, "mail_info is NULL");
        if (mail_info->save_status == EMAIL_MAIL_STATUS_SEND_SCHEDULED)
-               ug_data->mktime = mail_info->scheduled_sending_time;
+               view->mktime = mail_info->scheduled_sending_time;
        else
-               ug_data->mktime = mail_info->date_time;
-       debug_secure("mail time = %s", ctime(&ug_data->mktime));
+               view->mktime = mail_info->date_time;
+       debug_secure("mail time = %s", ctime(&view->mktime));
 }
 
 static void _make_internal_subject(void *data)
 {
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       email_mail_data_t *mail_info = ug_data->mail_info;
+       EmailViewerView *view = (EmailViewerView *)data;
+       email_mail_data_t *mail_info = view->mail_info;
        retm_if(mail_info == NULL, "mail_info is NULL");
 
        if (!STR_VALID(mail_info->subject)) {
@@ -314,49 +314,49 @@ static void _make_internal_subject(void *data)
                return;
        }
 
-       if (STR_VALID(ug_data->subject)) {
-               FREE(ug_data->subject);
+       if (STR_VALID(view->subject)) {
+               FREE(view->subject);
        }
-       ug_data->subject = g_strdup(mail_info->subject);
-       debug_secure("subject (%s)", ug_data->subject);
+       view->subject = g_strdup(mail_info->subject);
+       debug_secure("subject (%s)", view->subject);
 }
 
 static void _make_internal_body(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       email_mail_data_t *mail_info = ug_data->mail_info;
+       EmailViewerView *view = (EmailViewerView *)data;
+       email_mail_data_t *mail_info = view->mail_info;
        retm_if(mail_info == NULL, "mail_info is NULL");
 
        if (STR_VALID(mail_info->file_path_plain)) {
-               if (STR_VALID(ug_data->body_uri)) {
-                       FREE(ug_data->body_uri);
+               if (STR_VALID(view->body_uri)) {
+                       FREE(view->body_uri);
                }
-               ug_data->body_uri = g_strdup(mail_info->file_path_plain);
+               view->body_uri = g_strdup(mail_info->file_path_plain);
        }
 
        char *plain_charset = email_parse_get_filename_from_path(mail_info->file_path_plain);
 
        if (STR_VALID(plain_charset)) {
-               if (STR_VALID(ug_data->charset)) {
-                       FREE(ug_data->charset);
+               if (STR_VALID(view->charset)) {
+                       FREE(view->charset);
                }
                debug_secure("plain_charset:%s", plain_charset);
                if (!g_ascii_strcasecmp(plain_charset, UNKNOWN_CHARSET_PLAIN_TEXT_FILE)) {
                        g_free(plain_charset);
-                       ug_data->charset = g_strdup(DEFAULT_CHARSET);
+                       view->charset = g_strdup(DEFAULT_CHARSET);
                } else {
-                       ug_data->charset = plain_charset;
+                       view->charset = plain_charset;
                }
-               debug_secure("charset: %s", ug_data->charset);
+               debug_secure("charset: %s", view->charset);
        }
 
        if (STR_VALID(mail_info->file_path_plain)) {
-               if (STR_VALID(ug_data->body)) {
-                       FREE(ug_data->body);
+               if (STR_VALID(view->body)) {
+                       FREE(view->body);
                }
-               ug_data->body = email_get_buff_from_file(mail_info->file_path_plain, 0);
+               view->body = email_get_buff_from_file(mail_info->file_path_plain, 0);
        }
        debug_leave();
 }
@@ -365,11 +365,11 @@ static void _make_internal_html_body(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       ug_data->has_html = FALSE;
+       view->has_html = FALSE;
 
-       email_mail_data_t *mail_info = ug_data->mail_info;
+       email_mail_data_t *mail_info = view->mail_info;
        retm_if(mail_info == NULL, "mail_info is NULL");
 
        char *html = mail_info->file_path_html;
@@ -377,23 +377,23 @@ static void _make_internal_html_body(void *data)
        if (STR_VALID(html)) {
                debug_secure("html body path (%s)", html);
 
-               if (STR_VALID(ug_data->body_uri)) {
-                       FREE(ug_data->body_uri);
+               if (STR_VALID(view->body_uri)) {
+                       FREE(view->body_uri);
                }
 
-               ug_data->body_uri = g_strdup(mail_info->file_path_html);
-               ug_data->has_html = TRUE;
+               view->body_uri = g_strdup(mail_info->file_path_html);
+               view->has_html = TRUE;
 
-               if (ug_data->body_uri) {
-                       if (STR_VALID(ug_data->charset)) {
-                               FREE(ug_data->charset);
+               if (view->body_uri) {
+                       if (STR_VALID(view->charset)) {
+                               FREE(view->charset);
                        }
 
-                       ug_data->charset = email_parse_get_filename_from_path(ug_data->body_uri);
-                       debug_secure("charset: %s", ug_data->charset);
-                       if (!g_ascii_strcasecmp(ug_data->charset, UNKNOWN_CHARSET_PLAIN_TEXT_FILE)) {
-                               g_free(ug_data->charset);
-                               ug_data->charset = g_strdup(DEFAULT_CHARSET);
+                       view->charset = email_parse_get_filename_from_path(view->body_uri);
+                       debug_secure("charset: %s", view->charset);
+                       if (!g_ascii_strcasecmp(view->charset, UNKNOWN_CHARSET_PLAIN_TEXT_FILE)) {
+                               g_free(view->charset);
+                               view->charset = g_strdup(DEFAULT_CHARSET);
                        }
                }
        }
@@ -404,19 +404,19 @@ static void _make_internal_attachments(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       email_mail_data_t *mail_info = ug_data->mail_info;
+       EmailViewerView *view = (EmailViewerView *)data;
+       email_mail_data_t *mail_info = view->mail_info;
        retm_if(mail_info == NULL, "mail_info is NULL");
 
-       ug_data->has_attachment = FALSE;
+       view->has_attachment = FALSE;
 
-       email_attachment_data_t *attach_data = ug_data->attachment_info;
-       int attach_count = ug_data->attachment_count;
+       email_attachment_data_t *attach_data = view->attachment_info;
+       int attach_count = view->attachment_count;
        retm_if(attach_data == NULL, "Invalid parameter: attach_data[NULL]");
        retm_if(attach_count <= 0, "Invalid parameter: attach_count <= 0");
 
        int index = 0;
-       _remove_internal_attachments(ug_data);
+       _remove_internal_attachments(view);
 
        int i = 0;
        for (i = 0; i < attach_count; i++) {
@@ -469,32 +469,32 @@ static void _make_internal_attachments(void *data)
 
                        debug_log("inline_content(%d), inline_content_status(%d) ", attachment_info->inline_content, attachment->inline_content_status);
                        if (attachment_info->inline_content) {
-                               ug_data->has_inline_image = TRUE;
+                               view->has_inline_image = TRUE;
                        }
                        if (!g_strcmp0(attachment->attachment_mime_type, "application/smil") ||
                                        !g_strcmp0(attachment->attachment_mime_type, "application/smil+xml")) {
-                               ug_data->is_smil_mail = TRUE;
+                               view->is_smil_mail = TRUE;
                        }
 
-                       if (viewer_is_normal_attachment(attachment_info) || (ug_data->is_smil_mail)) {
-                               (ug_data->normal_att_count)++;
-                               ug_data->total_att_size += (guint64) attachment_info->size;
+                       if (viewer_is_normal_attachment(attachment_info) || (view->is_smil_mail)) {
+                               (view->normal_att_count)++;
+                               view->total_att_size += (guint64) attachment_info->size;
                        }
 
-                       (ug_data->total_att_count)++;
+                       (view->total_att_count)++;
 
-                       ug_data->attachment_info_list = g_list_append(ug_data->attachment_info_list, attachment_info);
+                       view->attachment_info_list = g_list_append(view->attachment_info_list, attachment_info);
                }
        }
 
-       if (ug_data->normal_att_count > 0) {
-               ug_data->has_attachment = TRUE;
+       if (view->normal_att_count > 0) {
+               view->has_attachment = TRUE;
        }
-       if (ug_data->is_smil_mail) {
-               ug_data->has_inline_image = FALSE;
+       if (view->is_smil_mail) {
+               view->has_inline_image = FALSE;
        }
 
-       debug_log("total_att_count(%d), normal_att_count(%d), has_attachment(%d)", ug_data->total_att_count, ug_data->normal_att_count, ug_data->has_attachment);
+       debug_log("total_att_count(%d), normal_att_count(%d), has_attachment(%d)", view->total_att_count, view->normal_att_count, view->has_attachment);
        debug_leave();
 }
 
@@ -502,9 +502,9 @@ static void _remove_internal_sender(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       FREE(ug_data->sender_address);
-       FREE(ug_data->sender_display_name);
+       EmailViewerView *view = (EmailViewerView *)data;
+       FREE(view->sender_address);
+       FREE(view->sender_display_name);
        debug_leave();
 }
 
@@ -512,8 +512,8 @@ static void _remove_internal_subject(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       FREE(ug_data->subject);
+       EmailViewerView *view = (EmailViewerView *)data;
+       FREE(view->subject);
        debug_leave();
 }
 
@@ -521,10 +521,10 @@ static void _remove_internal_body(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       FREE(ug_data->body_uri);
-       FREE(ug_data->charset);
-       FREE(ug_data->body);
+       EmailViewerView *view = (EmailViewerView *)data;
+       FREE(view->body_uri);
+       FREE(view->charset);
+       FREE(view->body);
        debug_leave();
 }
 
@@ -532,22 +532,22 @@ static void _remove_internal_attachments(void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       if (ug_data->attachment_info_list) {
+       EmailViewerView *view = (EmailViewerView *)data;
+       if (view->attachment_info_list) {
                debug_log("Free the existing attachments..");
                int i = 0;
-               LIST_ITER_START(i, ug_data->attachment_info_list) {
-                       EmailAttachmentType *info = (EmailAttachmentType *)LIST_ITER_GET_DATA(i, ug_data->attachment_info_list);
+               LIST_ITER_START(i, view->attachment_info_list) {
+                       EmailAttachmentType *info = (EmailAttachmentType *)LIST_ITER_GET_DATA(i, view->attachment_info_list);
                        FREE(info->name);
                        FREE(info->path);
                        FREE(info->content_id);
                        FREE(info);
                }
-               g_list_free(ug_data->attachment_info_list);
-               ug_data->attachment_info_list = NULL;
-               ug_data->normal_att_count = 0;
-               ug_data->total_att_size = 0;
-               ug_data->total_att_count = 0;
+               g_list_free(view->attachment_info_list);
+               view->attachment_info_list = NULL;
+               view->normal_att_count = 0;
+               view->total_att_size = 0;
+               view->total_att_count = 0;
        }
        debug_leave();
 }
@@ -578,9 +578,9 @@ void viewer_make_hard_link_for_inline_images(void *data, const char *path)
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       email_attachment_data_t *attach_data = ug_data->attachment_info;
-       int attach_count = ug_data->attachment_count;
+       EmailViewerView *view = (EmailViewerView *)data;
+       email_attachment_data_t *attach_data = view->attachment_info;
+       int attach_count = view->attachment_count;
        retm_if(attach_data == NULL, "Invalid parameter: attach_data[NULL]");
        retm_if(attach_count <= 0, "Invalid parameter: attach_count <= 0");
 
@@ -588,7 +588,7 @@ void viewer_make_hard_link_for_inline_images(void *data, const char *path)
        char dest[BUF_LEN_L] = { 0, };
        int result = -1;
 
-       debug_log("ug_data->body_download_status : %d", ug_data->body_download_status);
+       debug_log("view->body_download_status : %d", view->body_download_status);
        for (i = 0; i < attach_count; i++) {
                if (attach_data[i].inline_content_status && attach_data[i].save_status) {
                        snprintf(dest, sizeof(dest), "%s/%s", path, attach_data[i].attachment_name);
@@ -615,19 +615,19 @@ void viewer_remove_hard_link_for_inline_images(void *data)
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       email_attachment_data_t *attach_data = ug_data->attachment_info;
-       int attach_count = ug_data->attachment_count;
+       EmailViewerView *view = (EmailViewerView *)data;
+       email_attachment_data_t *attach_data = view->attachment_info;
+       int attach_count = view->attachment_count;
 
        int i = 0;
        char dest[BUF_LEN_L] = { 0, };
        int result = -1;
 
-       debug_log("ug_data->body_download_status : %d", ug_data->body_download_status);
+       debug_log("view->body_download_status : %d", view->body_download_status);
        for (i = 0; i < attach_count; i++) {
                if (attach_data != NULL) {
                        if (attach_data[i].inline_content_status && attach_data[i].save_status) {
-                               snprintf(dest, sizeof(dest), "%s/%s", ug_data->temp_folder_path, attach_data[i].attachment_name);
+                               snprintf(dest, sizeof(dest), "%s/%s", view->temp_folder_path, attach_data[i].attachment_name);
                                /*debug_secure("inline_attach_path: [%s]", attach_data[i].attachment_path);*/
                                /*debug_secure("hard_link_path: [%s]", dest);*/
                                if (email_file_exists(dest)) {
@@ -654,30 +654,30 @@ static int _make_webview_data(void *data)
 {
        debug_enter();
        retvm_if(data == NULL, -1, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *) data;
+       EmailViewerView *view = (EmailViewerView *) data;
        EmailViewerWebview *wvd;
-       if (ug_data->webview_data == NULL) {
+       if (view->webview_data == NULL) {
                wvd = (EmailViewerWebview *)malloc(sizeof(EmailViewerWebview));
                retvm_if(!wvd, -1, "wvd is NULL!");
                memset(wvd, 0x0, sizeof(EmailViewerWebview));
-               ug_data->webview_data = wvd;
+               view->webview_data = wvd;
        }
 
-       if (STR_VALID(ug_data->charset)) {
-               ug_data->webview_data->charset = ug_data->charset;
+       if (STR_VALID(view->charset)) {
+               view->webview_data->charset = view->charset;
        } else {
-               ug_data->webview_data->charset = DEFAULT_CHARSET;
+               view->webview_data->charset = DEFAULT_CHARSET;
        }
-       debug_secure("charset:%s", ug_data->webview_data->charset);
+       debug_secure("charset:%s", view->webview_data->charset);
 
-       if (ug_data->has_html) {
-               ug_data->webview_data->body_type_prev = BODY_TYPE_HTML;
-               ug_data->webview_data->body_type = BODY_TYPE_HTML;
-               ug_data->webview_data->uri = ug_data->body_uri;
+       if (view->has_html) {
+               view->webview_data->body_type_prev = BODY_TYPE_HTML;
+               view->webview_data->body_type = BODY_TYPE_HTML;
+               view->webview_data->uri = view->body_uri;
        } else {
-               ug_data->webview_data->body_type_prev = BODY_TYPE_TEXT;
-               ug_data->webview_data->body_type = BODY_TYPE_TEXT;
-               ug_data->webview_data->text_content = ug_data->body;
+               view->webview_data->body_type_prev = BODY_TYPE_TEXT;
+               view->webview_data->body_type = BODY_TYPE_TEXT;
+               view->webview_data->text_content = view->body;
        }
        return 0;
 }
@@ -686,27 +686,27 @@ int viewer_set_internal_data(void *data, Eina_Bool b_remove)
 {
        debug_enter();
        retvm_if(data == NULL, VIEWER_ERROR_INVALID_ARG, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        if (b_remove == EINA_TRUE) {
-               viewer_remove_internal_mail(ug_data);
-               if (viewer_get_internal_mail_info(ug_data)) {
-                       viewer_make_internal_mail(ug_data);
-                       if (ug_data->total_att_count > 0) {
-                               viewer_make_hard_link_for_inline_images(ug_data, ug_data->temp_folder_path);
+               viewer_remove_internal_mail(view);
+               if (viewer_get_internal_mail_info(view)) {
+                       viewer_make_internal_mail(view);
+                       if (view->total_att_count > 0) {
+                               viewer_make_hard_link_for_inline_images(view, view->temp_folder_path);
                        }
-                       _make_webview_data(ug_data);
+                       _make_webview_data(view);
                } else {
                        debug_log("viewer_get_internal_mail_info() failed!");
                        return VIEWER_ERROR_GET_DATA_FAIL;
                }
        } else {
-               viewer_remove_internal_mail(ug_data);
-               viewer_make_internal_mail(ug_data);
-               if (ug_data->total_att_count > 0) {
-                       viewer_make_hard_link_for_inline_images(ug_data, ug_data->temp_folder_path);
+               viewer_remove_internal_mail(view);
+               viewer_make_internal_mail(view);
+               if (view->total_att_count > 0) {
+                       viewer_make_hard_link_for_inline_images(view, view->temp_folder_path);
                }
-               _make_webview_data(ug_data);
+               _make_webview_data(view);
        }
        debug_leave();
        return VIEWER_ERROR_NONE;
index 49e8386..0f2e98a 100644 (file)
@@ -55,7 +55,7 @@ typedef enum {
  * Declaration for static functions
  */
 
-extern EmailViewerUGD *_g_md;
+extern EmailViewerView *_g_md;
 
 
 /*
@@ -70,8 +70,8 @@ void viewer_more_menu_window_resized_cb(void *data, Evas *e, Evas_Object *obj, v
 {
        debug_enter();
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       viewer_more_menu_move_ctxpopup(ug_data->con_popup, ug_data->base.module->win);
+       EmailViewerView *view = (EmailViewerView *)data;
+       viewer_more_menu_move_ctxpopup(view->con_popup, view->base.module->win);
 
        debug_leave();
 }
@@ -80,10 +80,10 @@ void viewer_more_menu_ctxpopup_del_cb(void *data, Evas *e, Evas_Object *obj, voi
 {
        debug_enter();
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       evas_object_smart_callback_del(ug_data->con_popup, "dismissed", viewer_more_ctxpopup_dismissed_cb);
-       evas_object_event_callback_del_full(ug_data->base.module->navi, EVAS_CALLBACK_RESIZE, viewer_more_menu_window_resized_cb, ug_data);
+       evas_object_smart_callback_del(view->con_popup, "dismissed", viewer_more_ctxpopup_dismissed_cb);
+       evas_object_event_callback_del_full(view->base.module->navi, EVAS_CALLBACK_RESIZE, viewer_more_menu_window_resized_cb, view);
 
        debug_leave();
 }
@@ -93,12 +93,12 @@ void viewer_ctxpopup_add_contact_cb(void *data, Evas_Object *obj, void *event_in
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
 
-       ug_data->create_contact_arg = CONTACTUI_REQ_ADD_EMAIL;
-       recipient_add_to_contact_selection_popup(ug_data, ug_data->sender_address, EMAIL_SENDER_NAME);
+       view->create_contact_arg = CONTACTUI_REQ_ADD_EMAIL;
+       recipient_add_to_contact_selection_popup(view, view->sender_address, EMAIL_SENDER_NAME);
        debug_leave();
 }
 
@@ -108,11 +108,11 @@ void viewer_ctxpopup_detail_contact_cb(void *data, Evas_Object *obj, void *event
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
        retm_if(_g_md == NULL, "Invalid parameter: _g_md[NULL]");
 
-       EmailViewerUGD *ug_data = _g_md;
+       EmailViewerView *view = _g_md;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
        debug_secure("data(%s)", data);
-       viewer_view_contact_detail(ug_data, (intptr_t)data);
+       viewer_view_contact_detail(view, (intptr_t)data);
        debug_leave();
 }
 
@@ -122,11 +122,11 @@ void viewer_ctxpopup_add_vip_rule_cb(void *data, Evas_Object *obj, void *event_i
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
        retm_if(_g_md == NULL, "Invalid parameter: _g_md[NULL]");
 
-       EmailViewerUGD *ug_data = _g_md;
+       EmailViewerView *view = _g_md;
        char *addr = (char *)data;
 
        debug_secure("VIP address: %s", addr);
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
 
        int ret_add = 0;
        int ret_apply = 0;
@@ -166,17 +166,17 @@ void viewer_ctxpopup_add_vip_rule_cb(void *data, Evas_Object *obj, void *event_i
                } else {
                        notification_status_message_post(_("IDS_EMAIL_TPOP_EMAIL_ADDRESS_ADDED_TO_PRIORITY_SENDERS"));
 
-                       if (g_strcmp0(ug_data->sender_address, addr) == 0) {
-                               if (ug_data->priority_sender_image) {
-                                       elm_object_part_content_unset(ug_data->sender_ly, "sender.priority.icon");
-                                       DELETE_EVAS_OBJECT(ug_data->priority_sender_image);
+                       if (g_strcmp0(view->sender_address, addr) == 0) {
+                               if (view->priority_sender_image) {
+                                       elm_object_part_content_unset(view->sender_ly, "sender.priority.icon");
+                                       DELETE_EVAS_OBJECT(view->priority_sender_image);
                                }
-                               Evas_Object *priority_image = elm_layout_add(ug_data->sender_ly);
+                               Evas_Object *priority_image = elm_layout_add(view->sender_ly);
                                elm_layout_file_set(priority_image, email_get_common_theme_path(), EMAIL_IMAGE_ICON_PRIO_SENDER);
-                               elm_object_part_content_set(ug_data->sender_ly, "sender.priority.icon", priority_image);
-                               elm_layout_signal_emit(ug_data->sender_ly, "set.priority.sender", "elm");
+                               elm_object_part_content_set(view->sender_ly, "sender.priority.icon", priority_image);
+                               elm_layout_signal_emit(view->sender_ly, "set.priority.sender", "elm");
                                evas_object_show(priority_image);
-                               ug_data->priority_sender_image = priority_image;
+                               view->priority_sender_image = priority_image;
                        }
                }
        }
@@ -189,11 +189,11 @@ void viewer_ctxpopup_remove_vip_rule_cb(void *data, Evas_Object *obj, void *even
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
        retm_if(_g_md == NULL, "Invalid parameter: _g_md[NULL]");
 
-       EmailViewerUGD *ug_data = _g_md;
+       EmailViewerView *view = _g_md;
        char *addr = (char *)data;
 
        debug_secure("VIP address: %s", addr);
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
 
        int count, i;
        int ret = EMAIL_ERROR_NONE;
@@ -230,10 +230,10 @@ void viewer_ctxpopup_remove_vip_rule_cb(void *data, Evas_Object *obj, void *even
                } else {
                        notification_status_message_post(_("IDS_EMAIL_TPOP_EMAIL_ADDRESS_REMOVED_FROM_PRIORITY_SENDERS"));
 
-                       if (g_strcmp0(ug_data->sender_address, addr) == 0) {
-                               elm_layout_signal_emit(ug_data->sender_ly, "remove.priority.sender", "elm");
-                               elm_object_part_content_unset(ug_data->sender_ly, "sender.priority.icon");
-                               DELETE_EVAS_OBJECT(ug_data->priority_sender_image);
+                       if (g_strcmp0(view->sender_address, addr) == 0) {
+                               elm_layout_signal_emit(view->sender_ly, "remove.priority.sender", "elm");
+                               elm_object_part_content_unset(view->sender_ly, "sender.priority.icon");
+                               DELETE_EVAS_OBJECT(view->priority_sender_image);
                        }
                }
        }
@@ -245,28 +245,28 @@ void viewer_ctxpopup_add_to_spambox_cb(void *data, Evas_Object *obj, void *event
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
 
-       if (ug_data->viewer_type == EML_VIEWER) {
+       if (view->viewer_type == EML_VIEWER) {
                debug_log("eml viewer. return here");
                return;
        }
 
-       debug_log("mailbox_id(%d), mailbox_type(%d)", ug_data->mailbox_id, ug_data->mailbox_type);
-       if (ug_data->mailbox_type == EMAIL_MAILBOX_TYPE_SPAMBOX) {
+       debug_log("mailbox_id(%d), mailbox_type(%d)", view->mailbox_id, view->mailbox_type);
+       if (view->mailbox_type == EMAIL_MAILBOX_TYPE_SPAMBOX) {
                debug_log("original folder is already spambox.");
        } else {
                int ret = EMAIL_ERROR_NONE;
-               ret = viewer_move_email(ug_data, _find_folder_id_using_folder_type(ug_data, EMAIL_MAILBOX_TYPE_SPAMBOX), FALSE, TRUE);
+               ret = viewer_move_email(view, _find_folder_id_using_folder_type(view, EMAIL_MAILBOX_TYPE_SPAMBOX), FALSE, TRUE);
 
                if (ret == 1) {
                        char str[EMAIL_VIEWER_STRING_LENGTH] = {0, };
                        snprintf(str, sizeof(str), email_get_email_string("IDS_EMAIL_TPOP_1_EMAIL_MOVED_TO_PS"), email_get_email_string("IDS_EMAIL_HEADER_SPAMBOX"));
                        notification_status_message_post(str);
                        debug_log("email_module_make_destroy_request");
-                       email_module_make_destroy_request(ug_data->base.module);
+                       email_module_make_destroy_request(view->base.module);
                } else {
                        notification_status_message_post(_("IDS_EMAIL_HEADER_UNABLE_TO_PERFORM_ACTION_ABB"));
                        debug_log("move failed. ret[%d]", ret);
@@ -280,27 +280,27 @@ void viewer_ctxpopup_remove_from_spambox_cb(void *data, Evas_Object *obj, void *
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
 
-       if (ug_data->viewer_type == EML_VIEWER) {
+       if (view->viewer_type == EML_VIEWER) {
                debug_log("eml viewer. return here");
                return;
        }
 
-       if (ug_data->mailbox_type != EMAIL_MAILBOX_TYPE_SPAMBOX) {
+       if (view->mailbox_type != EMAIL_MAILBOX_TYPE_SPAMBOX) {
                debug_log("original folder is already spambox.");
        } else {
                int ret = EMAIL_ERROR_NONE;
-               ret = viewer_move_email(ug_data, _find_folder_id_using_folder_type(ug_data, EMAIL_MAILBOX_TYPE_INBOX), FALSE, TRUE);
+               ret = viewer_move_email(view, _find_folder_id_using_folder_type(view, EMAIL_MAILBOX_TYPE_INBOX), FALSE, TRUE);
 
                if (ret == 1) {
                        char str[EMAIL_VIEWER_STRING_LENGTH] = {0, };
                        snprintf(str, sizeof(str), email_get_email_string("IDS_EMAIL_TPOP_1_EMAIL_MOVED_TO_PS"), email_get_email_string("IDS_EMAIL_HEADER_INBOX"));
                        notification_status_message_post(str);
                        debug_log("email_module_make_destroy_request");
-                       email_module_make_destroy_request(ug_data->base.module);
+                       email_module_make_destroy_request(view->base.module);
                } else {
                        notification_status_message_post(_("IDS_EMAIL_HEADER_UNABLE_TO_PERFORM_ACTION_ABB"));
                        debug_log("move failed. ret[%d]", ret);
@@ -314,8 +314,8 @@ void viewer_more_ctxpopup_dismissed_cb(void *data, Evas_Object *obj, void *event
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       EmailViewerView *view = (EmailViewerView *)data;
+       DELETE_EVAS_OBJECT(view->con_popup);
 
        debug_leave();
 }
@@ -325,14 +325,14 @@ void viewer_mark_as_unread_cb(void *data, Evas_Object *obj, void *event_info)
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
 
        int err = 0;
-       debug_log("ug_data->mail_id(%d), mail_info->mail_id(%d)", ug_data->mail_id, ug_data->mail_info->mail_id);
+       debug_log("view->mail_id(%d), mail_info->mail_id(%d)", view->mail_id, view->mail_info->mail_id);
 
-       err = email_set_flags_field(ug_data->account_id, &ug_data->mail_id, 1, EMAIL_FLAGS_SEEN_FIELD, 0, 1);
+       err = email_set_flags_field(view->account_id, &view->mail_id, 1, EMAIL_FLAGS_SEEN_FIELD, 0, 1);
        debug_log("email_set_flags_field - err(%d)", err);
 
        if (err != EMAIL_ERROR_NONE) {
@@ -340,7 +340,7 @@ void viewer_mark_as_unread_cb(void *data, Evas_Object *obj, void *event_info)
        } else {
                notification_status_message_post(_("IDS_EMAIL_TPOP_EMAIL_MARKED_AS_UNREAD"));
                debug_log("email_module_make_destroy_request");
-               email_module_make_destroy_request(ug_data->base.module);
+               email_module_make_destroy_request(view->base.module);
        }
        debug_leave();
 }
@@ -350,19 +350,19 @@ void viewer_edit_email_cb(void *data, Evas_Object *obj, void *event_info)
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
 
        email_params_h params = NULL;
 
        if (email_params_create(&params) &&
                email_params_add_int(params, EMAIL_BUNDLE_KEY_RUN_TYPE, RUN_COMPOSER_EDIT) &&
-               email_params_add_int(params, EMAIL_BUNDLE_KEY_ACCOUNT_ID, ug_data->account_id) &&
-               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAILBOX, ug_data->mailbox_id) &&
-               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAIL_ID, ug_data->mail_id)) {
+               email_params_add_int(params, EMAIL_BUNDLE_KEY_ACCOUNT_ID, view->account_id) &&
+               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAILBOX, view->mailbox_id) &&
+               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAIL_ID, view->mail_id)) {
 
-               ug_data->loaded_module = viewer_create_module(ug_data, EMAIL_MODULE_COMPOSER, params, true);
+               view->loaded_module = viewer_create_module(view, EMAIL_MODULE_COMPOSER, params, true);
        }
 
        email_params_free(&params);
@@ -375,25 +375,25 @@ void viewer_edit_scheduled_email_cb(void *data, Evas_Object *obj, void *event_in
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       debug_log("ug_data->mail_id:%d", ug_data->mail_id);
+       debug_log("view->mail_id:%d", view->mail_id);
 
-       int err = email_cancel_sending_mail(ug_data->mail_id);
+       int err = email_cancel_sending_mail(view->mail_id);
        if (err != EMAIL_ERROR_NONE)
                debug_warning("email_cancel_sending_mail failed - err(%d)", err);
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
 
        email_params_h params = NULL;
 
        if (email_params_create(&params) &&
                email_params_add_int(params, EMAIL_BUNDLE_KEY_RUN_TYPE, RUN_COMPOSER_EDIT) &&
-               email_params_add_int(params, EMAIL_BUNDLE_KEY_ACCOUNT_ID, ug_data->account_id) &&
-               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAILBOX, ug_data->mailbox_id) &&
-               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAIL_ID, ug_data->mail_id)) {
+               email_params_add_int(params, EMAIL_BUNDLE_KEY_ACCOUNT_ID, view->account_id) &&
+               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAILBOX, view->mailbox_id) &&
+               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAIL_ID, view->mail_id)) {
 
-               ug_data->loaded_module = viewer_create_scheduled_composer_module(ug_data, params);
+               view->loaded_module = viewer_create_scheduled_composer_module(view, params);
        }
 
        email_params_free(&params);
@@ -406,17 +406,17 @@ void viewer_cancel_send_cb(void *data, Evas_Object *obj, void *event_info)
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       EmailViewerView *view = (EmailViewerView *)data;
+       DELETE_EVAS_OBJECT(view->con_popup);
 
-       debug_log("ug_data->account_id(%d), mail_info->account_id(%d)", ug_data->account_id, ug_data->mail_info->account_id);
-       debug_log("ug_data->mail_id(%d), mail_info->mail_id(%d)", ug_data->mail_id, ug_data->mail_info->mail_id);
+       debug_log("view->account_id(%d), mail_info->account_id(%d)", view->account_id, view->mail_info->account_id);
+       debug_log("view->mail_id(%d), mail_info->mail_id(%d)", view->mail_id, view->mail_info->mail_id);
 
-       int err = email_cancel_sending_mail(ug_data->mail_id);
+       int err = email_cancel_sending_mail(view->mail_id);
        if (err != EMAIL_ERROR_NONE) {
                debug_warning("email_cancel_sending_mail failed - err(%d)", err);
        }
-       ug_data->is_cancel_sending_btn_clicked = EINA_TRUE;
+       view->is_cancel_sending_btn_clicked = EINA_TRUE;
 
        debug_leave();
 }
@@ -426,27 +426,27 @@ void viewer_resend_cb(void *data, Evas_Object *obj, void *event_info)
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       EmailViewerView *view = (EmailViewerView *)data;
+       DELETE_EVAS_OBJECT(view->con_popup);
        int err = 0;
 
        /* Send email again */
-       debug_log("ug_data->account_id(%d), mail_info->account_id(%d)", ug_data->account_id, ug_data->mail_info->account_id);
-       debug_log("ug_data->mail_id(%d), mail_info->mail_id(%d)", ug_data->mail_id, ug_data->mail_info->mail_id);
+       debug_log("view->account_id(%d), mail_info->account_id(%d)", view->account_id, view->mail_info->account_id);
+       debug_log("view->mail_id(%d), mail_info->mail_id(%d)", view->mail_id, view->mail_info->mail_id);
 
        email_account_t *account = NULL;
-       err = email_get_account(ug_data->account_id, EMAIL_ACC_GET_OPT_DEFAULT, &account);
+       err = email_get_account(view->account_id, EMAIL_ACC_GET_OPT_DEFAULT, &account);
        if (err == EMAIL_ERROR_NONE && account) {
                email_mail_attribute_value_t mail_attr;
 
                mail_attr.integer_type_value = (account->auto_resend_times == EMAIL_NO_LIMITED_RETRY_COUNT) ? 10 : account->auto_resend_times;
-               err = email_update_mail_attribute(ug_data->account_id, &ug_data->mail_id, 1, EMAIL_MAIL_ATTRIBUTE_REMAINING_RESEND_TIMES, mail_attr);
-               debug_log("mail_id(%d) resend tme(%d)", ug_data->mail_id, mail_attr.integer_type_value);
+               err = email_update_mail_attribute(view->account_id, &view->mail_id, 1, EMAIL_MAIL_ATTRIBUTE_REMAINING_RESEND_TIMES, mail_attr);
+               debug_log("mail_id(%d) resend tme(%d)", view->mail_id, mail_attr.integer_type_value);
                if (err != EMAIL_ERROR_NONE) {
-                       debug_warning("email_update_mail_attribute failed! - err(%d) mail_id(%d) resend tme(%d)", err, ug_data->mail_id, mail_attr.integer_type_value);
+                       debug_warning("email_update_mail_attribute failed! - err(%d) mail_id(%d) resend tme(%d)", err, view->mail_id, mail_attr.integer_type_value);
                }
        } else {
-               debug_warning("email_get_account failed! account_id(%d) - err(%d) or account NULL", ug_data->account_id, err);
+               debug_warning("email_get_account failed! account_id(%d) - err(%d) or account NULL", view->account_id, err);
        }
 
        if (account) {
@@ -455,7 +455,7 @@ void viewer_resend_cb(void *data, Evas_Object *obj, void *event_info)
        }
 
        int handle = 0;
-       err = email_send_mail(ug_data->mail_id, &handle);
+       err = email_send_mail(view->mail_id, &handle);
        debug_log("sending handle(%d)", handle);
        if (err != EMAIL_ERROR_NONE) {
                debug_warning("email_send_mail failed - err(%d)", err);
index 6bf80eb..83382e9 100644 (file)
@@ -30,7 +30,7 @@
 
 static void _viewer_more_menu_ctxpopup_back_cb(void *data, Evas_Object *obj, void *event_info);
 static int _viewer_launch_contacts_for_add_update(
-               EmailViewerUGD *ug_data,
+               EmailViewerView *view,
                const char *operation,
                const char *contact_data,
                const char *contact_name);
@@ -40,14 +40,14 @@ static int _viewer_launch_contacts_for_add_update(
  */
 
 static int _viewer_launch_contacts_for_add_update(
-               EmailViewerUGD *ug_data,
+               EmailViewerView *view,
                const char *operation,
                const char *contact_data,
                const char *contact_name)
 {
        const char *ext_data_key = NULL;
 
-       switch (ug_data->create_contact_arg) {
+       switch (view->create_contact_arg) {
        case CONTACTUI_REQ_ADD_PHONE_NUMBER:
                ext_data_key = EMAIL_CONTACT_EXT_DATA_PHONE;
                break;
@@ -58,7 +58,7 @@ static int _viewer_launch_contacts_for_add_update(
                ext_data_key = EMAIL_CONTACT_EXT_DATA_URL;
                break;
        default:
-               debug_error("not needed value %d", ug_data->create_contact_arg);
+               debug_error("not needed value %d", view->create_contact_arg);
                break;
        }
 
@@ -73,7 +73,7 @@ static int _viewer_launch_contacts_for_add_update(
                (!contact_name ||
                email_params_add_str(params, EMAIL_CONTACT_EXT_DATA_NAME, contact_name))) {
 
-               ret = email_module_launch_app(ug_data->base.module, EMAIL_LAUNCH_APP_AUTO, params, NULL);
+               ret = email_module_launch_app(view->base.module, EMAIL_LAUNCH_APP_AUTO, params, NULL);
        }
 
        email_params_free(&params);
@@ -92,10 +92,10 @@ void viewer_add_contact(void *data, char *contact_data, char *contact_name)
        retm_if(contact_data == NULL, "Invalid parameter: contact_address[NULL]");
        debug_secure("contact_address (%s)", contact_data);
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        int ret = _viewer_launch_contacts_for_add_update(
-                       ug_data,
+                       view,
                        APP_CONTROL_OPERATION_ADD,
                        contact_data,
                        contact_name);
@@ -113,10 +113,10 @@ void viewer_update_contact(void *data, char *contact_data)
        retm_if(contact_data == NULL, "Invalid parameter: contact_data[NULL]");
        debug_secure("contact_data (%s)", contact_data);
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        int ret = _viewer_launch_contacts_for_add_update(
-                       ug_data,
+                       view,
                        APP_CONTROL_OPERATION_EDIT,
                        contact_data,
                        NULL);
@@ -127,11 +127,11 @@ void viewer_update_contact(void *data, char *contact_data)
        debug_leave();
 }
 
-static Elm_Object_Item *_add_ctxpopup_menu_item(EmailViewerUGD *ug_data, const char *str, Evas_Object *icon, Evas_Smart_Cb cb)
+static Elm_Object_Item *_add_ctxpopup_menu_item(EmailViewerView *view, const char *str, Evas_Object *icon, Evas_Smart_Cb cb)
 {
        Elm_Object_Item *ctx_menu_item = NULL;
 
-       ctx_menu_item = elm_ctxpopup_item_append(ug_data->con_popup, str, icon, cb, ug_data);
+       ctx_menu_item = elm_ctxpopup_item_append(view->con_popup, str, icon, cb, view);
        elm_object_item_domain_text_translatable_set(ctx_menu_item, PACKAGE, EINA_TRUE);
        return ctx_menu_item;
 }
@@ -146,9 +146,9 @@ static Elm_Object_Item *_viewer_more_menu_add_item(Evas_Object *obj, const char
        return ctx_menu_item;
 }
 
-static void _viewer_add_to_spam_menu_add(EmailViewerUGD *ug_data)
+static void _viewer_add_to_spam_menu_add(EmailViewerView *view)
 {
-       bool add_spam = (ug_data->mailbox_type != EMAIL_MAILBOX_TYPE_SPAMBOX);
+       bool add_spam = (view->mailbox_type != EMAIL_MAILBOX_TYPE_SPAMBOX);
 
        const char *str = NULL;
        Evas_Smart_Cb cb = NULL;
@@ -161,7 +161,7 @@ static void _viewer_add_to_spam_menu_add(EmailViewerUGD *ug_data)
        }
 
        Elm_Object_Item *ctx_menu_item = NULL;
-       ctx_menu_item = elm_ctxpopup_item_append(ug_data->con_popup, str, NULL, cb, ug_data);
+       ctx_menu_item = elm_ctxpopup_item_append(view->con_popup, str, NULL, cb, view);
        elm_object_item_domain_text_translatable_set(ctx_menu_item, PACKAGE, EINA_TRUE);
 }
 
@@ -193,98 +193,98 @@ void viewer_more_menu_move_ctxpopup(Evas_Object *ctxpopup, Evas_Object *win)
        debug_leave();
 }
 
-void viewer_create_more_ctxpopup(EmailViewerUGD *ug_data)
+void viewer_create_more_ctxpopup(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
        Evas_Object *icon = NULL;
        Elm_Object_Item *ctx_menu_item = NULL;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
-       ug_data->con_popup = elm_ctxpopup_add(ug_data->base.module->win);
-       retm_if(ug_data->con_popup == NULL, "cannot create context popup: ug_data->con_popup[NULL]");
+       DELETE_EVAS_OBJECT(view->con_popup);
+       view->con_popup = elm_ctxpopup_add(view->base.module->win);
+       retm_if(view->con_popup == NULL, "cannot create context popup: view->con_popup[NULL]");
 
-       elm_ctxpopup_auto_hide_disabled_set(ug_data->con_popup, EINA_TRUE);
-       elm_object_style_set(ug_data->con_popup, "more/default");
-       elm_ctxpopup_direction_priority_set(ug_data->con_popup,
+       elm_ctxpopup_auto_hide_disabled_set(view->con_popup, EINA_TRUE);
+       elm_object_style_set(view->con_popup, "more/default");
+       elm_ctxpopup_direction_priority_set(view->con_popup,
                                                        ELM_CTXPOPUP_DIRECTION_UP,
                                                        ELM_CTXPOPUP_DIRECTION_UNKNOWN,
                                                        ELM_CTXPOPUP_DIRECTION_UNKNOWN,
                                                        ELM_CTXPOPUP_DIRECTION_UNKNOWN);
 
-       evas_object_smart_callback_add(ug_data->con_popup, "dismissed", viewer_more_ctxpopup_dismissed_cb, ug_data);
-       evas_object_event_callback_add(ug_data->con_popup, EVAS_CALLBACK_DEL, viewer_more_menu_ctxpopup_del_cb, ug_data);
-       evas_object_event_callback_add(ug_data->base.module->navi, EVAS_CALLBACK_RESIZE, viewer_more_menu_window_resized_cb, ug_data);
-       eext_object_event_callback_add(ug_data->con_popup, EEXT_CALLBACK_BACK, _viewer_more_menu_ctxpopup_back_cb, NULL);
-       eext_object_event_callback_add(ug_data->con_popup, EEXT_CALLBACK_MORE, _viewer_more_menu_ctxpopup_back_cb, NULL);
-       debug_log("mailbox_type:%d", ug_data->mailbox_type);
+       evas_object_smart_callback_add(view->con_popup, "dismissed", viewer_more_ctxpopup_dismissed_cb, view);
+       evas_object_event_callback_add(view->con_popup, EVAS_CALLBACK_DEL, viewer_more_menu_ctxpopup_del_cb, view);
+       evas_object_event_callback_add(view->base.module->navi, EVAS_CALLBACK_RESIZE, viewer_more_menu_window_resized_cb, view);
+       eext_object_event_callback_add(view->con_popup, EEXT_CALLBACK_BACK, _viewer_more_menu_ctxpopup_back_cb, NULL);
+       eext_object_event_callback_add(view->con_popup, EEXT_CALLBACK_MORE, _viewer_more_menu_ctxpopup_back_cb, NULL);
+       debug_log("mailbox_type:%d", view->mailbox_type);
 
        /* get save_status of mail_data */
        int err = EMAIL_ERROR_NONE;
        email_mail_data_t *mail_info = NULL;
-       err = email_get_mail_data(ug_data->mail_id, &mail_info);
+       err = email_get_mail_data(view->mail_id, &mail_info);
 
-       if (ug_data->viewer_type == EMAIL_VIEWER) {
+       if (view->viewer_type == EMAIL_VIEWER) {
                if (err == EMAIL_ERROR_NONE && mail_info != NULL) {
-                       if (ug_data->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) {
+                       if (view->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) {
                                if (mail_info->save_status == EMAIL_MAIL_STATUS_SEND_CANCELED || mail_info->save_status == EMAIL_MAIL_STATUS_SEND_FAILURE) {
-                                       _add_ctxpopup_menu_item(ug_data, "IDS_EMAIL_OPT_SEND", icon, viewer_resend_cb);
+                                       _add_ctxpopup_menu_item(view, "IDS_EMAIL_OPT_SEND", icon, viewer_resend_cb);
 
-                                       _add_ctxpopup_menu_item(ug_data, "IDS_EMAIL_OPT_EDIT", icon, viewer_edit_email_cb);
+                                       _add_ctxpopup_menu_item(view, "IDS_EMAIL_OPT_EDIT", icon, viewer_edit_email_cb);
                                } else if (mail_info->save_status == EMAIL_MAIL_STATUS_SEND_SCHEDULED) {
-                                       _add_ctxpopup_menu_item(ug_data, "IDS_EMAIL_OPT_EDIT", icon, viewer_edit_scheduled_email_cb);
+                                       _add_ctxpopup_menu_item(view, "IDS_EMAIL_OPT_EDIT", icon, viewer_edit_scheduled_email_cb);
                                } else if (mail_info->save_status == EMAIL_MAIL_STATUS_SENDING || mail_info->save_status == EMAIL_MAIL_STATUS_SEND_WAIT) {
-                                       ug_data->cancel_sending_ctx_item = _add_ctxpopup_menu_item(ug_data, "IDS_EMAIL_OPT_CANCEL_SENDING_ABB", icon, viewer_cancel_send_cb);
-                                       if (ug_data->is_cancel_sending_btn_clicked == EINA_TRUE) {
-                                               elm_object_item_disabled_set(ug_data->cancel_sending_ctx_item, EINA_TRUE);
+                                       view->cancel_sending_ctx_item = _add_ctxpopup_menu_item(view, "IDS_EMAIL_OPT_CANCEL_SENDING_ABB", icon, viewer_cancel_send_cb);
+                                       if (view->is_cancel_sending_btn_clicked == EINA_TRUE) {
+                                               elm_object_item_disabled_set(view->cancel_sending_ctx_item, EINA_TRUE);
                                        }
                                }
                        }
 
-                       debug_log("ug_data->save_status:%d, mail_info->save_status:%d", ug_data->save_status, mail_info->save_status);
+                       debug_log("view->save_status:%d, mail_info->save_status:%d", view->save_status, mail_info->save_status);
                        if ((mail_info->save_status != EMAIL_MAIL_STATUS_SENDING && mail_info->save_status != EMAIL_MAIL_STATUS_SEND_WAIT
                                && mail_info->save_status != EMAIL_MAIL_STATUS_SEND_SCHEDULED && mail_info->save_status != EMAIL_MAIL_STATUS_SEND_DELAYED)) {
-                               _viewer_more_menu_add_item(ug_data->con_popup, NULL, "IDS_EMAIL_OPT_DELETE", _delete_cb, (void *)ug_data);
+                               _viewer_more_menu_add_item(view->con_popup, NULL, "IDS_EMAIL_OPT_DELETE", _delete_cb, (void *)view);
                        }
                } else {
                        debug_log("fail to get mail data - err (%d), mail_info is NULL? (%d)", err, (mail_info == NULL));
                }
 
-               if (ug_data->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) {
-                       _add_ctxpopup_menu_item(ug_data, "IDS_EMAIL_OPT_MARK_AS_UNREAD_ABB", icon, viewer_mark_as_unread_cb);
+               if (view->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) {
+                       _add_ctxpopup_menu_item(view, "IDS_EMAIL_OPT_MARK_AS_UNREAD_ABB", icon, viewer_mark_as_unread_cb);
                }
 
-               debug_log("mailbox_type:%d, save_status:%d", ug_data->mailbox_type, ug_data->save_status);
-               if ((ug_data->mailbox_type != EMAIL_MAILBOX_TYPE_SENTBOX) && !(ug_data->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX)) {
-                       _viewer_more_menu_add_item(ug_data->con_popup, NULL, "IDS_EMAIL_OPT_MOVE", _move_cb, (void *)ug_data);
+               debug_log("mailbox_type:%d, save_status:%d", view->mailbox_type, view->save_status);
+               if ((view->mailbox_type != EMAIL_MAILBOX_TYPE_SENTBOX) && !(view->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX)) {
+                       _viewer_more_menu_add_item(view->con_popup, NULL, "IDS_EMAIL_OPT_MOVE", _move_cb, (void *)view);
                }
        }
 
        if (mail_info != NULL && mail_info->save_status != EMAIL_MAIL_STATUS_SENDING && mail_info->save_status != EMAIL_MAIL_STATUS_SEND_WAIT) {
-               email_contact_list_info_t *contact_list_item = email_contacts_get_contact_info_by_email_address(ug_data->sender_address);
+               email_contact_list_info_t *contact_list_item = email_contacts_get_contact_info_by_email_address(view->sender_address);
                        if (contact_list_item) {
                                debug_log("Sender address is listed in contacts DB, person ID:%d", contact_list_item->person_id);
-                               ctx_menu_item = elm_ctxpopup_item_append(ug_data->con_popup, "IDS_EMAIL_OPT_VIEW_CONTACT_DETAILS_ABB",
+                               ctx_menu_item = elm_ctxpopup_item_append(view->con_popup, "IDS_EMAIL_OPT_VIEW_CONTACT_DETAILS_ABB",
                                                icon, viewer_ctxpopup_detail_contact_cb, (void *)(ptrdiff_t)contact_list_item->person_id);
                        } else {
                                debug_log("Sender address is not listed in contacts DB");
-                               ctx_menu_item = elm_ctxpopup_item_append(ug_data->con_popup, "IDS_EMAIL_OPT_ADD_TO_CONTACTS_ABB2", icon, viewer_ctxpopup_add_contact_cb, ug_data);
+                               ctx_menu_item = elm_ctxpopup_item_append(view->con_popup, "IDS_EMAIL_OPT_ADD_TO_CONTACTS_ABB2", icon, viewer_ctxpopup_add_contact_cb, view);
                        }
                        email_contacts_delete_contact_info(&contact_list_item);
        }
 
        elm_object_item_domain_text_translatable_set(ctx_menu_item, PACKAGE, EINA_TRUE);
 
-       if (ug_data->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) {
-               _viewer_add_to_spam_menu_add(ug_data);
+       if (view->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) {
+               _viewer_add_to_spam_menu_add(view);
        }
 
-       if (ug_data->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) {
-               if (!recipient_is_priority_email_address(ug_data->sender_address)) {
-                       ctx_menu_item = elm_ctxpopup_item_append(ug_data->con_popup, "IDS_EMAIL_OPT_ADD_TO_PRIORITY_SENDERS_ABB", icon, viewer_ctxpopup_add_vip_rule_cb, ug_data->sender_address);
+       if (view->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) {
+               if (!recipient_is_priority_email_address(view->sender_address)) {
+                       ctx_menu_item = elm_ctxpopup_item_append(view->con_popup, "IDS_EMAIL_OPT_ADD_TO_PRIORITY_SENDERS_ABB", icon, viewer_ctxpopup_add_vip_rule_cb, view->sender_address);
                } else {
-                       ctx_menu_item = elm_ctxpopup_item_append(ug_data->con_popup, "IDS_EMAIL_OPT_REMOVE_FROM_PRIORITY_SENDERS", icon, viewer_ctxpopup_remove_vip_rule_cb, ug_data->sender_address);
+                       ctx_menu_item = elm_ctxpopup_item_append(view->con_popup, "IDS_EMAIL_OPT_REMOVE_FROM_PRIORITY_SENDERS", icon, viewer_ctxpopup_remove_vip_rule_cb, view->sender_address);
                }
                elm_object_item_domain_text_translatable_set(ctx_menu_item, PACKAGE, EINA_TRUE);
        }
@@ -294,9 +294,9 @@ void viewer_create_more_ctxpopup(EmailViewerUGD *ug_data)
                mail_info = NULL;
        }
 
-       viewer_more_menu_move_ctxpopup(ug_data->con_popup, ug_data->base.module->win);
+       viewer_more_menu_move_ctxpopup(view->con_popup, view->base.module->win);
 
-       evas_object_show(ug_data->con_popup);
+       evas_object_show(view->con_popup);
        debug_leave();
 }
 
index 2d66c93..6c94150 100644 (file)
@@ -27,7 +27,7 @@
 
 static void _noti_mgr_popup_response_cb(void *data, Evas_Object *obj, void *event_info);
 static void _noti_mgr_set_value_down_progress(void *data, double val);
-static char *_noti_mgr_get_service_fail_type(int type, EmailViewerUGD *ug_data);
+static char *_noti_mgr_get_service_fail_type(int type, EmailViewerView *view);
 static void _noti_mgr_parse_mail_move_finish_data_params(char *buf, int *src_mailbox_id, int *dst_mailbox_id, int *mail_id);
 static void _noti_mgr_parse_mail_field_update_data_params(char *inbuf, char **field_name, GList **mail_list);
 static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
@@ -42,14 +42,14 @@ static void _noti_mgr_popup_response_cb(void *data, Evas_Object *obj, void *even
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       EmailViewerView *view = (EmailViewerView *)data;
+       DELETE_EVAS_OBJECT(view->notify);
 
-       FREE(ug_data->translation_string_id1);
-       FREE(ug_data->translation_string_id2);
-       FREE(ug_data->str_format1);
-       FREE(ug_data->str_format2);
-       FREE(ug_data->extra_variable_string);
+       FREE(view->translation_string_id1);
+       FREE(view->translation_string_id2);
+       FREE(view->str_format1);
+       FREE(view->str_format2);
+       FREE(view->extra_variable_string);
 
        debug_leave();
 }
@@ -59,8 +59,8 @@ static void _noti_mgr_set_value_down_progress(void *data, double val)
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       Evas_Object *pb = ug_data->pb_notify_lb;
+       EmailViewerView *view = (EmailViewerView *)data;
+       Evas_Object *pb = view->pb_notify_lb;
        if (val < 0.0) {
                debug_log("val(%f) is MINUS", val);
                return;
@@ -82,8 +82,8 @@ static void _noti_mgr_set_value_down_progress(void *data, double val)
        g_snprintf(percent, sizeof(percent), "%d%%", (int)(val * 100));
 
        char size_string[MAX_STR_LEN] = { 0, };
-       char *file_size = email_get_file_size_string((guint64)ug_data->file_size);
-       char *downloaded_size = email_get_file_size_string((guint64)ug_data->file_size * val);
+       char *file_size = email_get_file_size_string((guint64)view->file_size);
+       char *downloaded_size = email_get_file_size_string((guint64)view->file_size * val);
        g_snprintf(size_string, sizeof(size_string), "%s/%s", downloaded_size, file_size);
 
        if ((int)elm_progressbar_value_get(pb) == 100) {
@@ -100,7 +100,7 @@ static void _noti_mgr_set_value_down_progress(void *data, double val)
        debug_leave();
 }
 
-static char *_noti_mgr_get_service_fail_type(int type, EmailViewerUGD *ug_data)
+static char *_noti_mgr_get_service_fail_type(int type, EmailViewerView *view)
 {
        debug_enter();
 
@@ -108,53 +108,53 @@ static char *_noti_mgr_get_service_fail_type(int type, EmailViewerUGD *ug_data)
        debug_log("service error type: %d", type);
 
        debug_leave();
-       ug_data->package_type2 = PACKAGE_TYPE_PACKAGE;
+       view->package_type2 = PACKAGE_TYPE_PACKAGE;
        if (type == EMAIL_ERROR_CANCELLED) {
-               ug_data->translation_string_id2 = strdup(N_("IDS_EMAIL_POP_DOWNLOAD_CANCELLED"));
+               view->translation_string_id2 = strdup(N_("IDS_EMAIL_POP_DOWNLOAD_CANCELLED"));
                ret = email_get_email_string(N_("IDS_EMAIL_POP_DOWNLOAD_CANCELLED"));
                return g_strdup(ret);
        } else if (type == EMAIL_ERROR_MAIL_NOT_FOUND_ON_SERVER) {
-               ug_data->translation_string_id2 = strdup("IDS_EMAIL_POP_THIS_EMAIL_HAS_BEEN_DELETED_FROM_THE_SERVER");
+               view->translation_string_id2 = strdup("IDS_EMAIL_POP_THIS_EMAIL_HAS_BEEN_DELETED_FROM_THE_SERVER");
                ret = email_get_email_string("IDS_EMAIL_POP_THIS_EMAIL_HAS_BEEN_DELETED_FROM_THE_SERVER");
                return g_strdup(ret);
        } else if (type == EMAIL_ERROR_NO_SUCH_HOST) {
-               ug_data->translation_string_id2 = strdup(N_("IDS_EMAIL_POP_HOST_NOT_FOUND"));
+               view->translation_string_id2 = strdup(N_("IDS_EMAIL_POP_HOST_NOT_FOUND"));
                ret = email_get_email_string(N_("IDS_EMAIL_POP_HOST_NOT_FOUND"));
                return g_strdup(ret);
        } else if (type == EMAIL_ERROR_INVALID_SERVER) {
-               ug_data->translation_string_id2 = strdup(N_("IDS_EMAIL_POP_SERVER_NOT_AVAILABLE"));
+               view->translation_string_id2 = strdup(N_("IDS_EMAIL_POP_SERVER_NOT_AVAILABLE"));
                ret = email_get_email_string(N_("IDS_EMAIL_POP_SERVER_NOT_AVAILABLE"));
                return g_strdup(ret);
        } else if (type == EMAIL_ERROR_MAIL_MEMORY_FULL) {
-               ug_data->translation_string_id2 = strdup("IDS_EMAIL_POP_THERE_IS_NOT_ENOUGH_SPACE_IN_YOUR_DEVICE_STORAGE_GO_TO_SETTINGS_POWER_AND_STORAGE_STORAGE_THEN_DELETE_SOME_FILES_AND_TRY_AGAIN");
+               view->translation_string_id2 = strdup("IDS_EMAIL_POP_THERE_IS_NOT_ENOUGH_SPACE_IN_YOUR_DEVICE_STORAGE_GO_TO_SETTINGS_POWER_AND_STORAGE_STORAGE_THEN_DELETE_SOME_FILES_AND_TRY_AGAIN");
                ret = _("IDS_EMAIL_POP_THERE_IS_NOT_ENOUGH_SPACE_IN_YOUR_DEVICE_STORAGE_GO_TO_SETTINGS_POWER_AND_STORAGE_STORAGE_THEN_DELETE_SOME_FILES_AND_TRY_AGAIN");
                return g_strdup(ret);
        } else if (type == EMAIL_ERROR_FAILED_BY_SECURITY_POLICY) {
-               ug_data->translation_string_id2 = strdup("IDS_EMAIL_POP_THE_CURRENT_EXCHANGE_SERVER_POLICY_PREVENTS_ATTACHMENTS_FROM_BEING_DOWNLOADED_TO_MOBILE_DEVICES");
+               view->translation_string_id2 = strdup("IDS_EMAIL_POP_THE_CURRENT_EXCHANGE_SERVER_POLICY_PREVENTS_ATTACHMENTS_FROM_BEING_DOWNLOADED_TO_MOBILE_DEVICES");
                ret = email_get_email_string("IDS_EMAIL_POP_THE_CURRENT_EXCHANGE_SERVER_POLICY_PREVENTS_ATTACHMENTS_FROM_BEING_DOWNLOADED_TO_MOBILE_DEVICES");
                return g_strdup(ret);
        } else if (type == EMAIL_ERROR_ATTACHMENT_SIZE_EXCEED_POLICY_LIMIT) {
-               ug_data->translation_string_id2 = strdup("IDS_EMAIL_POP_THE_MAXIMUM_ATTACHMENT_SIZE_ALLOWED_BY_THE_CURRENT_EXCHANGE_SERVER_POLICY_HAS_BEEN_EXCEEDED");
+               view->translation_string_id2 = strdup("IDS_EMAIL_POP_THE_MAXIMUM_ATTACHMENT_SIZE_ALLOWED_BY_THE_CURRENT_EXCHANGE_SERVER_POLICY_HAS_BEEN_EXCEEDED");
                ret = email_get_email_string("IDS_EMAIL_POP_THE_MAXIMUM_ATTACHMENT_SIZE_ALLOWED_BY_THE_CURRENT_EXCHANGE_SERVER_POLICY_HAS_BEEN_EXCEEDED");
                return g_strdup(ret);
        } else if (type == EMAIL_ERROR_NO_RESPONSE) {
-               ug_data->translation_string_id2 = strdup(N_("IDS_EMAIL_POP_NO_RESPONSE_HAS_BEEN_RECEIVED_FROM_THE_SERVER_TRY_AGAIN_LATER"));
+               view->translation_string_id2 = strdup(N_("IDS_EMAIL_POP_NO_RESPONSE_HAS_BEEN_RECEIVED_FROM_THE_SERVER_TRY_AGAIN_LATER"));
                ret = email_get_email_string(N_("IDS_EMAIL_POP_NO_RESPONSE_HAS_BEEN_RECEIVED_FROM_THE_SERVER_TRY_AGAIN_LATER"));
                return g_strdup(ret);
        } else if (type == EMAIL_ERROR_CERTIFICATE_FAILURE) {
-               ug_data->translation_string_id2 = strdup(N_("IDS_EMAIL_POP_INVALID_OR_INACCESSIBLE_CERTIFICATE"));
+               view->translation_string_id2 = strdup(N_("IDS_EMAIL_POP_INVALID_OR_INACCESSIBLE_CERTIFICATE"));
                ret = email_get_email_string(N_("IDS_EMAIL_POP_INVALID_OR_INACCESSIBLE_CERTIFICATE"));
                return g_strdup(ret);
        } else if (type == EMAIL_ERROR_TLS_NOT_SUPPORTED) {
-               ug_data->translation_string_id2 = strdup(N_("IDS_EMAIL_BODY_SERVER_DOES_NOT_SUPPORT_TLS"));
+               view->translation_string_id2 = strdup(N_("IDS_EMAIL_BODY_SERVER_DOES_NOT_SUPPORT_TLS"));
                ret = email_get_email_string(N_("IDS_EMAIL_BODY_SERVER_DOES_NOT_SUPPORT_TLS"));
                return g_strdup(ret);
        } else if (type == EMAIL_ERROR_TLS_SSL_FAILURE) {
-               ug_data->translation_string_id2 = strdup(N_("IDS_EMAIL_BODY_UNABLE_TO_OPEN_CONNECTION_TO_SERVER_SECURITY_ERROR_OCCURRED"));
+               view->translation_string_id2 = strdup(N_("IDS_EMAIL_BODY_UNABLE_TO_OPEN_CONNECTION_TO_SERVER_SECURITY_ERROR_OCCURRED"));
                ret = email_get_email_string(N_("IDS_EMAIL_BODY_UNABLE_TO_OPEN_CONNECTION_TO_SERVER_SECURITY_ERROR_OCCURRED"));
                return g_strdup(ret);
        } else {
-               ug_data->translation_string_id2 = strdup("IDS_EMAIL_POP_AN_UNKNOWN_ERROR_HAS_OCCURRED");
+               view->translation_string_id2 = strdup("IDS_EMAIL_POP_AN_UNKNOWN_ERROR_HAS_OCCURRED");
                ret = _("IDS_EMAIL_POP_AN_UNKNOWN_ERROR_HAS_OCCURRED");
                return g_strdup(ret);
        }
@@ -237,41 +237,41 @@ Eina_Bool noti_mgr_dbus_receiver_setup(void *data)
        debug_enter();
 
        retvm_if(!data, EINA_FALSE, "data is NULL");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        GError *error = NULL;
-       if (ug_data->viewer_dbus_conn == NULL) {
-               ug_data->viewer_dbus_conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
+       if (view->viewer_dbus_conn == NULL) {
+               view->viewer_dbus_conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
                if (error) {
                        debug_error("g_bus_get_sync() failed (%s)", error->message);
                        g_error_free(error);
                        return EINA_FALSE;
                }
 
-               ug_data->viewer_network_id = g_dbus_connection_signal_subscribe(ug_data->viewer_dbus_conn, NULL, "User.Email.StorageChange", "email", "/User/Email/StorageChange",
-                                                                                                       NULL, G_DBUS_SIGNAL_FLAGS_NONE, _noti_mgr_on_gdbus_event_receive, (void *)ug_data, NULL);
-               retvm_if(ug_data->viewer_network_id == GDBUS_SIGNAL_SUBSCRIBE_FAILURE, EINA_FALSE, "Failed to g_dbus_connection_signal_subscribe()");
+               view->viewer_network_id = g_dbus_connection_signal_subscribe(view->viewer_dbus_conn, NULL, "User.Email.StorageChange", "email", "/User/Email/StorageChange",
+                                                                                                       NULL, G_DBUS_SIGNAL_FLAGS_NONE, _noti_mgr_on_gdbus_event_receive, (void *)view, NULL);
+               retvm_if(view->viewer_network_id == GDBUS_SIGNAL_SUBSCRIBE_FAILURE, EINA_FALSE, "Failed to g_dbus_connection_signal_subscribe()");
 
-               ug_data->viewer_storage_id = g_dbus_connection_signal_subscribe(ug_data->viewer_dbus_conn, NULL, "User.Email.NetworkStatus", "email", "/User/Email/NetworkStatus",
-                                                                                                       NULL, G_DBUS_SIGNAL_FLAGS_NONE, _noti_mgr_on_gdbus_event_receive, (void *)ug_data, NULL);
-               retvm_if(ug_data->viewer_storage_id == GDBUS_SIGNAL_SUBSCRIBE_FAILURE, EINA_FALSE, "Failed to g_dbus_connection_signal_subscribe()");
+               view->viewer_storage_id = g_dbus_connection_signal_subscribe(view->viewer_dbus_conn, NULL, "User.Email.NetworkStatus", "email", "/User/Email/NetworkStatus",
+                                                                                                       NULL, G_DBUS_SIGNAL_FLAGS_NONE, _noti_mgr_on_gdbus_event_receive, (void *)view, NULL);
+               retvm_if(view->viewer_storage_id == GDBUS_SIGNAL_SUBSCRIBE_FAILURE, EINA_FALSE, "Failed to g_dbus_connection_signal_subscribe()");
        }
 
        debug_leave();
        return EINA_TRUE;
 }
 
-void noti_mgr_dbus_receiver_remove(EmailViewerUGD *ug_data)
+void noti_mgr_dbus_receiver_remove(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       g_dbus_connection_signal_unsubscribe(ug_data->viewer_dbus_conn, ug_data->viewer_network_id);
-       g_dbus_connection_signal_unsubscribe(ug_data->viewer_dbus_conn, ug_data->viewer_storage_id);
-       g_object_unref(ug_data->viewer_dbus_conn);
-       ug_data->viewer_dbus_conn = NULL;
-       ug_data->viewer_network_id = 0;
-       ug_data->viewer_storage_id = 0;
+       g_dbus_connection_signal_unsubscribe(view->viewer_dbus_conn, view->viewer_network_id);
+       g_dbus_connection_signal_unsubscribe(view->viewer_dbus_conn, view->viewer_storage_id);
+       g_object_unref(view->viewer_dbus_conn);
+       view->viewer_dbus_conn = NULL;
+       view->viewer_network_id = 0;
+       view->viewer_storage_id = 0;
 
        debug_leave();
 }
@@ -279,23 +279,23 @@ void noti_mgr_dbus_receiver_remove(EmailViewerUGD *ug_data)
 static void _passwd_popup_cancel_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_enter();
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       DELETE_EVAS_OBJECT(ug_data->passwd_popup);
+       EmailViewerView *view = (EmailViewerView *)data;
+       DELETE_EVAS_OBJECT(view->passwd_popup);
 }
 
 static void _continue_download_body(void *data, Evas_Object *obj, void *event_info)
 {
        debug_enter();
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       DELETE_EVAS_OBJECT(ug_data->passwd_popup);
-       _download_body(ug_data);
+       EmailViewerView *view = (EmailViewerView *)data;
+       DELETE_EVAS_OBJECT(view->passwd_popup);
+       _download_body(view);
 }
 
-static void _handle_auth_error(EmailViewerUGD *ug_data, int error, Evas_Smart_Cb continue_cb)
+static void _handle_auth_error(EmailViewerView *view, int error, Evas_Smart_Cb continue_cb)
 {
        email_authentication_method_t auth_method = EMAIL_AUTHENTICATION_METHOD_NO_AUTH;
        email_account_t *account = NULL;
-       int ret = email_get_account(ug_data->account_id, EMAIL_ACC_GET_OPT_DEFAULT, &account);
+       int ret = email_get_account(view->account_id, EMAIL_ACC_GET_OPT_DEFAULT, &account);
        if (ret == EMAIL_ERROR_NONE && account) {
                auth_method = account->incoming_server_authentication_method;
        }
@@ -309,17 +309,17 @@ static void _handle_auth_error(EmailViewerUGD *ug_data, int error, Evas_Smart_Cb
        if (!show_passwd_popup || !continue_cb ||
                        auth_method == EMAIL_AUTHENTICATION_METHOD_XOAUTH2) {
                /* in case of Google account, password changed popup should not created. */
-               char *s = email_util_get_login_failure_string(ug_data->account_id);
+               char *s = email_util_get_login_failure_string(view->account_id);
                if (s) {
                        notification_status_message_post(s);
                        free(s);
                }
        } else {
-               debug_log("error[%d], account_id[%d]", error, ug_data->account_id);
-               DELETE_EVAS_OBJECT(ug_data->passwd_popup);
-               ug_data->passwd_popup = email_util_create_password_changed_popup(
-                               ug_data->base.module->navi, ug_data->account_id, continue_cb,
-                               _passwd_popup_cancel_cb, ug_data);
+               debug_log("error[%d], account_id[%d]", error, view->account_id);
+               DELETE_EVAS_OBJECT(view->passwd_popup);
+               view->passwd_popup = email_util_create_password_changed_popup(
+                               view->base.module->navi, view->account_id, continue_cb,
+                               _passwd_popup_cancel_cb, view);
        }
 }
 
@@ -361,10 +361,10 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
        debug_enter();
 
        retm_if(!data, "data is NULL");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        debug_secure("Object path=%s, interface name=%s, signal name=%s", object_path, interface_name, signal_name);
-       if (ug_data->b_viewer_hided == TRUE) {
+       if (view->b_viewer_hided == TRUE) {
                debug_log("viewer hided -> no need to get dbus noti");
                return;
        }
@@ -390,9 +390,9 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                case NOTI_ACCOUNT_DELETE:
                        /* DATA1[account_id] */
                        debug_log("NOTI_ACCOUNT_DELETE (account_id:%d)", data1);
-                               if (ug_data->account_id == data1) {
+                               if (view->account_id == data1) {
                                        debug_log("email_module_make_destroy_request");
-                                       email_module_make_destroy_request(ug_data->base.module);
+                                       email_module_make_destroy_request(view->base.module);
                                }
                        break;
 
@@ -408,17 +408,17 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                        int type = data4;
                        debug_log("account_id : %d, mail_id : %d, mailbox_id : %d, type : %d", data1, mail_id, atoi(data3), data4);
                        if (type == UPDATE_PARTIAL_BODY_DOWNLOAD) {
-                               debug_log("ug_data->mail_id : %d, mail_id : %d", ug_data->mail_id, mail_id);
-                               if (ug_data->mail_id == mail_id) {
-                                       if (viewer_create_temp_folder(ug_data) < 0) {
+                               debug_log("view->mail_id : %d, mail_id : %d", view->mail_id, mail_id);
+                               if (view->mail_id == mail_id) {
+                                       if (viewer_create_temp_folder(view) < 0) {
                                                debug_log("creating viewer temp folder is failed");
-                                               ug_data->eViewerErrorType = VIEWER_ERROR_FAIL;
+                                               view->eViewerErrorType = VIEWER_ERROR_FAIL;
                                        }
-                                       G_FREE(ug_data->temp_viewer_html_file_path);
-                                       ug_data->temp_viewer_html_file_path = g_strdup_printf("%s/%s", ug_data->temp_folder_path, EMAIL_VIEWER_TMP_HTML_FILE);
+                                       G_FREE(view->temp_viewer_html_file_path);
+                                       view->temp_viewer_html_file_path = g_strdup_printf("%s/%s", view->temp_folder_path, EMAIL_VIEWER_TMP_HTML_FILE);
 
-                                       viewer_set_internal_data(ug_data, EINA_TRUE);
-                                       _reset_view(ug_data, EINA_TRUE);
+                                       viewer_set_internal_data(view, EINA_TRUE);
+                                       _reset_view(view, EINA_TRUE);
                                }
                        } else if (type == UPDATE_MAIL) {
                                debug_log("UPDATE_MAIL!");
@@ -432,22 +432,22 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                        debug_log("NOTI_MAIL_DELETE_FINISH");
                        int deleted_mail_id = atoi(data3);
                        debug_log("account_id : %d, delete_type : %d, mail_id : %d", data1, data2, deleted_mail_id);
-                       if (ug_data->mail_id == deleted_mail_id) {
-                               if (ug_data->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) {
+                       if (view->mail_id == deleted_mail_id) {
+                               if (view->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) {
                                        int ret = notification_status_message_post(email_get_email_string("IDS_EMAIL_POP_THIS_EMAIL_HAS_BEEN_DELETED_FROM_THE_SERVER"));
                                        debug_warning_if(ret != NOTIFICATION_ERROR_NONE, "notification_status_message_post() failed! ret:(%d)", ret);
                                }
 
-                               if (ug_data->loaded_module != NULL) {
+                               if (view->loaded_module != NULL) {
                                        debug_log("destroying the viewer is pending....");
-                                       ug_data->need_pending_destroy = EINA_TRUE;
+                                       view->need_pending_destroy = EINA_TRUE;
                                } else {
-                                       if (ug_data->can_destroy_on_msg_delete) {
+                                       if (view->can_destroy_on_msg_delete) {
                                                debug_log("email_module_make_destroy_request");
-                                               email_module_make_destroy_request(ug_data->base.module);
+                                               email_module_make_destroy_request(view->base.module);
                                        } else {
                                                debug_log("pending destroy");
-                                               ug_data->need_pending_destroy = EINA_TRUE;
+                                               view->need_pending_destroy = EINA_TRUE;
                                        }
                                }
                        }
@@ -460,15 +460,15 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                case NOTI_MAIL_MOVE_FINISH:
                        debug_log("NOTI_MAIL_MOVE_FINISH");
                        /* DATA1[account_id] DATA2[move_type] DATA3[mailbox_id0x01updated_value0x01mail_id] DATA4[??] */
-                       if (ug_data->account_id == data1) {
+                       if (view->account_id == data1) {
                                int src_mailbox_id = -1, dst_mailbox_id = -1, mail_id = -1;
                                /* notification format: <src_folder><0x01><dst_folder><0x01><<mail_id><,><mail_id>>*/
                                _noti_mgr_parse_mail_move_finish_data_params(data3, &src_mailbox_id, &dst_mailbox_id, &mail_id);
                                debug_log("src_mailbox_id : %d, dst_mailbox_id : %d, mail_id : %d", src_mailbox_id, dst_mailbox_id, mail_id);
 
-                               if (ug_data->mail_id == mail_id) {
+                               if (view->mail_id == mail_id) {
                                        debug_log("email_module_make_destroy_request");
-                                       email_module_make_destroy_request(ug_data->base.module);
+                                       email_module_make_destroy_request(view->base.module);
                                }
                        }
                        break;
@@ -476,7 +476,7 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                case NOTI_MAIL_FIELD_UPDATE:
                        /* DATA1[account_id] DATA2[email_mail_attribute_type] DATA3[updated_field_name0x01mail_id,mail_id] DATA4[updated_value] */
                        debug_log("NOTI_MAIL_FIELD_UPDATE");
-                       debug_log("ug_data->mail_id : %d", ug_data->mail_id);
+                       debug_log("view->mail_id : %d", view->mail_id);
                        int i = 0;
                        int update_type = data2;
                        int value = data4;
@@ -489,7 +489,7 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
 
                        for (i = 0; i < g_list_length(mail_list); i++) {
                                idx = (typeof(idx)) g_list_nth_data(mail_list, i);
-                               if (idx && (ug_data->mail_id == *idx)) {
+                               if (idx && (view->mail_id == *idx)) {
                                        debug_log("idx: [%d]", *idx);
                                        break;
                                }
@@ -502,15 +502,15 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                        switch (update_type) {
                                case EMAIL_MAIL_ATTRIBUTE_FLAGS_FLAGGED_FIELD:
                                        debug_log("EMAIL_MAIL_ATTRIBUTE_FLAGS_FLAGGED_FIELD");
-                                       if (ug_data->mail_id == *idx) {
+                                       if (view->mail_id == *idx) {
                                                int err = 0;
                                                email_mail_data_t *mail_data = NULL;
-                                               err = email_get_mail_data(ug_data->mail_id, &mail_data);
+                                               err = email_get_mail_data(view->mail_id, &mail_data);
                                                if (err == EMAIL_ERROR_NONE && mail_data != NULL) {
-                                                       ug_data->favorite = mail_data->flags_flagged_field;
-                                                       debug_log("favorite (%d)", ug_data->favorite);
+                                                       view->favorite = mail_data->flags_flagged_field;
+                                                       debug_log("favorite (%d)", view->favorite);
 
-                                                       header_update_favorite_icon(ug_data);
+                                                       header_update_favorite_icon(view);
                                                }
 
                                                if (mail_data != NULL) {
@@ -526,13 +526,13 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                                        /* no break */
                                case EMAIL_MAIL_ATTRIBUTE_FLAGS_ANSWERED_FIELD:
                                        debug_log("EMAIL_MAIL_ATTRIBUTE_FLAGS_ANSWERED_FIELD");
-                                       if (ug_data->mail_id == *idx) {
+                                       if (view->mail_id == *idx) {
                                                int err = 0;
                                                email_mail_data_t *mail_data = NULL;
-                                               err = email_get_mail_data(ug_data->mail_id, &mail_data);
+                                               err = email_get_mail_data(view->mail_id, &mail_data);
                                                if (err == EMAIL_ERROR_NONE && mail_data != NULL) {
-                                                       if (ug_data->subject_ly) {
-                                                               header_update_response_icon(ug_data, mail_data);
+                                                       if (view->subject_ly) {
+                                                               header_update_response_icon(view, mail_data);
                                                        }
                                                }
 
@@ -546,12 +546,12 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
 
                                case EMAIL_MAIL_ATTRIBUTE_FLAGS_DELETED_FIELD:
                                        debug_log("EMAIL_MAIL_ATTRIBUTE_FLAGS_DELETED_FIELD");
-                                       if (ug_data->mail_id == *idx) {
-                                               if ((ug_data->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) && (ug_data->move_status != EMAIL_ERROR_NONE)) {
-                                                       debug_log("This email has been deleted from the server. (mailbox_type:%d, move_status:%d)", ug_data->mailbox_type, ug_data->move_status);
+                                       if (view->mail_id == *idx) {
+                                               if ((view->mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX) && (view->move_status != EMAIL_ERROR_NONE)) {
+                                                       debug_log("This email has been deleted from the server. (mailbox_type:%d, move_status:%d)", view->mailbox_type, view->move_status);
                                                }
                                                debug_log("email_module_make_destroy_request");
-                                               email_module_make_destroy_request(ug_data->base.module);
+                                               email_module_make_destroy_request(view->base.module);
                                        }
                                        break;
 
@@ -563,7 +563,7 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                        if (mail_list) {
                                for (i = 0; i < g_list_length(mail_list); i++) {
                                        idx = (typeof(idx)) g_list_nth_data(mail_list, i);
-                                       if (idx && (ug_data->mail_id == *idx)) {
+                                       if (idx && (view->mail_id == *idx)) {
                                                debug_log("idx: [%d]", *idx);
                                                FREE(idx);
                                                break;
@@ -596,91 +596,91 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                case NOTI_DOWNLOAD_BODY_START:
                        /* DATA1[mail_id] DATA2[file_id] DATA3[body_size] DATA4[received size] */
                        debug_log("receive noti, DOWNLOAD_BODY");
-                       if (ug_data->mail_id == data1) {
-                               ug_data->file_id = g_strdup(data2);
-                               ug_data->file_size = data3;
+                       if (view->mail_id == data1) {
+                               view->file_id = g_strdup(data2);
+                               view->file_size = data3;
 
                                if (data4 == 0) {
-                                       _noti_mgr_set_value_down_progress(ug_data, 0.0);
+                                       _noti_mgr_set_value_down_progress(view, 0.0);
                                } else {
                                        double per = (double)data4 / (double)data3;
-                                       _noti_mgr_set_value_down_progress(ug_data, per);
+                                       _noti_mgr_set_value_down_progress(view, per);
                                }
                        } else {
                                debug_log("mail_id is different");
-                               debug_log("expected mail_id [%d], received mail_id [%d]", ug_data->mail_id, data1);
+                               debug_log("expected mail_id [%d], received mail_id [%d]", view->mail_id, data1);
                        }
                        break;
 
                case NOTI_DOWNLOAD_MULTIPART_BODY:
                        /* DATA1[mail_id] DATA2[file_id] DATA3[body_size] DATA4[received size] */
                        debug_log("receive noti, DOWNLOAD_MULTIPART_BODY");
-                       if (ug_data->mail_id == data1) {
-                               ug_data->file_id = g_strdup(data2);
-                               ug_data->file_size = data3;
+                       if (view->mail_id == data1) {
+                               view->file_id = g_strdup(data2);
+                               view->file_size = data3;
 
                                if (data4 == 0) {
-                                       _noti_mgr_set_value_down_progress(ug_data, 0.0);
+                                       _noti_mgr_set_value_down_progress(view, 0.0);
                                } else {
                                        double per = (double)data4 / (double)data3;
-                                       _noti_mgr_set_value_down_progress(ug_data, per);
+                                       _noti_mgr_set_value_down_progress(view, per);
                                }
                        } else {
                                debug_log("mail_id is different");
-                               debug_log("expected mail_id [%d], received mail_id [%d]", ug_data->mail_id, data1);
+                               debug_log("expected mail_id [%d], received mail_id [%d]", view->mail_id, data1);
                        }
                        break;
 
                case NOTI_DOWNLOAD_BODY_FINISH:
                        /* DATA1[mail_id] DATA2[NULL] DATA3[handle_id] */
                        debug_log("receive noti, DOWNLOAD_BODY_FINISH");
-                       if (ug_data->mail_id == data1) {
+                       if (view->mail_id == data1) {
                                /* delete progress */
-                               if (ug_data->email_handle == data3) {
-                                       if (ug_data->pb_notify) {
-                                               _noti_mgr_set_value_down_progress(ug_data, 1.0);
-                                               viewer_destroy_down_progress_cb(ug_data, NULL, NULL);
-                                               viewer_delete_body_button(ug_data);
+                               if (view->email_handle == data3) {
+                                       if (view->pb_notify) {
+                                               _noti_mgr_set_value_down_progress(view, 1.0);
+                                               viewer_destroy_down_progress_cb(view, NULL, NULL);
+                                               viewer_delete_body_button(view);
                                        }
-                                       ug_data->email_handle = 0;
+                                       view->email_handle = 0;
                                } else {
                                        debug_log("email_handle is different");
-                                       debug_log("expected email_handle [%d], received email_handle [%d]", ug_data->email_handle, data3);
+                                       debug_log("expected email_handle [%d], received email_handle [%d]", view->email_handle, data3);
                                        break;
                                }
                                /* set property */
-                               viewer_set_internal_data(ug_data, EINA_TRUE);
+                               viewer_set_internal_data(view, EINA_TRUE);
                                /* create att and body */
-                               if (ug_data->b_partial_body) {
+                               if (view->b_partial_body) {
                                        int scr_x = 0;
                                        int scr_y = 0;
                                        int scr_w = 0;
                                        int scr_h = 0;
-                                       elm_scroller_region_get(ug_data->scroller, &scr_x, &scr_y, &scr_w, &scr_h);
+                                       elm_scroller_region_get(view->scroller, &scr_x, &scr_y, &scr_w, &scr_h);
                                        debug_log("scroller region> x[%d] y[%d] w[%d] h[%d]", scr_x, scr_y, scr_w, scr_h);
 
-                                       if (ug_data->has_html) {
-                                               ug_data->webview_data->body_type = BODY_TYPE_HTML;
-                                               ug_data->webview_data->uri = ug_data->body_uri;
+                                       if (view->has_html) {
+                                               view->webview_data->body_type = BODY_TYPE_HTML;
+                                               view->webview_data->uri = view->body_uri;
                                        } else {
-                                               ug_data->webview_data->body_type = BODY_TYPE_TEXT;
-                                               ug_data->webview_data->text_content = ug_data->body;
+                                               view->webview_data->body_type = BODY_TYPE_TEXT;
+                                               view->webview_data->text_content = view->body;
                                        }
 
-                                       viewer_set_webview_content(ug_data);
+                                       viewer_set_webview_content(view);
 
-                                       elm_object_focus_set(ug_data->sender_ly, EINA_TRUE);
-                                       elm_scroller_region_show(ug_data->scroller, scr_x, scr_y, scr_w, scr_h);
-                                       header_update_view(ug_data);
+                                       elm_object_focus_set(view->sender_ly, EINA_TRUE);
+                                       elm_scroller_region_show(view->scroller, scr_x, scr_y, scr_w, scr_h);
+                                       header_update_view(view);
                                } else {
                                        debug_log("NOT b_partial_body");
-                                       viewer_check_body_download(ug_data);
-                                       header_update_view(ug_data);
+                                       viewer_check_body_download(view);
+                                       header_update_view(view);
                                }
                        } else {
                                debug_log("email_handle or mail_id is different");
-                               debug_log("expected mail_id [%d], received mail_id [%d]", ug_data->mail_id, data1);
-                               debug_log("expected email_handle [%d], received email_handle [%d]", ug_data->email_handle, data3);
+                               debug_log("expected mail_id [%d], received mail_id [%d]", view->mail_id, data1);
+                               debug_log("expected email_handle [%d], received email_handle [%d]", view->email_handle, data3);
                        }
 
                        break;
@@ -688,16 +688,16 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                case NOTI_DOWNLOAD_BODY_FAIL:
                        /* DATA1[mail_id] DATA2[NULL] DATA3[handle_id] DATA4[error_code] */
                        debug_log("receive noti, DOWNLOAD_BODY_FAIL err[%d]", data4);
-                       if (ug_data->email_handle == data3 && ug_data->mail_id == data1) {
-                               ug_data->email_handle = 0;
+                       if (view->email_handle == data3 && view->mail_id == data1) {
+                               view->email_handle = 0;
 
                                /* delete progress */
-                               if (ug_data->pb_notify) {
-                                       viewer_destroy_down_progress_cb(ug_data, NULL, NULL);
+                               if (view->pb_notify) {
+                                       viewer_destroy_down_progress_cb(view, NULL, NULL);
                                }
 
                                if (_is_auth_error(data4)) {
-                                       _handle_auth_error(ug_data, data4, _continue_download_body);
+                                       _handle_auth_error(view, data4, _continue_download_body);
                                } else if (_is_connection_error(data4)) {
                                        notification_status_message_post(_("IDS_EMAIL_TPOP_FAILED_TO_CONNECT_TO_NETWORK"));
                                } else {
@@ -705,17 +705,17 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                                }
                        } else {
                                debug_log("email_handle or mail_id is different");
-                               debug_log("expected mail_id [%d], received mail_id [%d]", ug_data->mail_id, data1);
-                               debug_log("expected email_handle [%d], received email_handle [%d]", ug_data->email_handle, data3);
+                               debug_log("expected mail_id [%d], received mail_id [%d]", view->mail_id, data1);
+                               debug_log("expected email_handle [%d], received email_handle [%d]", view->email_handle, data3);
                        }
                        break;
 
                case NOTI_DOWNLOAD_ATTACH_START:
                        /* DATA1[mail_id] DATA2[file_name] DATA3[info_index] DATA4[percentage] */
                        debug_log("receive noti, NOTI_DOWNLOAD_ATTACH");
-                       if (ug_data->mail_id == data1) {
+                       if (view->mail_id == data1) {
 
-                               EV_attachment_data *aid = viewer_get_attachment_data(ug_data, data3);
+                               EV_attachment_data *aid = viewer_get_attachment_data(view, data3);
                                retm_if(aid == NULL, "aid is NULL.");
                                retm_if(aid->download_handle == 0, "aid->download_handle is 0.");
 
@@ -731,7 +731,7 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
 
                        } else {
                                debug_log("mail_id is different");
-                               debug_log("expected mail_id [%d], received mail_id [%d]", ug_data->mail_id, data1);
+                               debug_log("expected mail_id [%d], received mail_id [%d]", view->mail_id, data1);
                        }
                        break;
 
@@ -739,9 +739,9 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                        {
                                /* DATA1[mail_id] DATA2[NULL] DATA3[attachment_id] */
                                debug_log("receive noti, DOWNLOAD_ATTACH_FINISH");
-                               if (ug_data->mail_id == data1) {
+                               if (view->mail_id == data1) {
 
-                                       EV_attachment_data *aid = viewer_get_attachment_data(ug_data, data3);
+                                       EV_attachment_data *aid = viewer_get_attachment_data(view, data3);
                                        retm_if(aid == NULL, "aid is NULL.");
                                        retm_if(aid->download_handle == 0, "aid->download_handle is 0.");
 
@@ -749,13 +749,13 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                                        aid->is_busy = false;
 
                                        viewer_update_attachment_item_info(aid);
-                                       header_update_attachment_summary_info(ug_data);
+                                       header_update_attachment_summary_info(view);
 
                                        viewer_download_and_preview_save_attachment(aid);
 
                                } else {
                                        debug_log("mail_id is different");
-                                       debug_log("expected mail_id [%d], received mail_id [%d]", ug_data->mail_id, data1);
+                                       debug_log("expected mail_id [%d], received mail_id [%d]", view->mail_id, data1);
                                }
                        }
                        break;
@@ -770,9 +770,9 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                                debug_log("receive noti, NOTI_DOWNLOAD_ATTACH_CANCEL");
                        }
 
-                       if (ug_data->mail_id == data1) {
+                       if (view->mail_id == data1) {
 
-                               EV_attachment_data *aid = viewer_get_attachment_data(ug_data, data3);
+                               EV_attachment_data *aid = viewer_get_attachment_data(view, data3);
                                retm_if(aid == NULL, "aid is NULL.");
 
                                aid->is_busy = false;
@@ -794,49 +794,49 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                                aid->download_handle = 0;
                                viewer_set_attachment_state(aid, EV_ATT_STATE_IDLE);
 
-                               retm_if(ug_data->notify, "Popup is already shown, no need to show one more");
+                               retm_if(view->notify, "Popup is already shown, no need to show one more");
                                if (_is_auth_error(data4)) {
-                                       _handle_auth_error(ug_data, data4, NULL);
+                                       _handle_auth_error(view, data4, NULL);
                                } else if (_is_storage_full_error(data4)) {
-                                       viewer_show_storage_full_popup(ug_data);
+                                       viewer_show_storage_full_popup(view);
                                } else {
                                        char *err_msg = NULL;
                                        if (_is_connection_error(data4)) {
-                                               ug_data->package_type2 = PACKAGE_TYPE_NOT_AVAILABLE;
-                                               ug_data->translation_string_id2 = strdup("IDS_EMAIL_POP_FAILED_TO_DOWNLOAD_ATTACHMENT_CHECK_YOUR_NETWORK_CONNECTION_AND_TRY_AGAIN");
+                                               view->package_type2 = PACKAGE_TYPE_NOT_AVAILABLE;
+                                               view->translation_string_id2 = strdup("IDS_EMAIL_POP_FAILED_TO_DOWNLOAD_ATTACHMENT_CHECK_YOUR_NETWORK_CONNECTION_AND_TRY_AGAIN");
                                                err_msg = g_strdup(email_get_email_string("IDS_EMAIL_POP_FAILED_TO_DOWNLOAD_ATTACHMENT_CHECK_YOUR_NETWORK_CONNECTION_AND_TRY_AGAIN"));
                                        } else {
-                                               err_msg = _noti_mgr_get_service_fail_type(data4, ug_data);
+                                               err_msg = _noti_mgr_get_service_fail_type(data4, view);
                                        }
 
                                        email_string_t EMAIL_VIEWER_FAIL_MSG = { NULL, err_msg};
-                                       ug_data->translation_string_id1 = strdup(err_msg);
-                                       ug_data->str_format1 = strdup("%s");
-                                       ug_data->package_type1 = PACKAGE_TYPE_NOT_AVAILABLE;
-                                       ug_data->popup_element_type = POPUP_ELEMENT_TYPE_CONTENT;
+                                       view->translation_string_id1 = strdup(err_msg);
+                                       view->str_format1 = strdup("%s");
+                                       view->package_type1 = PACKAGE_TYPE_NOT_AVAILABLE;
+                                       view->popup_element_type = POPUP_ELEMENT_TYPE_CONTENT;
 
                                        email_string_t title = { PACKAGE, "IDS_EMAIL_HEADER_UNABLE_TO_DOWNLOAD_ATTACHMENT_ABB" };
                                        email_string_t btn = { PACKAGE, "IDS_EMAIL_BUTTON_OK" };
                                        email_string_t null_str = { NULL, NULL };
 
-                                       util_create_notify(ug_data, title, EMAIL_VIEWER_FAIL_MSG, 1,
+                                       util_create_notify(view, title, EMAIL_VIEWER_FAIL_MSG, 1,
                                                        btn, _noti_mgr_popup_response_cb, null_str, NULL, NULL);
                                        g_free(err_msg);
                                }
 
                        } else {
                                debug_log("mail_id is different");
-                               debug_log("expected mail_id [%d], received mail_id [%d]", ug_data->mail_id, data1);
+                               debug_log("expected mail_id [%d], received mail_id [%d]", view->mail_id, data1);
                        }
                        break;
 
                case NOTI_SEND_FINISH:
                        /* DATA1[account_id] DATA2[NULL] DATA3[mail_id] DATA4[??] */
                        debug_log("receive noti, NOTI_SEND_FINISH");
-                       if ((ug_data->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) &&
-                               (ug_data->account_id == data1) && (ug_data->mail_id == data3)) {
+                       if ((view->mailbox_type == EMAIL_MAILBOX_TYPE_OUTBOX) &&
+                               (view->account_id == data1) && (view->mail_id == data3)) {
                                debug_log("email_module_make_destroy_request");
-                               email_module_make_destroy_request(ug_data->base.module);
+                               email_module_make_destroy_request(view->base.module);
                        }
                        break;
 
@@ -845,11 +845,11 @@ static void _noti_mgr_on_gdbus_event_receive(GDBusConnection *connection,
                case NOTI_SEND_CANCEL:
                        /* DATA1[account_id] DATA2[NULL] DATA3[mail_id] DATA4[??] */
                        debug_log("receive noti, NOTI_SEND_FAIL or NOTI_SEND_CANCEL");
-                       if ((ug_data->account_id == data1) && (ug_data->mail_id == data3)) {
-                               if (ug_data->cancel_sending_ctx_item) {
-                                       elm_object_item_disabled_set(ug_data->cancel_sending_ctx_item, EINA_FALSE);
+                       if ((view->account_id == data1) && (view->mail_id == data3)) {
+                               if (view->cancel_sending_ctx_item) {
+                                       elm_object_item_disabled_set(view->cancel_sending_ctx_item, EINA_FALSE);
                                }
-                               ug_data->is_cancel_sending_btn_clicked = EINA_FALSE;
+                               view->is_cancel_sending_btn_clicked = EINA_FALSE;
                        }
                        break;
 
index f7c79f7..832e0d0 100644 (file)
@@ -42,7 +42,7 @@ typedef struct _Item_Data {
 } Item_Data;
 
 typedef struct _Mbe_item_data {
-       EmailViewerUGD *ug_data;
+       EmailViewerView *view;
        int recipient_count;
        int appended_recipient_count;
        GList *recipient_info_list;
@@ -81,12 +81,12 @@ static void _recipient_popup_response_cb(void *data, Evas_Object *obj, void *eve
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->notify);
-       FREE(ug_data->selected_address);
-       FREE(ug_data->selected_name);
-       email_contacts_delete_contact_info(&ug_data->recipient_contact_list_item);
+       DELETE_EVAS_OBJECT(view->notify);
+       FREE(view->selected_address);
+       FREE(view->selected_name);
+       email_contacts_delete_contact_info(&view->recipient_contact_list_item);
 
        debug_leave();
 }
@@ -119,18 +119,18 @@ static void _recipient_mbe_selected_cb(void *data, Evas_Object *obj, void *event
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
        retm_if(event_info == NULL, "Invalid parameter: event_info[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        email_address_info_t *addrs_info = NULL;
        Elm_Object_Item *item = (Elm_Object_Item *) event_info;
        debug_secure("selected item:%s", elm_object_item_text_get(item));
        addrs_info = elm_object_item_data_get(item);
-       ug_data->recipient_address = addrs_info->address;
-       ug_data->recipient_name = addrs_info->display_name;
-       debug_secure("display_name:%s", ug_data->recipient_name);
-       debug_secure("recipient_address:%s", ug_data->recipient_address);
+       view->recipient_address = addrs_info->address;
+       view->recipient_name = addrs_info->display_name;
+       debug_secure("display_name:%s", view->recipient_name);
+       debug_secure("recipient_address:%s", view->recipient_address);
 
-       email_contacts_delete_contact_info(&ug_data->recipient_contact_list_item);
-       ug_data->recipient_contact_list_item = email_contacts_get_contact_info_by_email_address(ug_data->recipient_address);
+       email_contacts_delete_contact_info(&view->recipient_contact_list_item);
+       view->recipient_contact_list_item = email_contacts_get_contact_info_by_email_address(view->recipient_address);
 
        char *popup_title = NULL;
        if ((addrs_info->display_name) && (g_strcmp0(addrs_info->display_name, addrs_info->address))) {
@@ -148,7 +148,7 @@ static void _recipient_mbe_selected_cb(void *data, Evas_Object *obj, void *event
        }
 
        email_string_t EMAIL_VIEWER_STR_NO_TRANSITION = { NULL, popup_title };
-       ug_data->notify = util_create_notify_with_list(ug_data, EMAIL_VIEWER_STR_NO_TRANSITION, EMAIL_VIEWER_STRING_NULL, 1, EMAIL_VIEWER_BUTTON_CANCEL,
+       view->notify = util_create_notify_with_list(view, EMAIL_VIEWER_STR_NO_TRANSITION, EMAIL_VIEWER_STRING_NULL, 1, EMAIL_VIEWER_BUTTON_CANCEL,
                        _recipient_popup_response_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
 
        g_free(popup_title);
@@ -159,8 +159,8 @@ static void _recipient_mbe_selected_cb(void *data, Evas_Object *obj, void *event
        recipient_popup_itc.func.state_get = NULL;
        recipient_popup_itc.func.del = NULL;
 
-       Evas_Object *recipient_popup_genlist = util_notify_genlist_add(ug_data->notify);
-       evas_object_data_set(recipient_popup_genlist, VIEWER_EVAS_DATA_NAME, ug_data);
+       Evas_Object *recipient_popup_genlist = util_notify_genlist_add(view->notify);
+       evas_object_data_set(recipient_popup_genlist, VIEWER_EVAS_DATA_NAME, view);
 
        int item_cnt = 0;
        item_cnt = 3;
@@ -171,11 +171,11 @@ static void _recipient_mbe_selected_cb(void *data, Evas_Object *obj, void *event
        for (index = 0; index < item_cnt; index++) {
                item_data = MEM_ALLOC(item_data, 1);
                item_data->index = index;
-               gen_item[index] = elm_genlist_item_append(recipient_popup_genlist, &recipient_popup_itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, _recipient_popup_genlist_sel, (void *)ug_data);
+               gen_item[index] = elm_genlist_item_append(recipient_popup_genlist, &recipient_popup_itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, _recipient_popup_genlist_sel, (void *)view);
                elm_object_item_data_set(gen_item[index], item_data);
        }
 
-       elm_object_content_set(ug_data->notify, recipient_popup_genlist);
+       elm_object_content_set(view->notify, recipient_popup_genlist);
 
        debug_leave();
 }
@@ -184,15 +184,15 @@ static char *_recipient_popup_genlist_text_get(void *data, Evas_Object *obj, con
 {
        debug_enter();
        retvm_if(obj == NULL, NULL, "Invalid parameter: obj[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)evas_object_data_get(obj, VIEWER_EVAS_DATA_NAME);
-       retvm_if(!ug_data, NULL, "ug_data is NULL!");
+       EmailViewerView *view = (EmailViewerView *)evas_object_data_get(obj, VIEWER_EVAS_DATA_NAME);
+       retvm_if(!view, NULL, "view is NULL!");
        Item_Data *item_data = data;
        int index = item_data->index;
        char *menu_string = NULL;
 
        if (!strcmp(part, "elm.text")) {
                if (index == 0) {
-                       if (ug_data->recipient_contact_list_item) {
+                       if (view->recipient_contact_list_item) {
                                menu_string = email_get_email_string("IDS_EMAIL_OPT_VIEW_CONTACT_DETAILS_ABB");
                        } else {
                                menu_string = email_get_email_string("IDS_EMAIL_OPT_ADD_TO_CONTACTS_ABB2");
@@ -200,7 +200,7 @@ static char *_recipient_popup_genlist_text_get(void *data, Evas_Object *obj, con
                } else if (index == 1) {
                        menu_string = email_get_email_string("IDS_EMAIL_OPT_COMPOSE_EMAIL_ABB");
                } else if (index == 2) {
-                       if (recipient_is_priority_email_address(ug_data->recipient_address)) {
+                       if (recipient_is_priority_email_address(view->recipient_address)) {
                                menu_string = email_get_email_string("IDS_EMAIL_OPT_REMOVE_FROM_PRIORITY_SENDERS");
                        } else {
                                menu_string = email_get_email_string("IDS_EMAIL_OPT_ADD_TO_PRIORITY_SENDERS_ABB");
@@ -218,7 +218,7 @@ static void _recipient_popup_genlist_sel(void *data, Evas_Object *obj, void *eve
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
        retm_if(event_info == NULL, "Invalid parameter: event_info[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
 
        if (item != NULL) {
@@ -226,35 +226,35 @@ static void _recipient_popup_genlist_sel(void *data, Evas_Object *obj, void *eve
                int index = item_data->index;
                debug_log("index = %d", index);
                if (index == 0) {
-                       if (ug_data->recipient_contact_list_item) {
-                               debug_log("Contact Item Exist: index[%d]", ug_data->recipient_contact_list_item->person_id);
-                               viewer_view_contact_detail(ug_data, ug_data->recipient_contact_list_item->person_id);
-                               email_contacts_delete_contact_info(&ug_data->recipient_contact_list_item);
+                       if (view->recipient_contact_list_item) {
+                               debug_log("Contact Item Exist: index[%d]", view->recipient_contact_list_item->person_id);
+                               viewer_view_contact_detail(view, view->recipient_contact_list_item->person_id);
+                               email_contacts_delete_contact_info(&view->recipient_contact_list_item);
                        } else {
-                               ug_data->create_contact_arg = CONTACTUI_REQ_ADD_EMAIL;
-                               DELETE_EVAS_OBJECT(ug_data->notify);
-                               recipient_add_to_contact_selection_popup(ug_data, ug_data->recipient_address, EMAIL_RECIPIENT_NAME);
+                               view->create_contact_arg = CONTACTUI_REQ_ADD_EMAIL;
+                               DELETE_EVAS_OBJECT(view->notify);
+                               recipient_add_to_contact_selection_popup(view, view->recipient_address, EMAIL_RECIPIENT_NAME);
                                return;
                        }
                } else if (index == 1) {
-                       char *utf8_name = elm_entry_markup_to_utf8(ug_data->recipient_name);
-                       char *utf8_str = g_strconcat(utf8_name, " <", ug_data->recipient_address, ">", NULL);
+                       char *utf8_name = elm_entry_markup_to_utf8(view->recipient_name);
+                       char *utf8_str = g_strconcat(utf8_name, " <", view->recipient_address, ">", NULL);
                        debug_secure("utf8_name:[%s]", utf8_name);
                        debug_secure("utf8 string:[%s]", utf8_str);
 
-                       viewer_send_email(ug_data, utf8_str);
+                       viewer_send_email(view, utf8_str);
 
                        g_free(utf8_name);
                        g_free(utf8_str);
                } else if (index == 2) {
-                       if (recipient_is_priority_email_address(ug_data->recipient_address)) {
-                               viewer_ctxpopup_remove_vip_rule_cb(ug_data->recipient_address, NULL, NULL);
+                       if (recipient_is_priority_email_address(view->recipient_address)) {
+                               viewer_ctxpopup_remove_vip_rule_cb(view->recipient_address, NULL, NULL);
                        } else {
-                               viewer_ctxpopup_add_vip_rule_cb(ug_data->recipient_address, NULL, NULL);
+                               viewer_ctxpopup_add_vip_rule_cb(view->recipient_address, NULL, NULL);
                        }
                }
        }
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       DELETE_EVAS_OBJECT(view->notify);
        debug_leave();
 }
 
@@ -284,7 +284,7 @@ static void _recipient_add_to_contact_popup_genlist_sel(void *data, Evas_Object
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
        retm_if(event_info == NULL, "Invalid parameter: event_info[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
 
        if (item != NULL) {
@@ -292,14 +292,14 @@ static void _recipient_add_to_contact_popup_genlist_sel(void *data, Evas_Object
                debug_log("index = %d", index);
 
                if (index == 0) {
-                       viewer_add_contact(ug_data, ug_data->selected_address, ug_data->selected_name);
+                       viewer_add_contact(view, view->selected_address, view->selected_name);
                } else if (index == 1) {
-                       viewer_update_contact(ug_data, ug_data->selected_address);
+                       viewer_update_contact(view, view->selected_address);
                }
        }
-       DELETE_EVAS_OBJECT(ug_data->notify);
-       FREE(ug_data->selected_address);
-       FREE(ug_data->selected_name);
+       DELETE_EVAS_OBJECT(view->notify);
+       FREE(view->selected_address);
+       FREE(view->selected_name);
        debug_leave();
 }
 
@@ -308,39 +308,39 @@ void recipient_add_to_contact_selection_popup(void *data, char *contact_data, VI
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        char *popup_title = NULL;
        char *utf8_str = NULL;
-       if (name_type == EMAIL_SENDER_NAME && ug_data->sender_display_name && ug_data->sender_address &&
-                       g_strcmp0(ug_data->sender_display_name, ug_data->sender_address)) {
-               ug_data->selected_address = g_strdup(ug_data->sender_address);
-               ug_data->selected_name = g_strdup(ug_data->sender_display_name);
-               utf8_str = g_strconcat(ug_data->sender_display_name, " <", ug_data->sender_address, ">", NULL);
+       if (name_type == EMAIL_SENDER_NAME && view->sender_display_name && view->sender_address &&
+                       g_strcmp0(view->sender_display_name, view->sender_address)) {
+               view->selected_address = g_strdup(view->sender_address);
+               view->selected_name = g_strdup(view->sender_display_name);
+               utf8_str = g_strconcat(view->sender_display_name, " <", view->sender_address, ">", NULL);
                popup_title = elm_entry_utf8_to_markup(utf8_str);
-               debug_secure("sender_display_name:[%s]", ug_data->sender_display_name);
+               debug_secure("sender_display_name:[%s]", view->sender_display_name);
                debug_secure("utf8 string:[%s]", utf8_str);
-       } else if (name_type == EMAIL_RECIPIENT_NAME && ug_data->recipient_name && ug_data->recipient_address &&
-                       g_strcmp0(ug_data->recipient_name, ug_data->recipient_address)) {
-               ug_data->selected_address = g_strdup(ug_data->recipient_address);
-               ug_data->selected_name = elm_entry_markup_to_utf8(ug_data->recipient_name);
-               utf8_str = g_strconcat(ug_data->selected_name, " <", ug_data->recipient_address, ">", NULL);
+       } else if (name_type == EMAIL_RECIPIENT_NAME && view->recipient_name && view->recipient_address &&
+                       g_strcmp0(view->recipient_name, view->recipient_address)) {
+               view->selected_address = g_strdup(view->recipient_address);
+               view->selected_name = elm_entry_markup_to_utf8(view->recipient_name);
+               utf8_str = g_strconcat(view->selected_name, " <", view->recipient_address, ">", NULL);
                popup_title = elm_entry_utf8_to_markup(utf8_str);
-               debug_secure("recipient_name:[%s]", ug_data->recipient_name);
+               debug_secure("recipient_name:[%s]", view->recipient_name);
                debug_secure("utf8 string:[%s]", utf8_str);
        } else {
-               ug_data->selected_address = g_strdup(contact_data);
-               gchar **str_tokens = g_strsplit(ug_data->selected_address, "@", -1);
-               ug_data->selected_name = g_strdup(str_tokens[0]);
-               popup_title = g_strdup(ug_data->selected_address);
+               view->selected_address = g_strdup(contact_data);
+               gchar **str_tokens = g_strsplit(view->selected_address, "@", -1);
+               view->selected_name = g_strdup(str_tokens[0]);
+               popup_title = g_strdup(view->selected_address);
                g_strfreev(str_tokens);
        }
 
-       debug_secure("selected_address:[%s]", ug_data->selected_address);
-       debug_secure("selected_name:[%s]", ug_data->selected_name);
+       debug_secure("selected_address:[%s]", view->selected_address);
+       debug_secure("selected_name:[%s]", view->selected_name);
        debug_secure("popup_title:[%s]", popup_title);
 
        email_string_t EMAIL_VIEWER_STR_NO_TRANSITION = { NULL, popup_title };
-       ug_data->notify = util_create_notify_with_list(ug_data, EMAIL_VIEWER_STR_NO_TRANSITION, EMAIL_VIEWER_STRING_NULL, 1, EMAIL_VIEWER_BUTTON_CANCEL,
+       view->notify = util_create_notify_with_list(view, EMAIL_VIEWER_STR_NO_TRANSITION, EMAIL_VIEWER_STRING_NULL, 1, EMAIL_VIEWER_BUTTON_CANCEL,
                        _recipient_popup_response_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
 
        FREE(utf8_str);
@@ -352,20 +352,20 @@ void recipient_add_to_contact_selection_popup(void *data, char *contact_data, VI
        add_to_contact_popup_itc.func.state_get = NULL;
        add_to_contact_popup_itc.func.del = NULL;
 
-       Evas_Object *add_to_contact_popup_genlist = util_notify_genlist_add(ug_data->notify);
-       evas_object_data_set(add_to_contact_popup_genlist, VIEWER_EVAS_DATA_NAME, ug_data);
+       Evas_Object *add_to_contact_popup_genlist = util_notify_genlist_add(view->notify);
+       evas_object_data_set(add_to_contact_popup_genlist, VIEWER_EVAS_DATA_NAME, view);
 
        int index = 0;
        for (index = 0; index < 2; index++) {
-               elm_genlist_item_append(add_to_contact_popup_genlist, &add_to_contact_popup_itc, (void *)(ptrdiff_t)index, NULL, ELM_GENLIST_ITEM_NONE, _recipient_add_to_contact_popup_genlist_sel, (void *)ug_data);
+               elm_genlist_item_append(add_to_contact_popup_genlist, &add_to_contact_popup_itc, (void *)(ptrdiff_t)index, NULL, ELM_GENLIST_ITEM_NONE, _recipient_add_to_contact_popup_genlist_sel, (void *)view);
        }
 
-       elm_object_content_set(ug_data->notify, add_to_contact_popup_genlist);
+       elm_object_content_set(view->notify, add_to_contact_popup_genlist);
        debug_leave();
 }
 
 static void _viewer_append_mbe_item(
-               EmailViewerUGD *ug_data, Evas_Object *mbe,
+               EmailViewerView *view, Evas_Object *mbe,
                const email_address_info_t *addrs_info)
 {
        retm_if(!addrs_info, "invalid param");
@@ -411,7 +411,7 @@ static Eina_Bool _recipient_smart_mbe_append(void *data)
 
        retvm_if(data == NULL, ECORE_CALLBACK_CANCEL, "data is NULL");
        Mbe_item_data *mbe_item_data = (Mbe_item_data *)data;
-       EmailViewerUGD *ug_data = mbe_item_data->ug_data;
+       EmailViewerView *view = mbe_item_data->view;
        int add_rcpnt_cnt = RECIPIENT_ADD_WITH_IDLER;
 
        if ((mbe_item_data->recipient_count - mbe_item_data->appended_recipient_count) < add_rcpnt_cnt) {
@@ -420,7 +420,7 @@ static Eina_Bool _recipient_smart_mbe_append(void *data)
 
        int i = 0;
        for (i = 0; i < add_rcpnt_cnt; i++) {
-               _viewer_append_mbe_item(ug_data, mbe_item_data->recipient_mbe,
+               _viewer_append_mbe_item(view, mbe_item_data->recipient_mbe,
                                g_list_nth_data(mbe_item_data->recipient_info_list, mbe_item_data->appended_recipient_count + i));
        }
 
@@ -441,7 +441,7 @@ static void _recipient_append_mbe_items_without_idler(void *data)
        debug_enter();
        retm_if(data == NULL, "data is NULL");
        Mbe_item_data *mbe_item_data = (Mbe_item_data *)data;
-       EmailViewerUGD *ug_data = mbe_item_data->ug_data;
+       EmailViewerView *view = mbe_item_data->view;
 
        if (mbe_item_data->recipient_count < RECIPIENT_ADD_WITHOUT_IDLER) {
                mbe_item_data->appended_recipient_count = mbe_item_data->recipient_count;
@@ -451,7 +451,7 @@ static void _recipient_append_mbe_items_without_idler(void *data)
 
        int i = 0;
        for (i = 0; i < mbe_item_data->appended_recipient_count; i++) {
-               _viewer_append_mbe_item(ug_data, mbe_item_data->recipient_mbe,
+               _viewer_append_mbe_item(view, mbe_item_data->recipient_mbe,
                                g_list_nth_data(mbe_item_data->recipient_info_list, i));
        }
        debug_leave();
@@ -460,26 +460,26 @@ static void _recipient_append_mbe_items_without_idler(void *data)
 static void _recipient_append_mbe(void *data, VIEWER_TO_CC_BCC_LY recipient, email_address_info_list_t *addrs_info_list)
 {
        debug_enter();
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        Evas_Object *recipient_mbe = NULL;
        GList *recipient_info_list = NULL;
        int n_recipient_list = 0;
 
        if (recipient == EMAIL_VIEWER_TO_LAYOUT) {
-               n_recipient_list = ug_data->to_recipients_cnt;
-               recipient_mbe = ug_data->to_mbe;
+               n_recipient_list = view->to_recipients_cnt;
+               recipient_mbe = view->to_mbe;
                recipient_info_list = viewer_copy_recipient_list(addrs_info_list->to);
-               DELETE_IDLER_OBJECT(ug_data->to_recipient_idler);
+               DELETE_IDLER_OBJECT(view->to_recipient_idler);
        } else if (recipient == EMAIL_VIEWER_CC_LAYOUT) {
-               n_recipient_list = ug_data->cc_recipients_cnt;
-               recipient_mbe = ug_data->cc_mbe;
+               n_recipient_list = view->cc_recipients_cnt;
+               recipient_mbe = view->cc_mbe;
                recipient_info_list = viewer_copy_recipient_list(addrs_info_list->cc);
-               DELETE_IDLER_OBJECT(ug_data->cc_recipient_idler);
+               DELETE_IDLER_OBJECT(view->cc_recipient_idler);
        } else if (recipient == EMAIL_VIEWER_BCC_LAYOUT) {
-               n_recipient_list = ug_data->bcc_recipients_cnt;
-               recipient_mbe = ug_data->bcc_mbe;
+               n_recipient_list = view->bcc_recipients_cnt;
+               recipient_mbe = view->bcc_mbe;
                recipient_info_list = viewer_copy_recipient_list(addrs_info_list->bcc);
-               DELETE_IDLER_OBJECT(ug_data->bcc_recipient_idler);
+               DELETE_IDLER_OBJECT(view->bcc_recipient_idler);
        }
 
        if (n_recipient_list > EMAIL_VIEW_MAX_TO_COUNT) {
@@ -493,7 +493,7 @@ static void _recipient_append_mbe(void *data, VIEWER_TO_CC_BCC_LY recipient, ema
 
        mbe_item_data->recipient_mbe = recipient_mbe;
        mbe_item_data->recipient_info_list = recipient_info_list;
-       mbe_item_data->ug_data = ug_data;
+       mbe_item_data->view = view;
        mbe_item_data->recipient_count = n_recipient_list;
        mbe_item_data->appended_recipient_count = 0;
 
@@ -502,16 +502,16 @@ static void _recipient_append_mbe(void *data, VIEWER_TO_CC_BCC_LY recipient, ema
        bool run = false;
        if (mbe_item_data->appended_recipient_count != mbe_item_data->recipient_count) {
                if (recipient == EMAIL_VIEWER_TO_LAYOUT) {
-                       ug_data->to_recipient_idler = ecore_idler_add(_recipient_smart_mbe_append, (void *)mbe_item_data);
-                       mbe_item_data->recipient_append_idler = &(ug_data->to_recipient_idler);
+                       view->to_recipient_idler = ecore_idler_add(_recipient_smart_mbe_append, (void *)mbe_item_data);
+                       mbe_item_data->recipient_append_idler = &(view->to_recipient_idler);
                        run = true;
                } else if (recipient == EMAIL_VIEWER_CC_LAYOUT) {
-                       ug_data->cc_recipient_idler = ecore_idler_add(_recipient_smart_mbe_append, (void *)mbe_item_data);
-                       mbe_item_data->recipient_append_idler = &(ug_data->cc_recipient_idler);
+                       view->cc_recipient_idler = ecore_idler_add(_recipient_smart_mbe_append, (void *)mbe_item_data);
+                       mbe_item_data->recipient_append_idler = &(view->cc_recipient_idler);
                        run = true;
                } else if (recipient == EMAIL_VIEWER_BCC_LAYOUT) {
-                       ug_data->bcc_recipient_idler = ecore_idler_add(_recipient_smart_mbe_append, (void *)mbe_item_data);
-                       mbe_item_data->recipient_append_idler = &(ug_data->bcc_recipient_idler);
+                       view->bcc_recipient_idler = ecore_idler_add(_recipient_smart_mbe_append, (void *)mbe_item_data);
+                       mbe_item_data->recipient_append_idler = &(view->bcc_recipient_idler);
                        run = true;
                }
        }
@@ -540,39 +540,39 @@ static void _recipient_assign_mbe(void *data, Evas_Object *mbe, VIEWER_TO_CC_BCC
 {
        retm_if(mbe == NULL, "Invalid parameter: data[NULL]");
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        if (recipient == EMAIL_VIEWER_TO_LAYOUT)
-               ug_data->to_mbe = mbe;
+               view->to_mbe = mbe;
        else if (recipient == EMAIL_VIEWER_CC_LAYOUT)
-               ug_data->cc_mbe = mbe;
+               view->cc_mbe = mbe;
        else
-               ug_data->bcc_mbe = mbe;
+               view->bcc_mbe = mbe;
 }
 
 static Evas_Object *_recipient_create_mbe(void *data, VIEWER_TO_CC_BCC_LY recipient)
 {
        debug_enter();
        retvm_if(data == NULL, NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       Evas_Object *mbe = elm_multibuttonentry_add(ug_data->main_bx);
+       Evas_Object *mbe = elm_multibuttonentry_add(view->main_bx);
        elm_multibuttonentry_editable_set(mbe, EINA_FALSE);
 
        char *recipient_string = _recipient_get_mbe_string(recipient);
        elm_object_text_set(mbe, recipient_string);
 
-       evas_object_smart_callback_add(mbe, "item,clicked", _recipient_mbe_selected_cb, ug_data);
-       evas_object_smart_callback_add(mbe, "item,added", _recipient_mbe_added_cb, ug_data);
-       evas_object_smart_callback_add(mbe, "item,deleted", _recipient_mbe_deleted_cb, ug_data);
+       evas_object_smart_callback_add(mbe, "item,clicked", _recipient_mbe_selected_cb, view);
+       evas_object_smart_callback_add(mbe, "item,added", _recipient_mbe_added_cb, view);
+       evas_object_smart_callback_add(mbe, "item,deleted", _recipient_mbe_deleted_cb, view);
 
        elm_object_focus_allow_set(mbe, EINA_FALSE);
-       if (elm_win_focus_highlight_enabled_get(ug_data->base.module->win)) {
+       if (elm_win_focus_highlight_enabled_get(view->base.module->win)) {
                elm_object_tree_focus_allow_set(mbe, EINA_TRUE);
        } else {
                elm_object_tree_focus_allow_set(mbe, EINA_FALSE);
        }
-       _recipient_assign_mbe(ug_data, mbe, recipient);
+       _recipient_assign_mbe(view, mbe, recipient);
 
        return mbe;
 }
@@ -581,9 +581,9 @@ static Eina_Bool _recipient_scroll_correction(void *data)
 {
        debug_enter();
        retvm_if(data == NULL, ECORE_CALLBACK_CANCEL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       viewer_set_vertical_scroller_position(ug_data);
-       ug_data->rcpt_scroll_corr = NULL;
+       EmailViewerView *view = (EmailViewerView *)data;
+       viewer_set_vertical_scroller_position(view);
+       view->rcpt_scroll_corr = NULL;
 
        return ECORE_CALLBACK_CANCEL;
 }
@@ -592,10 +592,10 @@ static void _recipient_resize_cb(void *data, Evas *e, Evas_Object *obj, void *ev
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_TIMER_OBJECT(ug_data->rcpt_scroll_corr);
-       ug_data->rcpt_scroll_corr = ecore_timer_add(0.0, _recipient_scroll_correction, ug_data);
+       DELETE_TIMER_OBJECT(view->rcpt_scroll_corr);
+       view->rcpt_scroll_corr = ecore_timer_add(0.0, _recipient_scroll_correction, view);
 }
 
 
@@ -608,17 +608,17 @@ Evas_Object *recipient_create_address(void *data, email_address_info_list_t *add
        debug_enter();
        retvm_if(data == NULL, NULL, "Invalid parameter: data[NULL]");
        retvm_if(addrs_info_list == NULL, NULL, "Invalid parameter: addrs_info_list[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       Evas_Object *layout = viewer_load_edj(ug_data->main_bx, email_get_viewer_theme_path(), "ev/recipient/base", EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       Evas_Object *layout = viewer_load_edj(view->main_bx, email_get_viewer_theme_path(), "ev/recipient/base", EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
        evas_object_show(layout);
 
-       Evas_Object *mbe = _recipient_create_mbe(ug_data, recipient);
+       Evas_Object *mbe = _recipient_create_mbe(view, recipient);
        elm_object_part_content_set(layout, "ev.swallow.content", mbe);
 
-       _recipient_append_mbe(ug_data, recipient, addrs_info_list);
-       evas_object_event_callback_add(layout, EVAS_CALLBACK_RESIZE, _recipient_resize_cb, ug_data);
+       _recipient_append_mbe(view, recipient, addrs_info_list);
+       evas_object_event_callback_add(layout, EVAS_CALLBACK_RESIZE, _recipient_resize_cb, view);
 
        debug_leave();
        return layout;
@@ -707,12 +707,12 @@ void recipient_clear_multibuttonentry_data(Evas_Object *obj)
 void recipient_delete_callbacks(void *data)
 {
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-
-       if (ug_data->to_ly)
-               evas_object_event_callback_del(ug_data->to_ly, EVAS_CALLBACK_RESIZE, _recipient_resize_cb);
-       if (ug_data->cc_ly)
-               evas_object_event_callback_del(ug_data->cc_ly, EVAS_CALLBACK_RESIZE, _recipient_resize_cb);
-       if (ug_data->bcc_ly)
-               evas_object_event_callback_del(ug_data->bcc_ly, EVAS_CALLBACK_RESIZE, _recipient_resize_cb);
+       EmailViewerView *view = (EmailViewerView *)data;
+
+       if (view->to_ly)
+               evas_object_event_callback_del(view->to_ly, EVAS_CALLBACK_RESIZE, _recipient_resize_cb);
+       if (view->cc_ly)
+               evas_object_event_callback_del(view->cc_ly, EVAS_CALLBACK_RESIZE, _recipient_resize_cb);
+       if (view->bcc_ly)
+               evas_object_event_callback_del(view->bcc_ly, EVAS_CALLBACK_RESIZE, _recipient_resize_cb);
 }
index 42c3dae..7479086 100644 (file)
@@ -19,9 +19,9 @@
 #include "email-viewer-scroller.h"
 #include "email-viewer-util.h"
 
-static void _viewer_set_horizontal_scroller_view_sizes(EmailViewerUGD *ug_data);
-static void _viewer_set_vertical_scroller_view_sizes(EmailViewerUGD *ug_data);
-static void _viewer_adjust_header_scroll_pos(EmailViewerUGD *ug_data);
+static void _viewer_set_horizontal_scroller_view_sizes(EmailViewerView *view);
+static void _viewer_set_vertical_scroller_view_sizes(EmailViewerView *view);
+static void _viewer_adjust_header_scroll_pos(EmailViewerView *view);
 static void _viewer_scroll_down_cb(void *data, Evas_Object *obj, void *event_info);
 static void _viewer_scroll_up_cb(void *data, Evas_Object *obj, void *event_info);
 static void viewer_scroll_left_cb(void *data, Evas_Object *obj, void *event_info);
@@ -30,42 +30,42 @@ static void _viewer_main_scroller_scroll(void *data, Eina_Bool is_up);
 static void _viewer_main_scroller_scroll_up_cb(void *data, Evas_Object *obj, void *event_info);
 static void _viewer_main_scroller_scroll_down_cb(void *data, Evas_Object *obj, void *event_info);
 static Evas_Object *_viewer_create_combined_scroller_layout(Evas_Object *parent);
-static void _set_horizontal_scroller_position(EmailViewerUGD *ug_data);
+static void _set_horizontal_scroller_position(EmailViewerView *view);
 
 
 static int g_lock = 0;
-static void _viewer_set_horizontal_scroller_view_sizes(EmailViewerUGD *ug_data)
+static void _viewer_set_horizontal_scroller_view_sizes(EmailViewerView *view)
 {
        debug_enter_scroller();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
-       retm_if(ug_data->webview == NULL, "ug_data->webview is NULL.");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
+       retm_if(view->webview == NULL, "view->webview is NULL.");
 
        int scroll_pos_x = 0;
 
-       ewk_view_scroll_pos_get(ug_data->webview, &scroll_pos_x, NULL);
-       ug_data->webkit_scroll_x = scroll_pos_x;
+       ewk_view_scroll_pos_get(view->webview, &scroll_pos_x, NULL);
+       view->webkit_scroll_x = scroll_pos_x;
 
        int webkit_w = 0;
-       double scale = ewk_view_scale_get(ug_data->webview);
-       ewk_view_contents_size_get(ug_data->webview, &webkit_w, NULL);
+       double scale = ewk_view_scale_get(view->webview);
+       ewk_view_contents_size_get(view->webview, &webkit_w, NULL);
 
        double width = (double)webkit_w * scale;
-       ug_data->total_width = (int)width;
+       view->total_width = (int)width;
 
        int y = 0, h = 0, w = 0;
-       elm_scroller_region_get(ug_data->scroller, NULL, &y, &w, &h);
-       ug_data->main_scroll_y = y;
-       ug_data->main_scroll_h = h;
-       ug_data->main_scroll_w = w;
+       elm_scroller_region_get(view->scroller, NULL, &y, &w, &h);
+       view->main_scroll_y = y;
+       view->main_scroll_h = h;
+       view->main_scroll_w = w;
 
        debug_leave_scroller();
 }
 
-static void _viewer_set_vertical_scroller_view_sizes(EmailViewerUGD *ug_data)
+static void _viewer_set_vertical_scroller_view_sizes(EmailViewerView *view)
 {
        debug_enter_scroller();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
-       retm_if(ug_data->webview == NULL, "ug_data->webview is NULL.");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
+       retm_if(view->webview == NULL, "view->webview is NULL.");
 
        int scroll_pos_y = 0;
        int subject_y = 0;
@@ -74,93 +74,93 @@ static void _viewer_set_vertical_scroller_view_sizes(EmailViewerUGD *ug_data)
        int navi_h = 0;
        int navi_y = 0;
 
-       ewk_view_scroll_pos_get(ug_data->webview, NULL, &scroll_pos_y);
-       ug_data->webkit_scroll_y = scroll_pos_y;
+       ewk_view_scroll_pos_get(view->webview, NULL, &scroll_pos_y);
+       view->webkit_scroll_y = scroll_pos_y;
 
-       evas_object_geometry_get(ug_data->subject_ly, NULL, &subject_y, NULL, NULL);
-       evas_object_geometry_get(ug_data->webview_ly, NULL, &w_y, NULL, &w_h);
-       evas_object_geometry_get(ug_data->base.module->navi, NULL, &navi_y, NULL, &navi_h);
+       evas_object_geometry_get(view->subject_ly, NULL, &subject_y, NULL, NULL);
+       evas_object_geometry_get(view->webview_ly, NULL, &w_y, NULL, &w_h);
+       evas_object_geometry_get(view->base.module->navi, NULL, &navi_y, NULL, &navi_h);
 
        int webkit_h = 0;
-       double scale = ewk_view_scale_get(ug_data->webview);
-       ewk_view_contents_size_get(ug_data->webview, NULL, &webkit_h);
+       double scale = ewk_view_scale_get(view->webview);
+       ewk_view_contents_size_get(view->webview, NULL, &webkit_h);
 
        double height = (double)webkit_h * scale;
        int h_info = w_y;                       /*height of part above webkit*/
-       ug_data->trailer_height = (navi_y + navi_h) - (w_y + w_h);
-       ug_data->total_height = (int)height + h_info;
-       ug_data->header_height = w_y;
+       view->trailer_height = (navi_y + navi_h) - (w_y + w_h);
+       view->total_height = (int)height + h_info;
+       view->header_height = w_y;
 
        debug_leave_scroller();
 }
 
-static void _set_horizontal_scroller_position(EmailViewerUGD *ug_data)
+static void _set_horizontal_scroller_position(EmailViewerView *view)
 {
        debug_enter_scroller();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
        double pos_h = 0.0;
-       _viewer_set_horizontal_scroller_view_sizes(ug_data);
+       _viewer_set_horizontal_scroller_view_sizes(view);
 
-       pos_h = ((double)ug_data->webkit_scroll_x) / ((double)ug_data->total_width - (double)ug_data->main_scroll_w);
+       pos_h = ((double)view->webkit_scroll_x) / ((double)view->total_width - (double)view->main_scroll_w);
 
-       edje_object_part_drag_value_set(_EDJ(ug_data->combined_scroller), "elm.dragable.hbar", pos_h, 0.0);
+       edje_object_part_drag_value_set(_EDJ(view->combined_scroller), "elm.dragable.hbar", pos_h, 0.0);
 
        debug_leave_scroller();
 }
 
-void viewer_set_vertical_scroller_position(EmailViewerUGD *ug_data)
+void viewer_set_vertical_scroller_position(EmailViewerView *view)
 {
        debug_enter_scroller();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
        double pos_v = 0.0;
-       _viewer_adjust_header_scroll_pos(ug_data);
-       _viewer_set_vertical_scroller_view_sizes(ug_data);
+       _viewer_adjust_header_scroll_pos(view);
+       _viewer_set_vertical_scroller_view_sizes(view);
 
-       pos_v = ((double)ug_data->webkit_scroll_y + (double)ug_data->main_scroll_y) / ((double)ug_data->total_height - (double)ug_data->main_scroll_h);
-       debug_log_scroller("ug_data->main_scroll_y:%d ug_data->main_scroll_h:%d", ug_data->main_scroll_y, ug_data->main_scroll_h);
-       edje_object_part_drag_value_set(_EDJ(ug_data->combined_scroller), "elm.dragable.vbar", 0.0, pos_v);
+       pos_v = ((double)view->webkit_scroll_y + (double)view->main_scroll_y) / ((double)view->total_height - (double)view->main_scroll_h);
+       debug_log_scroller("view->main_scroll_y:%d view->main_scroll_h:%d", view->main_scroll_y, view->main_scroll_h);
+       edje_object_part_drag_value_set(_EDJ(view->combined_scroller), "elm.dragable.vbar", 0.0, pos_v);
 
        debug_leave_scroller();
 }
 
-void viewer_set_horizontal_scroller_size(EmailViewerUGD *ug_data)
+void viewer_set_horizontal_scroller_size(EmailViewerView *view)
 {
        debug_enter_scroller();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
        double size = 0.0;
-       size = (double)ug_data->main_scroll_w / ug_data->total_width;
+       size = (double)view->main_scroll_w / view->total_width;
 
-       edje_object_part_drag_size_set(_EDJ(ug_data->combined_scroller), "elm.dragable.hbar", size, 1.0);
+       edje_object_part_drag_size_set(_EDJ(view->combined_scroller), "elm.dragable.hbar", size, 1.0);
 
        debug_leave_scroller();
 }
 
-void viewer_set_vertical_scroller_size(EmailViewerUGD *ug_data)
+void viewer_set_vertical_scroller_size(EmailViewerView *view)
 {
        debug_enter_scroller();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       double size = (double)ug_data->main_scroll_h / ug_data->total_height;
-       edje_object_part_drag_size_set(_EDJ(ug_data->combined_scroller), "elm.dragable.vbar", 1.0, size);
+       double size = (double)view->main_scroll_h / view->total_height;
+       edje_object_part_drag_size_set(_EDJ(view->combined_scroller), "elm.dragable.vbar", 1.0, size);
 
        debug_leave_scroller();
 }
 
-static void _viewer_adjust_header_scroll_pos(EmailViewerUGD *ug_data)
+static void _viewer_adjust_header_scroll_pos(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(!ug_data, "Invalid parameter: ug_data is NULL!");
+       retm_if(!view, "Invalid parameter: view is NULL!");
 
-       if (ug_data->webkit_scroll_y) {
+       if (view->webkit_scroll_y) {
                Evas_Coord ms_x, ms_y, ms_w, ms_h, web_y;
-               elm_scroller_region_get(ug_data->scroller, &ms_x, &ms_y, &ms_w, &ms_h);
-               evas_object_geometry_get(ug_data->webview, NULL, &web_y, NULL, NULL);
+               elm_scroller_region_get(view->scroller, &ms_x, &ms_y, &ms_w, &ms_h);
+               evas_object_geometry_get(view->webview, NULL, &web_y, NULL, NULL);
 
                Evas_Coord bottom_coord = ms_y + web_y;
-               elm_scroller_region_show(ug_data->scroller, ms_x, bottom_coord, ms_w, ms_h);
+               elm_scroller_region_show(view->scroller, ms_x, bottom_coord, ms_w, ms_h);
        }
 }
 
@@ -168,15 +168,15 @@ static void _viewer_scroll_down_cb(void *data, Evas_Object *obj, void *event_inf
 {
 
        debug_enter_scroller();
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       ug_data->is_scrolling_down = EINA_TRUE;
-       ug_data->is_scrolling_up = EINA_FALSE;
+       view->is_scrolling_down = EINA_TRUE;
+       view->is_scrolling_up = EINA_FALSE;
 
-       viewer_set_vertical_scroller_position(ug_data);
-       viewer_set_vertical_scroller_size(ug_data);
+       viewer_set_vertical_scroller_position(view);
+       viewer_set_vertical_scroller_size(view);
 
-       edje_object_signal_emit(_EDJ(ug_data->combined_scroller), "elm,action,scroll_v", "elm");
+       edje_object_signal_emit(_EDJ(view->combined_scroller), "elm,action,scroll_v", "elm");
 
        debug_leave_scroller();
 }
@@ -185,15 +185,15 @@ static void _viewer_scroll_up_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_enter_scroller();
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       ug_data->is_scrolling_up = EINA_TRUE;
-       ug_data->is_scrolling_down = EINA_FALSE;
+       view->is_scrolling_up = EINA_TRUE;
+       view->is_scrolling_down = EINA_FALSE;
 
-       viewer_set_vertical_scroller_position(ug_data);
-       viewer_set_vertical_scroller_size(ug_data);
+       viewer_set_vertical_scroller_position(view);
+       viewer_set_vertical_scroller_size(view);
 
-       edje_object_signal_emit(_EDJ(ug_data->combined_scroller), "elm,action,scroll_v", "elm");
+       edje_object_signal_emit(_EDJ(view->combined_scroller), "elm,action,scroll_v", "elm");
 
        debug_leave_scroller();
 }
@@ -202,12 +202,12 @@ static void viewer_scroll_left_cb(void *data, Evas_Object *obj, void *event_info
 {
        debug_enter_scroller();
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       _set_horizontal_scroller_position(ug_data);
-       viewer_set_horizontal_scroller_size(ug_data);
+       _set_horizontal_scroller_position(view);
+       viewer_set_horizontal_scroller_size(view);
 
-       edje_object_signal_emit(_EDJ(ug_data->combined_scroller), "elm,action,scroll_h", "elm");
+       edje_object_signal_emit(_EDJ(view->combined_scroller), "elm,action,scroll_h", "elm");
 
        debug_leave_scroller();
 }
@@ -216,12 +216,12 @@ static void _viewer_scroll_right_cb(void *data, Evas_Object *obj, void *event_in
 {
        debug_enter_scroller();
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       _set_horizontal_scroller_position(ug_data);
-       viewer_set_horizontal_scroller_size(ug_data);
+       _set_horizontal_scroller_position(view);
+       viewer_set_horizontal_scroller_size(view);
 
-       edje_object_signal_emit(_EDJ(ug_data->combined_scroller), "elm,action,scroll_h", "elm");
+       edje_object_signal_emit(_EDJ(view->combined_scroller), "elm,action,scroll_h", "elm");
 
        debug_leave_scroller();
 }
@@ -230,22 +230,22 @@ static void _viewer_main_scroller_scroll(void *data, Eina_Bool is_up)
 {
        debug_enter_scroller();
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       _viewer_set_vertical_scroller_view_sizes(ug_data);
+       _viewer_set_vertical_scroller_view_sizes(view);
 
        int x = 0, y = 0, h = 0, w = 0;
-       elm_scroller_region_get(ug_data->scroller, &x, &y, &w, &h);
-       ug_data->main_scroll_y = y;
-       ug_data->main_scroll_h = h;
-       ug_data->main_scroll_w = w;
-       edje_object_signal_emit(_EDJ(ug_data->combined_scroller), "elm,action,scroll_v", "elm");
+       elm_scroller_region_get(view->scroller, &x, &y, &w, &h);
+       view->main_scroll_y = y;
+       view->main_scroll_h = h;
+       view->main_scroll_w = w;
+       edje_object_signal_emit(_EDJ(view->combined_scroller), "elm,action,scroll_v", "elm");
 
-       double pos = ((double)ug_data->webkit_scroll_y + (double)ug_data->main_scroll_y) / ((double)ug_data->total_height - (double)ug_data->main_scroll_h);
+       double pos = ((double)view->webkit_scroll_y + (double)view->main_scroll_y) / ((double)view->total_height - (double)view->main_scroll_h);
 
-       edje_object_part_drag_value_set(_EDJ(ug_data->combined_scroller), "elm.dragable.vbar", 0.0, pos);
+       edje_object_part_drag_value_set(_EDJ(view->combined_scroller), "elm.dragable.vbar", 0.0, pos);
        debug_log_scroller("pos: %f", pos);
-       viewer_set_vertical_scroller_size(ug_data);
+       viewer_set_vertical_scroller_size(view);
 
        debug_leave_scroller();
 }
@@ -254,16 +254,16 @@ static void _viewer_main_scroller_scroll_up_cb(void *data, Evas_Object *obj, voi
 {
        debug_enter_scroller();
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        retm_if(g_lock == 1, "this function is already running");
        g_lock = 1;     /*lock this function*/
 
-       ug_data->is_bottom_webview_reached = EINA_FALSE;
-       ug_data->is_scrolling_up = EINA_TRUE;
-       ug_data->is_scrolling_down = EINA_FALSE;
+       view->is_bottom_webview_reached = EINA_FALSE;
+       view->is_scrolling_up = EINA_TRUE;
+       view->is_scrolling_down = EINA_FALSE;
 
-       _viewer_main_scroller_scroll(ug_data, EINA_TRUE);
+       _viewer_main_scroller_scroll(view, EINA_TRUE);
 
        g_lock = 0;     /*unlock this function*/
 
@@ -274,16 +274,16 @@ static void _viewer_main_scroller_scroll_down_cb(void *data, Evas_Object *obj, v
 {
        debug_enter_scroller();
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        retm_if(g_lock == 1, "this function is already running");
        g_lock = 1;     /*lock this function*/
 
-       ug_data->is_top_webview_reached = EINA_FALSE;
-       ug_data->is_scrolling_down = EINA_TRUE;
-       ug_data->is_scrolling_up = EINA_FALSE;
+       view->is_top_webview_reached = EINA_FALSE;
+       view->is_scrolling_down = EINA_TRUE;
+       view->is_scrolling_up = EINA_FALSE;
 
-       _viewer_main_scroller_scroll(ug_data, EINA_FALSE);
+       _viewer_main_scroller_scroll(view, EINA_FALSE);
 
        g_lock = 0;     /*unlock this function*/
 
@@ -309,28 +309,28 @@ void viewer_stop_elm_scroller_start_webkit_scroller(void *data)
        debug_enter_scroller();
 
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        int h = 0;
-       int res = email_engine_check_body_download(ug_data->mail_id);
+       int res = email_engine_check_body_download(view->mail_id);
 
-       debug_log_scroller("recipient idler present: %d", (ug_data->to_recipient_idler || ug_data->cc_recipient_idler));
+       debug_log_scroller("recipient idler present: %d", (view->to_recipient_idler || view->cc_recipient_idler));
 
        debug_log_scroller("is_main_scroller_scrolling: %d, to_recipient_idler: %d, cc_recipient_idler: %d",
-                       ug_data->is_main_scroller_scrolling, ug_data->to_recipient_idler, ug_data->cc_recipient_idler);
+                       view->is_main_scroller_scrolling, view->to_recipient_idler, view->cc_recipient_idler);
 
-       if ((ug_data->is_main_scroller_scrolling) &&
-                       ((((res != 0) || (ug_data->viewer_type == EML_VIEWER))) &&
-                               !(ug_data->to_recipient_idler || ug_data->cc_recipient_idler || ug_data->bcc_recipient_idler))) {
-               ewk_view_scroll_size_get(ug_data->webview, NULL, &h);
+       if ((view->is_main_scroller_scrolling) &&
+                       ((((res != 0) || (view->viewer_type == EML_VIEWER))) &&
+                               !(view->to_recipient_idler || view->cc_recipient_idler || view->bcc_recipient_idler))) {
+               ewk_view_scroll_size_get(view->webview, NULL, &h);
                if (h > 0) {
                        debug_log_scroller("Main scroller hold push");
-                       if (!elm_object_scroll_freeze_get(ug_data->scroller)) {
-                               elm_object_scroll_freeze_push(ug_data->scroller); /* stop */
+                       if (!elm_object_scroll_freeze_get(view->scroller)) {
+                               elm_object_scroll_freeze_push(view->scroller); /* stop */
                        }
-                       ewk_view_vertical_panning_hold_set(ug_data->webview, EINA_FALSE); /* restart */
-                       ug_data->is_main_scroller_scrolling = EINA_FALSE;
-                       ug_data->is_webview_scrolling = EINA_TRUE;
+                       ewk_view_vertical_panning_hold_set(view->webview, EINA_FALSE); /* restart */
+                       view->is_main_scroller_scrolling = EINA_FALSE;
+                       view->is_webview_scrolling = EINA_TRUE;
                }
        }
 
@@ -342,23 +342,23 @@ void viewer_stop_webkit_scroller_start_elm_scroller(void *data)
        debug_enter_scroller();
 
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       retm_if(ug_data->webview == NULL, "webview is NULL");
+       EmailViewerView *view = (EmailViewerView *)data;
+       retm_if(view->webview == NULL, "webview is NULL");
 
-       if (ug_data->is_webview_scrolling) {
+       if (view->is_webview_scrolling) {
                debug_log_scroller("main scroller start");
-               ewk_view_vertical_panning_hold_set(ug_data->webview, EINA_TRUE); /* stop */
+               ewk_view_vertical_panning_hold_set(view->webview, EINA_TRUE); /* stop */
 
-               if (elm_object_scroll_freeze_get(ug_data->scroller) > 0)
-                       elm_object_scroll_freeze_pop(ug_data->scroller); /* restart */
+               if (elm_object_scroll_freeze_get(view->scroller) > 0)
+                       elm_object_scroll_freeze_pop(view->scroller); /* restart */
 
                int x = 0, y = 0, w = 0, h = 0;
-               elm_scroller_region_get(ug_data->scroller, &x, &y, &w, &h);
+               elm_scroller_region_get(view->scroller, &x, &y, &w, &h);
                debug_log_scroller("main_scroller(x:%d, y:%d, w:%d, h:%d)", x, y, w, h);
 
-               elm_scroller_region_bring_in(ug_data->scroller, x, 0, w, h);
-               ug_data->is_main_scroller_scrolling = EINA_TRUE;
-               ug_data->is_webview_scrolling = EINA_FALSE;
+               elm_scroller_region_bring_in(view->scroller, x, 0, w, h);
+               view->is_main_scroller_scrolling = EINA_TRUE;
+               view->is_webview_scrolling = EINA_FALSE;
        }
 
        debug_leave_scroller();
@@ -369,26 +369,26 @@ void viewer_create_combined_scroller(void *data)
        debug_enter_scroller();
 
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->combined_scroller);
-       Evas_Object *combined_sc_ly = _viewer_create_combined_scroller_layout(ug_data->base.content);
-       elm_object_part_content_set(ug_data->base.content, "ev.swallow.scroller", combined_sc_ly);
-       ug_data->combined_scroller = combined_sc_ly;
+       DELETE_EVAS_OBJECT(view->combined_scroller);
+       Evas_Object *combined_sc_ly = _viewer_create_combined_scroller_layout(view->base.content);
+       elm_object_part_content_set(view->base.content, "ev.swallow.scroller", combined_sc_ly);
+       view->combined_scroller = combined_sc_ly;
 
        /*set scroller size*/
-       _viewer_set_vertical_scroller_view_sizes(ug_data);
-       _viewer_set_horizontal_scroller_view_sizes(ug_data);
-       viewer_set_vertical_scroller_size(ug_data);
-       viewer_set_horizontal_scroller_size(ug_data);
+       _viewer_set_vertical_scroller_view_sizes(view);
+       _viewer_set_horizontal_scroller_view_sizes(view);
+       viewer_set_vertical_scroller_size(view);
+       viewer_set_horizontal_scroller_size(view);
 
        /*set callbacks for scroll*/
-       evas_object_smart_callback_add(ug_data->scroller, "scroll,up", _viewer_main_scroller_scroll_up_cb, ug_data);
-       evas_object_smart_callback_add(ug_data->scroller, "scroll,down", _viewer_main_scroller_scroll_down_cb, ug_data);
-       evas_object_smart_callback_add(ug_data->webview, "scroll,up", _viewer_scroll_up_cb, ug_data);
-       evas_object_smart_callback_add(ug_data->webview, "scroll,down", _viewer_scroll_down_cb, ug_data);
-       evas_object_smart_callback_add(ug_data->webview, "scroll,left", viewer_scroll_left_cb, ug_data);
-       evas_object_smart_callback_add(ug_data->webview, "scroll,right", _viewer_scroll_right_cb, ug_data);
+       evas_object_smart_callback_add(view->scroller, "scroll,up", _viewer_main_scroller_scroll_up_cb, view);
+       evas_object_smart_callback_add(view->scroller, "scroll,down", _viewer_main_scroller_scroll_down_cb, view);
+       evas_object_smart_callback_add(view->webview, "scroll,up", _viewer_scroll_up_cb, view);
+       evas_object_smart_callback_add(view->webview, "scroll,down", _viewer_scroll_down_cb, view);
+       evas_object_smart_callback_add(view->webview, "scroll,left", viewer_scroll_left_cb, view);
+       evas_object_smart_callback_add(view->webview, "scroll,right", _viewer_scroll_right_cb, view);
 
        debug_leave_scroller();
        return;
index 17703a9..7a28d17 100644 (file)
@@ -97,8 +97,8 @@ static void _popup_response_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       EmailViewerView *view = (EmailViewerView *)data;
+       DELETE_EVAS_OBJECT(view->notify);
        debug_leave();
 }
 
@@ -154,23 +154,23 @@ static void _popup_content_remove(Evas_Object *popup)
 
 }
 
-Evas_Object *util_create_notify_with_list(EmailViewerUGD *ug_data, email_string_t t_header, email_string_t t_content,
+Evas_Object *util_create_notify_with_list(EmailViewerView *view, email_string_t t_header, email_string_t t_content,
                                                int btn_num, email_string_t t_btn1_lb, popup_cb resp_cb1,
                                                email_string_t t_btn2_lb, popup_cb resp_cb2, popup_cb resp_block_cb)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, NULL, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, NULL, "Invalid parameter: view[NULL]");
 
        Evas_Object *notify = NULL;
 
-       if (ug_data->notify) {
-               _popup_content_remove(ug_data->notify);
-               notify = ug_data->notify;
+       if (view->notify) {
+               _popup_content_remove(view->notify);
+               notify = view->notify;
        } else {
-               notify = elm_popup_add(ug_data->base.module->win);
+               notify = elm_popup_add(view->base.module->win);
                elm_popup_align_set(notify, ELM_NOTIFY_ALIGN_FILL, 1.0);
                retvm_if(notify == NULL, NULL, "elm_popup_add returns NULL.");
-               debug_log("notify: %p, win_main: %p", notify, ug_data->base.module->win);
+               debug_log("notify: %p, win_main: %p", notify, view->base.module->win);
        }
 
        if (t_header.id) {
@@ -191,10 +191,10 @@ Evas_Object *util_create_notify_with_list(EmailViewerUGD *ug_data, email_string_
 
        if (btn_num == 0 && resp_block_cb) {
                elm_popup_timeout_set(notify, 2.0);
-               evas_object_smart_callback_add(notify, "timeout", resp_block_cb, ug_data);
-               evas_object_smart_callback_add(notify, "block,clicked", resp_block_cb, ug_data);
+               evas_object_smart_callback_add(notify, "timeout", resp_block_cb, view);
+               evas_object_smart_callback_add(notify, "block,clicked", resp_block_cb, view);
                evas_object_data_set(notify, LIST_POPUP_BLOCK_CLICKED_CB, (void *)resp_block_cb);
-               eext_object_event_callback_add(notify, EEXT_CALLBACK_BACK, resp_block_cb, ug_data);
+               eext_object_event_callback_add(notify, EEXT_CALLBACK_BACK, resp_block_cb, view);
                evas_object_data_set(notify, LIST_POPUP_BACK_CB, (void *)resp_block_cb);
        }
 
@@ -210,13 +210,13 @@ Evas_Object *util_create_notify_with_list(EmailViewerUGD *ug_data, email_string_
                                }
                        }
                        elm_object_part_content_set(notify, "button1", btn1);
-                       evas_object_smart_callback_add(btn1, "clicked", resp_cb1, ug_data);
+                       evas_object_smart_callback_add(btn1, "clicked", resp_cb1, view);
                        evas_object_data_set(notify, LIST_POPUP_BUTTON1_CB, (void *)resp_cb1);
                } else {
-                       evas_object_smart_callback_add(notify, "block,clicked", resp_cb1, ug_data);
+                       evas_object_smart_callback_add(notify, "block,clicked", resp_cb1, view);
                        evas_object_data_set(notify, LIST_POPUP_BLOCK_CLICKED_CB, (void *)resp_cb1);
                }
-               eext_object_event_callback_add(notify, EEXT_CALLBACK_BACK, resp_cb1, ug_data);
+               eext_object_event_callback_add(notify, EEXT_CALLBACK_BACK, resp_cb1, view);
                evas_object_data_set(notify, LIST_POPUP_BACK_CB, (void *)resp_cb1);
        }
        if (btn_num == 2) {
@@ -230,9 +230,9 @@ Evas_Object *util_create_notify_with_list(EmailViewerUGD *ug_data, email_string_
                        }
                }
                elm_object_part_content_set(notify, "button1", btn1);
-               evas_object_smart_callback_add(btn1, "clicked", resp_cb1, ug_data);
+               evas_object_smart_callback_add(btn1, "clicked", resp_cb1, view);
                evas_object_data_set(notify, LIST_POPUP_BUTTON1_CB, (void *)resp_cb1);
-               eext_object_event_callback_add(notify, EEXT_CALLBACK_BACK, resp_cb1, ug_data);
+               eext_object_event_callback_add(notify, EEXT_CALLBACK_BACK, resp_cb1, view);
                evas_object_data_set(notify, LIST_POPUP_BACK_CB, (void *)resp_cb1);
 
                Evas_Object *btn2 = elm_button_add(notify);
@@ -245,33 +245,33 @@ Evas_Object *util_create_notify_with_list(EmailViewerUGD *ug_data, email_string_
                        }
                }
                elm_object_part_content_set(notify, "button2", btn2);
-               evas_object_smart_callback_add(btn2, "clicked", resp_cb2, ug_data);
+               evas_object_smart_callback_add(btn2, "clicked", resp_cb2, view);
                evas_object_data_set(notify, LIST_POPUP_BUTTON2_CB, (void *)resp_cb2);
        }
 
-       evas_object_event_callback_add(notify, EVAS_CALLBACK_MOUSE_UP, _mouseup_cb, ug_data);
+       evas_object_event_callback_add(notify, EVAS_CALLBACK_MOUSE_UP, _mouseup_cb, view);
        evas_object_show(notify);
 
        debug_leave();
        return notify;
 }
 
-void util_create_notify(EmailViewerUGD *ug_data, email_string_t t_header, email_string_t t_content,
+void util_create_notify(EmailViewerView *view, email_string_t t_header, email_string_t t_content,
                                                int btn_num, email_string_t t_btn1_lb, popup_cb resp_cb1,
                                                email_string_t t_btn2_lb, popup_cb resp_cb2, popup_cb resp_block_cb)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
-       retm_if(ug_data->base.module->win == NULL, "Invalid parameter: ug_data->base.module->win[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
+       retm_if(view->base.module->win == NULL, "Invalid parameter: view->base.module->win[NULL]");
        Evas_Object *notify = NULL;
 
-       DELETE_EVAS_OBJECT(ug_data->notify);
-       notify = elm_popup_add(ug_data->base.module->win);
+       DELETE_EVAS_OBJECT(view->notify);
+       notify = elm_popup_add(view->base.module->win);
        elm_popup_align_set(notify, ELM_NOTIFY_ALIGN_FILL, 1.0);
        retm_if(notify == NULL, "elm_popup_add returns NULL.");
-       debug_log("notify: %p, win_main: %p", notify, ug_data->base.module->win);
+       debug_log("notify: %p, win_main: %p", notify, view->base.module->win);
        evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       ug_data->notify = notify;
+       view->notify = notify;
 
        if (t_header.id) {
                if (t_header.domain) {
@@ -291,9 +291,9 @@ void util_create_notify(EmailViewerUGD *ug_data, email_string_t t_header, email_
 
        if (btn_num == 0 && resp_block_cb) {
                elm_popup_timeout_set(notify, 2.0);
-               evas_object_smart_callback_add(notify, "timeout", resp_block_cb, ug_data);
-               evas_object_smart_callback_add(notify, "block,clicked", resp_block_cb, ug_data);
-               eext_object_event_callback_add(notify, EEXT_CALLBACK_BACK, resp_block_cb, ug_data);
+               evas_object_smart_callback_add(notify, "timeout", resp_block_cb, view);
+               evas_object_smart_callback_add(notify, "block,clicked", resp_block_cb, view);
+               eext_object_event_callback_add(notify, EEXT_CALLBACK_BACK, resp_block_cb, view);
        }
 
        if (btn_num == 1) {
@@ -307,8 +307,8 @@ void util_create_notify(EmailViewerUGD *ug_data, email_string_t t_header, email_
                        }
                }
                elm_object_part_content_set(notify, "button1", btn1);
-               evas_object_smart_callback_add(btn1, "clicked", resp_cb1, ug_data);
-               eext_object_event_callback_add(notify, EEXT_CALLBACK_BACK, resp_cb1, ug_data);
+               evas_object_smart_callback_add(btn1, "clicked", resp_cb1, view);
+               eext_object_event_callback_add(notify, EEXT_CALLBACK_BACK, resp_cb1, view);
        } else if (btn_num == 2) {
                Evas_Object *btn1 = elm_button_add(notify);
                elm_object_style_set(btn1, "popup");
@@ -320,8 +320,8 @@ void util_create_notify(EmailViewerUGD *ug_data, email_string_t t_header, email_
                        }
                }
                elm_object_part_content_set(notify, "button1", btn1);
-               evas_object_smart_callback_add(btn1, "clicked", resp_cb1, ug_data);
-               eext_object_event_callback_add(notify, EEXT_CALLBACK_BACK, resp_cb1, ug_data);
+               evas_object_smart_callback_add(btn1, "clicked", resp_cb1, view);
+               eext_object_event_callback_add(notify, EEXT_CALLBACK_BACK, resp_cb1, view);
 
                Evas_Object *btn2 = elm_button_add(notify);
                elm_object_style_set(btn2, "popup");
@@ -333,26 +333,26 @@ void util_create_notify(EmailViewerUGD *ug_data, email_string_t t_header, email_
                        }
                }
                elm_object_part_content_set(notify, "button2", btn2);
-               evas_object_smart_callback_add(btn2, "clicked", resp_cb2, ug_data);
+               evas_object_smart_callback_add(btn2, "clicked", resp_cb2, view);
        }
 
-       evas_object_event_callback_add(notify, EVAS_CALLBACK_MOUSE_UP, _mouseup_cb, ug_data);
+       evas_object_event_callback_add(notify, EVAS_CALLBACK_MOUSE_UP, _mouseup_cb, view);
 
        evas_object_show(notify);
        debug_leave();
 }
 
-int _find_folder_id_using_folder_type(EmailViewerUGD *ug_data, email_mailbox_type_e mailbox_type)
+int _find_folder_id_using_folder_type(EmailViewerView *view, email_mailbox_type_e mailbox_type)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, -1, "Invalid parameter: ug_data[NULL]");
-       retvm_if(ug_data->folder_list == NULL, -1, "Invalid parameter: ug_data->folder_list[NULL]");
+       retvm_if(view == NULL, -1, "Invalid parameter: view[NULL]");
+       retvm_if(view->folder_list == NULL, -1, "Invalid parameter: view->folder_list[NULL]");
 
        int i = 0;
        debug_log("mailbox_type:%d", mailbox_type);
 
-       LIST_ITER_START(i, ug_data->folder_list) {
-               email_mailbox_name_and_alias_t *nameandalias = (email_mailbox_name_and_alias_t *) LIST_ITER_GET_DATA(i, ug_data->folder_list);
+       LIST_ITER_START(i, view->folder_list) {
+               email_mailbox_name_and_alias_t *nameandalias = (email_mailbox_name_and_alias_t *) LIST_ITER_GET_DATA(i, view->folder_list);
                int folder_id = nameandalias->mailbox_id;
                if (mailbox_type == nameandalias->mailbox_type) {
                        debug_secure("folder_id: %d, name: %s, alias: %s", folder_id, nameandalias->name, nameandalias->alias);
@@ -363,17 +363,17 @@ int _find_folder_id_using_folder_type(EmailViewerUGD *ug_data, email_mailbox_typ
        return -1;
 }
 
-int _find_folder_type_using_folder_id(EmailViewerUGD *ug_data, int mailbox_id)
+int _find_folder_type_using_folder_id(EmailViewerView *view, int mailbox_id)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, -1, "Invalid parameter: ug_data[NULL]");
-       retvm_if(ug_data->folder_list == NULL, -1, "Invalid parameter: ug_data->folder_list[NULL]");
+       retvm_if(view == NULL, -1, "Invalid parameter: view[NULL]");
+       retvm_if(view->folder_list == NULL, -1, "Invalid parameter: view->folder_list[NULL]");
 
        int i = 0;
        debug_log("mailbox_id:%d", mailbox_id);
 
-       LIST_ITER_START(i, ug_data->folder_list) {
-               email_mailbox_name_and_alias_t *nameandalias = (email_mailbox_name_and_alias_t *) LIST_ITER_GET_DATA(i, ug_data->folder_list);
+       LIST_ITER_START(i, view->folder_list) {
+               email_mailbox_name_and_alias_t *nameandalias = (email_mailbox_name_and_alias_t *) LIST_ITER_GET_DATA(i, view->folder_list);
                int folder_type = nameandalias->mailbox_type;
                if (mailbox_id == nameandalias->mailbox_id) {
                        debug_secure("folder_type: %d, name: %s, alias: %s", folder_type, nameandalias->name, nameandalias->alias);
@@ -384,40 +384,40 @@ int _find_folder_type_using_folder_id(EmailViewerUGD *ug_data, int mailbox_id)
        return -1;
 }
 
-int viewer_move_email(EmailViewerUGD *ug_data, int dest_folder_id, gboolean is_delete, gboolean is_block)
+int viewer_move_email(EmailViewerView *view, int dest_folder_id, gboolean is_delete, gboolean is_block)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, 0, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, 0, "Invalid parameter: view[NULL]");
 
-       if (!email_engine_move_mail(ug_data->account_id, dest_folder_id, ug_data->mail_id)) {
+       if (!email_engine_move_mail(view->account_id, dest_folder_id, view->mail_id)) {
                debug_log("Moving email is failed.");
 
                if (is_delete)
-                       util_create_notify(ug_data, EMAIL_VIEWER_POP_ERROR,
+                       util_create_notify(view, EMAIL_VIEWER_POP_ERROR,
                                        EMAIL_VIEWER_POP_FAILED_TO_DELETE, 1,
                                        EMAIL_VIEWER_STRING_OK, _popup_response_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
                else
-                       util_create_notify(ug_data, EMAIL_VIEWER_POP_ERROR,
+                       util_create_notify(view, EMAIL_VIEWER_POP_ERROR,
                                        EMAIL_VIEWER_POP_FAILED_TO_MOVE, 1,
                                        EMAIL_VIEWER_STRING_OK, _popup_response_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
 
                return -1;
        } else {
-               debug_log("account_id: %d, moveto folder id: %d, mail_id: %d", ug_data->account_id, dest_folder_id, ug_data->mail_id);
+               debug_log("account_id: %d, moveto folder id: %d, mail_id: %d", view->account_id, dest_folder_id, view->mail_id);
                debug_leave();
                return 1;
        }
 }
 
-int viewer_delete_email(EmailViewerUGD *ug_data)
+int viewer_delete_email(EmailViewerView *view)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, 0, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, 0, "Invalid parameter: view[NULL]");
 
        int sync = EMAIL_DELETE_LOCAL_AND_SERVER;
-       if (ug_data->account_type == EMAIL_SERVER_TYPE_POP3) {
+       if (view->account_type == EMAIL_SERVER_TYPE_POP3) {
                email_account_t *account_data = NULL;
-               if (email_engine_get_account_full_data(ug_data->account_id, &account_data)) {
+               if (email_engine_get_account_full_data(view->account_id, &account_data)) {
                        debug_log("email_engine_get_account");
                        if (account_data) {
                                account_user_data_t *user_data = (account_user_data_t *)account_data->user_data;
@@ -438,15 +438,15 @@ int viewer_delete_email(EmailViewerUGD *ug_data)
                }
        }
 
-       if (!email_engine_delete_mail(ug_data->account_id, ug_data->mailbox_id, ug_data->mail_id, sync)) {
+       if (!email_engine_delete_mail(view->account_id, view->mailbox_id, view->mail_id, sync)) {
                debug_log("Deleting email is failed.");
-               util_create_notify(ug_data, EMAIL_VIEWER_POP_ERROR,
+               util_create_notify(view, EMAIL_VIEWER_POP_ERROR,
                                EMAIL_VIEWER_POP_FAILED_TO_DELETE, 1,
                                EMAIL_VIEWER_STRING_OK, _popup_response_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
                return 0;
        }
 
-       debug_log("account_id: %d, mailbox_id: %d, mail_id: %d", ug_data->account_id, ug_data->mailbox_id, ug_data->mail_id);
+       debug_log("account_id: %d, mailbox_id: %d, mail_id: %d", view->account_id, view->mailbox_id, view->mail_id);
        return 1;
 }
 
@@ -552,28 +552,28 @@ static void _module_destroy_request_cb(void *data, email_module_h module)
        retm_if(module == NULL, "Invalid parameter: module[NULL]");
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       viewer_show_webview(ug_data);
+       viewer_show_webview(view);
 
-       if (ug_data->base.content) {
-               elm_object_tree_focus_allow_set(ug_data->base.content, EINA_TRUE);
+       if (view->base.content) {
+               elm_object_tree_focus_allow_set(view->base.content, EINA_TRUE);
        }
 
-       debug_log("need_pending_destroy: %d", ug_data->need_pending_destroy);
+       debug_log("need_pending_destroy: %d", view->need_pending_destroy);
 
-       if (ug_data->need_pending_destroy) {
+       if (view->need_pending_destroy) {
                debug_log("email_module_make_destroy_request");
-               email_module_make_destroy_request(ug_data->base.module);
+               email_module_make_destroy_request(view->base.module);
        } else {
                email_module_destroy(module);
        }
 
-       ug_data->loaded_module = NULL;
+       view->loaded_module = NULL;
 
-       if (ug_data->is_composer_module_launched) {
+       if (view->is_composer_module_launched) {
                debug_log("composer module destroyed");
-               ug_data->is_composer_module_launched = FALSE;
+               view->is_composer_module_launched = FALSE;
        }
 
        debug_leave();
@@ -585,23 +585,23 @@ static void _scheduled_composer_destroy_request_cb(void *data, email_module_h mo
        retm_if(module == NULL, "Invalid parameter: module[NULL]");
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       viewer_show_webview(ug_data);
+       viewer_show_webview(view);
 
-       if (ug_data->base.content) {
-               elm_object_tree_focus_allow_set(ug_data->base.content, EINA_TRUE);
+       if (view->base.content) {
+               elm_object_tree_focus_allow_set(view->base.content, EINA_TRUE);
        }
 
-       if (ug_data->need_pending_destroy || (ug_data->save_status == EMAIL_MAIL_STATUS_SEND_SCHEDULED)) {
+       if (view->need_pending_destroy || (view->save_status == EMAIL_MAIL_STATUS_SEND_SCHEDULED)) {
                debug_log("email_module_make_destroy_request");
-               email_module_make_destroy_request(ug_data->base.module);
+               email_module_make_destroy_request(view->base.module);
        } else {
                debug_log("email_module_destroy");
                email_module_destroy(module);
        }
 
-       ug_data->loaded_module = NULL;
+       view->loaded_module = NULL;
 
        debug_leave();
 }
@@ -612,22 +612,22 @@ static void _account_destroy_request_cb(void *data, email_module_h module)
        retm_if(module == NULL, "Invalid parameter: module[NULL]");
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       viewer_show_webview(ug_data);
+       viewer_show_webview(view);
 
-       if (ug_data->base.content) {
-               elm_object_tree_focus_allow_set(ug_data->base.content, EINA_TRUE);
+       if (view->base.content) {
+               elm_object_tree_focus_allow_set(view->base.content, EINA_TRUE);
        }
 
-       if (ug_data->move_status) {
+       if (view->move_status) {
                debug_log("email_module_make_destroy_request");
-               email_module_make_destroy_request(ug_data->base.module);
+               email_module_make_destroy_request(view->base.module);
        } else {
                email_module_destroy(module);
        }
 
-       ug_data->loaded_module = NULL;
+       view->loaded_module = NULL;
 
        debug_leave();
 }
@@ -638,12 +638,12 @@ static void _account_result_cb(void *data, email_module_h module, email_params_h
        retm_if(module == NULL, "Invalid parameter: module[NULL]");
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       int is_move_mail_ug = 0;
-       email_params_get_int_opt(result, EMAIL_BUNDLE_KEY_IS_MAILBOX_MOVE_MODE, &is_move_mail_ug);
+       int is_move_mail_mode = 0;
+       email_params_get_int_opt(result, EMAIL_BUNDLE_KEY_IS_MAILBOX_MOVE_MODE, &is_move_mail_mode);
 
-       if (is_move_mail_ug) {
+       if (is_move_mail_mode) {
                int move_status = 0;
                email_params_get_int_opt(result, EMAIL_BUNDLE_KEY_MAILBOX_MOVE_STATUS, &move_status);
 
@@ -657,11 +657,11 @@ static void _account_result_cb(void *data, email_module_h module, email_params_h
                        }
                        int ret = notification_status_message_post(str);
                        debug_warning_if(ret != NOTIFICATION_ERROR_NONE, "notification_status_message_post() failed! ret:(%d)", ret);
-                       ug_data->move_status = move_status;
+                       view->move_status = move_status;
                }
        }
-       if (ug_data->loaded_module) {
-               _account_destroy_request_cb(ug_data, ug_data->loaded_module);
+       if (view->loaded_module) {
+               _account_destroy_request_cb(view, view->loaded_module);
        }
 }
 
@@ -669,10 +669,10 @@ email_module_h viewer_create_module(void *data, email_module_type_e module_type,
 {
        debug_enter();
        retvm_if(data == NULL, NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        email_module_listener_t listener = { 0 };
-       listener.cb_data = ug_data;
+       listener.cb_data = view;
        if (module_type == EMAIL_MODULE_ACCOUNT) {
                listener.result_cb = _account_result_cb;
                listener.destroy_request_cb = _account_destroy_request_cb;
@@ -682,14 +682,14 @@ email_module_h viewer_create_module(void *data, email_module_type_e module_type,
 
        if (module_type == EMAIL_MODULE_COMPOSER) {
                debug_log("composer module launched");
-               ug_data->is_composer_module_launched = TRUE;
+               view->is_composer_module_launched = TRUE;
        }
 
-       if (hide) viewer_hide_webview(ug_data);
+       if (hide) viewer_hide_webview(view);
 
-       email_module_h module = email_module_create_child(ug_data->base.module, module_type, params, &listener);
-       if (ug_data->base.content)
-               elm_object_tree_focus_allow_set(ug_data->base.content, EINA_FALSE);
+       email_module_h module = email_module_create_child(view->base.module, module_type, params, &listener);
+       if (view->base.content)
+               elm_object_tree_focus_allow_set(view->base.content, EINA_FALSE);
 
        return module;
 }
@@ -699,18 +699,18 @@ email_module_h viewer_create_scheduled_composer_module(void *data, email_params_
        debug_enter();
        retvm_if(data == NULL, NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        email_module_listener_t listener = { 0 };
-       listener.cb_data = ug_data;
+       listener.cb_data = view;
        listener.destroy_request_cb = _scheduled_composer_destroy_request_cb;
 
-       viewer_hide_webview(ug_data);
+       viewer_hide_webview(view);
 
-       email_module_h module = email_module_create_child(ug_data->base.module,
+       email_module_h module = email_module_create_child(view->base.module,
                        EMAIL_MODULE_COMPOSER, params, &listener);
-       if (ug_data->base.content)
-               elm_object_tree_focus_allow_set(ug_data->base.content, EINA_FALSE);
+       if (view->base.content)
+               elm_object_tree_focus_allow_set(view->base.content, EINA_FALSE);
 
        return module;
 }
@@ -734,7 +734,7 @@ Evas_Object *viewer_load_edj(Evas_Object *parent, const char *file, const char *
        return eo;
 }
 
-void viewer_launch_browser(EmailViewerUGD *ug_data, const char *link_url)
+void viewer_launch_browser(EmailViewerView *view, const char *link_url)
 {
        debug_enter();
        retm_if(link_url == NULL, "Invalid parameter: link_url[NULL]");
@@ -762,10 +762,10 @@ void viewer_launch_browser(EmailViewerUGD *ug_data, const char *link_url)
        debug_leave();
 }
 
-void viewer_create_email(EmailViewerUGD *ug_data, const char *email_address)
+void viewer_create_email(EmailViewerView *view, const char *email_address)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
        retm_if(email_address == NULL, "Invalid parameter: email_address[NULL]");
        debug_secure("email_address (%s)", email_address);
        int scheme_length = strlen(URI_SCHEME_MAILTO);
@@ -775,7 +775,7 @@ void viewer_create_email(EmailViewerUGD *ug_data, const char *email_address)
                email_params_add_int(params, EMAIL_BUNDLE_KEY_RUN_TYPE, RUN_COMPOSER_EXTERNAL) &&
                email_params_add_str(params, EMAIL_BUNDLE_KEY_TO, &email_address[scheme_length])) {
 
-               ug_data->loaded_module = viewer_create_module(ug_data, EMAIL_MODULE_COMPOSER, params, ug_data);
+               view->loaded_module = viewer_create_module(view, EMAIL_MODULE_COMPOSER, params, view);
        }
 
        email_params_free(&params);
@@ -863,13 +863,13 @@ void viewer_show_attachment_preview(EV_attachment_data *aid)
 {
        debug_enter();
        retm_if(aid == NULL, "Invalid parameter: aid[NULL]");
-       EmailViewerUGD *ug_data = aid->ug_data;
+       EmailViewerView *view = aid->view;
 
-       if (aid != ug_data->preview_aid) {
+       if (aid != view->preview_aid) {
                debug_error("Not ready for preview!");
                return;
        }
-       ug_data->preview_aid = NULL;
+       view->preview_aid = NULL;
 
        _show_attachment(aid);
 
@@ -879,12 +879,12 @@ void viewer_show_attachment_preview(EV_attachment_data *aid)
 static void _show_attachment(EV_attachment_data *aid)
 {
        debug_enter();
-       EmailViewerUGD *ug_data = aid->ug_data;
+       EmailViewerView *view = aid->view;
 
        int ret;
-       ret = email_preview_attachment_file(ug_data->base.module, aid->preview_path, NULL);
+       ret = email_preview_attachment_file(view->base.module, aid->preview_path, NULL);
        if (ret != 0) {
-               util_create_notify(ug_data, EMAIL_VIEWER_HEADER_UNABLE_TO_OPEN_FILE,
+               util_create_notify(view, EMAIL_VIEWER_HEADER_UNABLE_TO_OPEN_FILE,
                                EMAIL_VIEWER_POP_THIS_FILE_TYPE_IS_NOT_SUPPORTED, 1,
                                EMAIL_VIEWER_STRING_OK, _popup_response_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
        }
@@ -915,23 +915,23 @@ int viewer_check_storage_full(unsigned int mb_size)
        return ret;
 }
 
-void viewer_show_storage_full_popup(EmailViewerUGD *ug_data)
+void viewer_show_storage_full_popup(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       if (ug_data->is_storage_full_popup_shown) {
+       if (view->is_storage_full_popup_shown) {
                debug_log("Popup is already dispalyed. No need to show another one");
                return;
        }
-       ug_data->is_storage_full_popup_shown = EINA_TRUE;
+       view->is_storage_full_popup_shown = EINA_TRUE;
        email_string_t content = { PACKAGE, "IDS_EMAIL_POP_THERE_IS_NOT_ENOUGH_SPACE_IN_YOUR_DEVICE_STORAGE_GO_TO_SETTINGS_POWER_AND_STORAGE_STORAGE_THEN_DELETE_SOME_FILES_AND_TRY_AGAIN" };
        email_string_t btn2 = { PACKAGE, "IDS_EMAIL_BUTTON_SETTINGS" };
-       util_create_notify(ug_data, EMAIL_VIEWER_POP_ERROR, content, 2,
+       util_create_notify(view, EMAIL_VIEWER_POP_ERROR, content, 2,
                        EMAIL_VIEWER_STRING_OK, _popup_response_cb,
                        btn2, viewer_storage_full_popup_response_cb, NULL);
 
-       evas_object_event_callback_add(ug_data->notify, EVAS_CALLBACK_DEL, _viewer_storage_full_popup_del_cb, ug_data);
+       evas_object_event_callback_add(view->notify, EVAS_CALLBACK_DEL, _viewer_storage_full_popup_del_cb, view);
        debug_leave();
 }
 
@@ -939,14 +939,14 @@ static void  _viewer_storage_full_popup_del_cb(void *data, Evas *e, Evas_Object
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       ug_data->is_storage_full_popup_shown = EINA_FALSE;
+       view->is_storage_full_popup_shown = EINA_FALSE;
        debug_leave();
 
 }
 
-static void _viewer_launch_storage_settings(EmailViewerUGD *ug_data)
+static void _viewer_launch_storage_settings(EmailViewerView *view)
 {
        debug_enter();
        int ret = APP_CONTROL_ERROR_NONE;
@@ -964,7 +964,7 @@ static void _viewer_launch_storage_settings(EmailViewerUGD *ug_data)
        debug_warning_if(ret != APP_CONTROL_ERROR_NONE, "app_control_set_app_id() failed! ret:[%d]", ret);
 
        /* Launch application */
-       ret = app_control_send_launch_request(app_control, NULL, ug_data);
+       ret = app_control_send_launch_request(app_control, NULL, view);
        debug_warning_if(ret != APP_CONTROL_ERROR_NONE, "app_control_send_launch_request() failed! ret:[%d]", ret);
        if (ret != APP_CONTROL_ERROR_NONE) {
                notification_status_message_post(_("IDS_EMAIL_HEADER_UNABLE_TO_PERFORM_ACTION_ABB"));
@@ -980,11 +980,11 @@ void viewer_storage_full_popup_response_cb(void *data, Evas_Object *obj, void *e
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       DELETE_EVAS_OBJECT(view->notify);
 
-       _viewer_launch_storage_settings(ug_data);
+       _viewer_launch_storage_settings(view);
 
        debug_leave();
 }
@@ -994,14 +994,14 @@ void viewer_create_down_progress(void *data, email_string_t t, popup_cb resp_cb)
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        Evas_Object *popup, *pb;
-       ug_data->is_download_message_btn_clicked = EINA_TRUE;
-       popup = elm_popup_add(ug_data->base.module->win);
+       view->is_download_message_btn_clicked = EINA_TRUE;
+       popup = elm_popup_add(view->base.module->win);
        elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
        retm_if(popup == NULL, "elm_popup_add returns NULL.");
-       debug_log("popup: %p, win_main: %p", popup, ug_data->base.module->win);
-       ug_data->pb_notify = popup;
+       debug_log("popup: %p, win_main: %p", popup, view->base.module->win);
+       view->pb_notify = popup;
 
        elm_object_domain_translatable_part_text_set(popup, "title,text", t.domain, t.id);
 
@@ -1021,7 +1021,7 @@ void viewer_create_down_progress(void *data, email_string_t t, popup_cb resp_cb)
        elm_progressbar_value_set(pb, 0.0);
        elm_object_part_text_set(pb, "elm.text.bottom.left", "0.0/0.0");
        elm_object_part_text_set(pb, "elm.text.bottom.right", "0%");
-       ug_data->pb_notify_lb = pb;
+       view->pb_notify_lb = pb;
        elm_object_part_content_set(layout, "progressbar", pb);
        elm_object_content_set(popup, layout);
 
@@ -1029,11 +1029,11 @@ void viewer_create_down_progress(void *data, email_string_t t, popup_cb resp_cb)
        elm_object_style_set(btn, "popup");
        elm_object_domain_translatable_text_set(btn, PACKAGE, "IDS_EMAIL_BUTTON_CANCEL");
        elm_object_part_content_set(popup, "button1", btn);
-       evas_object_smart_callback_add(btn, "clicked", resp_cb, ug_data);
+       evas_object_smart_callback_add(btn, "clicked", resp_cb, view);
        debug_log("Cancel btn1 for downloading body: %p", btn);
 
-       evas_object_event_callback_add(popup, EVAS_CALLBACK_MOUSE_UP, _mouseup_cb, ug_data);
-       eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, resp_cb, ug_data);
+       evas_object_event_callback_add(popup, EVAS_CALLBACK_MOUSE_UP, _mouseup_cb, view);
+       eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, resp_cb, view);
        evas_object_show(popup);
        debug_leave();
 }
@@ -1043,14 +1043,14 @@ void viewer_destroy_down_progress_cb(void *data, Evas_Object *obj, void *event_i
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       ug_data->is_download_message_btn_clicked = EINA_FALSE;
+       EmailViewerView *view = (EmailViewerView *)data;
+       view->is_download_message_btn_clicked = EINA_FALSE;
 
-       email_engine_stop_working(ug_data->account_id, ug_data->email_handle);
-       ug_data->email_handle = 0;
+       email_engine_stop_working(view->account_id, view->email_handle);
+       view->email_handle = 0;
 
-       DELETE_EVAS_OBJECT(ug_data->pb_notify);
-       DELETE_EVAS_OBJECT(ug_data->pb_notify_lb);
+       DELETE_EVAS_OBJECT(view->pb_notify);
+       DELETE_EVAS_OBJECT(view->pb_notify_lb);
        debug_leave();
 }
 
@@ -1060,7 +1060,7 @@ void viewer_send_email(void *data, char *email_address)
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
        retm_if(email_address == NULL, "Invalid parameter: email_address[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        email_params_h params = NULL;
 
@@ -1068,7 +1068,7 @@ void viewer_send_email(void *data, char *email_address)
                email_params_add_int(params, EMAIL_BUNDLE_KEY_RUN_TYPE, RUN_COMPOSER_EXTERNAL) &&
                email_params_add_str(params, EMAIL_BUNDLE_KEY_TO, email_address)) {
 
-               ug_data->loaded_module = viewer_create_module(ug_data, EMAIL_MODULE_COMPOSER, params, true);
+               view->loaded_module = viewer_create_module(view, EMAIL_MODULE_COMPOSER, params, true);
        }
 
        email_params_free(&params);
@@ -1082,7 +1082,7 @@ void viewer_view_contact_detail(void *data, int index)
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
        debug_secure("index (%s)", index);
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        email_params_h params = NULL;
        int ret = -1;
 
@@ -1091,7 +1091,7 @@ void viewer_view_contact_detail(void *data, int index)
                email_params_set_mime(params, EMAIL_CONTACT_MIME_SCHEME) &&
                email_params_add_int(params, EMAIL_CONTACT_EXT_DATA_ID, index)) {
 
-               ret = email_module_launch_app(ug_data->base.module, EMAIL_LAUNCH_APP_AUTO, params, NULL);
+               ret = email_module_launch_app(view->base.module, EMAIL_LAUNCH_APP_AUTO, params, NULL);
        }
 
        email_params_free(&params);
@@ -1107,20 +1107,20 @@ void viewer_launch_composer(void *data, int type)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       retm_if(ug_data->mail_info == NULL, "Invalid parameter: mail_info[NULL]");
+       EmailViewerView *view = (EmailViewerView *)data;
+       retm_if(view->mail_info == NULL, "Invalid parameter: mail_info[NULL]");
 
        email_params_h params = NULL;
 
        if (email_params_create(&params) &&
                email_params_add_int(params, EMAIL_BUNDLE_KEY_RUN_TYPE, type) &&
-               email_params_add_int(params, EMAIL_BUNDLE_KEY_ACCOUNT_ID, ug_data->account_id) &&
-               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAILBOX, ug_data->mailbox_id) &&
-               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAIL_ID, ug_data->mail_id) &&
+               email_params_add_int(params, EMAIL_BUNDLE_KEY_ACCOUNT_ID, view->account_id) &&
+               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAILBOX, view->mailbox_id) &&
+               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAIL_ID, view->mail_id) &&
                ((type != RUN_EML_REPLY && type != RUN_EML_REPLY_ALL && type != RUN_EML_FORWARD) ||
-               email_params_add_str(params, EMAIL_BUNDLE_KEY_MYFILE_PATH, ug_data->eml_file_path))) {
+               email_params_add_str(params, EMAIL_BUNDLE_KEY_MYFILE_PATH, view->eml_file_path))) {
 
-               ug_data->loaded_module = viewer_create_module(ug_data, EMAIL_MODULE_COMPOSER, params, true);
+               view->loaded_module = viewer_create_module(view, EMAIL_MODULE_COMPOSER, params, true);
        }
 
        email_params_free(&params);
@@ -1251,10 +1251,10 @@ Eina_Bool viewer_check_body_download_status(int body_download_status, int status
 }
 
 /* Temporary folder /tmp/email is created when viewer is launched. */
-int viewer_create_temp_folder(EmailViewerUGD *ug_data)
+int viewer_create_temp_folder(EmailViewerView *view)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, -1, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, -1, "Invalid parameter: view[NULL]");
        pid_t pid = getpid();
 
        /* for temp viewer files. */
@@ -1264,9 +1264,9 @@ int viewer_create_temp_folder(EmailViewerUGD *ug_data)
                return -1;
        }
 
-       ug_data->temp_folder_path = g_strdup_printf("%s/%d_%d_%d", email_get_viewer_tmp_dir(),
-                       pid, ug_data->account_id, ug_data->mail_id);
-       nErr = email_create_folder(ug_data->temp_folder_path);
+       view->temp_folder_path = g_strdup_printf("%s/%d_%d_%d", email_get_viewer_tmp_dir(),
+                       pid, view->account_id, view->mail_id);
+       nErr = email_create_folder(view->temp_folder_path);
        if (nErr == -1) {
                debug_error("email_create_folder(temp_folder_path) failed!");
                return -1;
@@ -1276,60 +1276,60 @@ int viewer_create_temp_folder(EmailViewerUGD *ug_data)
 }
 
 /* Temporary folder '/tmp/email' and its contents are deleted when composer is destroyed. */
-void viewer_remove_temp_folders(EmailViewerUGD *ug_data)
+void viewer_remove_temp_folders(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       viewer_remove_folder(ug_data->temp_folder_path);
-       FREE(ug_data->temp_folder_path);
-       viewer_remove_folder(ug_data->temp_preview_folder_path);
-       FREE(ug_data->temp_preview_folder_path);
+       viewer_remove_folder(view->temp_folder_path);
+       FREE(view->temp_folder_path);
+       viewer_remove_folder(view->temp_preview_folder_path);
+       FREE(view->temp_preview_folder_path);
 
        debug_leave();
 }
 
-void viewer_remove_temp_files(EmailViewerUGD *ug_data)
+void viewer_remove_temp_files(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       if (email_file_exists(ug_data->temp_viewer_html_file_path)) {
-               if (!email_file_remove(ug_data->temp_viewer_html_file_path)) {
+       if (email_file_exists(view->temp_viewer_html_file_path)) {
+               if (!email_file_remove(view->temp_viewer_html_file_path)) {
                        debug_error("email_file_remove(temp_viewer_html_file_path) failed! : %s", strerror(errno));
                }
-               G_FREE(ug_data->temp_viewer_html_file_path);
+               G_FREE(view->temp_viewer_html_file_path);
        }
 
        debug_leave();
 }
 
-void viewer_create_body_button(EmailViewerUGD *ug_data, const char *button_title, Evas_Smart_Cb cb)
+void viewer_create_body_button(EmailViewerView *view, const char *button_title, Evas_Smart_Cb cb)
 {
        debug_enter();
 
        retm_if(!cb, "Callback is NULL");
        retm_if(!button_title, "Button text is button");
-       viewer_delete_body_button(ug_data);
+       viewer_delete_body_button(view);
 
-       ug_data->dn_btn = elm_button_add(ug_data->base.content);
-       elm_object_style_set(ug_data->dn_btn, "body_button");
-       evas_object_size_hint_align_set(ug_data->dn_btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
-       evas_object_size_hint_weight_set(ug_data->dn_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       elm_object_domain_translatable_text_set(ug_data->dn_btn, PACKAGE, button_title);
-       evas_object_show(ug_data->dn_btn);
+       view->dn_btn = elm_button_add(view->base.content);
+       elm_object_style_set(view->dn_btn, "body_button");
+       evas_object_size_hint_align_set(view->dn_btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_size_hint_weight_set(view->dn_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_object_domain_translatable_text_set(view->dn_btn, PACKAGE, button_title);
+       evas_object_show(view->dn_btn);
 
-       if (ug_data->dn_btn) {
-               elm_box_pack_end(ug_data->main_bx, ug_data->dn_btn);
+       if (view->dn_btn) {
+               elm_box_pack_end(view->main_bx, view->dn_btn);
        }
 
-       evas_object_smart_callback_add(ug_data->dn_btn, "clicked", cb, (void *)ug_data);
+       evas_object_smart_callback_add(view->dn_btn, "clicked", cb, (void *)view);
 }
 
-void viewer_delete_body_button(EmailViewerUGD *ug_data)
+void viewer_delete_body_button(EmailViewerView *view)
 {
        debug_enter();
-       elm_box_unpack(ug_data->main_bx, ug_data->dn_btn);
-       DELETE_EVAS_OBJECT(ug_data->dn_btn);
+       elm_box_unpack(view->main_bx, view->dn_btn);
+       DELETE_EVAS_OBJECT(view->dn_btn);
 }
 /* EOF */
index 6abe3e6..ac23424 100644 (file)
  *
  */
 
-#ifndef UG_MODULE_API
-#define UG_MODULE_API __attribute__ ((visibility("default")))
-#endif
-
 /* Header Include */
 #include <utils_i18n.h>
 #include <malloc.h>
@@ -49,7 +45,7 @@
 
 
 /* Global Val */
-EmailViewerUGD *_g_md = NULL; /* TODO Need more investigation why we need this global variable. */
+EmailViewerView *_g_md = NULL; /* TODO Need more investigation why we need this global variable. */
 
 static email_string_t EMAIL_VIEWER_POPUP_DOWNLOADING = { PACKAGE, "IDS_EMAIL_BUTTON_DOWNLOAD_FULL_EMAIL_ABB" };
 static email_string_t EMAIL_VIEWER_STRING_OK = { PACKAGE, "IDS_EMAIL_BUTTON_OK" };
@@ -81,26 +77,26 @@ static void _viewer_update(email_view_t *self, int flags);
 static void _viewer_on_back_key(email_view_t *self);
 
 /* viewer theme */
-static void _viewer_initialize_theme(EmailViewerUGD *ug_data);
-static void _viewer_deinitialize_theme(EmailViewerUGD *ug_data);
+static void _viewer_initialize_theme(EmailViewerView *view);
+static void _viewer_deinitialize_theme(EmailViewerView *view);
 
 /*event update functions*/
-static void _viewer_update_on_orientation_change(EmailViewerUGD *ug_data, bool isLandscape);
-static void _viewer_update_on_region_change(EmailViewerUGD *ug_data);
-static void _viewer_update_on_language_change(EmailViewerUGD *ug_data);
+static void _viewer_update_on_orientation_change(EmailViewerView *view, bool isLandscape);
+static void _viewer_update_on_region_change(EmailViewerView *view);
+static void _viewer_update_on_language_change(EmailViewerView *view);
 
-static void __viewer_add_main_callbacks(EmailViewerUGD *ug_data, void *data);
-static void _viewer_add_main_callbacks(EmailViewerUGD *ug_data);
+static void __viewer_add_main_callbacks(EmailViewerView *view, void *data);
+static void _viewer_add_main_callbacks(EmailViewerView *view);
 static void _viewer_update_data_on_start(void *data);
 
 /* View related */
-static VIEWER_ERROR_TYPE_E _viewer_create_base_view(EmailViewerUGD *ug_data);
-static void _viewer_get_window_sizes(EmailViewerUGD *ug_data);
+static VIEWER_ERROR_TYPE_E _viewer_create_base_view(EmailViewerView *view);
+static void _viewer_get_window_sizes(EmailViewerView *view);
 static void _create_webview_layout(void *data);
 
 static void _timezone_changed_cb(system_settings_key_e key, void *data);
 
-static void _viewer_set_webview_size(EmailViewerUGD *ug_data, int height);
+static void _viewer_set_webview_size(EmailViewerView *view, int height);
 
 /* callback functions */
 static void _more_cb(void *data, Evas_Object *obj, void *event_info);
@@ -118,8 +114,8 @@ static void _outter_scroller_top_hit_cb(void *data, Evas_Object *obj, void *even
 
 static Eina_Bool _viewer_launch_email_application_cb(void *data);
 
-static int _construct_viewer_data(EmailViewerUGD *ug_data);
-static void _destroy_viewer(EmailViewerUGD *ug_data);
+static int _construct_viewer_data(EmailViewerView *view);
+static void _destroy_viewer(EmailViewerView *view);
 
 #ifdef SHARED_MODULES_FEATURE
 EMAIL_API email_module_t *email_module_alloc()
@@ -129,115 +125,115 @@ email_module_t *viewer_module_alloc()
 {
        debug_enter();
 
-       EmailViewerModule *md = MEM_ALLOC(md, 1);
-       if (!md) {
-               debug_error("md is NULL");
+       EmailViewerModule *module = MEM_ALLOC(module, 1);
+       if (!module) {
+               debug_error("module is NULL");
                return NULL;
        }
 
-       _g_md = &md->view;
+       _g_md = &module->view;
 
-       md->base.create = _viewer_module_create;
-       md->base.on_message = _viewer_module_on_message;
-       md->base.on_event = _viewer_module_on_event;
+       module->base.create = _viewer_module_create;
+       module->base.on_message = _viewer_module_on_message;
+       module->base.on_event = _viewer_module_on_event;
 
-       return &md->base;
+       return &module->base;
 }
 
-static void _viewer_set_webview_size(EmailViewerUGD *ug_data, int height)
+static void _viewer_set_webview_size(EmailViewerView *view, int height)
 {
        debug_enter();
 
-       retm_if(ug_data->loaded_module, "Viewer module in background");
+       retm_if(view->loaded_module, "Viewer module in background");
        int min_height = 0, max_height = 0;
 
        int win_h = 0, win_w = 0;
-       elm_win_screen_size_get(ug_data->base.module->win, NULL, NULL, &win_w, &win_h);
+       elm_win_screen_size_get(view->base.module->win, NULL, NULL, &win_w, &win_h);
        debug_log("==> main layout [w, h] = [%d, %d]", win_w, win_h);
-       debug_log("ug_data->header_height : %d", ug_data->header_height);
+       debug_log("view->header_height : %d", view->header_height);
 
-       if (ug_data->isLandscape) {
-               min_height = win_w - ug_data->header_height;
+       if (view->isLandscape) {
+               min_height = win_w - view->header_height;
                max_height = win_w;
-               ug_data->webview_width = win_h;
+               view->webview_width = win_h;
        } else {
-               min_height = win_h - ug_data->header_height;
+               min_height = win_h - view->header_height;
                max_height = win_h;
-               ug_data->webview_width = win_w;
+               view->webview_width = win_w;
        }
 
        if (height <= min_height) {
                debug_log("min");
-               ug_data->webview_height = min_height;
+               view->webview_height = min_height;
        } else {
                debug_log("max");
-               ug_data->webview_height = max_height;
+               view->webview_height = max_height;
        }
 
        debug_log("min_height: %d height :%d max_height :%d ", min_height, height, max_height);
-       debug_log("ug_data->webview_height: %d", ug_data->webview_height);
+       debug_log("view->webview_height: %d", view->webview_height);
 
        debug_leave();
 }
 
-void viewer_resize_webview(EmailViewerUGD *ug_data, int height)
+void viewer_resize_webview(EmailViewerView *view, int height)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
-       _viewer_set_webview_size(ug_data, height);
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
+       _viewer_set_webview_size(view, height);
 
-       evas_object_size_hint_min_set(ug_data->webview, ug_data->webview_width, ug_data->webview_height);
-       evas_object_size_hint_max_set(ug_data->webview, ug_data->webview_width, ug_data->webview_height);
+       evas_object_size_hint_min_set(view->webview, view->webview_width, view->webview_height);
+       evas_object_size_hint_max_set(view->webview, view->webview_width, view->webview_height);
 }
 
-void viewer_back_key_press_handler(EmailViewerUGD *ug_data)
+void viewer_back_key_press_handler(EmailViewerView *view)
 {
        debug_enter();
 
-       if (ug_data->b_load_finished == EINA_FALSE) {
+       if (view->b_load_finished == EINA_FALSE) {
                debug_log("b_load_finished is not yet done");
                return;
        }
 
-       if (ug_data->webview) {
-               if (ewk_view_text_selection_clear(ug_data->webview)) {
+       if (view->webview) {
+               if (ewk_view_text_selection_clear(view->webview)) {
                        debug_log("ewk_view_text_selection_clear() failed");
                        return;
                }
        }
-       debug_log("ug_destroy_me");
-       ug_data->need_pending_destroy = EINA_TRUE;
-       evas_object_smart_callback_del(ug_data->more_btn, "clicked", _more_cb);
-       email_module_make_destroy_request(ug_data->base.module);
+       debug_log("email_module_make_destroy_request");
+       view->need_pending_destroy = EINA_TRUE;
+       evas_object_smart_callback_del(view->more_btn, "clicked", _more_cb);
+       email_module_make_destroy_request(view->base.module);
        debug_leave();
 }
 
-static void __viewer_add_main_callbacks(EmailViewerUGD *ug_data, void *data)
+static void __viewer_add_main_callbacks(EmailViewerView *view, void *data)
 {
        debug_enter();
 
        retm_if(!data, "Invalid parameter: data is NULL!");
-       retm_if(!ug_data, "Invalid parameter: ug_data is NULL!");
+       retm_if(!view, "Invalid parameter: view is NULL!");
 
        /* indicator */
-       elm_win_indicator_mode_set(ug_data->base.module->win, ELM_WIN_INDICATOR_SHOW);
-       elm_win_indicator_opacity_set(ug_data->base.module->win, ELM_WIN_INDICATOR_OPAQUE);
+       elm_win_indicator_mode_set(view->base.module->win, ELM_WIN_INDICATOR_SHOW);
+       elm_win_indicator_opacity_set(view->base.module->win, ELM_WIN_INDICATOR_OPAQUE);
 
        viewer_open_pattern_generator();
        if (email_register_timezone_changed_callback(_timezone_changed_cb, data) == -1) {
                debug_log("Failed to register system settings callback for time changed");
-               ug_data->eViewerErrorType = VIEWER_ERROR_FAIL;
+               view->eViewerErrorType = VIEWER_ERROR_FAIL;
        }
 
        debug_leave();
 }
 
-static void _viewer_add_main_callbacks(EmailViewerUGD *ug_data)
+static void _viewer_add_main_callbacks(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       __viewer_add_main_callbacks(ug_data, (void *)ug_data);
+       __viewer_add_main_callbacks(view, (void *)view);
 
        debug_leave();
 }
@@ -273,31 +269,31 @@ int _viewer_module_create(email_module_t *self, email_params_h params)
        debug_enter();
        retvm_if(!self, -1, "Invalid parameter: self is NULL!");
 
-       EmailViewerModule *md = (EmailViewerModule *)self;
-       EmailViewerUGD *ug_data = &md->view;
+       EmailViewerModule *module = (EmailViewerModule *)self;
+       EmailViewerView *view = &module->view;
 
-       viewer_initialize_data(ug_data);
+       viewer_initialize_data(view);
 
        if (!params) {
                debug_log("params handle is NULL");
-               ug_data->eViewerErrorType = VIEWER_ERROR_INVALID_ARG;
+               view->eViewerErrorType = VIEWER_ERROR_INVALID_ARG;
        }
 
-       int ret = viewer_initial_data_pre_parse_arguments(ug_data, params);
+       int ret = viewer_initial_data_pre_parse_arguments(view, params);
        if (ret != VIEWER_ERROR_NONE) {
                debug_log("viewer_initial_data_pre_parse_arguments() failed! (error type: %d)", ret);
-               ug_data->eViewerErrorType = ret;
+               view->eViewerErrorType = ret;
        }
 
-       ug_data->base.create = _viewer_create;
-       ug_data->base.destroy = _viewer_destroy;
-       ug_data->base.activate = _viewer_activate;
-       ug_data->base.show = _viewer_show;
-       ug_data->base.hide = _viewer_hide;
-       ug_data->base.update = _viewer_update;
-       ug_data->base.on_back_key = _viewer_on_back_key;
+       view->base.create = _viewer_create;
+       view->base.destroy = _viewer_destroy;
+       view->base.activate = _viewer_activate;
+       view->base.show = _viewer_show;
+       view->base.hide = _viewer_hide;
+       view->base.update = _viewer_update;
+       view->base.on_back_key = _viewer_on_back_key;
 
-       ret = email_module_create_view(&md->base, &ug_data->base);
+       ret = email_module_create_view(&module->base, &view->base);
        if (ret != 0) {
                debug_error("email_module_create_view(): failed (%d)", ret);
                return -1;
@@ -312,45 +308,45 @@ int _viewer_create(email_view_t *self)
        debug_enter();
        retvm_if(!self, -1, "Invalid parameter: self is NULL!");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)self;
+       EmailViewerView *view = (EmailViewerView *)self;
 
-       int ret = _construct_viewer_data(ug_data);
+       int ret = _construct_viewer_data(view);
        if (ret != VIEWER_ERROR_NONE) {
                debug_log("_construct_viewer_data() failed! (error type: %d)", ret);
-               ug_data->eViewerErrorType = ret;
+               view->eViewerErrorType = ret;
        }
 
-       ret = _initialize_services(ug_data);
+       ret = _initialize_services(view);
        if (ret != VIEWER_ERROR_NONE) {
-               ug_data->eViewerErrorType = ret;
+               view->eViewerErrorType = ret;
        }
 
-       ug_data->create_contact_arg = CONTACTUI_REQ_ADD_EMAIL;
-       _viewer_initialize_theme(ug_data);
-       _viewer_create_base_view(ug_data);
-       _create_webview_layout(ug_data);
-       viewer_get_webview(ug_data);
-       header_create_view(ug_data);
-       header_update_view(ug_data);
+       view->create_contact_arg = CONTACTUI_REQ_ADD_EMAIL;
+       _viewer_initialize_theme(view);
+       _viewer_create_base_view(view);
+       _create_webview_layout(view);
+       viewer_get_webview(view);
+       header_create_view(view);
+       header_update_view(view);
 
-       create_body_progress(ug_data);
-       ug_data->b_viewer_hided = FALSE;
-       _viewer_add_main_callbacks(ug_data);
+       create_body_progress(view);
+       view->b_viewer_hided = FALSE;
+       _viewer_add_main_callbacks(view);
 
        debug_leave();
        return 0;
 }
 
-static VIEWER_ERROR_TYPE_E _viewer_process_error_popup(EmailViewerUGD *ug_data)
+static VIEWER_ERROR_TYPE_E _viewer_process_error_popup(EmailViewerView *view)
 {
        debug_enter();
 
-       debug_log("eViewerErrorType:%d", ug_data->eViewerErrorType);
-       if (ug_data->eViewerErrorType != VIEWER_ERROR_NONE) {
-               switch (ug_data->eViewerErrorType) {
+       debug_log("eViewerErrorType:%d", view->eViewerErrorType);
+       if (view->eViewerErrorType != VIEWER_ERROR_NONE) {
+               switch (view->eViewerErrorType) {
                case VIEWER_ERROR_NOT_ALLOWED:
                        debug_warning("Lauching viewer failed! VIEWER_ERROR_NOT_ALLOWED");
-                       util_create_notify(ug_data, EMAIL_VIEWER_HEADER_UNAVAILABLE,
+                       util_create_notify(view, EMAIL_VIEWER_HEADER_UNAVAILABLE,
                                        EMAIL_VIEWER_POP_SECURITY_POLICY_RESTRICTS_USE_OF_POP_IMAP_EMAIL, 1,
                                        EMAIL_VIEWER_STRING_OK, _popup_response_to_destroy_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
                        break;
@@ -358,17 +354,17 @@ static VIEWER_ERROR_TYPE_E _viewer_process_error_popup(EmailViewerUGD *ug_data)
                case VIEWER_ERROR_NO_DEFAULT_ACCOUNT:
                case VIEWER_ERROR_NO_ACCOUNT_LIST:
                case VIEWER_ERROR_NO_ACCOUNT:
-                       debug_warning("Lauching viewer failed! Failed to get account! [%d]", ug_data->eViewerErrorType);
-                       util_create_notify(ug_data, EMAIL_VIEWER_HEADER_UNABLE_TO_PERFORM_ACTION,
+                       debug_warning("Lauching viewer failed! Failed to get account! [%d]", view->eViewerErrorType);
+                       util_create_notify(view, EMAIL_VIEWER_HEADER_UNABLE_TO_PERFORM_ACTION,
                                        EMAIL_VIEWER_POP_THERE_IS_NO_ACCOUNT_CREATE_A_NEW_ACCOUNT_FIRST, 0,
                                        EMAIL_VIEWER_STRING_NULL, NULL, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
-                       DELETE_TIMER_OBJECT(ug_data->launch_timer);
-                       ug_data->launch_timer = ecore_timer_add(2.0f, _viewer_launch_email_application_cb, ug_data);
+                       DELETE_TIMER_OBJECT(view->launch_timer);
+                       view->launch_timer = ecore_timer_add(2.0f, _viewer_launch_email_application_cb, view);
                        break;
 
                case VIEWER_ERROR_GET_DATA_FAIL:
                        debug_warning("Lauching viewer failed! VIEWER_ERROR_GET_DATA_FAIL");
-                       util_create_notify(ug_data, EMAIL_VIEWER_HEADER_UNABLE_TO_PERFORM_ACTION,
+                       util_create_notify(view, EMAIL_VIEWER_HEADER_UNABLE_TO_PERFORM_ACTION,
                                                EMAIL_VIEWER_BODY_SELECTED_DATA_NOT_FOUND, 1,
                                                EMAIL_VIEWER_STRING_OK, _popup_response_to_destroy_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
                        break;
@@ -376,8 +372,8 @@ static VIEWER_ERROR_TYPE_E _viewer_process_error_popup(EmailViewerUGD *ug_data)
                case VIEWER_ERROR_FAIL:
                case VIEWER_ERROR_UNKOWN_TYPE:
                case VIEWER_ERROR_INVALID_ARG:
-                       debug_warning("Lauching viewer failed! Due to [%d]", ug_data->eViewerErrorType);
-                       util_create_notify(ug_data, EMAIL_VIEWER_HEADER_UNABLE_TO_PERFORM_ACTION,
+                       debug_warning("Lauching viewer failed! Due to [%d]", view->eViewerErrorType);
+                       util_create_notify(view, EMAIL_VIEWER_HEADER_UNABLE_TO_PERFORM_ACTION,
                                                EMAIL_VIEWER_UNKNOWN_ERROR_HAS_OCCURED, 1,
                                                EMAIL_VIEWER_STRING_OK, _popup_response_to_destroy_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
 
@@ -387,8 +383,8 @@ static VIEWER_ERROR_TYPE_E _viewer_process_error_popup(EmailViewerUGD *ug_data)
                case VIEWER_ERROR_DBUS_FAIL:
                case VIEWER_ERROR_SERVICE_INIT_FAIL:
                case VIEWER_ERROR_OUT_OF_MEMORY:
-                       debug_warning("Lauching viewer failed! Due to [%d]", ug_data->eViewerErrorType);
-                       util_create_notify(ug_data, EMAIL_VIEWER_HEADER_UNABLE_TO_PERFORM_ACTION,
+                       debug_warning("Lauching viewer failed! Due to [%d]", view->eViewerErrorType);
+                       util_create_notify(view, EMAIL_VIEWER_HEADER_UNABLE_TO_PERFORM_ACTION,
                                                EMAIL_VIEWER_POP_FAILED_TO_START_EMAIL_APPLICATION, 1,
                                                EMAIL_VIEWER_STRING_OK, _popup_response_to_destroy_cb, EMAIL_VIEWER_STRING_NULL, NULL, NULL);
                        break;
@@ -397,7 +393,7 @@ static VIEWER_ERROR_TYPE_E _viewer_process_error_popup(EmailViewerUGD *ug_data)
                        debug_warning("Lauching viewer failed! VIEWER_ERROR_STORAGE_FULL");
                        email_string_t content = { PACKAGE, "IDS_EMAIL_POP_THERE_IS_NOT_ENOUGH_SPACE_IN_YOUR_DEVICE_STORAGE_GO_TO_SETTINGS_POWER_AND_STORAGE_STORAGE_THEN_DELETE_SOME_FILES_AND_TRY_AGAIN" };
                        email_string_t btn2 = { PACKAGE, "IDS_EMAIL_BUTTON_SETTINGS" };
-                       util_create_notify(ug_data, EMAIL_VIEWER_HEADER_UNABLE_TO_PERFORM_ACTION, content, 2,
+                       util_create_notify(view, EMAIL_VIEWER_HEADER_UNABLE_TO_PERFORM_ACTION, content, 2,
                                                EMAIL_VIEWER_STRING_OK, _popup_response_to_destroy_cb,
                                                btn2, viewer_storage_full_popup_response_cb, NULL);
                        break;
@@ -407,7 +403,7 @@ static VIEWER_ERROR_TYPE_E _viewer_process_error_popup(EmailViewerUGD *ug_data)
                }
 
                debug_leave();
-               return ug_data->eViewerErrorType;
+               return view->eViewerErrorType;
        }
 
        debug_leave();
@@ -419,17 +415,17 @@ void _viewer_activate(email_view_t *self, email_view_state prev_state)
        debug_enter();
        retm_if(!self, "Invalid parameter: self is NULL!");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)self;
+       EmailViewerView *view = (EmailViewerView *)self;
 
        if (prev_state != EV_STATE_CREATED) {
                return;
        }
 
-       VIEWER_ERROR_TYPE_E error = _viewer_process_error_popup(ug_data);
+       VIEWER_ERROR_TYPE_E error = _viewer_process_error_popup(view);
        if (error != VIEWER_ERROR_NONE) {
                return;
        }
-       _viewer_update_data_on_start(ug_data);
+       _viewer_update_data_on_start(view);
 
        debug_leave();
 }
@@ -439,9 +435,9 @@ static void _viewer_update_data_on_start(void *data)
        debug_enter();
 
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       viewer_check_body_download(ug_data);
+       viewer_check_body_download(view);
 
        debug_leave();
 }
@@ -451,10 +447,10 @@ void _viewer_hide(email_view_t *self)
        debug_enter();
        retm_if(self == NULL, "Invalid parameter: self is NULL!");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)self;
+       EmailViewerView *view = (EmailViewerView *)self;
 
-       viewer_hide_webview(ug_data);
-       elm_object_focus_allow_set(ug_data->en_subject, EINA_FALSE);
+       viewer_hide_webview(view);
+       elm_object_focus_allow_set(view->en_subject, EINA_FALSE);
 
        debug_leave();
 }
@@ -464,10 +460,10 @@ void _viewer_show(email_view_t *self)
        debug_enter();
        retm_if(!self, "Invalid parameter: self is NULL!");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)self;
+       EmailViewerView *view = (EmailViewerView *)self;
 
-       viewer_show_webview(ug_data);
-       elm_object_focus_allow_set(ug_data->en_subject, EINA_TRUE);
+       viewer_show_webview(view);
+       elm_object_focus_allow_set(view->en_subject, EINA_TRUE);
 
        debug_leave();
 }
@@ -477,9 +473,9 @@ void _viewer_destroy(email_view_t *self)
        debug_enter();
        retm_if(!self, "Invalid parameter: self is NULL!");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)self;
+       EmailViewerView *view = (EmailViewerView *)self;
 
-       _destroy_viewer(ug_data);
+       _destroy_viewer(view);
 
        debug_leave();
 }
@@ -489,21 +485,21 @@ void _viewer_module_on_message(email_module_t *self, email_params_h msg)
        debug_enter();
        retm_if(!self, "Invalid parameter: self is NULL!");
 
-       EmailViewerModule *md = (EmailViewerModule *)self;
-       EmailViewerUGD *ug_data = &md->view;
+       EmailViewerModule *module = (EmailViewerModule *)self;
+       EmailViewerView *view = &module->view;
 
        bool wait_for_composer = false;
 
        const char *msg_type = NULL;
        email_params_get_str_opt(msg, EMAIL_BUNDLE_KEY_MSG, &msg_type);
 
-       if (ug_data->loaded_module && ug_data->is_composer_module_launched) {
+       if (view->loaded_module && view->is_composer_module_launched) {
                email_params_h params = NULL;
 
                if (email_params_create(&params) &&
                        email_params_add_str(params, EMAIL_BUNDLE_KEY_MSG, EMAIL_BUNDLE_VAL_EMAIL_COMPOSER_SAVE_DRAFT)) {
 
-                       email_module_send_message(ug_data->loaded_module, params);
+                       email_module_send_message(view->loaded_module, params);
                }
 
                email_params_free(&params);
@@ -513,68 +509,68 @@ void _viewer_module_on_message(email_module_t *self, email_params_h msg)
        if (g_strcmp0(msg_type, EMAIL_BUNDLE_VAL_VIEWER_DESTROY_VIEW) == 0) {
                debug_log("Email viewer need to be closed");
                if (wait_for_composer) {
-                       ug_data->need_pending_destroy = EINA_TRUE;
+                       view->need_pending_destroy = EINA_TRUE;
                } else {
-                       email_module_make_destroy_request(ug_data->base.module);
+                       email_module_make_destroy_request(view->base.module);
                }
                return;
        }
 
-       if (ug_data->loaded_module && !ug_data->is_composer_module_launched) {
-               email_module_destroy(ug_data->loaded_module);
-               ug_data->loaded_module = NULL;
+       if (view->loaded_module && !view->is_composer_module_launched) {
+               email_module_destroy(view->loaded_module);
+               view->loaded_module = NULL;
        }
 
        if (g_strcmp0(msg_type, EMAIL_BUNDLE_VAL_VIEWER_RESTORE_VIEW) == 0) {
                debug_log("Restore Email viewer");
-               _reset_view(ug_data, EINA_TRUE);
+               _reset_view(view, EINA_TRUE);
                return;
        }
 
        debug_log("Hide previous mail data");
-       _hide_view(ug_data);
+       _hide_view(view);
 
-       _g_md = ug_data;
+       _g_md = view;
 
-       int ret = viewer_initial_data_pre_parse_arguments(ug_data, msg);
+       int ret = viewer_initial_data_pre_parse_arguments(view, msg);
        if (ret != VIEWER_ERROR_NONE) {
                debug_log("viewer_initial_data_pre_parse_arguments() failed! (error type: %d)", ret);
-               ug_data->eViewerErrorType = ret;
+               view->eViewerErrorType = ret;
        }
 
        /* The viewer layout is not destroyed. Therefore, it runs with EINA_TRUE. */
-       ret = _construct_viewer_data(ug_data);
+       ret = _construct_viewer_data(view);
        if (ret != VIEWER_ERROR_NONE) {
                debug_log("_construct_viewer_data() failed! (error type: %d)", ret);
-               ug_data->eViewerErrorType = ret;
+               view->eViewerErrorType = ret;
        }
 
-       if (noti_mgr_dbus_receiver_setup(ug_data) == EINA_FALSE) {
+       if (noti_mgr_dbus_receiver_setup(view) == EINA_FALSE) {
                debug_log("Failed to initialize dbus");
-               ug_data->eViewerErrorType = VIEWER_ERROR_DBUS_FAIL;
+               view->eViewerErrorType = VIEWER_ERROR_DBUS_FAIL;
        }
 
-       if (ug_data->webview != NULL) {
-               Ewk_Settings *ewk_settings = ewk_view_settings_get(ug_data->webview);
-               debug_log("b_show_remote_images is %d", ug_data->b_show_remote_images);
-               if (ewk_settings_loads_images_automatically_set(ewk_settings, ug_data->b_show_remote_images) == EINA_FALSE) { /* ewk_settings_load_remote_images_set for remote image */
+       if (view->webview != NULL) {
+               Ewk_Settings *ewk_settings = ewk_view_settings_get(view->webview);
+               debug_log("b_show_remote_images is %d", view->b_show_remote_images);
+               if (ewk_settings_loads_images_automatically_set(ewk_settings, view->b_show_remote_images) == EINA_FALSE) { /* ewk_settings_load_remote_images_set for remote image */
                        debug_log("SET show images is FAILED!");
                }
        }
 
-       edje_object_signal_emit(_EDJ(ug_data->base.content), "hide_button", "elm.event.btn");
+       edje_object_signal_emit(_EDJ(view->base.content), "hide_button", "elm.event.btn");
 
-       int angle = elm_win_rotation_get(ug_data->base.module->win);
-       ug_data->isLandscape = ((angle == APP_DEVICE_ORIENTATION_90) || (angle == APP_DEVICE_ORIENTATION_270)) ? true : false;
-       debug_log("isLandscapte : %d", ug_data->isLandscape);
+       int angle = elm_win_rotation_get(view->base.module->win);
+       view->isLandscape = ((angle == APP_DEVICE_ORIENTATION_90) || (angle == APP_DEVICE_ORIENTATION_270)) ? true : false;
+       debug_log("isLandscapte : %d", view->isLandscape);
 
-       _reset_view(ug_data, EINA_FALSE);
+       _reset_view(view, EINA_FALSE);
 
-       create_body_progress(ug_data);
+       create_body_progress(view);
 
-       ug_data->b_viewer_hided = FALSE;
+       view->b_viewer_hided = FALSE;
 
-       VIEWER_ERROR_TYPE_E error = _viewer_process_error_popup(ug_data);
+       VIEWER_ERROR_TYPE_E error = _viewer_process_error_popup(view);
        if (error != VIEWER_ERROR_NONE) {
                return;
        }
@@ -587,18 +583,18 @@ static void _viewer_module_on_event(email_module_t *self, email_module_event_e e
        debug_enter();
        retm_if(!self, "Invalid parameter: self is NULL!");
 
-       EmailViewerModule *md = (EmailViewerModule *)self;
-       EmailViewerUGD *ug_data = &md->view;
+       EmailViewerModule *module = (EmailViewerModule *)self;
+       EmailViewerView *view = &module->view;
        debug_log("event = %d", event);
 
        switch (event) {
        case EM_EVENT_LOW_MEMORY_SOFT:
                debug_log("Low memory: %d", event);
-               viewer_webview_handle_mem_warning(ug_data, false);
+               viewer_webview_handle_mem_warning(view, false);
                break;
        case EM_EVENT_LOW_MEMORY_HARD:
                debug_log("Low memory: %d", event);
-               viewer_webview_handle_mem_warning(ug_data, true);
+               viewer_webview_handle_mem_warning(view, true);
                break;
 
        default:
@@ -614,59 +610,59 @@ static void _viewer_update(email_view_t *self, int flags)
        debug_enter();
        retm_if(!self, "Invalid parameter: self is NULL!");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)self;
+       EmailViewerView *view = (EmailViewerView *)self;
        debug_log("flags = %d", flags);
 
        if (flags & EVUF_LANGUAGE_CHANGED) {
-               _viewer_update_on_language_change(ug_data);
+               _viewer_update_on_language_change(view);
        }
 
        if (flags & EVUF_ORIENTATION_CHANGED) {
-               switch (ug_data->base.orientation) {
+               switch (view->base.orientation) {
                case APP_DEVICE_ORIENTATION_0:
                case APP_DEVICE_ORIENTATION_180:
-                       if (ug_data->webview) {
-                               ewk_view_orientation_send(ug_data->webview,
-                                               ug_data->base.orientation == APP_DEVICE_ORIENTATION_0 ? 0 : 180);
+                       if (view->webview) {
+                               ewk_view_orientation_send(view->webview,
+                                               view->base.orientation == APP_DEVICE_ORIENTATION_0 ? 0 : 180);
                        }
-                       if (ug_data->isLandscape == true) {
-                               _viewer_update_on_orientation_change(ug_data, false);
+                       if (view->isLandscape == true) {
+                               _viewer_update_on_orientation_change(view, false);
                        }
                        break;
 
                case APP_DEVICE_ORIENTATION_270:
                case APP_DEVICE_ORIENTATION_90:
-                       if (ug_data->webview) {
-                               ewk_view_orientation_send(ug_data->webview,
-                                               ug_data->base.orientation == APP_DEVICE_ORIENTATION_270 ? 90 : -90);
+                       if (view->webview) {
+                               ewk_view_orientation_send(view->webview,
+                                               view->base.orientation == APP_DEVICE_ORIENTATION_270 ? 90 : -90);
                        }
-                       if (ug_data->isLandscape == false) {
-                               _viewer_update_on_orientation_change(ug_data, true);
+                       if (view->isLandscape == false) {
+                               _viewer_update_on_orientation_change(view, true);
                        }
                        break;
                }
        }
 
        if (flags & EVUF_REGION_FMT_CHANGED) {
-               _viewer_update_on_region_change(ug_data);
+               _viewer_update_on_region_change(view);
        }
 
        debug_leave();
 }
 
-static void _viewer_update_on_orientation_change(EmailViewerUGD *ug_data, bool isLandscape)
+static void _viewer_update_on_orientation_change(EmailViewerView *view, bool isLandscape)
 {
        debug_enter();
-       retm_if(!ug_data, "Invalid parameter: ug_data is NULL!");
+       retm_if(!view, "Invalid parameter: view is NULL!");
 
-       ug_data->isLandscape = isLandscape;
-       viewer_set_vertical_scroller_position(ug_data);
+       view->isLandscape = isLandscape;
+       viewer_set_vertical_scroller_position(view);
        /* resize webview */
-       double scale = ewk_view_scale_get(ug_data->webview);
+       double scale = ewk_view_scale_get(view->webview);
        int content_height = 0;
-       ewk_view_contents_size_get(ug_data->webview, NULL, &content_height);
+       ewk_view_contents_size_get(view->webview, NULL, &content_height);
        if (content_height) {
-               viewer_resize_webview(ug_data, content_height * scale);
+               viewer_resize_webview(view, content_height * scale);
        }
 
        debug_log("content_height :%d scale :%f", content_height, scale);
@@ -674,98 +670,98 @@ static void _viewer_update_on_orientation_change(EmailViewerUGD *ug_data, bool i
        debug_leave();
 }
 
-static void _viewer_update_on_region_change(EmailViewerUGD *ug_data)
+static void _viewer_update_on_region_change(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(!ug_data, "Invalid parameter: ug_data is NULL!");
+       retm_if(!view, "Invalid parameter: view is NULL!");
 
-       header_update_date(ug_data);
+       header_update_date(view);
 
        debug_leave();
 }
 
-static void _viewer_update_on_language_change(EmailViewerUGD *ug_data)
+static void _viewer_update_on_language_change(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(!ug_data, "Invalid parameter: ug_data is NULL!");
+       retm_if(!view, "Invalid parameter: view is NULL!");
 
-       char *_subject = elm_entry_utf8_to_markup(ug_data->subject);
+       char *_subject = elm_entry_utf8_to_markup(view->subject);
        if (!g_strcmp0(_subject, "")) {
                g_free(_subject);
                _subject = g_strdup(email_get_email_string("IDS_EMAIL_SBODY_NO_SUBJECT_M_NOUN"));
-               elm_entry_entry_set(ug_data->en_subject, _subject);
+               elm_entry_entry_set(view->en_subject, _subject);
        }
        g_free(_subject);
 
-       if (ug_data->to_mbe) {
-               elm_object_text_set(ug_data->to_mbe, email_get_email_string("IDS_EMAIL_BODY_TO_M_RECIPIENT"));
+       if (view->to_mbe) {
+               elm_object_text_set(view->to_mbe, email_get_email_string("IDS_EMAIL_BODY_TO_M_RECIPIENT"));
        }
-       if (ug_data->cc_mbe) {
-               elm_object_text_set(ug_data->cc_mbe, email_get_email_string("IDS_EMAIL_BODY_CC"));
+       if (view->cc_mbe) {
+               elm_object_text_set(view->cc_mbe, email_get_email_string("IDS_EMAIL_BODY_CC"));
        }
-       if (ug_data->bcc_mbe) {
-               elm_object_text_set(ug_data->bcc_mbe, email_get_email_string("IDS_EMAIL_BODY_BCC"));
+       if (view->bcc_mbe) {
+               elm_object_text_set(view->bcc_mbe, email_get_email_string("IDS_EMAIL_BODY_BCC"));
        }
 
-       header_update_attachment_summary_info(ug_data);
+       header_update_attachment_summary_info(view);
 
        /* This code is specific for popups where string translation is not handled by EFL */
-       if (ug_data->notify && ug_data->popup_element_type) {
+       if (view->notify && view->popup_element_type) {
                char str[MAX_STR_LEN] = { 0, };
                char first_str[MAX_STR_LEN] = { 0, };
-               switch (ug_data->popup_element_type) {
+               switch (view->popup_element_type) {
                case POPUP_ELEMENT_TYPE_TITLE:
                        break;
                case POPUP_ELEMENT_TYPE_CONTENT:
-                       if (ug_data->extra_variable_type == VARIABLE_TYPE_INT) {
-                               if (ug_data->str_format2) {
-                                       if (ug_data->package_type2 == PACKAGE_TYPE_SYS_STRING) {
-                                               snprintf(str, sizeof(str), ug_data->str_format2, email_get_system_string(ug_data->translation_string_id2), ug_data->extra_variable_integer);
-                                       } else if (ug_data->package_type2 == PACKAGE_TYPE_PACKAGE) {
-                                               snprintf(str, sizeof(str), ug_data->str_format2, email_get_email_string(ug_data->translation_string_id2), ug_data->extra_variable_integer);
+                       if (view->extra_variable_type == VARIABLE_TYPE_INT) {
+                               if (view->str_format2) {
+                                       if (view->package_type2 == PACKAGE_TYPE_SYS_STRING) {
+                                               snprintf(str, sizeof(str), view->str_format2, email_get_system_string(view->translation_string_id2), view->extra_variable_integer);
+                                       } else if (view->package_type2 == PACKAGE_TYPE_PACKAGE) {
+                                               snprintf(str, sizeof(str), view->str_format2, email_get_email_string(view->translation_string_id2), view->extra_variable_integer);
                                        }
                                } else {
-                                       if (ug_data->package_type2 == PACKAGE_TYPE_SYS_STRING) {
-                                               snprintf(str, sizeof(str), email_get_system_string(ug_data->translation_string_id2), ug_data->extra_variable_integer);
-                                       } else if (ug_data->package_type2 == PACKAGE_TYPE_PACKAGE) {
-                                               snprintf(str, sizeof(str), email_get_email_string(ug_data->translation_string_id2), ug_data->extra_variable_integer);
+                                       if (view->package_type2 == PACKAGE_TYPE_SYS_STRING) {
+                                               snprintf(str, sizeof(str), email_get_system_string(view->translation_string_id2), view->extra_variable_integer);
+                                       } else if (view->package_type2 == PACKAGE_TYPE_PACKAGE) {
+                                               snprintf(str, sizeof(str), email_get_email_string(view->translation_string_id2), view->extra_variable_integer);
                                        }
                                }
-                       } else if (ug_data->extra_variable_type == VARIABLE_TYPE_STRING) {
-                               if (ug_data->str_format2) {
-                                       if (ug_data->package_type2 == PACKAGE_TYPE_SYS_STRING) {
-                                               snprintf(str, sizeof(str), ug_data->str_format2, email_get_system_string(ug_data->translation_string_id2), ug_data->extra_variable_string);
-                                       } else if (ug_data->package_type2 == PACKAGE_TYPE_PACKAGE) {
-                                               snprintf(str, sizeof(str), ug_data->str_format2, email_get_email_string(ug_data->translation_string_id2), ug_data->extra_variable_string);
+                       } else if (view->extra_variable_type == VARIABLE_TYPE_STRING) {
+                               if (view->str_format2) {
+                                       if (view->package_type2 == PACKAGE_TYPE_SYS_STRING) {
+                                               snprintf(str, sizeof(str), view->str_format2, email_get_system_string(view->translation_string_id2), view->extra_variable_string);
+                                       } else if (view->package_type2 == PACKAGE_TYPE_PACKAGE) {
+                                               snprintf(str, sizeof(str), view->str_format2, email_get_email_string(view->translation_string_id2), view->extra_variable_string);
                                        }
                                } else {
-                                       if (ug_data->package_type2 == PACKAGE_TYPE_SYS_STRING) {
-                                               snprintf(str, sizeof(str), email_get_system_string(ug_data->translation_string_id2), ug_data->extra_variable_string);
-                                       } else if (ug_data->package_type2 == PACKAGE_TYPE_PACKAGE) {
-                                               snprintf(str, sizeof(str), email_get_email_string(ug_data->translation_string_id2), ug_data->extra_variable_string);
+                                       if (view->package_type2 == PACKAGE_TYPE_SYS_STRING) {
+                                               snprintf(str, sizeof(str), email_get_system_string(view->translation_string_id2), view->extra_variable_string);
+                                       } else if (view->package_type2 == PACKAGE_TYPE_PACKAGE) {
+                                               snprintf(str, sizeof(str), email_get_email_string(view->translation_string_id2), view->extra_variable_string);
                                        }
                                }
                        } else {
-                               if (ug_data->package_type2 == PACKAGE_TYPE_SYS_STRING) {
-                                       snprintf(str, sizeof(str), "%s", email_get_system_string(ug_data->translation_string_id2));
-                               } else if (ug_data->package_type2 == PACKAGE_TYPE_PACKAGE) {
-                                       snprintf(str, sizeof(str), "%s", email_get_email_string(ug_data->translation_string_id2));
+                               if (view->package_type2 == PACKAGE_TYPE_SYS_STRING) {
+                                       snprintf(str, sizeof(str), "%s", email_get_system_string(view->translation_string_id2));
+                               } else if (view->package_type2 == PACKAGE_TYPE_PACKAGE) {
+                                       snprintf(str, sizeof(str), "%s", email_get_email_string(view->translation_string_id2));
                                } else {
-                                       snprintf(str, sizeof(str), "%s", ug_data->translation_string_id2);
+                                       snprintf(str, sizeof(str), "%s", view->translation_string_id2);
                                }
                        }
-                       if (ug_data->str_format1) {
-                               if (ug_data->package_type1 == PACKAGE_TYPE_SYS_STRING) {
-                                       snprintf(first_str, sizeof(first_str), ug_data->str_format1, email_get_system_string(ug_data->translation_string_id1), str);
-                               } else if (ug_data->package_type1 == PACKAGE_TYPE_PACKAGE) {
-                                       snprintf(first_str, sizeof(first_str), ug_data->str_format1, email_get_email_string(ug_data->translation_string_id1), str);
+                       if (view->str_format1) {
+                               if (view->package_type1 == PACKAGE_TYPE_SYS_STRING) {
+                                       snprintf(first_str, sizeof(first_str), view->str_format1, email_get_system_string(view->translation_string_id1), str);
+                               } else if (view->package_type1 == PACKAGE_TYPE_PACKAGE) {
+                                       snprintf(first_str, sizeof(first_str), view->str_format1, email_get_email_string(view->translation_string_id1), str);
                                } else {
-                                       snprintf(first_str, sizeof(first_str), ug_data->str_format1, ug_data->translation_string_id1, str);
+                                       snprintf(first_str, sizeof(first_str), view->str_format1, view->translation_string_id1, str);
                                }
                        } else {
-                               snprintf(first_str, sizeof(first_str), "%s", ug_data->translation_string_id1);
+                               snprintf(first_str, sizeof(first_str), "%s", view->translation_string_id1);
                        }
-                       elm_object_text_set(ug_data->notify, first_str);
+                       elm_object_text_set(view->notify, first_str);
                        break;
                case POPUP_ELEMENT_TYPE_BTN1:
                        break;
@@ -783,7 +779,7 @@ static Eina_Bool _viewer_launch_email_application_cb(void *data)
 {
        debug_enter();
        retvm_if(data == NULL, ECORE_CALLBACK_CANCEL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        app_control_h app_control = NULL;
        int ret = APP_CONTROL_ERROR_NONE;
@@ -804,46 +800,46 @@ static Eina_Bool _viewer_launch_email_application_cb(void *data)
        ret = app_control_destroy(app_control);
        debug_warning_if(ret != APP_CONTROL_ERROR_NONE, "app_control_destroy() failed! ret:[%d]", ret);
 
-       ug_data->launch_timer = NULL;
-       _popup_response_to_destroy_cb(ug_data, ug_data->notify, NULL);
+       view->launch_timer = NULL;
+       _popup_response_to_destroy_cb(view, view->notify, NULL);
 
        debug_leave();
        return ECORE_CALLBACK_CANCEL;
 }
 
-static int _construct_viewer_data(EmailViewerUGD *ug_data)
+static int _construct_viewer_data(EmailViewerView *view)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, VIEWER_ERROR_FAIL, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, VIEWER_ERROR_FAIL, "Invalid parameter: view[NULL]");
 
-       debug_log("pointer %p account_id [%d], mail_id [%d], mailbox_id [%d]", ug_data, ug_data->account_id, ug_data->mail_id, ug_data->mailbox_id);
-       if (((ug_data->account_id <= 0 || (ug_data->mail_id <= 0) || (ug_data->mailbox_id <= 0)) && (ug_data->viewer_type != EML_VIEWER))) {
+       debug_log("pointer %p account_id [%d], mail_id [%d], mailbox_id [%d]", view, view->account_id, view->mail_id, view->mailbox_id);
+       if (((view->account_id <= 0 || (view->mail_id <= 0) || (view->mailbox_id <= 0)) && (view->viewer_type != EML_VIEWER))) {
                debug_log("Required parameters are missing!");
                return VIEWER_ERROR_INVALID_ARG;
        }
 
-       if (viewer_create_temp_folder(ug_data) < 0) {
+       if (viewer_create_temp_folder(view) < 0) {
                debug_log("creating email viewer temp folder is failed");
                return VIEWER_ERROR_FAIL;
        }
 
-       G_FREE(ug_data->temp_viewer_html_file_path);
-       ug_data->temp_viewer_html_file_path = g_strdup_printf("%s/%s", ug_data->temp_folder_path, EMAIL_VIEWER_TMP_HTML_FILE);
+       G_FREE(view->temp_viewer_html_file_path);
+       view->temp_viewer_html_file_path = g_strdup_printf("%s/%s", view->temp_folder_path, EMAIL_VIEWER_TMP_HTML_FILE);
 
-       int ret = viewer_reset_mail_data(ug_data);
+       int ret = viewer_reset_mail_data(view);
        if (ret != VIEWER_ERROR_NONE) {
                debug_log("viewer_reset_mail_data() failed! (error type: %d)", ret);
                return ret;
        }
 
-       viewer_create_account_data(ug_data);
+       viewer_create_account_data(view);
 
-       if (ug_data->viewer_type == EMAIL_VIEWER) {
-               retvm_if(ug_data->mail_info == NULL, VIEWER_ERROR_GET_DATA_FAIL, "ug_data->mail_info is NULL.");
+       if (view->viewer_type == EMAIL_VIEWER) {
+               retvm_if(view->mail_info == NULL, VIEWER_ERROR_GET_DATA_FAIL, "view->mail_info is NULL.");
 
-               email_mail_data_t *mail_data = ug_data->mail_info;
-               ug_data->mailbox_type = mail_data->mailbox_type;
-               debug_log("mailbox_type:%d", ug_data->mailbox_type);
+               email_mail_data_t *mail_data = view->mail_info;
+               view->mailbox_type = mail_data->mailbox_type;
+               debug_log("mailbox_type:%d", view->mailbox_type);
                debug_secure("server_mailbox_name:%s", mail_data->server_mailbox_name);
        }
        return VIEWER_ERROR_NONE;
@@ -888,129 +884,129 @@ static Evas_Object *_create_box(Evas_Object *parent)
        return box;
 }
 
-static void _viewer_get_window_sizes(EmailViewerUGD *ug_data)
+static void _viewer_get_window_sizes(EmailViewerView *view)
 {
        debug_enter();
 
        Evas_Coord width, height;
-       evas_object_geometry_get(ug_data->base.module->win, NULL, NULL, &width, &height);
-       ug_data->main_w = width;
-       ug_data->main_h = height;
-       ug_data->scale_factor = elm_app_base_scale_get() / elm_config_scale_get();
+       evas_object_geometry_get(view->base.module->win, NULL, NULL, &width, &height);
+       view->main_w = width;
+       view->main_h = height;
+       view->scale_factor = elm_app_base_scale_get() / elm_config_scale_get();
 
        debug_log("WINDOW W[%d] H[%d]", width, height);
-       debug_log("ELM Scale[%f]", ug_data->scale_factor);
+       debug_log("ELM Scale[%f]", view->scale_factor);
 
 }
 
-static VIEWER_ERROR_TYPE_E _viewer_create_base_view(EmailViewerUGD *ug_data)
+static VIEWER_ERROR_TYPE_E _viewer_create_base_view(EmailViewerView *view)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, VIEWER_ERROR_FAIL, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, VIEWER_ERROR_FAIL, "Invalid parameter: view[NULL]");
 
-       _viewer_get_window_sizes(ug_data);
+       _viewer_get_window_sizes(view);
 
        /* add container layout */
-       ug_data->base.content = viewer_load_edj(ug_data->base.module->navi, email_get_viewer_theme_path(), "ev/viewer/base", EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       view->base.content = viewer_load_edj(view->base.module->navi, email_get_viewer_theme_path(), "ev/viewer/base", EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
-       if (ug_data->theme) {
-               elm_object_theme_set(ug_data->base.content, ug_data->theme);
+       if (view->theme) {
+               elm_object_theme_set(view->base.content, view->theme);
        }
-       retvm_if(ug_data->base.content == NULL, VIEWER_ERROR_FAIL, "Cannot load edj!");
-       evas_object_show(ug_data->base.content);
+       retvm_if(view->base.content == NULL, VIEWER_ERROR_FAIL, "Cannot load edj!");
+       evas_object_show(view->base.content);
 
        /* create scroller */
-       ug_data->scroller = _create_scroller(ug_data->base.content);
-       retvm_if(ug_data->scroller == NULL, VIEWER_ERROR_FAIL, "scroller is NULL!");
-       elm_object_part_content_set(ug_data->base.content, "ev.swallow.content", ug_data->scroller);
-       evas_object_smart_callback_add(ug_data->scroller, "edge,bottom", _outter_scroller_bottom_hit_cb, ug_data);
-       evas_object_smart_callback_add(ug_data->scroller, "edge,top", _outter_scroller_top_hit_cb, ug_data);
-       evas_object_show(ug_data->scroller);
+       view->scroller = _create_scroller(view->base.content);
+       retvm_if(view->scroller == NULL, VIEWER_ERROR_FAIL, "scroller is NULL!");
+       elm_object_part_content_set(view->base.content, "ev.swallow.content", view->scroller);
+       evas_object_smart_callback_add(view->scroller, "edge,bottom", _outter_scroller_bottom_hit_cb, view);
+       evas_object_smart_callback_add(view->scroller, "edge,top", _outter_scroller_top_hit_cb, view);
+       evas_object_show(view->scroller);
 
        /* create flick detection layer */
-       viewer_set_flick_layer(ug_data);
+       viewer_set_flick_layer(view);
 
        /* create base layout */
-       ug_data->base_ly = viewer_load_edj(ug_data->scroller, email_get_viewer_theme_path(), "ev/layout/base", EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       retvm_if(ug_data->base_ly == NULL, VIEWER_ERROR_FAIL, "Cannot load edj!");
-       elm_object_content_set(ug_data->scroller, ug_data->base_ly);
-       evas_object_show(ug_data->base_ly);
+       view->base_ly = viewer_load_edj(view->scroller, email_get_viewer_theme_path(), "ev/layout/base", EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       retvm_if(view->base_ly == NULL, VIEWER_ERROR_FAIL, "Cannot load edj!");
+       elm_object_content_set(view->scroller, view->base_ly);
+       evas_object_show(view->base_ly);
 
        /* create main box */
-       ug_data->main_bx = _create_box(ug_data->scroller);
-       retvm_if(ug_data->main_bx == NULL, VIEWER_ERROR_FAIL, "main_bx is NULL!");
-       elm_object_part_content_set(ug_data->base_ly, "ev.swallow.box", ug_data->main_bx);
-       evas_object_show(ug_data->main_bx);
+       view->main_bx = _create_box(view->scroller);
+       retvm_if(view->main_bx == NULL, VIEWER_ERROR_FAIL, "main_bx is NULL!");
+       elm_object_part_content_set(view->base_ly, "ev.swallow.box", view->main_bx);
+       evas_object_show(view->main_bx);
 
        /* push navigation bar */
-       email_module_view_push(&ug_data->base, NULL, EVPF_NO_BACK_BUTTON | EVPF_NO_TITLE);
+       email_module_view_push(&view->base, NULL, EVPF_NO_BACK_BUTTON | EVPF_NO_TITLE);
 
        /* This button is set for devices which doesn't have H/W more key. */
-       ug_data->more_btn = elm_button_add(ug_data->base.module->navi);
-       elm_object_style_set(ug_data->more_btn, "naviframe/more/default");
-       evas_object_smart_callback_add(ug_data->more_btn, "clicked", _more_cb, ug_data);
-       elm_object_item_part_content_set(ug_data->base.navi_item, "toolbar_more_btn", ug_data->more_btn);
+       view->more_btn = elm_button_add(view->base.module->navi);
+       elm_object_style_set(view->more_btn, "naviframe/more/default");
+       evas_object_smart_callback_add(view->more_btn, "clicked", _more_cb, view);
+       elm_object_item_part_content_set(view->base.navi_item, "toolbar_more_btn", view->more_btn);
 
        debug_leave();
        return VIEWER_ERROR_NONE;
 }
 
-void _reset_view(EmailViewerUGD *ug_data, Eina_Bool update_body)
+void _reset_view(EmailViewerView *view, Eina_Bool update_body)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       if (ug_data->base.module->views_count > 1) {
-               email_module_exit_view(&ug_data->attachment_view);
+       if (view->base.module->views_count > 1) {
+               email_module_exit_view(&view->attachment_view);
        }
 
-       debug_log("@@@@@@@@@@ isLandscape = %d", ug_data->isLandscape);
-       if (ug_data->isLandscape == true) {
+       debug_log("@@@@@@@@@@ isLandscape = %d", view->isLandscape);
+       if (view->isLandscape == true) {
                debug_log("In Split view - Hiding navi bar");
                /* Set scroller to start - height made 480 to consider viewer in split view */
-               elm_scroller_region_show(ug_data->scroller, 0, 0, (int)((double)ug_data->main_h * 0.6), ug_data->main_w);
+               elm_scroller_region_show(view->scroller, 0, 0, (int)((double)view->main_h * 0.6), view->main_w);
        } else {
                debug_log("In Full view - Showing navi bar");
                /* Set scroller to start */
-               elm_scroller_region_show(ug_data->scroller, 0, 0, ug_data->main_w, ug_data->main_h);
+               elm_scroller_region_show(view->scroller, 0, 0, view->main_w, view->main_h);
        }
 
-       if (elm_object_scroll_freeze_get(ug_data->scroller) > 0)
-               elm_object_scroll_freeze_pop(ug_data->scroller);
+       if (elm_object_scroll_freeze_get(view->scroller) > 0)
+               elm_object_scroll_freeze_pop(view->scroller);
 
-       viewer_check_body_download(ug_data);
+       viewer_check_body_download(view);
 
        if (update_body) {
-               header_update_view(ug_data);
+               header_update_view(view);
        } else {
-               ug_data->is_recipient_ly_shown = EINA_FALSE;
-               header_layout_unpack(ug_data);
-               header_create_view(ug_data);
-               header_update_view(ug_data);
+               view->is_recipient_ly_shown = EINA_FALSE;
+               header_layout_unpack(view);
+               header_create_view(view);
+               header_update_view(view);
        }
 
        debug_leave();
 }
 
-void _hide_view(EmailViewerUGD *ug_data)
+void _hide_view(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       ug_data->b_viewer_hided = TRUE;
+       view->b_viewer_hided = TRUE;
 
-       viewer_webkit_del_callbacks(ug_data);
-       viewer_delete_account_data(ug_data);
-       viewer_stop_ecore_running_apis(ug_data);
-       viewer_delete_evas_objects(ug_data, EINA_TRUE);
-       viewer_remove_hard_link_for_inline_images(ug_data);
+       viewer_webkit_del_callbacks(view);
+       viewer_delete_account_data(view);
+       viewer_stop_ecore_running_apis(view);
+       viewer_delete_evas_objects(view, EINA_TRUE);
+       viewer_remove_hard_link_for_inline_images(view);
 
-       viewer_remove_temp_files(ug_data);
-       viewer_remove_temp_folders(ug_data);
-       viewer_free_viewer_data(ug_data);
-       noti_mgr_dbus_receiver_remove(ug_data);
+       viewer_remove_temp_files(view);
+       viewer_remove_temp_folders(view);
+       viewer_free_viewer_data(view);
+       noti_mgr_dbus_receiver_remove(view);
 
-       viewer_initialize_data(ug_data);
+       viewer_initialize_data(view);
        _g_md = NULL;
        debug_leave();
 }
@@ -1018,189 +1014,189 @@ void _hide_view(EmailViewerUGD *ug_data)
 /**
  * initialize viewer's private data
  */
-Eina_Bool viewer_initialize_data(EmailViewerUGD *ug_data)
+Eina_Bool viewer_initialize_data(EmailViewerView *view)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, EINA_FALSE, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, EINA_FALSE, "Invalid parameter: view[NULL]");
 
-       ug_data->loaded_module = NULL;
+       view->loaded_module = NULL;
 
-       ug_data->main_w = 0;
-       ug_data->main_h = 0;
-       ug_data->eViewerErrorType = VIEWER_ERROR_NONE;
+       view->main_w = 0;
+       view->main_h = 0;
+       view->eViewerErrorType = VIEWER_ERROR_NONE;
 
        /*dbus*/
-       ug_data->viewer_dbus_conn = NULL;
-       ug_data->viewer_network_id = 0;
-       ug_data->viewer_storage_id = 0;
+       view->viewer_dbus_conn = NULL;
+       view->viewer_network_id = 0;
+       view->viewer_storage_id = 0;
 
        /*combined scroller*/
-       ug_data->combined_scroller = NULL;
-       ug_data->webkit_scroll_y = 0;
-       ug_data->webkit_scroll_x = 0;
-       ug_data->header_height = 0;
-       ug_data->trailer_height = 0;
-       ug_data->total_height = 0;
-       ug_data->total_width = 0;
-       ug_data->main_scroll_y = 0;
-       ug_data->main_scroll_h = 0;
-       ug_data->main_scroll_w = 0;
+       view->combined_scroller = NULL;
+       view->webkit_scroll_y = 0;
+       view->webkit_scroll_x = 0;
+       view->header_height = 0;
+       view->trailer_height = 0;
+       view->total_height = 0;
+       view->total_width = 0;
+       view->main_scroll_y = 0;
+       view->main_scroll_h = 0;
+       view->main_scroll_w = 0;
 
        /* arguments */
-       ug_data->account_id = 0;
-       ug_data->account_type = 0;
-       ug_data->mail_id = 0;
-       ug_data->mailbox_id = 0;
-       ug_data->account_email_address = NULL;
-       ug_data->temp_folder_path = NULL;
-       ug_data->temp_viewer_html_file_path = NULL;
+       view->account_id = 0;
+       view->account_type = 0;
+       view->mail_id = 0;
+       view->mailbox_id = 0;
+       view->account_email_address = NULL;
+       view->temp_folder_path = NULL;
+       view->temp_viewer_html_file_path = NULL;
        /* for preview */
-       ug_data->temp_preview_folder_path = NULL;
+       view->temp_preview_folder_path = NULL;
 
        /* flags */
-       ug_data->b_viewer_hided = 0;
-       ug_data->b_partial_body = 0;
-       ug_data->scroller_locked = 0;
-       ug_data->is_composer_module_launched = FALSE;
-
-       ug_data->can_destroy_on_msg_delete = false;
-       ug_data->b_load_finished = EINA_FALSE;
-       ug_data->b_show_remote_images = EINA_FALSE;
-       ug_data->is_long_pressed = EINA_FALSE;
-       ug_data->is_webview_scrolling = EINA_FALSE;
-       ug_data->is_main_scroller_scrolling = EINA_TRUE;
-       ug_data->is_outer_scroll_bot_hit = EINA_FALSE;
-       ug_data->is_magnifier_opened = EINA_FALSE;
-       ug_data->is_recipient_ly_shown = EINA_FALSE;
-       ug_data->is_download_message_btn_clicked = EINA_FALSE;
-       ug_data->is_cancel_sending_btn_clicked = EINA_FALSE;
-       ug_data->is_storage_full_popup_shown = EINA_FALSE;
-       ug_data->need_pending_destroy = EINA_FALSE;
-       ug_data->is_top_webview_reached = EINA_FALSE;
-       ug_data->is_bottom_webview_reached = EINA_FALSE;
-       ug_data->is_scrolling_down = EINA_FALSE;
-       ug_data->is_scrolling_up = EINA_FALSE;
-       ug_data->is_webview_text_selected = EINA_FALSE;
+       view->b_viewer_hided = 0;
+       view->b_partial_body = 0;
+       view->scroller_locked = 0;
+       view->is_composer_module_launched = FALSE;
+
+       view->can_destroy_on_msg_delete = false;
+       view->b_load_finished = EINA_FALSE;
+       view->b_show_remote_images = EINA_FALSE;
+       view->is_long_pressed = EINA_FALSE;
+       view->is_webview_scrolling = EINA_FALSE;
+       view->is_main_scroller_scrolling = EINA_TRUE;
+       view->is_outer_scroll_bot_hit = EINA_FALSE;
+       view->is_magnifier_opened = EINA_FALSE;
+       view->is_recipient_ly_shown = EINA_FALSE;
+       view->is_download_message_btn_clicked = EINA_FALSE;
+       view->is_cancel_sending_btn_clicked = EINA_FALSE;
+       view->is_storage_full_popup_shown = EINA_FALSE;
+       view->need_pending_destroy = EINA_FALSE;
+       view->is_top_webview_reached = EINA_FALSE;
+       view->is_bottom_webview_reached = EINA_FALSE;
+       view->is_scrolling_down = EINA_FALSE;
+       view->is_scrolling_up = EINA_FALSE;
+       view->is_webview_text_selected = EINA_FALSE;
 
        /*eml viewer*/
-       ug_data->viewer_type = EMAIL_VIEWER;
-       ug_data->eml_file_path = NULL;
+       view->viewer_type = EMAIL_VIEWER;
+       view->eml_file_path = NULL;
 
        /*popup translation*/
-       ug_data->popup_element_type = 0;
-       ug_data->package_type1 = 0;
-       ug_data->package_type2 = 0;
-       ug_data->translation_string_id1 = NULL;
-       ug_data->translation_string_id2 = NULL;
-       ug_data->extra_variable_type = 0;
-       ug_data->extra_variable_string = NULL;
-       ug_data->extra_variable_integer = 0;
-       ug_data->str_format1 = NULL;
-       ug_data->str_format2 = NULL;
-
-       /* for ug create */
-       ug_data->create_contact_arg = 0;
+       view->popup_element_type = 0;
+       view->package_type1 = 0;
+       view->package_type2 = 0;
+       view->translation_string_id1 = NULL;
+       view->translation_string_id2 = NULL;
+       view->extra_variable_type = 0;
+       view->extra_variable_string = NULL;
+       view->extra_variable_integer = 0;
+       view->str_format1 = NULL;
+       view->str_format2 = NULL;
+
+       /* for module create */
+       view->create_contact_arg = 0;
 
        /* Scalable UI */
-       ug_data->scale_factor = 0.0;
-       ug_data->webview_width = 0;
-       ug_data->webview_height = 0;
+       view->scale_factor = 0.0;
+       view->webview_width = 0;
+       view->webview_height = 0;
 
        /* rotation */
-       ug_data->isLandscape = 0;
+       view->isLandscape = 0;
 
        /* mailbox list */
-       ug_data->mailbox_type = EMAIL_MAILBOX_TYPE_NONE;
-       ug_data->folder_list = NULL;
-       ug_data->move_mailbox_list = NULL;
-       ug_data->move_mailbox_count = 0;
-       ug_data->move_status = 0;
+       view->mailbox_type = EMAIL_MAILBOX_TYPE_NONE;
+       view->folder_list = NULL;
+       view->move_mailbox_list = NULL;
+       view->move_mailbox_count = 0;
+       view->move_status = 0;
 
        /* Evas Object */
-       ug_data->en_subject = NULL;
-       ug_data->subject_ly = NULL;
-       ug_data->sender_ly = NULL;
-       ug_data->attachment_ly = NULL;
-       ug_data->webview_ly = NULL;
-       ug_data->webview_button = NULL;
-       ug_data->webview = NULL;
-       ug_data->list_progressbar = NULL;
-       ug_data->con_popup = NULL;
-       ug_data->notify = NULL;
-       ug_data->pb_notify = NULL;
-       ug_data->pb_notify_lb = NULL;
-       ug_data->dn_btn = NULL;
-       ug_data->to_mbe = NULL;
-       ug_data->to_ly = NULL;
-       ug_data->cc_mbe = NULL;
-       ug_data->cc_ly = NULL;
-       ug_data->bcc_mbe = NULL;
-       ug_data->bcc_ly = NULL;
-       ug_data->to_recipients_cnt = 0;
-       ug_data->cc_recipients_cnt = 0;
-       ug_data->bcc_recipients_cnt = 0;
-       ug_data->to_recipient_idler = NULL;
-       ug_data->cc_recipient_idler = NULL;
-       ug_data->bcc_recipient_idler = NULL;
-       ug_data->idler_regionbringin = NULL;
-
-       ug_data->attachment_save_thread = 0;
-       ug_data->attachment_update_job = NULL;
-       ug_data->attachment_update_timer = NULL;
-       ug_data->attachment_data_list = NULL;
-       ug_data->attachment_data_list_to_save = NULL;
-       ug_data->preview_aid = NULL;
-       ug_data->show_cancel_all_btn = false;
-       ug_data->attachment_genlist = NULL;
-       ug_data->save_all_btn = NULL;
-       ug_data->attachment_group_item = NULL;
-       ug_data->attachment_itc = NULL;
-       ug_data->attachment_group_itc = NULL;
-
-       ug_data->cancel_sending_ctx_item = NULL;
-
-       ug_data->webview_data = NULL;
+       view->en_subject = NULL;
+       view->subject_ly = NULL;
+       view->sender_ly = NULL;
+       view->attachment_ly = NULL;
+       view->webview_ly = NULL;
+       view->webview_button = NULL;
+       view->webview = NULL;
+       view->list_progressbar = NULL;
+       view->con_popup = NULL;
+       view->notify = NULL;
+       view->pb_notify = NULL;
+       view->pb_notify_lb = NULL;
+       view->dn_btn = NULL;
+       view->to_mbe = NULL;
+       view->to_ly = NULL;
+       view->cc_mbe = NULL;
+       view->cc_ly = NULL;
+       view->bcc_mbe = NULL;
+       view->bcc_ly = NULL;
+       view->to_recipients_cnt = 0;
+       view->cc_recipients_cnt = 0;
+       view->bcc_recipients_cnt = 0;
+       view->to_recipient_idler = NULL;
+       view->cc_recipient_idler = NULL;
+       view->bcc_recipient_idler = NULL;
+       view->idler_regionbringin = NULL;
+
+       view->attachment_save_thread = 0;
+       view->attachment_update_job = NULL;
+       view->attachment_update_timer = NULL;
+       view->attachment_data_list = NULL;
+       view->attachment_data_list_to_save = NULL;
+       view->preview_aid = NULL;
+       view->show_cancel_all_btn = false;
+       view->attachment_genlist = NULL;
+       view->save_all_btn = NULL;
+       view->attachment_group_item = NULL;
+       view->attachment_itc = NULL;
+       view->attachment_group_itc = NULL;
+
+       view->cancel_sending_ctx_item = NULL;
+
+       view->webview_data = NULL;
 
        /* Email Viewer Private variables */
-       ug_data->file_id = NULL;
-       ug_data->file_size = 0;
-       ug_data->email_handle = 0;
-       ug_data->mail_info = NULL;
-       ug_data->attachment_info = NULL;
-       ug_data->attachment_count = 0;
+       view->file_id = NULL;
+       view->file_size = 0;
+       view->email_handle = 0;
+       view->mail_info = NULL;
+       view->attachment_info = NULL;
+       view->attachment_count = 0;
 
        /*Email Viewer Property Variables*/
-       ug_data->mail_type = 0;
-       ug_data->mktime = 0;
-       ug_data->sender_address = NULL;
-       ug_data->sender_display_name = NULL;
-       ug_data->subject = NULL;
-       ug_data->charset = NULL;
-       ug_data->body = NULL;
-       ug_data->body_uri = NULL;
-       ug_data->attachment_info_list = NULL;
-       ug_data->total_att_count = 0;
-       ug_data->normal_att_count = 0;
-       ug_data->total_att_size = 0;
-       ug_data->has_html = FALSE;
-       ug_data->has_attachment = FALSE;
-       ug_data->has_inline_image = FALSE;
-       ug_data->is_smil_mail = FALSE;
-       ug_data->favorite = FALSE;
-       ug_data->request_report = FALSE;
-
-       ug_data->account = NULL;
-
-       ug_data->launch_timer = NULL;
-       ug_data->rcpt_scroll_corr = NULL;
-
-       ug_data->recipient_address = NULL;
-       ug_data->recipient_name = NULL;
-       ug_data->selected_address = NULL;
-       ug_data->selected_name = NULL;
-       ug_data->recipient_contact_list_item = NULL;
-
-       ug_data->passwd_popup = NULL;
+       view->mail_type = 0;
+       view->mktime = 0;
+       view->sender_address = NULL;
+       view->sender_display_name = NULL;
+       view->subject = NULL;
+       view->charset = NULL;
+       view->body = NULL;
+       view->body_uri = NULL;
+       view->attachment_info_list = NULL;
+       view->total_att_count = 0;
+       view->normal_att_count = 0;
+       view->total_att_size = 0;
+       view->has_html = FALSE;
+       view->has_attachment = FALSE;
+       view->has_inline_image = FALSE;
+       view->is_smil_mail = FALSE;
+       view->favorite = FALSE;
+       view->request_report = FALSE;
+
+       view->account = NULL;
+
+       view->launch_timer = NULL;
+       view->rcpt_scroll_corr = NULL;
+
+       view->recipient_address = NULL;
+       view->recipient_name = NULL;
+       view->selected_address = NULL;
+       view->selected_name = NULL;
+       view->recipient_contact_list_item = NULL;
+
+       view->passwd_popup = NULL;
        return EINA_TRUE;
 }
 
@@ -1208,123 +1204,123 @@ static void _timezone_changed_cb(system_settings_key_e key, void *data)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       header_update_date(ug_data);
+       header_update_date(view);
        debug_leave();
 }
 
-void create_body_progress(EmailViewerUGD *ug_data)
+void create_body_progress(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
-       retm_if(ug_data->list_progressbar != NULL, "progressbar already present");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
+       retm_if(view->list_progressbar != NULL, "progressbar already present");
        /*unset webview to show progressbar*/
        /*webview will be set on "load,finished" callback or after setting search highlight*/
-       if (ug_data->webview_ly && ug_data->webview) {
-               elm_object_part_content_unset(ug_data->webview_ly, "elm.swallow.content");
-               evas_object_hide(ug_data->webview);
+       if (view->webview_ly && view->webview) {
+               elm_object_part_content_unset(view->webview_ly, "elm.swallow.content");
+               evas_object_hide(view->webview);
        }
 
        /*create list process animation*/
        debug_log("Creating list progress");
-       ug_data->list_progressbar = elm_progressbar_add(ug_data->base.content);
-       elm_object_style_set(ug_data->list_progressbar, "process_large");
-       evas_object_size_hint_align_set(ug_data->list_progressbar, EVAS_HINT_FILL, 0.5);
-       evas_object_size_hint_weight_set(ug_data->list_progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       evas_object_show(ug_data->list_progressbar);
-       elm_progressbar_pulse(ug_data->list_progressbar, EINA_TRUE);
-       elm_object_part_content_set(ug_data->base.content, "ev.swallow.progress", ug_data->list_progressbar);
+       view->list_progressbar = elm_progressbar_add(view->base.content);
+       elm_object_style_set(view->list_progressbar, "process_large");
+       evas_object_size_hint_align_set(view->list_progressbar, EVAS_HINT_FILL, 0.5);
+       evas_object_size_hint_weight_set(view->list_progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_show(view->list_progressbar);
+       elm_progressbar_pulse(view->list_progressbar, EINA_TRUE);
+       elm_object_part_content_set(view->base.content, "ev.swallow.progress", view->list_progressbar);
        debug_leave();
 }
 
-void _create_body(EmailViewerUGD *ug_data)
+void _create_body(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
        /* create webview */
-       if (ug_data->webview == NULL) {
-               viewer_get_webview(ug_data);
+       if (view->webview == NULL) {
+               viewer_get_webview(view);
        }
 
-       viewer_set_webview_content(ug_data);
-       viewer_set_mail_seen(ug_data);
+       viewer_set_webview_content(view);
+       viewer_set_mail_seen(view);
 
        debug_leave();
 }
 
-void viewer_stop_ecore_running_apis(EmailViewerUGD *ug_data)
+void viewer_stop_ecore_running_apis(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
-
-       DELETE_TIMER_OBJECT(ug_data->launch_timer);
-       DELETE_TIMER_OBJECT(ug_data->rcpt_scroll_corr);
-       DELETE_IDLER_OBJECT(ug_data->idler_regionbringin);
-       DELETE_IDLER_OBJECT(ug_data->to_recipient_idler);
-       DELETE_IDLER_OBJECT(ug_data->cc_recipient_idler);
-       DELETE_IDLER_OBJECT(ug_data->bcc_recipient_idler);
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
+
+       DELETE_TIMER_OBJECT(view->launch_timer);
+       DELETE_TIMER_OBJECT(view->rcpt_scroll_corr);
+       DELETE_IDLER_OBJECT(view->idler_regionbringin);
+       DELETE_IDLER_OBJECT(view->to_recipient_idler);
+       DELETE_IDLER_OBJECT(view->cc_recipient_idler);
+       DELETE_IDLER_OBJECT(view->bcc_recipient_idler);
 }
 
-void viewer_delete_evas_objects(EmailViewerUGD *ug_data, Eina_Bool isHide)
+void viewer_delete_evas_objects(EmailViewerView *view, Eina_Bool isHide)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       if (ug_data->base.module->views_count > 1) {
-               email_module_exit_view(&ug_data->attachment_view);
+       if (view->base.module->views_count > 1) {
+               email_module_exit_view(&view->attachment_view);
        }
 
-       FREE(ug_data->eml_file_path);
+       FREE(view->eml_file_path);
 
        /* folder list */
-       if (NULL != ug_data->folder_list) {
+       if (NULL != view->folder_list) {
                int i = 0;
-               LIST_ITER_START(i, ug_data->folder_list) {
-                       email_mailbox_name_and_alias_t *nameandalias = (email_mailbox_name_and_alias_t *)LIST_ITER_GET_DATA(i, ug_data->folder_list);
+               LIST_ITER_START(i, view->folder_list) {
+                       email_mailbox_name_and_alias_t *nameandalias = (email_mailbox_name_and_alias_t *)LIST_ITER_GET_DATA(i, view->folder_list);
                        FREE(nameandalias->name);
                        FREE(nameandalias->alias);
                        FREE(nameandalias);
                }
-               g_list_free(ug_data->folder_list);
-               ug_data->folder_list = NULL;
+               g_list_free(view->folder_list);
+               view->folder_list = NULL;
        }
 
        /* mailbox list */
-       if (ug_data->move_mailbox_list) {
-               email_free_mailbox(&ug_data->move_mailbox_list, ug_data->move_mailbox_count);
-               ug_data->move_mailbox_list = NULL;
-               ug_data->move_mailbox_count = 0;
+       if (view->move_mailbox_list) {
+               email_free_mailbox(&view->move_mailbox_list, view->move_mailbox_count);
+               view->move_mailbox_list = NULL;
+               view->move_mailbox_count = 0;
        }
 
        /* Evas Object */
-       DELETE_EVAS_OBJECT(ug_data->passwd_popup);
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
-       DELETE_EVAS_OBJECT(ug_data->pb_notify);
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       DELETE_EVAS_OBJECT(view->passwd_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
+       DELETE_EVAS_OBJECT(view->pb_notify);
+       DELETE_EVAS_OBJECT(view->notify);
 
        if (isHide) {
-               DELETE_EVAS_OBJECT(ug_data->combined_scroller);
-               DELETE_EVAS_OBJECT(ug_data->subject_ly);
-               DELETE_EVAS_OBJECT(ug_data->en_subject);
-               DELETE_EVAS_OBJECT(ug_data->sender_ly);
-               DELETE_EVAS_OBJECT(ug_data->to_ly);
-               DELETE_EVAS_OBJECT(ug_data->cc_ly);
-               DELETE_EVAS_OBJECT(ug_data->bcc_ly);
-               DELETE_EVAS_OBJECT(ug_data->header_divider);
-               DELETE_EVAS_OBJECT(ug_data->priority_sender_image);
-               DELETE_EVAS_OBJECT(ug_data->details_button);
-               DELETE_EVAS_OBJECT(ug_data->attachment_ly);
-               DELETE_EVAS_OBJECT(ug_data->dn_btn);
-               DELETE_EVAS_OBJECT(ug_data->webview_ly);
-               DELETE_EVAS_OBJECT(ug_data->webview_button);
-               DELETE_EVAS_OBJECT(ug_data->list_progressbar);
-       }
-
-       FREE(ug_data->selected_address);
-       FREE(ug_data->selected_name);
-       email_contacts_delete_contact_info(&ug_data->recipient_contact_list_item);
+               DELETE_EVAS_OBJECT(view->combined_scroller);
+               DELETE_EVAS_OBJECT(view->subject_ly);
+               DELETE_EVAS_OBJECT(view->en_subject);
+               DELETE_EVAS_OBJECT(view->sender_ly);
+               DELETE_EVAS_OBJECT(view->to_ly);
+               DELETE_EVAS_OBJECT(view->cc_ly);
+               DELETE_EVAS_OBJECT(view->bcc_ly);
+               DELETE_EVAS_OBJECT(view->header_divider);
+               DELETE_EVAS_OBJECT(view->priority_sender_image);
+               DELETE_EVAS_OBJECT(view->details_button);
+               DELETE_EVAS_OBJECT(view->attachment_ly);
+               DELETE_EVAS_OBJECT(view->dn_btn);
+               DELETE_EVAS_OBJECT(view->webview_ly);
+               DELETE_EVAS_OBJECT(view->webview_button);
+               DELETE_EVAS_OBJECT(view->list_progressbar);
+       }
+
+       FREE(view->selected_address);
+       FREE(view->selected_name);
+       email_contacts_delete_contact_info(&view->recipient_contact_list_item);
 
        debug_leave();
 }
@@ -1334,8 +1330,8 @@ static void _viewer_on_back_key(email_view_t *self)
        debug_enter();
        retm_if(self == NULL, "Invalid parameter: self is NULL");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)self;
-       viewer_back_key_press_handler(ug_data);
+       EmailViewerView *view = (EmailViewerView *)self;
+       viewer_back_key_press_handler(view);
 
        debug_leave();
 }
@@ -1345,18 +1341,18 @@ void _reply_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_U
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       DELETE_EVAS_OBJECT(view->con_popup);
+       DELETE_EVAS_OBJECT(view->notify);
 
-       if (ug_data->viewer_type == EML_VIEWER) {
-               viewer_launch_composer(ug_data, RUN_EML_REPLY);
+       if (view->viewer_type == EML_VIEWER) {
+               viewer_launch_composer(view, RUN_EML_REPLY);
        } else {
-               bool is_body_fully_downloaded = viewer_check_body_download_status(ug_data->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED);
+               bool is_body_fully_downloaded = viewer_check_body_download_status(view->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED);
 
-               email_attachment_data_t *attach_data = ug_data->attachment_info;
-               int attach_count = ug_data->attachment_count;
+               email_attachment_data_t *attach_data = view->attachment_info;
+               int attach_count = view->attachment_count;
 
                int i = 0;
                bool is_inline_fully_downloaded = false;
@@ -1366,13 +1362,13 @@ void _reply_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_U
                        }
                }
 
-               debug_log("is_body_fully_downloaded [%d], account_type [%d], has_inline_image [%d], is_inline_fully_downloaded [%d]", is_body_fully_downloaded, ug_data->account_type, ug_data->has_inline_image, is_inline_fully_downloaded);
-               if (!is_body_fully_downloaded && !(ug_data->has_inline_image && is_inline_fully_downloaded)) {
-                       util_create_notify(ug_data, EMAIL_VIEWER_HEADER_DOWNLOAD_ENTIRE_EMAIL, EMAIL_VIEWER_POP_PARTIAL_BODY_DOWNLOADED_REST_LOST, 2,
+               debug_log("is_body_fully_downloaded [%d], account_type [%d], has_inline_image [%d], is_inline_fully_downloaded [%d]", is_body_fully_downloaded, view->account_type, view->has_inline_image, is_inline_fully_downloaded);
+               if (!is_body_fully_downloaded && !(view->has_inline_image && is_inline_fully_downloaded)) {
+                       util_create_notify(view, EMAIL_VIEWER_HEADER_DOWNLOAD_ENTIRE_EMAIL, EMAIL_VIEWER_POP_PARTIAL_BODY_DOWNLOADED_REST_LOST, 2,
                                        EMAIL_VIEWER_STRING_CANCEL, _popup_response_cb,
                                        EMAIL_VIEWER_BUTTON_CONTINUE, _popup_response_continue_reply_cb, NULL);
                } else {
-                       viewer_launch_composer(ug_data, RUN_COMPOSER_REPLY);
+                       viewer_launch_composer(view, RUN_COMPOSER_REPLY);
                }
        }
        debug_leave();
@@ -1383,18 +1379,18 @@ void _reply_all_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EI
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       DELETE_EVAS_OBJECT(view->con_popup);
+       DELETE_EVAS_OBJECT(view->notify);
 
-       if (ug_data->viewer_type == EML_VIEWER) {
-               viewer_launch_composer(ug_data, RUN_EML_REPLY_ALL);
+       if (view->viewer_type == EML_VIEWER) {
+               viewer_launch_composer(view, RUN_EML_REPLY_ALL);
        } else {
-               bool is_body_fully_downloaded = viewer_check_body_download_status(ug_data->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED);
+               bool is_body_fully_downloaded = viewer_check_body_download_status(view->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED);
 
-               email_attachment_data_t *attach_data = ug_data->attachment_info;
-               int attach_count = ug_data->attachment_count;
+               email_attachment_data_t *attach_data = view->attachment_info;
+               int attach_count = view->attachment_count;
 
                int i = 0;
                bool is_inline_fully_downloaded = false;
@@ -1404,13 +1400,13 @@ void _reply_all_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EI
                        }
                }
 
-               debug_log("is_body_fully_downloaded [%d], account_type [%d], has_inline_image [%d], is_inline_fully_downloaded [%d]", is_body_fully_downloaded, ug_data->account_type, ug_data->has_inline_image, is_inline_fully_downloaded);
-               if (!is_body_fully_downloaded && !(ug_data->has_inline_image && is_inline_fully_downloaded)) {
-                       util_create_notify(ug_data, EMAIL_VIEWER_HEADER_DOWNLOAD_ENTIRE_EMAIL, EMAIL_VIEWER_POP_PARTIAL_BODY_DOWNLOADED_REST_LOST, 2,
+               debug_log("is_body_fully_downloaded [%d], account_type [%d], has_inline_image [%d], is_inline_fully_downloaded [%d]", is_body_fully_downloaded, view->account_type, view->has_inline_image, is_inline_fully_downloaded);
+               if (!is_body_fully_downloaded && !(view->has_inline_image && is_inline_fully_downloaded)) {
+                       util_create_notify(view, EMAIL_VIEWER_HEADER_DOWNLOAD_ENTIRE_EMAIL, EMAIL_VIEWER_POP_PARTIAL_BODY_DOWNLOADED_REST_LOST, 2,
                                        EMAIL_VIEWER_STRING_CANCEL, _popup_response_cb,
                                        EMAIL_VIEWER_BUTTON_CONTINUE, _popup_response_continue_reply_all_cb, NULL);
                } else {
-                       viewer_launch_composer(ug_data, RUN_COMPOSER_REPLY_ALL);
+                       viewer_launch_composer(view, RUN_COMPOSER_REPLY_ALL);
                }
        }
        debug_leave();
@@ -1421,18 +1417,18 @@ void _forward_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       DELETE_EVAS_OBJECT(view->con_popup);
+       DELETE_EVAS_OBJECT(view->notify);
 
-       if (ug_data->viewer_type == EML_VIEWER) {
-               viewer_launch_composer(ug_data, RUN_EML_FORWARD);
+       if (view->viewer_type == EML_VIEWER) {
+               viewer_launch_composer(view, RUN_EML_FORWARD);
        } else {
-               bool is_body_fully_downloaded = viewer_check_body_download_status(ug_data->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED);
+               bool is_body_fully_downloaded = viewer_check_body_download_status(view->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED);
 
-               email_attachment_data_t *attach_data = ug_data->attachment_info;
-               int attach_count = ug_data->attachment_count;
+               email_attachment_data_t *attach_data = view->attachment_info;
+               int attach_count = view->attachment_count;
 
                int i = 0;
                bool is_inline_fully_downloaded = false;
@@ -1442,13 +1438,13 @@ void _forward_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA
                        }
                }
 
-               debug_log("is_body_fully_downloaded [%d], account_type [%d], has_inline_image [%d], is_inline_fully_downloaded [%d]", is_body_fully_downloaded, ug_data->account_type, ug_data->has_inline_image, is_inline_fully_downloaded);
-               if (!is_body_fully_downloaded && !(ug_data->has_inline_image && is_inline_fully_downloaded)) {
-                       util_create_notify(ug_data, EMAIL_VIEWER_HEADER_DOWNLOAD_ENTIRE_EMAIL, EMAIL_VIEWER_POP_PARTIAL_BODY_DOWNLOADED_REST_LOST, 2,
+               debug_log("is_body_fully_downloaded [%d], account_type [%d], has_inline_image [%d], is_inline_fully_downloaded [%d]", is_body_fully_downloaded, view->account_type, view->has_inline_image, is_inline_fully_downloaded);
+               if (!is_body_fully_downloaded && !(view->has_inline_image && is_inline_fully_downloaded)) {
+                       util_create_notify(view, EMAIL_VIEWER_HEADER_DOWNLOAD_ENTIRE_EMAIL, EMAIL_VIEWER_POP_PARTIAL_BODY_DOWNLOADED_REST_LOST, 2,
                                        EMAIL_VIEWER_STRING_CANCEL, _popup_response_cb,
                                        EMAIL_VIEWER_BUTTON_CONTINUE, _popup_response_continue_forward_cb, NULL);
                } else {
-                       viewer_launch_composer(ug_data, RUN_COMPOSER_FORWARD);
+                       viewer_launch_composer(view, RUN_COMPOSER_FORWARD);
                }
        }
        debug_leave();
@@ -1458,14 +1454,14 @@ void _delete_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
 
        email_string_t title = { PACKAGE, "IDS_EMAIL_HEADER_DELETE" };
        email_string_t content = { PACKAGE, "IDS_EMAIL_POP_THIS_EMAIL_WILL_BE_DELETED" };
        email_string_t btn2 = { PACKAGE, "IDS_EMAIL_BUTTON_DELETE_ABB4" };
-       util_create_notify(ug_data, title, content, 2,
+       util_create_notify(view, title, content, 2,
                        EMAIL_VIEWER_STRING_CANCEL, _popup_response_cb,
                        btn2, _popup_response_delete_ok_cb, NULL);
 
@@ -1477,26 +1473,26 @@ void _move_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UN
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->con_popup);
+       DELETE_EVAS_OBJECT(view->con_popup);
 
        char s_mail_id[EMAIL_BUFF_SIZE_SML] = { 0 };
        const char *sa_mail_id = s_mail_id;
-       snprintf(s_mail_id, EMAIL_BUFF_SIZE_SML, "%d", ug_data->mail_id);
+       snprintf(s_mail_id, EMAIL_BUFF_SIZE_SML, "%d", view->mail_id);
 
        email_params_h params = NULL;
 
        if (email_params_create(&params) &&
-               email_params_add_int(params, EMAIL_BUNDLE_KEY_ACCOUNT_ID, ug_data->account_id) &&
-               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAILBOX, ug_data->mailbox_id) &&
-               email_params_add_int(params, EMAIL_BUNDLE_KEY_MOVE_SRC_MAILBOX_ID, ug_data->mailbox_id) &&
+               email_params_add_int(params, EMAIL_BUNDLE_KEY_ACCOUNT_ID, view->account_id) &&
+               email_params_add_int(params, EMAIL_BUNDLE_KEY_MAILBOX, view->mailbox_id) &&
+               email_params_add_int(params, EMAIL_BUNDLE_KEY_MOVE_SRC_MAILBOX_ID, view->mailbox_id) &&
                email_params_add_int(params, EMAIL_BUNDLE_KEY_IS_MAILBOX_MOVE_MODE, 1) &&
                email_params_add_int(params, EMAIL_BUNDLE_KEY_MAILBOX_MOVE_MODE, 0) &&
                email_params_add_int(params, EMAIL_BUNDLE_KEY_IS_MAILBOX_EDIT_MODE, 0) &&
                email_params_add_str_array(params, EMAIL_BUNDLE_KEY_ARRAY_SELECTED_MAIL_IDS, &sa_mail_id, 1)) {
 
-               ug_data->loaded_module = viewer_create_module(ug_data, EMAIL_MODULE_ACCOUNT, params, false);
+               view->loaded_module = viewer_create_module(view, EMAIL_MODULE_ACCOUNT, params, false);
        }
 
        email_params_free(&params);
@@ -1508,9 +1504,9 @@ static void _more_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       viewer_create_more_ctxpopup(ug_data);
+       viewer_create_more_ctxpopup(view);
        debug_leave();
 }
 
@@ -1520,19 +1516,19 @@ void _download_body(void *data)
 
        int handle;
        gboolean ret = 0;
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
        if (viewer_check_storage_full(MIN_FREE_SPACE)) {
-               viewer_show_storage_full_popup(ug_data);
+               viewer_show_storage_full_popup(view);
                return;
        }
-       ret = email_engine_body_download(ug_data->account_id, ug_data->mail_id, FALSE, &handle);
+       ret = email_engine_body_download(view->account_id, view->mail_id, FALSE, &handle);
 
        if (ret == TRUE) {
-               ug_data->email_handle = handle;
+               view->email_handle = handle;
                debug_log("mail_id(%d) account_id(%d) handle(%d)",
-                               ug_data->mail_id, ug_data->account_id, ug_data->email_handle);
-               viewer_create_down_progress(ug_data, EMAIL_VIEWER_POPUP_DOWNLOADING, viewer_destroy_down_progress_cb);
+                               view->mail_id, view->account_id, view->email_handle);
+               viewer_create_down_progress(view, EMAIL_VIEWER_POPUP_DOWNLOADING, viewer_destroy_down_progress_cb);
        } else {
                debug_log("unable to download mail body");
                notification_status_message_post(_("IDS_EMAIL_POP_DOWNLOAD_FAILED"));
@@ -1544,11 +1540,11 @@ static void _download_msg_btn_clicked_cb(void *data, Evas_Object *obj, void *eve
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       retm_if(ug_data->is_download_message_btn_clicked, "Already clicked!!");
+       EmailViewerView *view = (EmailViewerView *)data;
+       retm_if(view->is_download_message_btn_clicked, "Already clicked!!");
 
        /* check already downloaded */
-       int body_download_status = ug_data->body_download_status;
+       int body_download_status = view->body_download_status;
 
        if (viewer_check_body_download_status(body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_NONE)) {
                debug_log("only header downloaded -> need body download");
@@ -1556,7 +1552,7 @@ static void _download_msg_btn_clicked_cb(void *data, Evas_Object *obj, void *eve
                debug_log("body downloaded partially -> need full body download");
        }
 
-       _download_body(ug_data);
+       _download_body(view);
 
        debug_leave();
 }
@@ -1565,9 +1561,9 @@ static void _popup_response_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       DELETE_EVAS_OBJECT(view->notify);
        debug_leave();
 }
 
@@ -1575,33 +1571,33 @@ static void _popup_response_delete_ok_cb(void *data, Evas_Object *obj, void *eve
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
        int ret = 0;
 
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       DELETE_EVAS_OBJECT(view->notify);
 
-       if (ug_data->mailbox_type == EMAIL_MAILBOX_TYPE_TRASH || ug_data->save_status == EMAIL_MAIL_STATUS_SEND_SCHEDULED) {
+       if (view->mailbox_type == EMAIL_MAILBOX_TYPE_TRASH || view->save_status == EMAIL_MAIL_STATUS_SEND_SCHEDULED) {
                /*cancel scheduled email before deleting the mail*/
-               if (ug_data->save_status == EMAIL_MAIL_STATUS_SEND_SCHEDULED) {
-                       int err = email_cancel_sending_mail(ug_data->mail_id);
+               if (view->save_status == EMAIL_MAIL_STATUS_SEND_SCHEDULED) {
+                       int err = email_cancel_sending_mail(view->mail_id);
                        if (err != EMAIL_ERROR_NONE)
                                debug_log("email_cancel_sending_mail() failed: [%d]", err);
                }
-               ret = viewer_delete_email(ug_data);
-       } else if (ug_data->viewer_type == EML_VIEWER) {
-               if (remove(ug_data->eml_file_path)) {
+               ret = viewer_delete_email(view);
+       } else if (view->viewer_type == EML_VIEWER) {
+               if (remove(view->eml_file_path)) {
                        debug_log("failed to delete eml file");
                } else {
                        debug_log("succeed to delete eml file");
                        ret = 1;
                }
        } else {
-               ret = viewer_move_email(ug_data, _find_folder_id_using_folder_type(ug_data, EMAIL_MAILBOX_TYPE_TRASH), TRUE, FALSE);
+               ret = viewer_move_email(view, _find_folder_id_using_folder_type(view, EMAIL_MAILBOX_TYPE_TRASH), TRUE, FALSE);
        }
 
        if (ret == 1) {
-               debug_log("ug_destroy_me");
-               email_module_make_destroy_request(ug_data->base.module);
+               debug_log("email_module_make_destroy_request");
+               email_module_make_destroy_request(view->base.module);
        }
        debug_leave();
 }
@@ -1610,11 +1606,11 @@ static void _popup_response_continue_reply_cb(void *data, Evas_Object *obj, void
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       DELETE_EVAS_OBJECT(view->notify);
 
-       viewer_launch_composer(ug_data, RUN_COMPOSER_REPLY);
+       viewer_launch_composer(view, RUN_COMPOSER_REPLY);
        debug_leave();
 }
 
@@ -1622,11 +1618,11 @@ static void _popup_response_continue_reply_all_cb(void *data, Evas_Object *obj,
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       DELETE_EVAS_OBJECT(view->notify);
 
-       viewer_launch_composer(ug_data, RUN_COMPOSER_REPLY_ALL);
+       viewer_launch_composer(view, RUN_COMPOSER_REPLY_ALL);
        debug_leave();
 }
 
@@ -1634,11 +1630,11 @@ static void _popup_response_continue_forward_cb(void *data, Evas_Object *obj, vo
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       DELETE_EVAS_OBJECT(view->notify);
 
-       viewer_launch_composer(ug_data, RUN_COMPOSER_FORWARD);
+       viewer_launch_composer(view, RUN_COMPOSER_FORWARD);
        debug_leave();
 }
 
@@ -1646,11 +1642,11 @@ static void _popup_response_to_destroy_cb(void *data, Evas_Object *obj, void *ev
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       DELETE_EVAS_OBJECT(ug_data->notify);
+       DELETE_EVAS_OBJECT(view->notify);
        debug_log("email_module_make_destroy_request");
-       email_module_make_destroy_request(ug_data->base.module);
+       email_module_make_destroy_request(view->base.module);
        debug_leave();
 }
 
@@ -1659,9 +1655,9 @@ static void _outter_scroller_bottom_hit_cb(void *data, Evas_Object *obj, void *e
 {
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       EmailViewerView *view = (EmailViewerView *)data;
 
-       viewer_stop_elm_scroller_start_webkit_scroller(ug_data);
+       viewer_stop_elm_scroller_start_webkit_scroller(view);
 
        debug_leave();
 }
@@ -1671,45 +1667,45 @@ static void _outter_scroller_top_hit_cb(void *data, Evas_Object *obj, void *even
        debug_enter();
 
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       ug_data->is_outer_scroll_bot_hit = EINA_FALSE;
-       edje_object_part_drag_value_set(_EDJ(ug_data->combined_scroller), "elm.dragable.vbar", 0.0, 0.0);
+       EmailViewerView *view = (EmailViewerView *)data;
+       view->is_outer_scroll_bot_hit = EINA_FALSE;
+       edje_object_part_drag_value_set(_EDJ(view->combined_scroller), "elm.dragable.vbar", 0.0, 0.0);
        debug_leave();
 }
 
-void viewer_remove_callback(EmailViewerUGD *ug_data)
+void viewer_remove_callback(EmailViewerView *view)
 {
        email_unregister_timezone_changed_callback(_timezone_changed_cb);
        viewer_close_pattern_generator();
 }
 
-int viewer_reset_mail_data(EmailViewerUGD *ug_data)
+int viewer_reset_mail_data(EmailViewerView *view)
 {
        debug_enter();
-       retvm_if(ug_data == NULL, VIEWER_ERROR_INVALID_ARG, "Invalid parameter: ug_data[NULL]");
+       retvm_if(view == NULL, VIEWER_ERROR_INVALID_ARG, "Invalid parameter: view[NULL]");
 
        /* Create Email Viewer Private variables */
-       if (ug_data->mail_info) {
+       if (view->mail_info) {
                debug_log("mail_info freed");
-               email_free_mail_data(&(ug_data->mail_info), 1);
-               ug_data->mail_info = NULL;
+               email_free_mail_data(&(view->mail_info), 1);
+               view->mail_info = NULL;
        }
 
-       if (ug_data->attachment_info && ug_data->attachment_count > 0) {
-               debug_log("attachment_info freed p[%p] n[%d]", ug_data->attachment_info, ug_data->attachment_count);
-               email_free_attachment_data(&(ug_data->attachment_info), ug_data->attachment_count);
-               ug_data->attachment_info = NULL;
-               ug_data->attachment_count = 0;
+       if (view->attachment_info && view->attachment_count > 0) {
+               debug_log("attachment_info freed p[%p] n[%d]", view->attachment_info, view->attachment_count);
+               email_free_attachment_data(&(view->attachment_info), view->attachment_count);
+               view->attachment_info = NULL;
+               view->attachment_count = 0;
        }
 
        /* Get mail_info from service, and fill property */
-       int ret = viewer_set_internal_data(ug_data, EINA_TRUE);
+       int ret = viewer_set_internal_data(view, EINA_TRUE);
        if (ret != VIEWER_ERROR_NONE) {
                debug_log("viewer_set_internal_data() failed! (error type: %d)", ret);
                return ret;
        }
 
-       viewer_get_address_info_count(ug_data->mail_info, &ug_data->to_recipients_cnt, &ug_data->cc_recipients_cnt, &ug_data->bcc_recipients_cnt);
+       viewer_get_address_info_count(view->mail_info, &view->to_recipients_cnt, &view->cc_recipients_cnt, &view->bcc_recipients_cnt);
 
        debug_leave();
        return VIEWER_ERROR_NONE;
@@ -1720,23 +1716,23 @@ static void _create_webview_layout(void *data)
        debug_enter();
        retm_if(data == NULL, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       if (ug_data->webview_ly == NULL) {
-               Evas_Object *ewk_view_ly = _create_fullview(ug_data->base.content);
-               ug_data->webview_ly = ewk_view_ly;
+       EmailViewerView *view = (EmailViewerView *)data;
+       if (view->webview_ly == NULL) {
+               Evas_Object *ewk_view_ly = _create_fullview(view->base.content);
+               view->webview_ly = ewk_view_ly;
 
-               Evas_Object *ewk_btn = elm_button_add(ug_data->base.content);
+               Evas_Object *ewk_btn = elm_button_add(view->base.content);
                elm_object_style_set(ewk_btn, "transparent");
                evas_object_size_hint_weight_set(ewk_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                evas_object_size_hint_align_set(ewk_btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
-               elm_object_part_content_set(ug_data->base.content, "ev.swallow.webview_button", ewk_btn);
+               elm_object_part_content_set(view->base.content, "ev.swallow.webview_button", ewk_btn);
                evas_object_show(ewk_btn);
-               ug_data->webview_button = ewk_btn;
+               view->webview_button = ewk_btn;
        } else {
-               evas_object_show(ug_data->webview_ly);
-               evas_object_show(ug_data->webview_button);
+               evas_object_show(view->webview_ly);
+               evas_object_show(view->webview_button);
        }
-       elm_object_part_content_set(ug_data->base_ly, "ev.swallow.webview", ug_data->webview_ly);
+       elm_object_part_content_set(view->base_ly, "ev.swallow.webview", view->webview_ly);
 
        debug_leave();
 }
@@ -1746,108 +1742,108 @@ Eina_Bool viewer_check_body_download(void *data)
        debug_enter();
        retvm_if(data == NULL, EINA_FALSE, "Invalid parameter: data[NULL]");
 
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-       _create_webview_layout(ug_data);
-       _create_body(ug_data);
+       EmailViewerView *view = (EmailViewerView *)data;
+       _create_webview_layout(view);
+       _create_body(view);
 
-       if (viewer_check_body_download_status(ug_data->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_PARTIALLY_DOWNLOADED)) {
-               ug_data->b_partial_body = 1;
+       if (viewer_check_body_download_status(view->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_PARTIALLY_DOWNLOADED)) {
+               view->b_partial_body = 1;
        } else {
-               ug_data->b_partial_body = 0;
+               view->b_partial_body = 0;
        }
 
-       if (!viewer_check_body_download_status(ug_data->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED)) {
-               viewer_create_body_button(ug_data, "IDS_EMAIL_BUTTON_DOWNLOAD_FULL_EMAIL_ABB", _download_msg_btn_clicked_cb);
+       if (!viewer_check_body_download_status(view->body_download_status, EMAIL_BODY_DOWNLOAD_STATUS_FULLY_DOWNLOADED)) {
+               viewer_create_body_button(view, "IDS_EMAIL_BUTTON_DOWNLOAD_FULL_EMAIL_ABB", _download_msg_btn_clicked_cb);
        }
        debug_leave();
        return EINA_FALSE;
 }
 
-void viewer_create_account_data(EmailViewerUGD *ug_data)
+void viewer_create_account_data(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
        email_account_t *account = NULL;
-       if (email_engine_get_account_full_data(ug_data->account_id, &account)) {
+       if (email_engine_get_account_full_data(view->account_id, &account)) {
                if (account) {
-                       ug_data->account_type = account->incoming_server_type;
-                       FREE(ug_data->account_email_address);
-                       ug_data->account_email_address = strdup(account->user_email_address);
+                       view->account_type = account->incoming_server_type;
+                       FREE(view->account_email_address);
+                       view->account_email_address = strdup(account->user_email_address);
                        account_user_data_t *ud = (account_user_data_t *)account->user_data;
                        if (ud != NULL) {
                                debug_log("show_images is %d", ud->show_images);
-                               ug_data->b_show_remote_images = ud->show_images;
+                               view->b_show_remote_images = ud->show_images;
                        }
                }
-               viewer_delete_account_data(ug_data);
-               ug_data->account = account;
+               viewer_delete_account_data(view);
+               view->account = account;
        }
 
        debug_leave();
 }
 
-void viewer_delete_account_data(EmailViewerUGD *ug_data)
+void viewer_delete_account_data(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
 
-       if (ug_data->account) {
-               email_free_account(&ug_data->account, 1);
-               ug_data->account = NULL;
+       if (view->account) {
+               email_free_account(&view->account, 1);
+               view->account = NULL;
        }
 
        debug_leave();
 }
 
-static void _viewer_initialize_theme(EmailViewerUGD *ug_data)
+static void _viewer_initialize_theme(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(!ug_data, "Invalid parameter, ug_data is NULL");
+       retm_if(!view, "Invalid parameter, view is NULL");
 
-       ug_data->theme = elm_theme_new();
-       elm_theme_ref_set(ug_data->theme, NULL);
-       elm_theme_extension_add(ug_data->theme, email_get_viewer_theme_path());
+       view->theme = elm_theme_new();
+       elm_theme_ref_set(view->theme, NULL);
+       elm_theme_extension_add(view->theme, email_get_viewer_theme_path());
 
        debug_leave();
 
 }
 
-static void _viewer_deinitialize_theme(EmailViewerUGD *ug_data)
+static void _viewer_deinitialize_theme(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(!ug_data, "Invalid parameter, ug_data is NULL");
+       retm_if(!view, "Invalid parameter, view is NULL");
 
-       elm_theme_extension_del(ug_data->theme, email_get_viewer_theme_path());
-       elm_theme_free(ug_data->theme);
-       ug_data->theme = NULL;
+       elm_theme_extension_del(view->theme, email_get_viewer_theme_path());
+       elm_theme_free(view->theme);
+       view->theme = NULL;
 
        debug_leave();
 
 }
 
-static void _destroy_viewer(EmailViewerUGD *ug_data)
+static void _destroy_viewer(EmailViewerView *view)
 {
        debug_enter();
-       retm_if(ug_data == NULL, "Invalid parameter: ug_data[NULL]");
-
-       ug_data->b_viewer_hided = TRUE;
-       viewer_webkit_del_callbacks(ug_data);
-       viewer_delete_account_data(ug_data);
-       viewer_stop_ecore_running_apis(ug_data);
-       recipient_delete_callbacks(ug_data);
-       viewer_delete_evas_objects(ug_data, EINA_FALSE);
-       viewer_remove_hard_link_for_inline_images(ug_data);
-       viewer_remove_temp_files(ug_data);
-       viewer_remove_temp_folders(ug_data);
-       viewer_free_viewer_data(ug_data);
-       viewer_remove_callback(ug_data);
-       noti_mgr_dbus_receiver_remove(ug_data);
+       retm_if(view == NULL, "Invalid parameter: view[NULL]");
+
+       view->b_viewer_hided = TRUE;
+       viewer_webkit_del_callbacks(view);
+       viewer_delete_account_data(view);
+       viewer_stop_ecore_running_apis(view);
+       recipient_delete_callbacks(view);
+       viewer_delete_evas_objects(view, EINA_FALSE);
+       viewer_remove_hard_link_for_inline_images(view);
+       viewer_remove_temp_files(view);
+       viewer_remove_temp_folders(view);
+       viewer_free_viewer_data(view);
+       viewer_remove_callback(view);
+       noti_mgr_dbus_receiver_remove(view);
 
        email_engine_finalize();
        int ct_ret = email_contacts_finalize_service();
        debug_warning_if(ct_ret != CONTACTS_ERROR_NONE, "email_contacts_finalize_service() failed! ct_ret:[%d]", ct_ret);
-       _viewer_deinitialize_theme(ug_data);
+       _viewer_deinitialize_theme(view);
        _g_md = NULL;
 
        debug_leave();