efl_access: Add reading_info_type set/get APIs

Summary:
Information obtained by atspi client is name, role, description, state of an object.
reading_info_type_set/get APIs give control to application to decide on the information
that can be exposed.

Test Plan:
The reading info is added as an attribute of an accessible object, on query of
attribute, reading_info_type and corresponding character buffer should be given to ATSPI clients.

Reviewers: kimcinoo

Subscribers: cedric, govi, rajeshps, jpeg

Differential Revision: https://phab.enlightenment.org/D5524
This commit is contained in:
Shilpa Singh 2017-11-23 12:07:52 +09:00 committed by Shinwoo Kim
parent 06778385f1
commit a2c342270c
2 changed files with 57 additions and 0 deletions

View File

@ -129,6 +129,7 @@ struct _Efl_Access_Data
const char *description;
const char *translation_domain;
Efl_Access_Role role;
Efl_Access_Reading_Info_Type reading_info;
Efl_Access_Type type: 2;
};
@ -253,6 +254,42 @@ EOLIAN static void _efl_access_attributes_clear(Eo *obj EINA_UNUSED, Efl_Access_
pd->attr_list = NULL;
}
EOLIAN static void
_efl_access_reading_info_type_set(Eo *obj, Efl_Access_Data *pd, Efl_Access_Reading_Info_Type reading_info)
{
Eina_Strbuf *buf = NULL;
pd->reading_info = reading_info;
buf = eina_strbuf_new();
eina_strbuf_reset(buf);
if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_NAME))
{
eina_strbuf_append(buf, "name");
eina_strbuf_append_char(buf, '|');
}
if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_ROLE))
{
eina_strbuf_append(buf, "role");
eina_strbuf_append_char(buf, '|');
}
if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_DESCRIPTION))
{
eina_strbuf_append(buf, "description");
eina_strbuf_append_char(buf, '|');
}
if (reading_info & (EFL_ACCESS_READING_INFO_TYPE_STATE))
{
eina_strbuf_append(buf, "state");
}
efl_access_attribute_append(obj, "reading_info_type", eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
}
EOLIAN Efl_Access_Reading_Info_Type
_efl_access_reading_info_type_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd)
{
return pd->reading_info;
}
EOLIAN static Efl_Access_Role
_efl_access_role_get(Eo *obj EINA_UNUSED, Efl_Access_Data *pd EINA_UNUSED)
{

View File

@ -192,6 +192,15 @@ enum Efl.Access.Relation_Type
last_defined, [[Last enum entry sentinel]]
}
enum Efl.Access.Reading.Info.Type
{
[[The accessible Reading information type that can be read.]]
name = 1 << 0, [[Name should be read]]
role = 1 << 1, [[Role should be read]]
description = 1 << 2, [[description should be read.]]
state = 1 << 3, [[State should be read.]]
}
type Efl.Access.State_Set: uint64; [[Accessibility object state set.]]
struct Efl.Access.Event.Handler; [[Accessibility event listener]]
@ -315,6 +324,17 @@ mixin Efl.Access (Efl.Interface, Efl.Object)
\@internal
]]
}
@property reading_info_type @protected {
get {
[[Gets reading information types of an accessible object.]]
}
set {
[[Sets reading information of an accessible object.]]
}
values {
reading_info: Efl.Access.Reading.Info.Type; [[Reading information types]]
}
}
@property index_in_parent @protected @beta {
[[Gets index of the child in parent's children list.]]
get {