From: Igor Olshevskyi Date: Thu, 24 Nov 2016 14:27:56 +0000 (+0200) Subject: TizenRefApp-7720 [Call UI] Add Quick Panel Mini Controler components info for TTS X-Git-Tag: submit/tizen_3.0/20161205.123214~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5db6593e2d5d7560df40b7c85b8c78e0911bdcae;p=profile%2Fmobile%2Fapps%2Fnative%2Fcall-ui.git TizenRefApp-7720 [Call UI] Add Quick Panel Mini Controler components info for TTS Change-Id: I978a9c8c1aa60059fec9d2ff19d9f75ac93b5815 --- diff --git a/edje_src/edc/callui-view-end-call.edc b/edje_src/edc/callui-view-end-call.edc index 429295f..068a07b 100644 --- a/edje_src/edc/callui-view-end-call.edc +++ b/edje_src/edc/callui-view-end-call.edc @@ -332,7 +332,7 @@ group { name: "elm/layout/callui/end_call_view"; // Accessibility - CU_PART_RECT( "access.rect", + CU_PART_RECT( "rect.access", description { state: "default" 0.0; fixed: 0 1; min: 0 INDICATOR_HEIGHT; diff --git a/edje_src/edc/callui-view-main-layout.edc b/edje_src/edc/callui-view-main-layout.edc index 8b08461..2b38816 100644 --- a/edje_src/edc/callui-view-main-layout.edc +++ b/edje_src/edc/callui-view-main-layout.edc @@ -125,7 +125,7 @@ group { name: "elm/layout/callui/view_main"; mouse_events: 0; repeat_events: 1; description { state: "default" 0.0; - rel1 { relative: 0.0 1.0; to: "access.rect"; } + rel1 { relative: 0.0 1.0; to: "rect.access"; } rel2 { relative: 1.0 0.0; to: "end_btn.bg"; } } ) @@ -174,7 +174,7 @@ group { name: "elm/layout/callui/view_main"; // ACCESSIBILITY - CU_PART_RECT( "access.rect", + CU_PART_RECT( "rect.access", description { state: "default" 0.0; fixed: 0 1; min: 0 INDICATOR_HEIGHT; diff --git a/edje_src/edc/callui-view-quick-pannel.edc b/edje_src/edc/callui-view-quick-pannel.edc index 9f56cc7..0ab4569 100644 --- a/edje_src/edc/callui-view-quick-pannel.edc +++ b/edje_src/edc/callui-view-quick-pannel.edc @@ -450,6 +450,29 @@ group { name: "elm/layout/callui/quickpanel"; QP_MC_SWALLOW_WITH_PAD_L("swallow.mute_button", "pad.swallow.end_button.left", 0, 1, 0, 0) QP_MC_SWALLOW_WITH_PAD_L("swallow.resume_button", "pad.swallow.end_button.left", 0, 0, 0, 1) QP_MC_SWALLOW_WITH_PAD_L("swallow.call_button", "pad.swallow.end_button.left", 1, 0, 0, 0) + + part { name: "txt_timer.access"; + type: RECT; + scale: 1; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "txt_timer"; } + rel2 { relative: 1.0 1.0; to: "txt_timer"; } + color: COLOR_BG_ALPHA; + } + } + part { name: "contact_name.access"; + type: RECT; + scale: 1; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "contact_name"; } + rel2 { relative: 1.0 1.0; to: "contact_name"; } + color: COLOR_BG_ALPHA; + } + } } programs{ program { name: "resume_call"; diff --git a/inc/callui-view-quickpanel.h b/inc/callui-view-quickpanel.h index 1446a12..0e19bee 100644 --- a/inc/callui-view-quickpanel.h +++ b/inc/callui-view-quickpanel.h @@ -19,6 +19,8 @@ #include +#include "callui-common-types.h" + typedef struct _callui_qp_mc *callui_qp_mc_h; typedef struct appdata callui_app_data_t; @@ -41,4 +43,13 @@ callui_qp_mc_h _callui_qp_mc_create(callui_app_data_t *ad); */ void _callui_qp_mc_destroy(callui_qp_mc_h qp); +/** + * @brief Updates accessibility info of quick panel objects + * + * @param[in] qp Quick panel mini control handle + * + * @return CALLUI_RESULT_OK on success or another result otherwise + */ +callui_result_e _callui_qp_mc_update_accessibility_info(callui_qp_mc_h qp); + #endif /*__UI_VIEW_QUICKPANEL_H__*/ diff --git a/src/callui-action-bar.c b/src/callui-action-bar.c index 20c959c..ec50163 100644 --- a/src/callui-action-bar.c +++ b/src/callui-action-bar.c @@ -825,5 +825,7 @@ callui_result_e _callui_action_bar_update_accessibility_info(callui_action_bar_h void _callui_action_bar_set_access_possibility(callui_action_bar_h action_bar, bool is_accessable) { + CALLUI_RETURN_IF_FAIL(action_bar); + __update_all_btns_highlight_possibility(action_bar, is_accessable); } diff --git a/src/callui-view-callend.c b/src/callui-view-callend.c index b01157d..a8fd5e3 100644 --- a/src/callui-view-callend.c +++ b/src/callui-view-callend.c @@ -788,7 +788,7 @@ static void __prevent_highlight_accessible_objects(callui_view_callend_h vd) static callui_result_e __create_accessible_objects(callui_view_callend_h vd) { - vd->base_view.ao_first = _callui_au_register_accessible_object(vd->base_view.contents, vd->base_view.contents, "access.rect"); + vd->base_view.ao_first = _callui_au_register_accessible_object(vd->base_view.contents, vd->base_view.contents, "rect.access"); CALLUI_RETURN_VALUE_IF_FAIL(vd->base_view.ao_first, CALLUI_RESULT_FAIL); _callui_au_set_highlight_ability(vd->base_view.ao_first, false); diff --git a/src/callui-view-dialing.c b/src/callui-view-dialing.c index 279c1f3..b3c577a 100644 --- a/src/callui-view-dialing.c +++ b/src/callui-view-dialing.c @@ -249,7 +249,7 @@ static void __keypad_show_state_change_cd(void *data, callui_keypad_state_event_ static void __register_accessibility_rout_start_and_end_points(callui_view_dialing_h vd) { - vd->base_view.ao_first = _callui_au_register_accessible_object(vd->base_view.contents, vd->base_view.contents, "access.rect"); + vd->base_view.ao_first = _callui_au_register_accessible_object(vd->base_view.contents, vd->base_view.contents, "rect.access"); _callui_au_set_highlight_ability(vd->base_view.ao_first, false); callui_result_e res = _callui_au_append_symmetric_relationship(vd->base_view.ao_first, vd->base_view.ao_call_status); diff --git a/src/callui-view-incoming-call.c b/src/callui-view-incoming-call.c index c4605d9..8db280a 100644 --- a/src/callui-view-incoming-call.c +++ b/src/callui-view-incoming-call.c @@ -967,7 +967,7 @@ static callui_result_e __create_accessible_objects(callui_view_incoming_call_h v static void __register_accessibility_rout_default(callui_view_incoming_call_h vd) { - vd->base_view.ao_first = _callui_au_register_accessible_object(vd->base_view.contents, vd->base_view.contents, "access.rect"); + vd->base_view.ao_first = _callui_au_register_accessible_object(vd->base_view.contents, vd->base_view.contents, "rect.access"); CALLUI_RETURN_IF_FAIL(vd->base_view.ao_first); _callui_au_set_highlight_ability(vd->base_view.ao_first, false); diff --git a/src/callui-view-manager.c b/src/callui-view-manager.c index 8fd6f6c..3cd4da5 100644 --- a/src/callui-view-manager.c +++ b/src/callui-view-manager.c @@ -343,10 +343,8 @@ Evas_Object *_callui_vm_get_main_ly(callui_vm_h vm) */ callui_view_type_e _callui_vm_get_cur_view_type(callui_vm_h vm) { - if (!vm) { - err("vm is NULL"); - return CALLUI_VIEW_UNDEFINED; - } + CALLUI_RETURN_VALUE_IF_FAIL(vm, CALLUI_VIEW_UNDEFINED); + return vm->cur_view_type; } diff --git a/src/callui-view-multi-call-conf.c b/src/callui-view-multi-call-conf.c index 9bf796f..d0f37cd 100755 --- a/src/callui-view-multi-call-conf.c +++ b/src/callui-view-multi-call-conf.c @@ -323,7 +323,7 @@ static void __keypad_show_state_change_cd(void *data, callui_keypad_state_event_ static void __register_accessibility_rout_start_and_end_points(callui_view_mc_conf_h vd) { - vd->base_view.ao_first = _callui_au_register_accessible_object(vd->base_view.contents, vd->base_view.contents, "access.rect"); + vd->base_view.ao_first = _callui_au_register_accessible_object(vd->base_view.contents, vd->base_view.contents, "rect.access"); _callui_au_set_highlight_ability(vd->base_view.ao_first, false); callui_result_e res = _callui_au_append_symmetric_relationship(vd->base_view.ao_first, vd->base_view.ao_call_status); diff --git a/src/callui-view-multi-call-split.c b/src/callui-view-multi-call-split.c index 875eacc..c87305b 100755 --- a/src/callui-view-multi-call-split.c +++ b/src/callui-view-multi-call-split.c @@ -577,7 +577,7 @@ static callui_result_e __create_accessible_objects(callui_view_mc_split_h vd) static void __register_accessibility_rout_start_and_end_points(callui_view_mc_split_h vd) { - vd->base_view.ao_first = _callui_au_register_accessible_object(vd->base_view.contents, vd->base_view.contents, "access.rect"); + vd->base_view.ao_first = _callui_au_register_accessible_object(vd->base_view.contents, vd->base_view.contents, "rect.access"); CALLUI_RETURN_IF_FAIL(vd->base_view.ao_first); _callui_au_set_highlight_ability(vd->base_view.ao_first, false); diff --git a/src/callui-view-quickpanel.c b/src/callui-view-quickpanel.c index 94854b6..41a8da4 100755 --- a/src/callui-view-quickpanel.c +++ b/src/callui-view-quickpanel.c @@ -28,6 +28,7 @@ #include "callui-sound-manager.h" #include "callui-state-provider.h" #include "callui-bidi-text-utils.h" +#include "callui-accessibility-utils.h" #define CALLUI_LY_STYLE_QUICKPANEL "quickpanel" @@ -47,18 +48,22 @@ typedef enum { } callui_qp_mc_btn_type_e; struct _callui_qp_mc { - Evas_Object *win_quickpanel; - Evas_Object *quickpanel_layout; - Evas_Object *caller_id; + Evas_Object *win; + Evas_Object *main_ly; bool is_activated; int rotate_angle; callui_app_data_t *ad; Evas_Object *buttons[CALLUI_QP_BTN_COUNT]; bool is_available[CALLUI_QP_BTN_COUNT]; + bool is_active[CALLUI_QP_BTN_COUNT]; Ecore_Timer *call_duration_timer; struct tm *call_duration_tm; + + /* Accessible objects */ + Evas_Object *ao_caller_info; + Evas_Object *ao_call_status; }; typedef struct _callui_qp_mc callui_qp_mc_t; @@ -72,6 +77,7 @@ typedef void (*btn_update_func)(callui_qp_mc_h qp); struct __btn_params { char *part; + char *name; Evas_Smart_Cb click_cb_func; btn_update_func update_func; __btn_style_t style; @@ -88,33 +94,34 @@ static void __update_call_btn(callui_qp_mc_h qp); static void __update_resume_btn(callui_qp_mc_h qp); static void __update_mute_btn(callui_qp_mc_h qp); static void __update_speaker_btn(callui_qp_mc_h qp); +static void __update_end_btn(callui_qp_mc_h qp); -static void __set_caller_info_emergency_name(Evas_Object *eo); -static void __set_caller_info_unknown_name(Evas_Object *eo); -static void __set_caller_info_phone_number(Evas_Object *eo, const char *call_number); -static void __set_caller_info_caller_name(Evas_Object *eo, const callui_call_data_t *call_data); -static void __set_caller_info_conference_call(Evas_Object *eo); +static void __set_caller_info_emergency_name(callui_qp_mc_h qp); +static void __set_caller_info_unknown_name(callui_qp_mc_h qp); +static void __set_caller_info_phone_number(callui_qp_mc_h qp, const char *call_number); +static void __set_caller_info_caller_name(callui_qp_mc_h qp, const callui_call_data_t *call_data); +static void __set_caller_info_conference_call(callui_qp_mc_h qp); static __btn_params_t btn_params[CALLUI_QP_BTN_COUNT] = { { - "swallow.call_button",__caller_btn_click_cb, __update_call_btn, - {"callui_qp_btn_call", NULL} + "swallow.call_button", "IDS_CALL_HEADER_ANSWER_CALL_ABB", __caller_btn_click_cb, + __update_call_btn, {"callui_qp_btn_call", NULL} }, { - "swallow.resume_button", __resume_btn_click_cb, __update_resume_btn, - {"callui_qp_btn_resume", "callui_qp_btn_resume_on"} + "swallow.resume_button", "IDS_CALL_BUTTON_RESUME_ABB", __resume_btn_click_cb, + __update_resume_btn, {"callui_qp_btn_resume", "callui_qp_btn_resume_on"} }, { - "swallow.mute_button", __mute_btn_click_cb, __update_mute_btn, - {"callui_qp_btn_mute", "callui_qp_btn_mute_on"} + "swallow.mute_button", "IDS_CALL_BUTTON_MUTE_ABB", __mute_btn_click_cb, + __update_mute_btn, {"callui_qp_btn_mute", "callui_qp_btn_mute_on"} }, { - "swallow.speaker_button", __speaker_btn_click_cb, __update_speaker_btn, - {"callui_qp_btn_speaker", "callui_qp_btn_speaker_on"} + "swallow.speaker_button", "IDS_CALL_BUTTON_SPEAKER", __speaker_btn_click_cb, + __update_speaker_btn, {"callui_qp_btn_speaker", "callui_qp_btn_speaker_on"} }, { - "swallow.end_button", __end_btn_click_cb, NULL, - {"callui_qp_btn_end", NULL} + "swallow.end_button", "IDS_CALL_SK3_END_CALL", __end_btn_click_cb, + __update_end_btn, {"callui_qp_btn_end", NULL} } }; @@ -130,7 +137,7 @@ static void __refresh_components(callui_qp_mc_h qp); static void __hide_minicontrol(callui_qp_mc_h qp); static void __main_layout_mouse_up_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info); -static void __update_caller_info(Evas_Object *eo, const callui_call_data_t *call_data); +static void __update_caller_info(callui_qp_mc_h qp, const callui_call_data_t *call_data); static void __update_layout_components(callui_qp_mc_h qp); static void __minicontrol_provider_cb(minicontrol_viewer_event_e event_type, bundle *event_arg); @@ -155,6 +162,10 @@ static void __mute_state_changed_cb(void *user_data, bool is_enable); static void __update_all_btns_state(callui_qp_mc_h qp); static void __update_all_btns(callui_qp_mc_h qp); +static void __update_btn_accessibility_info(callui_qp_mc_h qp, callui_qp_mc_btn_type_e type); + +static callui_result_e __create_accessible_objects(callui_qp_mc_h qp); +static void __destroy_accessible_objects(callui_qp_mc_h qp); static void __call_state_event_cb(void *user_data, callui_call_event_type_e call_event_type, @@ -254,6 +265,59 @@ void _callui_qp_mc_destroy(callui_qp_mc_h qp) free(qp); } +static void __update_btn_accessibility_info(callui_qp_mc_h qp, callui_qp_mc_btn_type_e type) +{ + CALLUI_RETURN_IF_FAIL(qp); + CALLUI_RETURN_IF_FAIL((type >= CALLUI_QP_BTN_CALL && type < CALLUI_QP_BTN_COUNT)); + + Evas_Object *btn = qp->buttons[type]; + CALLUI_RETURN_IF_FAIL(btn); + + switch (type) { + case CALLUI_QP_BTN_SPEAKER: + case CALLUI_QP_BTN_MUTE: + { + char buff[CALLUI_BUFF_SIZE_HUG] = { '\0' }; + snprintf(buff, + CALLUI_BUFF_SIZE_HUG, + "%s, %s", + (qp->is_active[type]? _("IDS_STORYALBUM_BODY_ON_T_TTS"):_("IDS_STORYALBUM_BODY_OFF_T_TTS")), + (qp->is_available[type]? "":_("IDS_GCTS_OPT_DIMMED_TTS"))); + elm_atspi_accessible_description_set(btn, buff); + } + break; + case CALLUI_QP_BTN_CALL: + case CALLUI_QP_BTN_RESUME: + elm_atspi_accessible_description_set(btn, ((qp->is_available[type])? "" : "IDS_GCTS_OPT_DIMMED_TTS" )); + break; + case CALLUI_QP_BTN_END: + if (_callui_stp_get_call_data(qp->ad->state_provider, CALLUI_CALL_DATA_INCOMING)) { + elm_atspi_accessible_name_set(btn, "IDS_KM_OPT_REJECT_CALL_TTS"); + } else { + elm_atspi_accessible_name_set(btn, btn_params[CALLUI_QP_BTN_END].name); + } + elm_atspi_accessible_description_set(btn, ((qp->is_available[type])? "" : "IDS_GCTS_OPT_DIMMED_TTS" )); + break; + default: + return; + } +} + +callui_result_e _callui_qp_mc_update_accessibility_info(callui_qp_mc_h qp) +{ + CALLUI_RETURN_VALUE_IF_FAIL(qp, CALLUI_RESULT_INVALID_PARAM); + + if (!qp->is_activated) { + dbg("Ignored. Quick panel minicontrol is not active"); + } + + int i = 0; + for (; i < CALLUI_QP_BTN_COUNT; i++) { + __update_btn_accessibility_info(qp, i); + } + return CALLUI_RESULT_OK; +} + static void __caller_btn_click_cb(void *data, Evas_Object *obj, void *event_info) { CALLUI_RETURN_IF_FAIL(data); @@ -288,60 +352,67 @@ static void __main_layout_mouse_up_cb(void *data, Evas *evas, Evas_Object *obj, static void __hide_minicontrol(callui_qp_mc_h qp) { - minicontrol_send_event(qp->win_quickpanel, MINICONTROL_PROVIDER_EVENT_REQUEST_HIDE, NULL); + minicontrol_send_event(qp->win, MINICONTROL_PROVIDER_EVENT_REQUEST_HIDE, NULL); } -static void __set_caller_info_emergency_name(Evas_Object *eo) +static void __set_caller_info_emergency_name(callui_qp_mc_h qp) { - elm_object_translatable_part_text_set(eo, CALLUI_QP_PART_CONTACT_NAME, "IDS_COM_BODY_EMERGENCY_NUMBER"); + elm_object_translatable_part_text_set(qp->main_ly, CALLUI_QP_PART_CONTACT_NAME, "IDS_COM_BODY_EMERGENCY_NUMBER"); + + elm_atspi_accessible_name_set(qp->ao_caller_info, "IDS_KM_BODY_EMERGENCY_CALL_TTS"); } -static void __set_caller_info_unknown_name(Evas_Object *eo) +static void __set_caller_info_unknown_name(callui_qp_mc_h qp) { - elm_object_translatable_part_text_set(eo, CALLUI_QP_PART_CONTACT_NAME, "IDS_CALL_BODY_UNKNOWN"); + elm_object_translatable_part_text_set(qp->main_ly, CALLUI_QP_PART_CONTACT_NAME, "IDS_CALL_BODY_UNKNOWN"); + + elm_atspi_accessible_name_set(qp->ao_caller_info, "IDS_CALL_BODY_UNKNOWN"); } -static void __set_caller_info_conference_call(Evas_Object *eo) +static void __set_caller_info_conference_call(callui_qp_mc_h qp) { - elm_object_translatable_part_text_set(eo, CALLUI_QP_PART_CONTACT_NAME, "IDS_CALL_OPT_CONFERENCE_CALL"); + elm_object_translatable_part_text_set(qp->main_ly, CALLUI_QP_PART_CONTACT_NAME, "IDS_CALL_OPT_CONFERENCE_CALL"); + + elm_atspi_accessible_name_set(qp->ao_caller_info, "IDS_CALL_OPT_CONFERENCE_CALL"); } -static void __set_caller_info_phone_number(Evas_Object *eo, const char *call_number) +static void __set_caller_info_phone_number(callui_qp_mc_h qp, const char *call_number) { char *enclosed_call_number = _callui_bidi_text_utils_enclose_text(call_number, CALLUI_BIDI_TEXT_ENCLOSE_LRM); - elm_object_part_text_set(eo, CALLUI_QP_PART_CONTACT_NAME, enclosed_call_number); + elm_object_part_text_set(qp->main_ly, CALLUI_QP_PART_CONTACT_NAME, enclosed_call_number); free(enclosed_call_number); + + elm_atspi_accessible_name_set(qp->ao_caller_info, call_number); } -static void __set_caller_info_caller_name(Evas_Object *eo, const callui_call_data_t *call_data) +static void __set_caller_info_caller_name(callui_qp_mc_h qp, const callui_call_data_t *call_data) { if (_callui_common_is_display_contact_name_support_rtl(call_data->call_ct_info.call_disp_name_type)) { - elm_object_part_text_set(eo, CALLUI_QP_PART_CONTACT_NAME, call_data->call_ct_info.call_disp_name); + elm_object_part_text_set(qp->main_ly, CALLUI_QP_PART_CONTACT_NAME, call_data->call_ct_info.call_disp_name); } else { char *enclosed_call_name = _callui_bidi_text_utils_enclose_text(call_data->call_ct_info.call_disp_name, CALLUI_BIDI_TEXT_ENCLOSE_LRM); - elm_object_part_text_set(eo, CALLUI_QP_PART_CONTACT_NAME, enclosed_call_name); + elm_object_part_text_set(qp->main_ly, CALLUI_QP_PART_CONTACT_NAME, enclosed_call_name); free(enclosed_call_name); } + + elm_atspi_accessible_name_set(qp->ao_caller_info, call_data->call_ct_info.call_disp_name); } -static void __update_caller_info(Evas_Object *eo, const callui_call_data_t *call_data) +static void __update_caller_info(callui_qp_mc_h qp, const callui_call_data_t *call_data) { - CALLUI_RETURN_IF_FAIL(eo); - CALLUI_RETURN_IF_FAIL(call_data); - if (call_data->is_emergency) { - __set_caller_info_emergency_name(eo); + __set_caller_info_emergency_name(qp); } else if (call_data->conf_member_count > 1) { - __set_caller_info_conference_call(eo); + __set_caller_info_conference_call(qp); } else if (STRING_EMPTY(call_data->call_num)) { - __set_caller_info_unknown_name(eo); + __set_caller_info_unknown_name(qp); } else if (STRING_EMPTY(call_data->call_ct_info.call_disp_name)) { - __set_caller_info_phone_number(eo, call_data->call_num); + __set_caller_info_phone_number(qp, call_data->call_num); } else { - __set_caller_info_caller_name(eo, call_data); + __set_caller_info_caller_name(qp, call_data); } - _callui_caller_info_set_caller_image(eo, call_data); + _callui_caller_info_set_caller_image(qp->main_ly, call_data); } static void __set_split_call_duration_time(struct tm *time, Evas_Object *obj, const char *txt_part) @@ -373,14 +444,12 @@ static Eina_Bool __split_call_duration_timer_cb(void *data) return ECORE_CALLBACK_CANCEL; } - _callui_common_try_update_call_duration_time(qp->call_duration_tm, - new_tm, - __set_split_call_duration_time, - qp->quickpanel_layout, - CALLUI_QP_PART_TIMER); - + _callui_common_try_update_call_duration_time(qp->call_duration_tm, new_tm, + __set_split_call_duration_time, qp->main_ly, CALLUI_QP_PART_TIMER); free(new_tm); + elm_atspi_accessible_name_set(qp->ao_call_status, elm_object_part_text_get(qp->main_ly, CALLUI_QP_PART_TIMER)); + return ECORE_CALLBACK_RENEW; } @@ -396,14 +465,12 @@ static Eina_Bool __active_call_duration_timer_cb(void* data) return ECORE_CALLBACK_CANCEL; } - _callui_common_try_update_call_duration_time(qp->call_duration_tm, - new_tm, - _callui_common_set_call_duration_time, - qp->quickpanel_layout, - CALLUI_QP_PART_TIMER); - + _callui_common_try_update_call_duration_time(qp->call_duration_tm, new_tm, + _callui_common_set_call_duration_time, qp->main_ly, CALLUI_QP_PART_TIMER); free(new_tm); + elm_atspi_accessible_name_set(qp->ao_call_status, elm_object_part_text_get(qp->main_ly, CALLUI_QP_PART_TIMER)); + return ECORE_CALLBACK_RENEW; } @@ -411,7 +478,8 @@ static void __init_split_call_duration_timer(callui_qp_mc_h qp) { qp->call_duration_tm = _callui_stp_get_call_duration(qp->ad->state_provider, CALLUI_CALL_DATA_ACTIVE); CALLUI_RETURN_IF_FAIL(qp->call_duration_tm); - __set_split_call_duration_time(qp->call_duration_tm, qp->quickpanel_layout, CALLUI_QP_PART_TIMER); + __set_split_call_duration_time(qp->call_duration_tm, qp->main_ly, CALLUI_QP_PART_TIMER); + elm_atspi_accessible_name_set(qp->ao_call_status, elm_object_part_text_get(qp->main_ly, CALLUI_QP_PART_TIMER)); qp->call_duration_timer = ecore_timer_add(0.1, __split_call_duration_timer_cb, qp); CALLUI_RETURN_IF_FAIL(qp->call_duration_timer); @@ -427,7 +495,8 @@ static void __init_active_call_duration_timer(callui_qp_mc_h qp) { qp->call_duration_tm = _callui_stp_get_call_duration(qp->ad->state_provider, CALLUI_CALL_DATA_ACTIVE); CALLUI_RETURN_IF_FAIL(qp->call_duration_tm); - _callui_common_set_call_duration_time(qp->call_duration_tm, qp->quickpanel_layout, CALLUI_QP_PART_TIMER); + _callui_common_set_call_duration_time(qp->call_duration_tm, qp->main_ly, CALLUI_QP_PART_TIMER); + elm_atspi_accessible_name_set(qp->ao_call_status, elm_object_part_text_get(qp->main_ly, CALLUI_QP_PART_TIMER)); qp->call_duration_timer = ecore_timer_add(0.1, __active_call_duration_timer_cb, qp); CALLUI_RETURN_IF_FAIL(qp->call_duration_timer); @@ -471,41 +540,41 @@ static void __update_all_btns(callui_qp_mc_h qp) static void __update_layout_components(callui_qp_mc_h qp) { - callui_app_data_t *ad = qp->ad; - Evas_Object *eo = qp->quickpanel_layout; - __update_all_btns_state(qp); __update_all_btns(qp); __deinit_call_duration_timer(qp); - const callui_call_data_t *incom = _callui_stp_get_call_data(ad->state_provider, + const callui_call_data_t *incom = _callui_stp_get_call_data(qp->ad->state_provider, CALLUI_CALL_DATA_INCOMING); - const callui_call_data_t *active = _callui_stp_get_call_data(ad->state_provider, + const callui_call_data_t *active = _callui_stp_get_call_data(qp->ad->state_provider, CALLUI_CALL_DATA_ACTIVE); - const callui_call_data_t *held = _callui_stp_get_call_data(ad->state_provider, + const callui_call_data_t *held = _callui_stp_get_call_data(qp->ad->state_provider, CALLUI_CALL_DATA_HELD); if (incom) { - __update_caller_info(eo, incom); - elm_object_signal_emit(eo, "incoming_call", ""); - elm_object_translatable_part_text_set(eo, CALLUI_QP_PART_TIMER, "IDS_CALL_BODY_INCOMING_CALL"); + __update_caller_info(qp, incom); + elm_object_signal_emit(qp->main_ly, "incoming_call", ""); + elm_object_translatable_part_text_set(qp->main_ly, CALLUI_QP_PART_TIMER, "IDS_CALL_BODY_INCOMING_CALL"); + elm_atspi_accessible_name_set(qp->ao_call_status, "IDS_CALL_BODY_INCOMING_CALL"); } else if (active && active->is_dialing) { - __update_caller_info(eo, active); - elm_object_signal_emit(eo, "outgoing_call", ""); - elm_object_translatable_part_text_set(eo, CALLUI_QP_PART_TIMER, "IDS_CALL_POP_DIALLING"); + __update_caller_info(qp, active); + elm_object_signal_emit(qp->main_ly, "outgoing_call", ""); + elm_object_translatable_part_text_set(qp->main_ly, CALLUI_QP_PART_TIMER, "IDS_CALL_POP_DIALLING"); + elm_atspi_accessible_name_set(qp->ao_call_status, "IDS_CALL_POP_DIALLING"); } else if (active) { - __update_caller_info(eo, active); - elm_object_signal_emit(eo, "during_call", ""); + __update_caller_info(qp, active); + elm_object_signal_emit(qp->main_ly, "during_call", ""); if (held) { __init_split_call_duration_timer(qp); } else { __init_active_call_duration_timer(qp); } } else if (held) { - __update_caller_info(eo, held); - elm_object_signal_emit(eo, "resume_call", ""); - elm_object_translatable_part_text_set(eo, CALLUI_QP_PART_TIMER, "IDS_CALL_BODY_ON_HOLD_ABB"); + __update_caller_info(qp, held); + elm_object_signal_emit(qp->main_ly, "resume_call", ""); + elm_object_translatable_part_text_set(qp->main_ly, CALLUI_QP_PART_TIMER, "IDS_CALL_BODY_ON_HOLD_ABB"); + elm_atspi_accessible_name_set(qp->ao_call_status, "IDS_CALL_BODY_ON_HOLD_ABB"); } else { dbg("incoming call. error!"); } @@ -548,12 +617,21 @@ static Evas_Object *__create_window(callui_app_data_t *ad) static Evas_Object *__create_qp_btn(callui_qp_mc_h qp, callui_qp_mc_btn_type_e type) { - Evas_Object *btn = elm_button_add(qp->quickpanel_layout); + Evas_Object *btn = elm_button_add(qp->main_ly); CALLUI_RETURN_NULL_IF_FAIL(btn); elm_object_style_set(btn, btn_params[type].style.normal); - elm_object_part_content_set(qp->quickpanel_layout, btn_params[type].part, btn); + elm_object_part_content_set(qp->main_ly, btn_params[type].part, btn); evas_object_smart_callback_add(btn, "clicked", btn_params[type].click_cb_func, qp); evas_object_propagate_events_set(btn, EINA_FALSE); + + /* Accessibility */ + elm_atspi_accessible_reading_info_type_set(btn, + ELM_ACCESSIBLE_READING_INFO_TYPE_NAME | + ELM_ACCESSIBLE_READING_INFO_TYPE_ROLE | + ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION); + elm_atspi_accessible_translation_domain_set(btn, CALLUI_TEXT_DOMAIN); + elm_atspi_accessible_name_set(btn, btn_params[type].name); + return btn; } @@ -563,24 +641,24 @@ static callui_result_e __activate(callui_qp_mc_h qp) _g_ad = qp->ad; - if (!qp->win_quickpanel) { - qp->win_quickpanel = __create_window(qp->ad); - if (qp->win_quickpanel == NULL) { + if (!qp->win) { + qp->win = __create_window(qp->ad); + if (qp->win == NULL) { err("__create_window() FAILED!"); return CALLUI_RESULT_FAIL; } - qp->rotate_angle = elm_win_rotation_get(qp->win_quickpanel); + qp->rotate_angle = elm_win_rotation_get(qp->win); dbg("current rotate angle(%d)", qp->rotate_angle); - qp->quickpanel_layout = _callui_create_layout(qp->win_quickpanel, CALLUI_LY_STYLE_QUICKPANEL); - if (qp->quickpanel_layout == NULL) { + qp->main_ly = _callui_create_layout(qp->win, CALLUI_LY_STYLE_QUICKPANEL); + if (qp->main_ly == NULL) { err("__callui_qp_mc_create_contents() FAILED!"); return CALLUI_RESULT_FAIL; } - elm_win_resize_object_add(qp->win_quickpanel, qp->quickpanel_layout); - evas_object_event_callback_add(qp->quickpanel_layout, EVAS_CALLBACK_MOUSE_UP, + elm_win_resize_object_add(qp->win, qp->main_ly); + evas_object_event_callback_add(qp->main_ly, EVAS_CALLBACK_MOUSE_UP, __main_layout_mouse_up_cb, qp); @@ -589,6 +667,10 @@ static callui_result_e __activate(callui_qp_mc_h qp) qp->buttons[i] = __create_qp_btn(qp, i); qp->is_available[i] = true; } + + if (__create_accessible_objects(qp) != CALLUI_RESULT_OK) { + err("Create accessible objects failed."); + } } qp->is_activated = true; @@ -603,19 +685,19 @@ static void __refresh_components(callui_qp_mc_h qp) if (qp->rotate_angle == 0 || qp->rotate_angle == 180) { dbg("portrait mode layout"); - evas_object_resize(qp->win_quickpanel, qp->ad->root_w, ELM_SCALE_SIZE(QP_WIN_H)); + evas_object_resize(qp->win, qp->ad->root_w, ELM_SCALE_SIZE(QP_WIN_H)); } else if (qp->rotate_angle == 90 || qp->rotate_angle == 270) { dbg("landscape mode layout"); - evas_object_resize(qp->win_quickpanel, qp->ad->root_h, ELM_SCALE_SIZE(QP_WIN_H)); + evas_object_resize(qp->win, qp->ad->root_h, ELM_SCALE_SIZE(QP_WIN_H)); } __update_layout_components(qp); - evas_object_show(qp->win_quickpanel); - evas_object_show(qp->quickpanel_layout); + evas_object_show(qp->win); + evas_object_show(qp->main_ly); /* Prohibit remove of mini control */ - minicontrol_send_event(qp->win_quickpanel, MINICONTROL_EVENT_REQUEST_LOCK, NULL); + minicontrol_send_event(qp->win, MINICONTROL_EVENT_REQUEST_LOCK, NULL); } static void __deactivate(callui_qp_mc_h qp) @@ -624,6 +706,8 @@ static void __deactivate(callui_qp_mc_h qp) qp->is_activated = false; + __destroy_accessible_objects(qp); + int i = 0; for (; i < CALLUI_QP_BTN_COUNT; i++) { evas_object_smart_callback_del_full(qp->buttons[i], "clicked", btn_params[i].click_cb_func, qp); @@ -631,20 +715,16 @@ static void __deactivate(callui_qp_mc_h qp) qp->is_available[i] = true; } - if (qp->caller_id) { - evas_object_del(qp->caller_id); - } - - if (qp->quickpanel_layout) { - evas_object_event_callback_del_full(qp->quickpanel_layout, EVAS_CALLBACK_MOUSE_UP, + if (qp->main_ly) { + evas_object_event_callback_del_full(qp->main_ly, EVAS_CALLBACK_MOUSE_UP, __main_layout_mouse_up_cb, qp); - evas_object_del(qp->quickpanel_layout); - qp->quickpanel_layout = NULL; + evas_object_del(qp->main_ly); + qp->main_ly = NULL; } - if (qp->win_quickpanel) { - evas_object_del(qp->win_quickpanel); - qp->win_quickpanel = NULL; + if (qp->win) { + evas_object_del(qp->win); + qp->win = NULL; } __deinit_call_duration_timer(qp); @@ -656,6 +736,8 @@ static void __update_call_btn(callui_qp_mc_h qp) CALLUI_RETURN_IF_FAIL(btn); elm_object_disabled_set(btn, !qp->is_available[CALLUI_QP_BTN_CALL]); + + __update_btn_accessibility_info(qp, CALLUI_QP_BTN_CALL); } static void __update_resume_btn(callui_qp_mc_h qp) @@ -667,10 +749,14 @@ static void __update_resume_btn(callui_qp_mc_h qp) _callui_stp_get_call_data(qp->ad->state_provider, CALLUI_CALL_DATA_HELD); if (held) { elm_object_style_set(btn, btn_params[CALLUI_QP_BTN_RESUME].style.normal); + qp->is_active[CALLUI_QP_BTN_RESUME] = false; } else { elm_object_style_set(btn, btn_params[CALLUI_QP_BTN_RESUME].style.active); + qp->is_active[CALLUI_QP_BTN_RESUME] = true; } elm_object_disabled_set(btn, !qp->is_available[CALLUI_QP_BTN_RESUME]); + + __update_btn_accessibility_info(qp, CALLUI_QP_BTN_RESUME); } static void __update_speaker_btn(callui_qp_mc_h qp) @@ -681,10 +767,22 @@ static void __update_speaker_btn(callui_qp_mc_h qp) callui_audio_state_type_e audio_state = _callui_sdm_get_audio_state(qp->ad->sound_manager); if (audio_state != CALLUI_AUDIO_STATE_SPEAKER) { elm_object_style_set(btn, btn_params[CALLUI_QP_BTN_SPEAKER].style.normal); + qp->is_active[CALLUI_QP_BTN_SPEAKER] = false; } else { elm_object_style_set(btn, btn_params[CALLUI_QP_BTN_SPEAKER].style.active); + qp->is_active[CALLUI_QP_BTN_SPEAKER] = true; } elm_object_disabled_set(btn, !qp->is_available[CALLUI_QP_BTN_SPEAKER]); + + __update_btn_accessibility_info(qp, CALLUI_QP_BTN_SPEAKER); +} + +static void __update_end_btn(callui_qp_mc_h qp) +{ + Evas_Object *btn = qp->buttons[CALLUI_QP_BTN_END]; + CALLUI_RETURN_IF_FAIL(btn); + + __update_btn_accessibility_info(qp, CALLUI_QP_BTN_END); } static void __update_mute_btn(callui_qp_mc_h qp) @@ -694,10 +792,14 @@ static void __update_mute_btn(callui_qp_mc_h qp) if (_callui_sdm_get_mute_state(qp->ad->sound_manager)) { elm_object_style_set(btn, btn_params[CALLUI_QP_BTN_MUTE].style.active); + qp->is_active[CALLUI_QP_BTN_MUTE] = true; } else { elm_object_style_set(btn, btn_params[CALLUI_QP_BTN_MUTE].style.normal); + qp->is_active[CALLUI_QP_BTN_MUTE] = false; } elm_object_disabled_set(btn, !qp->is_available[CALLUI_QP_BTN_MUTE]); + + __update_btn_accessibility_info(qp, CALLUI_QP_BTN_MUTE); } static void __resume_btn_click_cb(void *data, Evas_Object *obj, void *event_info) @@ -791,3 +893,26 @@ static void __end_btn_click_cb(void *data, Evas_Object *obj, void *event_info) err("__end_btn_click_cb() failed. res[%d]", res); } } + +static callui_result_e __create_accessible_objects(callui_qp_mc_h qp) +{ + qp->ao_caller_info = _callui_au_register_accessible_object(qp->main_ly, qp->main_ly, "contact_name.access"); + CALLUI_RETURN_VALUE_IF_FAIL(qp->ao_caller_info, CALLUI_RESULT_FAIL); + elm_atspi_accessible_translation_domain_set(qp->ao_caller_info, CALLUI_TEXT_DOMAIN); + elm_atspi_accessible_reading_info_type_set(qp->ao_caller_info, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME); + + qp->ao_call_status = _callui_au_register_accessible_object(qp->main_ly, qp->main_ly, "txt_timer.access"); + CALLUI_RETURN_VALUE_IF_FAIL(qp->ao_call_status, CALLUI_RESULT_FAIL); + elm_atspi_accessible_translation_domain_set(qp->ao_call_status, CALLUI_TEXT_DOMAIN); + elm_atspi_accessible_reading_info_type_set(qp->ao_call_status, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME); + + return CALLUI_RESULT_OK; +} + +static void __destroy_accessible_objects(callui_qp_mc_h qp) +{ + _callui_au_unregister_accessible_object(qp->ao_caller_info); + DELETE_EVAS_OBJECT(qp->ao_caller_info); + _callui_au_unregister_accessible_object(qp->ao_call_status); + DELETE_EVAS_OBJECT(qp->ao_call_status); +} diff --git a/src/callui-view-single-call.c b/src/callui-view-single-call.c index 9bbd66e..1d51513 100644 --- a/src/callui-view-single-call.c +++ b/src/callui-view-single-call.c @@ -330,7 +330,7 @@ static void __keypad_show_state_change_cd(void *data, callui_keypad_state_event_ static void __register_accessibility_rout_start_and_end_points(call_view_single_call_h vd) { - vd->base_view.ao_first = _callui_au_register_accessible_object(vd->base_view.contents, vd->base_view.contents, "access.rect"); + vd->base_view.ao_first = _callui_au_register_accessible_object(vd->base_view.contents, vd->base_view.contents, "rect.access"); _callui_au_set_highlight_ability(vd->base_view.ao_first, false); callui_result_e res = _callui_au_append_symmetric_relationship(vd->base_view.ao_first, vd->base_view.ao_call_status); diff --git a/src/callui.c b/src/callui.c index 18fc53d..45a695e 100755 --- a/src/callui.c +++ b/src/callui.c @@ -498,20 +498,21 @@ static void __app_lang_changed_cb(app_event_info_h event_info, void *user_data) err("Update application language failed. res[%d]", res); } res = _callui_window_validate_position(ad->window); - if (res != CALLUI_RESULT_OK) - { + if (res != CALLUI_RESULT_OK) { err("Validate window position failed. res[%d]", res); } res = _callui_vm_update_language(ad->view_manager); - if (res != CALLUI_RESULT_OK) - { + if (res != CALLUI_RESULT_OK) { err("Update language in view manager failed. res[%d]", res); } res = _callui_action_bar_update_accessibility_info(ad->action_bar); - if (res != CALLUI_RESULT_OK) - { + if (res != CALLUI_RESULT_OK) { err("Update action bar accessibility objects info failed. res[%d]", res); } + res = _callui_qp_mc_update_accessibility_info(ad->qp_minicontrol); + if (res != CALLUI_RESULT_OK) { + err("Update quick panel mini controller accessibility objects info failed. res[%d]", res); + } } static void __app_deinit(callui_app_data_t *ad)