[Index] Made UX changes for atspi as per v0.2 73/69873/5
authorPrasoon Singh <prasoon.16@samsung.com>
Tue, 17 May 2016 06:29:34 +0000 (11:59 +0530)
committerPrasoon Singh <prasoon.16@samsung.com>
Thu, 19 May 2016 10:06:14 +0000 (15:36 +0530)
Change-Id: Ie32d8e12827e13a0bb761813b3433d4eadbb6137

src/lib/elm_index.c

index b14ef04..e26f455 100644 (file)
@@ -114,6 +114,17 @@ _access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
    return NULL;
 }
 
+//TIZEN_ONLY(20160519): improve index atspi support
+static Eina_Bool _atspi_enabled()
+{
+    Eo *bridge = NULL;
+    Eina_Bool ret = EINA_FALSE;
+    if (_elm_config->atspi_mode && (bridge = _elm_atspi_bridge_get()))
+      eo_do(bridge, ret = elm_obj_atspi_bridge_connected_get());
+    return ret;
+}
+//
+
 EOLIAN static Evas_Object*
 _elm_index_item_elm_widget_item_access_register(Eo *eo_item, Elm_Index_Item_Data *it)
 {
@@ -534,7 +545,9 @@ _elm_index_item_eo_base_constructor(Eo *obj, Elm_Index_Item_Data *it)
 {
    obj = eo_do_super_ret(obj, ELM_INDEX_ITEM_CLASS, obj, eo_constructor());
    it->base = eo_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
-   eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_PUSH_BUTTON));
+   //TIZEN_ONLY(20160519): improve index atspi support
+   eo_do(obj, elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_RADIO_MENU_ITEM));
+   //
 
    return obj;
 }
@@ -1238,7 +1251,11 @@ _elm_index_eo_base_constructor(Eo *obj, Elm_Index_Data *_pd EINA_UNUSED)
    eo_do(obj,
          evas_obj_type_set(MY_CLASS_NAME_LEGACY),
          evas_obj_smart_callbacks_descriptions_set(_smart_callbacks),
-         elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_SCROLL_BAR));
+         elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_SCROLL_BAR),
+         //TIZEN_ONLY(20160519): improve index atspi support
+         elm_interface_atspi_accessible_name_set(N_("Index"))
+         //
+        );
 
    return obj;
 }
@@ -1311,6 +1328,9 @@ _elm_index_item_selected_set(Eo *eo_it,
 
              edje_object_signal_emit(VIEW(it_inactive),
                                      "elm,state,inactive", "elm");
+             //TIZEN_ONLY(20160519): improve index atspi support
+             if (_atspi_enabled()) elm_layout_signal_emit(obj, "elm,indicator,state,inactive", "elm");
+             //
              edje_object_message_signal_process(VIEW(it_inactive));
           }
 
@@ -1321,6 +1341,15 @@ _elm_index_item_selected_set(Eo *eo_it,
           it_active = it_sel;
 
         edje_object_signal_emit(VIEW(it_active), "elm,state,active", "elm");
+
+        //TIZEN_ONLY(20160519): improve index atspi support
+        if (_atspi_enabled())
+          {
+             elm_layout_text_set(obj, "elm.text", strdup(it_sel->letter));
+             elm_layout_signal_emit(obj, "elm,indicator,state,active", "elm");
+          }
+        //
+
         edje_object_message_signal_process(VIEW(it_active));
 
         eo_do(obj, eo_event_callback_call