efl_access: if 0 is set as reading_info_type, remove existing reading_info
authorShilpa Singh <shilpa.singh@samsung.com>
Mon, 25 Mar 2019 01:11:39 +0000 (10:11 +0900)
committerYeongjong Lee <yj34.lee@samsung.com>
Tue, 2 Apr 2019 03:45:17 +0000 (12:45 +0900)
Summary:
if 0 is set as reading_info_type, remove existing reading_info and
allow default reading info types (name, role, state and description)
to be read.
Do not set reading info again in reading_info_type_set API if new
value matches the old value.

Test Plan:
If application does not set reading_info_type or set 0 reading_info_type,
All four reading info types of an accessible object should be read on highlight.

Signed-off-by: Shilpa Singh <shilpa.singh@samsung.com>
Reviewers: kimcinoo, jsuya, bu5hm4n, lukasz.stanislawski

Subscribers: prasoonsingh16, rajeev.jnnce, #reviewers, cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8435

Change-Id: I5258ad5c6a1210c4880aa822ed1c504cf838b8ca

src/lib/elementary/efl_access_object.c
src/lib/elementary/efl_access_object.eo

index 80c63e7..48e1619 100644 (file)
@@ -312,7 +312,14 @@ EOLIAN static void
 _efl_access_object_reading_info_type_set(Eo *obj, Efl_Access_Object_Data *pd, Efl_Access_Reading_Info_Type reading_info)
 {
    Eina_Strbuf *buf = NULL;
+   if (reading_info == pd->reading_info)
+     return;
    pd->reading_info = reading_info;
+   if (!pd->reading_info)
+     {
+        efl_access_object_attribute_del(obj, "reading_info_type");
+        return;
+     }
    buf = eina_strbuf_new();
    eina_strbuf_reset(buf);
    if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_NAME))
index 6fa98da..d666c9b 100644 (file)
@@ -467,14 +467,18 @@ mixin Efl.Access.Object requires Efl.Object
       }
       @property reading_info_type @protected {
          get {
-            [[Gets reading information types of an accessible object.
+            [[Gets reading information types of an accessible object. if no reading information
+            is set, 0 is returned which means all four reading information types will be read on
+            object highlight
 
               \@if WEARABLE \@since_tizen 3.0
               \@endif
             ]]
          }
          set {
-            [[Sets reading information of an accessible object.
+            [[Sets reading information of an accessible object. If set as 0, existing
+            reading info will be deleted and by default all four reading information types
+            like name, role, state and description will be read on object highlight
 
               \@if WEARABLE \@since_tizen 3.0
               \@endif