summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoHyun Pyun <dh79.pyun@samsung.com>2016-12-08 12:14:25 +0900
committerDoHyun Pyun <dh79.pyun@samsung.com>2016-12-08 12:14:55 +0900
commit43b0ad4b3846a9a92ce7a9752248cd7b18e598fc (patch)
tree7fb82eb1faa7dc2ec484321aab4e38ab7d128e8d
parentecf7e8a2aca054e0762cb83799441c4646a217f9 (diff)
downloadbluetooth-43b0ad4b3846a9a92ce7a9752248cd7b18e598fc.tar.gz
bluetooth-43b0ad4b3846a9a92ce7a9752248cd7b18e598fc.tar.bz2
bluetooth-43b0ad4b3846a9a92ce7a9752248cd7b18e598fc.zip
Change-Id: I4fc2b2f64230747791b3e9d918c1d7eadeca05a9 Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
-rw-r--r--src/bt-main-view.c75
-rw-r--r--src/bt-popup.c6
2 files changed, 51 insertions, 30 deletions
diff --git a/src/bt-main-view.c b/src/bt-main-view.c
index ff80cb2..b8f028c 100644
--- a/src/bt-main-view.c
+++ b/src/bt-main-view.c
@@ -209,11 +209,6 @@ static void __bt_scan_btn_cb(void *data, Evas_Object *obj,
FN_END;
}
-static void __bt_headset_detail_tts_activated_cb(void *data, Evas_Object *part_obj, Elm_Object_Item *item)
-{
- __bt_detail_icon_sel_cb(data, NULL, NULL);
-}
-
static Eina_Bool __bt_headset_title_item_access_action_cb(void *data, Evas_Object *obj, Elm_Access_Action_Info *action_info)
{
FN_START;
@@ -402,6 +397,26 @@ void _bt_remove_scanning_item(bt_app_data_t *ad)
ad->scanning_item = NULL;
}
+static char *__bt_scan_accessible_name_cb(void *data, Evas_Object *obj)
+{
+ FN_START;
+
+ bt_app_data_t *ad = NULL;
+ char *accessible_str = NULL;
+
+ retv_if(data == NULL, NULL);
+
+ ad = (bt_app_data_t *)data;
+
+ if (ad->op_status == BT_SEARCHING)
+ accessible_str = BT_STR_STOP;
+ else
+ accessible_str = BT_STR_SCAN;
+
+ FN_END;
+ return g_strdup(accessible_str);
+}
+
static Evas_Object * __bt_create_scan_btn(bt_app_data_t *ad)
{
FN_START;
@@ -418,6 +433,8 @@ static Evas_Object * __bt_create_scan_btn(bt_app_data_t *ad)
evas_object_show(btn);
ad->scan_btn = btn;
+ elm_atspi_accessible_name_cb_set(btn, __bt_scan_accessible_name_cb, ad);
+
_bt_update_scan_btn(ad);
elm_object_part_content_set(ad->headset_layout, "elm.swallow.button", btn);
@@ -579,7 +596,6 @@ static Evas_Object *__bt_paired_item_icon_get(void *data, Evas_Object *obj,
Evas_Object *btn = NULL;
Evas_Object *icon = NULL;
bt_dev_t *dev = NULL;
- Evas_Object *ao = NULL;
retv_if(data == NULL, NULL);
dev = (bt_dev_t *)data;
@@ -598,11 +614,10 @@ static Evas_Object *__bt_paired_item_icon_get(void *data, Evas_Object *obj,
elm_object_content_set(btn, icon);
evas_object_color_set(icon, 20, 107, 147, 255);
elm_access_object_unregister(btn);
- ao = elm_access_object_register(btn, obj);
- elm_access_info_set(ao, ELM_ACCESS_TYPE, BT_STR_BUTTON);
- elm_access_info_set(ao, ELM_ACCESS_INFO, BT_STR_DEVICE_SETTINGS);
- elm_access_activate_cb_set(ao , __bt_headset_detail_tts_activated_cb, data);
+ elm_atspi_accessible_description_set(btn, BT_STR_DEVICE_SETTINGS);
+ elm_atspi_accessible_translation_domain_set(btn, BT_COMMON_PKG);
+
evas_object_smart_callback_add(btn, "clicked",
(Evas_Smart_Cb)
__bt_detail_icon_sel_cb,
@@ -904,6 +919,26 @@ int _bt_create_headset_view(bt_app_data_t *ad)
return 0;
}
+static char *__bt_onoff_accessible_name_cb(void *data, Evas_Object *obj)
+{
+ FN_START;
+
+ bt_app_data_t *ad = NULL;
+ char *accessible_str = NULL;
+
+ retv_if(data == NULL, NULL);
+
+ ad = (bt_app_data_t *)data;
+
+ if (ad->bt_enabled == TRUE)
+ accessible_str = BT_STR_OFF_FOR_TTS;
+ else
+ accessible_str = BT_STR_ON_FOR_TTS;
+
+ FN_END;
+ return g_strdup(accessible_str);
+}
+
static Evas_Object * __bt_gl_bluetooth_check_get(void *data, Evas_Object *obj, const char *part)
{
retvm_if(data == NULL, NULL, "data is NULL!");
@@ -930,6 +965,8 @@ static Evas_Object * __bt_gl_bluetooth_check_get(void *data, Evas_Object *obj, c
evas_object_repeat_events_set(check, EINA_TRUE);
elm_access_object_unregister(check);
+ elm_atspi_accessible_description_cb_set(check, __bt_onoff_accessible_name_cb, ad);
+
/* add smart callback */
evas_object_smart_callback_add(check, "changed",
__bt_base_bluetooth_cb, ad);
@@ -943,23 +980,11 @@ static Evas_Object * __bt_gl_bluetooth_check_get(void *data, Evas_Object *obj, c
static char *__bt_gl_bluetooth_label_get(void *data, Evas_Object *obj, const char *part)
{
retvm_if(data == NULL, NULL, "data is NULL!");
- bt_app_data_t *ad = (bt_app_data_t *)data;
char *text_color = "<font color=#4DCFFFC9>%s</font>";
char *buf = NULL;
char *name_str = NULL;
- char *new_access_info = NULL;
- Evas_Object *access_obj = NULL;
- access_obj = elm_object_item_access_object_get(ad->bt_item);
if (!strcmp(part, "elm.text")) {
- if (elm_check_state_get(ad->gl_bt_check) == EINA_FALSE &&
- (ad->bt_enabled == FALSE)) {
- new_access_info = g_strdup_printf("%s, %s, %s", BT_STR_BLUETOOTH,
- BT_STR_SWITCH_FOR_TTS, BT_STR_OFF_FOR_TTS);
- DBG("new_access_info : %s", new_access_info);
- elm_access_info_set(access_obj, ELM_ACCESS_INFO, new_access_info);
- g_free(new_access_info);
- }
return g_strdup(BT_STR_BLUETOOTH);
} else if (!strcmp(part, "elm.text.1")) {
name_str = vconf_get_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR);
@@ -973,13 +998,7 @@ static char *__bt_gl_bluetooth_label_get(void *data, Evas_Object *obj, const cha
return buf;
} else if (!strcmp(part, "elm.text.2")) {
name_str = vconf_get_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR);
- new_access_info = g_strdup_printf("%s, %s, %s, %s, %s", BT_STR_BLUETOOTH,
- name_str, BT_STR_VISIBLE, BT_STR_SWITCH_FOR_TTS,
- BT_STR_ON_FOR_TTS);
- DBG("new_access_info : %s", new_access_info);
- elm_access_info_set(access_obj, ELM_ACCESS_INFO, new_access_info);
g_free(name_str);
- g_free(new_access_info);
return g_strdup_printf(text_color, BT_STR_VISIBLE);
}
return NULL;
diff --git a/src/bt-popup.c b/src/bt-popup.c
index f869f15..d2d1802 100644
--- a/src/bt-popup.c
+++ b/src/bt-popup.c
@@ -133,6 +133,8 @@ static void __bt_draw_popup(bt_app_data_t *ad,
btn = elm_button_add(ad->popup);
elm_object_style_set(btn , "popup/circle/left");
+ elm_atspi_accessible_description_set(btn, BT_STR_CANCEL);
+ elm_atspi_accessible_translation_domain_set(btn, BT_COMMON_PKG);
elm_object_part_content_set(ad->popup, "button1", btn);
evas_object_smart_callback_add(btn , "clicked", func, data);
@@ -140,11 +142,12 @@ static void __bt_draw_popup(bt_app_data_t *ad,
elm_image_file_set(icon, BT_IMAGE_EDJ, BT_ICON_DELETE);
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_object_part_content_set(btn, "elm.swallow.content", icon);
- elm_access_info_set(btn, ELM_ACCESS_INFO, BT_STR_CANCEL);
evas_object_show(icon);
btn = elm_button_add(ad->popup);
elm_object_style_set(btn , "popup/circle/right");
+ elm_atspi_accessible_description_set(btn, BT_STR_OK);
+ elm_atspi_accessible_translation_domain_set(btn, BT_COMMON_PKG);
elm_object_part_content_set(ad->popup, "button2", btn);
evas_object_smart_callback_add(btn , "clicked", func, data);
@@ -152,7 +155,6 @@ static void __bt_draw_popup(bt_app_data_t *ad,
elm_image_file_set(icon, BT_IMAGE_EDJ, BT_ICON_CHECK);
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_object_part_content_set(btn, "elm.swallow.content", icon);
- elm_access_info_set(btn, ELM_ACCESS_INFO, BT_STR_OK);
evas_object_show(icon);
evas_object_show(ad->popup);