/* * Copyright 2012 Samsung Electronics Co., Ltd * * Licensed under the Flora License, Version 1.1 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://floralicense.org/license * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __MSG_UI_VIEWER_PLAY_VIEW_H__ #define __MSG_UI_VIEWER_PLAY_VIEW_H__ /*================================================================================================== * INCLUDE HEADERS *==================================================================================================*/ #include #include "msg-smil-player-interface.h" #include "msg-ui-viewer-types.h" #include #include #include #include /*================================================================================================== * DEFINITIONS *==================================================================================================*/ #define VIEWER_BUFFER_SIZE_64 64 #define VIEWER_TITLE_MENU_GENLIST_MAX_ITEM 3 #define VIEWER_TITLE_MENU_1TEXT_HEIGHT 112 #define VIEWER_TITLE_MENU_2TEXT_HEIGHT 129 #define VIEWER_ATTACH_GL_ITEM_HEIGHT 100 #define VIEWER_TITLE_FONT_LEN 100 #define VIEWER_NAVI_FRAME_HEIGHT 98 #define VIEWER_NAVIFRAME_BOTTOM_H 114 #define VIEWER_PLAY_CONTROLLER_LIFETIME (3.0) #define VIEWER_PLAY_CONTROLLER_PROGRESSBAR_TIME (1.0) #define VIEWER_PLAY_CONTROLLER_HEIGHT 218 #define VIEWER_VOLUMEBAR_LIFETIME (3.0) #define VIEWER_VOLUME_KEY_FONT_LONG_PRESS_TIME (0.3) #define VIEWER_VOLUME_KEY_VOLUME_LONG_PRESS_TIME (0.1) #define VIEWER_DETAILS_TEXT_SPACE " " #define VIEWER_DETAILS_TEXT_LEFT_BRACE "(" #define VIEWER_DETAILS_TEXT_RIGHT_BRACE ")" #define VIEWER_DETAILS_TEXT_MSG_SIZE_KB 1024 #define MSG_VIEWER_EDJ EDJDIR"/msg_viewer.edj" /*================================================================================================== * ENUMERATIONS *==================================================================================================*/ typedef enum { MSG_VIEWER_PLAY = 0, MSG_VIEWER_PAUSE, MSG_VIEWER_STOP, MSG_VIEWER_CLOSE, MSG_VIEWER_UNKOWN, } MSG_VIEWER_PLAY_STATUS_E; typedef enum { MSG_VIEWER_ACTION_NONE = 0, MSG_VIEWER_ACTION_TOOLBAR_PLAY, /* action tapping play button in play toolbar */ MSG_VIEWER_ACTION_TOOLBAR_PAUSE, /* action tapping pause button in play toolbar */ MSG_VIEWER_ACTION_AUTO_PLAY, /* action auto play by related UX flow */ MSG_VIEWER_ACTION_AUTO_PAUSE, /* action auto pause by related UX flow */ } MSG_VIEWER_ACTION_TYPE_E; typedef enum { MSG_VIEWER_DEFAULT_MODE = 0, MSG_VIEWER_LOAD_CONTACT_UG, /* launching CONTACT UG */ MSG_VIEWER_LOAD_COMPOSER_UG, /* launching COMPOSER UG */ MSG_VIEWER_HIDED_BY_OTHER_WINDOW, /* launch other application like email/call/vcall/browser */ } MSG_VIEWER_MODE_E; typedef enum { MSG_VIEWER_FILE_SAVE_SUCCESS = 0, MSG_VIEWER_FILE_SAVE_FAILED, MSG_VIEWER_FILE_SAVE_INVALID_ERROR, } MSG_VIEWER_FILE_SAVE_STATUS_E; typedef enum { MSG_VIEWER_POPUP_NONE = 0, MSG_VIEWER_NORMAL_POPUP, MSG_VIEWER_DELETE_POPUP, MSG_VIEWER_ATTACHMENTS_POPUP, MSG_VIEWER_DETAILS_POPUP, MSG_VIEWER_MENU_CTX_POPUP, MSG_VIEWER_CUTLINK_POPUP, MSG_VIEWER_TITLE_MENU_POPUP, MSG_VIEWER_BLOCK_POPOP, } MSG_VIEWER_POPUP_TYPE_E; typedef enum { MSG_VIEWER_MEDIA_INVALID = 0, MSG_VIEWER_MEDIA_IMG, MSG_VIEWER_MEDIA_AUDIO, MSG_VIEWER_MEDIA_VIDEO, MSG_VIEWER_MEDIA_TEXT, MSG_VIEWER_MEDIA_ANIMATE, MSG_VIEWER_MEDIA_IMG_OR_VIDEO, MSG_VIEWER_MEDIA_ATTACH, MSG_VIEWER_MEDIA_DRM, } MSG_VIEWER_MEDIA_TYPE_E; typedef enum { MSG_VIEWER_OPTION_CONTACT = 0, MSG_VIEWER_OPTION_BLOCK, } MSG_VIEWER_OPTION_CHANGE_TYPE_E; typedef enum { MSG_VIEWER_FONT_SIZE_NONE, MSG_VIEWER_ACCESSIBILITY_FONT_SIZE, MSG_VIEWER_MSG_FONT_SIZE } MSG_VIEWER_FONT_SIZE_TYPE_E; typedef enum { MSG_VIEWER_FONT_CHANGE_LOAD_SETTING, MSG_VIEWER_FONT_CHANGE_LATEST_UPDATE, } MSG_VIEWER_FONT_CHANGE_TYPE_E; typedef enum { MSG_VIEWER_ENTRY_NORMAL_TEXT, MSG_VIEWER_ENTRY_HELP_TEXT, } MSG_VIEWER_ENTRY_TYPE_E; typedef enum { MSG_VIEWER_VOLUME_EVENT_DRAG_START, MSG_VIEWER_VOLUME_EVENT_DRAG_STOP, } MSG_VIEWER_VOLUME_BAR_EVENT_E; typedef enum { VIEWER_HELP_PAGE_FONT_SMALL = 24, VIEWER_HELP_PAGE_FONT_NORMAL= 30, VIEWER_HELP_PAGE_FONT_LARGE = 44, VIEWER_HELP_PAGE_FONT_HUGE = 60, VIEWER_HELP_PAGE_FONT_GIANT = 76, VIEWER_HELP_PAGE_FONT_MAX } MSG_VIEWER_HELP_PAGE_FONT_SIZE_E; typedef void (*MSG_VIEWER_VOLUMEBAR_CB)(void *user_data, Evas_Object *obj, MSG_VIEWER_VOLUME_BAR_EVENT_E event); /*================================================================================================== * STRUCTURES *==================================================================================================*/ typedef struct _MSG_VIEWER_ADDR_INFO_S { int contact_id; char address[MAX_ADDRESS_VAL_LEN+1]; char name[MAX_DISPLAY_NAME_LEN+1]; } MSG_VIEWER_ADDR_INFO; typedef struct _MSG_VIEWER_ADDR_LIST_S { int addr_cnt; MSG_VIEWER_ADDR_INFO addr_info[MAX_TO_ADDRESS_CNT]; } MSG_VIEWER_ADDR_LIST; typedef struct _MSG_PLAY_DATA_S { struct ug_cbs cbs; void *viewer_main; Evas_Object *main_window; Evas_Object *navi_frame; Evas_Object *navi_title_layout; /* navi title area layout */ Evas_Object *title_button; /* navi title button */ Evas_Object *attach_button; /* attachment button */ Evas_Object *more_btn; /* control toolbar */ Evas_Object *title_box_layout; /* title box layout for genlist */ Evas_Object *play_layout; /* play viewer main layout */ Evas_Object *subject_index_layout; /* subject / page index */ Evas_Object *play_controller; /* play controller */ Evas_Object *progressbar; /* progressbar of play controller */ Evas_Object *volumebar; /* volumebar */ Evas_Object *volume_slider; /* volumebar_slider */ Evas_Object *save_attachment_gl; /* save attachments genlist(controlbar menu) */ Evas_Object *render_entry; /* entry handle of SMIL render */ Evas_Object *save_button; /* save attachment's popup button */ Evas_Object *sa_check; /* select all check object in save attachment popup */ Eina_Bool isSelectAll; /* check if save attachments select all mode is enable */ Elm_Object_Item *navi_item; /* naviframe item */ Evas_Object *popup; /*simple popup*/ MSG_VIEWER_POPUP_TYPE_E popup_type; SMIL_SLIDE_CLIENT_CB_PARAM_S *smil_eventStatus; int m_x; int m_y; int window_width; int window_height; Ecore_Event_Handler *mouse_down_event_handler; Ecore_Event_Handler *mouse_up_event_handler; msg_handle_t msgHandle; /*ipc handler between viewer and MF*/ msg_struct_t msg_t; msg_struct_t mms_t; int msgID; void *SmilHandle; MSG_VIEWER_PLAY_STATUS_E status; MSG_VIEWER_PLAY_STATUS_E previous_status; MSG_VIEWER_MODE_E mode; int font_size; Ecore_Idler *del_idler; Ecore_Timer *play_controller_timer; Ecore_Timer *play_controller_progressbar_timer; Ecore_Timer *volumebar_timer; MSG_VIEWER_VOLUMEBAR_CB volumebar_event_cb; int ctrl_start_x; /* play controller mouse pointer */ int ctrl_start_y; /* play controller mouse pointer */ int ctrl_end_x; /* play controller mouse pointer */ int ctrl_end_y; /* play controller mouse pointer */ int insert_count; /*inserted contents count, except text file*/ int attach_count; /*attached contents count*/ Eina_List *insert_list; /*inserted content list */ Eina_List *attach_list; /*attached contents list */ bool title_menu_opened; /* check if title button option is opened*/ bool playcontroller_opened; /*check play controller is shown or not */ bool auto_resume_state; /* check state of auto resume availablity */ bool msg_box_viewer; /* TRUE is viewer is launched from message box */ bool drag_volume_slider; /* check do not navigate multiple page when volume bar is displayed */ bool is_rotated; /* TRUE if horizontal or reverse horizontal */ bool drm_ro_check; /* whether showing drm cotents popup or not - before SMIL START*/ int totalProgressTime; /* total progress time for all slide*/ int elapsedProgressTime; /*progress time from 1st slide to current slide*/ Elm_Genlist_Item_Class itc_title_single; /* title button single recipient item */ Elm_Genlist_Item_Class itc_title; /* title button multi recipient item */ Elm_Genlist_Item_Class hp_sa_class; /* help page attach list save all item */ Elm_Genlist_Item_Class hp_class; /* help page attach list item */ Elm_Genlist_Item_Class attach_sa_class; /*attachments select all item */ Elm_Genlist_Item_Class attach_item_class; /*attachments each item */ Elm_Theme *title_th; /* title theme */ Elm_Theme *progress_th; /* progressbar theme*/ /* for use volume key setting */ Ecore_Event_Handler *volkey_release_handler; Ecore_Event_Handler *volkey_press_handler; Ecore_Event_Handler *focus_in; Ecore_Event_Handler *focus_out; Ecore_Timer *vol_up_key_longpress; Ecore_Timer *vol_down_key_longpress; Ecore_X_Display *xdisplay; } MSG_PLAY_DATA_S; typedef struct { char pfile_name[MSG_VIEWER_FILENAME_MAX_LEN + 1]; char pfile_path[MSG_VIEWER_FILEPATH_MAX_LEN + 1]; int pfile_size; Eina_Bool isChecked; /* check object status of save attachment genlist */ Evas_Object *check_item; /* check object for save attachments genlist */ MSG_VIEWER_MEDIA_TYPE_E media_type; MSG_PLAY_DATA_S *viewer_play_data; } MSG_VIEWER_ATTACH_MEDIA_INFO_S; /*================================================================================================== * FUNCTION DECLARATIONS *=================================================================================================*/ /* main */ MSG_BOOL msg_ui_viewer_create_player_view(MSG_PLAY_DATA_S *data); MSG_BOOL msg_ui_viewer_show_player_view(MSG_PLAY_DATA_S *data); void msg_ui_viewer_play_view_init(void *data); void msg_ui_viewer_destroy_play_view(void *data); void msg_ui_viewer_connect_handler(void *data); void msg_ui_viewer_disconnect_handler(void *data); void msg_ui_viewer_apply_font_size(void *data); Evas_Object *msg_ui_viewer_create_navigation_layout(MSG_PLAY_DATA_S *viewer_play_data, Evas_Object *parent); Evas_Object *msg_ui_viewer_create_navi_title_layout(MSG_PLAY_DATA_S *data); void msg_ui_viewer_set_navi_title_layout(MSG_PLAY_DATA_S *data); void msg_ui_viewer_show_popup(void *data, Evas_Object *parent, char *pcontent); void msg_ui_viewer_copy_message_text_to_clipboard(MSG_PLAY_DATA_S *data); MSG_BOOL msg_ui_viewer_command_play_pause(void *data, MSG_VIEWER_ACTION_TYPE_E action_type); MSG_SMIL_ERROR_E msg_ui_viewer_smil_cb(SMIL_SLIDE_CLIENT_CB_PARAM_S *eventStatus, void *appUserData); Eina_Bool msg_ui_viewer_focused_in_cb(void *data, int type, void *event); Eina_Bool msg_ui_viewer_focused_out_cb(void *data, int type, void *event); MSG_SMIL_ERROR_E msg_ui_viewer_set_entry_handle_cb(MSG_PLAY_DATA_S *data, void *entry); Eina_Bool msg_ui_viewer_mouse_down_cb(void *data, int type, void *event); Eina_Bool msg_ui_viewer_mouse_up_cb(void *data, int type, void *event); void msg_ui_viewer_play_layout_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); void msg_ui_viewer_play_layout_mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); void msg_ui_viewer_play_layout_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source); void msg_ui_viewer_title_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_back_button_cb(void *data, Evas_Object *obj, void *event_info); int msg_ui_viewer_get_thread_address_count(MSG_PLAY_DATA_S *data); void msg_ui_viewer_get_thread_address_nth_address(MSG_PLAY_DATA_S *data, int number, char **address, int *contact_id); void msg_ui_viewer_title_update(MSG_PLAY_DATA_S *data, MSG_VIEWER_OPTION_CHANGE_TYPE_E option_type); void msg_ui_viewer_set_font_size(MSG_PLAY_DATA_S *data, MSG_VIEWER_ENTRY_TYPE_E entry_type, MSG_VIEWER_FONT_CHANGE_TYPE_E change_type); void msg_ui_viewer_popup_block_clicked_cb(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_popup_timeout_cb(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_display_drm_list_popup(MSG_PLAY_DATA_S *data); /* options */ void msg_ui_viewer_option_create_title_menu(void *data); void msg_ui_viewer_option_destroy_title_menu(void *data); void msg_ui_viewer_option_save_attachment_menu(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_option_create_more_popup(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_option_create_delete_popup(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_option_forward_menu_cb(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_option_resend_menu_cb(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_option_create_msg_detail_popup(MSG_PLAY_DATA_S *data); void msg_ui_viewer_option_email_menu(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_option_call_menu(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_option_vcall_menu(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_option_add_to_contact_menu(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_option_view_contact_menu(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_option_block_address_menu(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_option_unblock_address_menu(void *data, Evas_Object *obj, void *event_info); /* Play controller */ void msg_ui_viewer_play_controller_create(MSG_PLAY_DATA_S *data); void msg_ui_viewer_play_controller_update(void *data, MSG_VIEWER_PLAY_STATUS_E status); void msg_ui_viewer_play_controller_volume_clicked_cb(void *data, Evas_Object *o, const char *emission, const char *source); void msg_ui_viewer_play_controller_prev_clicked_cb(void *data, Evas_Object *o, const char *emission, const char *source); void msg_ui_viewer_play_controller_play_pause_clicked_cb(void *data, Evas_Object *o, const char *emission, const char *source); void msg_ui_viewer_play_controller_next_clicked_cb(void *data, Evas_Object *o, const char *emission, const char *source); void msg_ui_viewer_play_controller_create_timer(MSG_PLAY_DATA_S *data); Eina_Bool msg_ui_viewer_play_controller_timer_cb(void *data); void msg_ui_viewer_play_controller_destroy_timer(MSG_PLAY_DATA_S *data); void msg_ui_viewer_play_controller_create_progressbar(MSG_PLAY_DATA_S *data, int slideIdx); Eina_Bool msg_ui_viewer_play_controller_progressbar_timer_cb(void *data); /* volume bar */ void msg_ui_viewer_grab_volume_key(void *data); void msg_ui_viewer_ungrab_volume_key(void *data); Eina_Bool msg_ui_viewer_volume_key_release_cb(void *data, int type, void *event); Eina_Bool msg_ui_viewer_volume_key_press_cb(void *data, int type, void *event); void msg_ui_viewer_create_volume_bar(void *data); void msg_ui_viewer_destroy_volume_bar(void *data); /* help page */ MSG_SMIL_ERROR_E msg_ui_viewer_help_page_create_list(MSG_PLAY_DATA_S *data, void **attach_list, void *box); void msg_ui_viewer_help_page_save_all_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); void msg_ui_viewer_help_page_save_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); /* attachment */ void msg_ui_viewer_create_save_attachments_popup(MSG_PLAY_DATA_S *data); #endif /* __MSG_UI_VIEWER_PLAY_VIEW_H__*/