efl_access_object: Support org.a11y.atspi.Value.Text property
[platform/upstream/efl.git] / src / lib / elementary / efl_access_object.eo
1 import eina_types;
2
3 type @beta Efl.Access.Reading_Info_Cb: __undefined_type; [[reading information callback]]
4 type @beta Efl.Access.Gesture_Cb: __undefined_type; [[gesture callback]]
5 type @beta Efl.Access.Reading_Info_Type_Mask: uint; [[Reading information types]]
6
7 enum @beta Efl.Access.Type
8 {
9    [[Type of accessibility object]]
10    regular, [[default accessible object]]
11    disabled, [[skip object and its children in accessibility hierarchy]]
12    skipped [[skip object in accessibility hierarchy]]
13 }
14
15 enum @beta Efl.Access.Role
16 {
17    [[Describes the role of an object visible to Accessibility Clients.]]
18    invalid, [[Role: invalid]]
19    accelerator_label, [[Role: accelerator label]]
20    alert, [[Role: alert]]
21    animation, [[Role: animation]]
22    arrow, [[Role: arrow]]
23    calendar, [[Role: calendar]]
24    canvas, [[Role: canvas]]
25    check_box, [[Role: check box]]
26    check_menu_item, [[Role: check menu item]]
27    color_chooser, [[Role: color chooser]]
28    column_header, [[Role: column header]]
29    combo_box, [[Role: combo box]]
30    date_editor, [[Role: data editor]]
31    desktop_icon, [[Role: desktop icon]]
32    desktop_frame, [[Role: desktop frame]]
33    dial, [[Role: dial]]
34    dialog, [[Role: dialog]]
35    directory_pane, [[Role: directory pane]]
36    drawing_area, [[Role: drawing area]]
37    file_chooser, [[Role: file chooser]]
38    filler, [[Role: filler]]
39    focus_traversable, [[Role: focus traversable]]
40    font_chooser, [[Role: font chooser]]
41    frame, [[Role: frame]]
42    glass_pane, [[Role: glass pane]]
43    html_container, [[Role: HTML container]]
44    icon, [[Role: icon]]
45    image, [[Role: image]]
46    internal_frame, [[Role: internal frame]]
47    label, [[Role: label]]
48    layered_pane, [[Role: layered pane]]
49    list, [[Role: list]]
50    list_item, [[Role: list item]]
51    menu, [[Role: menu]]
52    menu_bar, [[Role: menu bar]]
53    menu_item, [[Role: menu item]]
54    option_pane, [[Role: option pane]]
55    page_tab, [[Role: page tab]]
56    page_tab_list, [[Role: page tab list]]
57    panel, [[Role: panel]]
58    password_text, [[Role: password text]]
59    popup_menu, [[Role: popup menu]]
60    progress_bar, [[Role: progress bar]]
61    push_button, [[Role: push button]]
62    radio_button, [[Role: radio button]]
63    radio_menu_item, [[Role: radio menu item]]
64    root_pane, [[Role: root pane]]
65    row_header, [[Role: row header]]
66    scroll_bar, [[Role: scroll bar]]
67    scroll_pane, [[Role: scroll pane]]
68    separator, [[Role: separator]]
69    slider, [[Role: slider]]
70    spin_button, [[Role: spin button]]
71    split_pane, [[Role: split pane]]
72    status_bar, [[Role: status bar]]
73    table, [[Role: table]]
74    table_cell, [[Role: table cell]]
75    table_column_header, [[Role: table column header]]
76    table_row_header, [[Role: table row header]]
77    tearoff_menu_item, [[Role: tearoff menu item]]
78    terminal, [[Role: terminal]]
79    text, [[Role: text]]
80    toggle_button, [[Role: toggle button]]
81    tool_bar, [[Role: too bar]]
82    tool_tip, [[Role: tool tip]]
83    tree, [[Role: tree]]
84    tree_table, [[Role: tree table]]
85    unknown, [[Role: unknown]]
86    viewport, [[Role: viewport]]
87    window, [[Role: window]]
88    extended, [[Role: extended]]
89    header, [[Role: header]]
90    footer, [[Role: footer]]
91    paragraph, [[Role: paragraph]]
92    ruler, [[Role: ruler]]
93    application, [[Role: application]]
94    autocomplete, [[Role: autocomplete]]
95    editbar, [[Role: editbar]]
96    embedded, [[Role: embedded]]
97    entry, [[Role: entry]]
98    chart, [[Role: chart]]
99    caption, [[Role: caption]]
100    document_frame, [[Role: document frame]]
101    heading, [[Role: heading]]
102    page, [[Role: page]]
103    section, [[Role: section]]
104    redundant_object, [[Role: redundant object]]
105    form, [[Role: form]]
106    link, [[Role: link]]
107    input_method_window, [[Role: input method window]]
108    table_row, [[Role: table row]]
109    tree_item, [[Role: table item]]
110    document_spreadsheet, [[Role: document spreadsheet]]
111    document_presentation, [[Role: document presentation]]
112    document_text, [[Role: document text]]
113    document_web, [[Role: document web]]
114    document_email, [[Role: document email]]
115    comment, [[Role: comment]]
116    list_box, [[Role: list box]]
117    grouping, [[Role: grouping]]
118    image_map, [[Role: image map]]
119    notification, [[Role: notification]]
120    info_bar, [[Role: info bar]]
121    last_defined,  [[Last enum entry sentinel]]
122 }
123
124 enum @beta Efl.Access.State_Type
125 {
126    [[Describes the possible states for an object visible to accessibility clients.]]
127    invalid, [[State: invalid]]
128    active, [[State: active]]
129    armed, [[State: armed]]
130    busy, [[State: busy]]
131    checked, [[State: checked]]
132    collapsed, [[State: collapsed]]
133    defunct, [[State: defunct]]
134    editable, [[State: editable]]
135    enabled, [[State: enabled]]
136    expandable, [[State: expandable]]
137    expanded, [[State: expanded]]
138    focusable, [[State: focusable]]
139    focused, [[State: focused]]
140    has_tooltip, [[State: has a tooltip]]
141    horizontal, [[State: horizontal]]
142    minimized, [[State: minimized]]
143    modal, [[State: modal]]
144    multi_line, [[State: multi line]]
145    multiselectable, [[State: multiselectable]]
146    opaque, [[State: opaque]]
147    pressed, [[State: pressed]]
148    resizable, [[State: resizable]]
149    selectable, [[State: selectable]]
150    selected, [[State: selected]]
151    sensitive, [[State: sensitive]]
152    showing, [[State: showing]]
153    single_line, [[State: single line]]
154    stale, [[State: stale]]
155    transient, [[State: transient]]
156    vertical, [[State: vertical]]
157    visible, [[State: visible]]
158    manages_descendants, [[State: manage descendants]]
159    indeterminate, [[State: indeterminate]]
160    required, [[State: required]]
161    truncated, [[State: truncated]]
162    animated, [[State: animated]]
163    invalid_entry, [[State: invalid entry]]
164    supports_autocompletion, [[State: supports autocompletion]]
165    selectable_text, [[State: selectable text]]
166    is_default, [[State: is default]]
167    visited, [[State: visited]]
168    //TIZEN_ONLY(20171108): bring HIGHLIGHT related changes
169    checkable, [[State: checkable]]
170    has_popup, [[State: has popup]]
171    read_only, [[State: read only]]
172    highlighted, [[State: highlighted]]
173    highlightable, [[State: highlightable]]
174    //
175    last_defined,  [[Last enum entry sentinel]]
176 }
177
178 enum @beta Efl.Access.Relation_Type
179 {
180    [[Describes the relationship between two objects.]]
181    null, [[No relation]]
182    label_for, [[Label for relation]]
183    labelled_by, [[Labelled by relation]]
184    controller_for, [[Controller for relation]]
185    controlled_by, [[Controlled by relation]]
186    member_of, [[Member of relation]]
187    tooltip_for, [[Tooltip for relation]]
188    node_child_of, [[Node child of relation]]
189    node_parent_of, [[Node parent of relation]]
190    extended, [[Extended relation]]
191    flows_to, [[Flows to relation]]
192    flows_from, [[Flows from relation]]
193    subwindow_of, [[Subwindow of relation]]
194    embeds, [[Embeds relation]]
195    embedded_by, [[Embedded by relation]]
196    popup_for, [[Popup for relation]]
197    parent_window_of, [[Parent window of relation]]
198    description_for, [[Description for relation]]
199    described_by, [[Described by relation]]
200    last_defined, [[Last enum entry sentinel]]
201 }
202
203 enum @beta Efl.Access.Reading.Info.Type
204 {
205    [[The accessible Reading information type that can be read.]]
206    name = 1 << 0, [[Name should be read]]
207    role = 1 << 1, [[Role should be read]]
208    description = 1 << 2, [[description should be read.]]
209    state = 1 << 3, [[State should be read.]]
210 }
211
212 enum @beta Efl.Access.Gesture
213 {
214    one_finger_hover,
215    two_fingers_hover,
216    three_fingers_hover,
217    one_finger_flick_left,
218    one_finger_flick_right,
219    one_finger_flick_up,
220    one_finger_flick_down,
221    two_fingers_flick_left,
222    two_fingers_flick_right,
223    two_fingers_flick_up,
224    two_fingers_flick_down,
225    three_fingers_flick_left,
226    three_fingers_flick_right,
227    three_fingers_flick_up,
228    three_fingers_flick_down,
229    one_finger_single_tap,
230    one_finger_double_tap,
231    one_finger_triple_tap,
232    two_fingers_single_tap,
233    two_fingers_double_tap,
234    two_fingers_triple_tap,
235    three_fingers_single_tap,
236    three_fingers_double_tap,
237    three_fingers_triple_tap,
238    one_finger_flick_left_return,
239    one_finger_flick_right_return,
240    one_finger_flick_up_return,
241    one_finger_flick_down_return,
242    two_fingers_flick_left_return,
243    two_fingers_flick_right_return,
244    two_fingers_flick_up_return,
245    two_fingers_flick_down_return,
246    three_fingers_flick_left_return,
247    three_fingers_flick_right_return,
248    three_fingers_flick_up_return,
249    three_fingers_flick_down_return,
250 }
251
252 enum @beta Efl.Access.Gesture_State
253 {
254    start,
255    move,
256    end,
257    abort,
258 }
259
260 type @beta Efl.Access.State_Set: uint64; [[Accessibility object state set.]]
261
262 struct @beta Efl.Access.Event.Handler; [[Accessibility event listener]]
263
264 struct @beta Efl.Access.Event.State_Changed.Data
265 {
266    [[Accessibility state changed event data]]
267    type: Efl.Access.State_Type; [[Type of the state changed event]]
268    new_value: bool; [[New value]]
269 }
270
271 struct @beta Efl.Access.Event.Geometry_Changed.Data
272 {
273    [[Accessibility geometry changed event data]]
274    x: int; [[X coordinate]]
275    y: int; [[Y coordinate]]
276    width: int; [[Width]]
277    height: int; [[Height]]
278 }
279
280 struct @beta Efl.Access.Event.Children_Changed.Data
281 {
282    [[Accessibility children changed event data]]
283    is_added: bool; [[Child is added or not]]
284    child: Efl.Object; [[Child object]]
285 }
286
287 struct @beta @free(efl_access_attribute_free) Efl.Access.Attribute
288 {
289    [[Accessibility Attribute]]
290    key: string; [[Attribute key]]
291    value: string; [[Attribute value]]
292 }
293
294 struct @beta Efl.Access.Relation
295 {
296    [[Accessibility Relation]]
297    type: Efl.Access.Relation_Type; [[Relation type]]
298    objects: list<Efl.Object>; [[List with relation objects]]
299 }
300
301 struct @beta Efl.Access.Gesture_Info
302 {
303    type: Efl.Access.Gesture; [[Gesture type]]
304    x_beg: int; [[start gesture x co-ordinate]]
305    y_beg: int; [[start gesture y co-ordinate]]
306    x_end: int; [[end gesture x co-ordinate]]
307    y_end: int; [[end gesture y co-ordinate]]
308    state: Efl.Access.Gesture_State; [[state of gesture]]
309    event_time: uint; [[gesture occurance time]]
310 }
311
312 type @beta Efl.Access.Relation_Set: list<Efl.Access.Relation>; [[Elementary Accessibility relation set type]]
313
314 mixin @beta Efl.Access.Object requires Efl.Object
315 {
316    [[Accessibility accessible mixin]]
317    c_prefix: efl_access_object;
318    data: Efl_Access_Object_Data;
319    methods {
320       @property localized_role_name @protected @beta {
321          [[Gets an localized string describing accessible object role name.]]
322          get {
323          }
324          values {
325             localized_name: string; [[Localized accessible object role name]]
326          }
327       }
328       @property i18n_name @beta {
329          [[Accessible name of the object.]]
330          get {
331          }
332          set {
333          }
334          values {
335             i18n_name: string; [[Accessible name]]
336          }
337       }
338       //TIZEN_ONLY(20190922): add name callback, description callback.
339       @property name_cb @beta {
340          [[The name information callback about widget.
341
342            \@if WEARABLE \@since_tizen 3.0
343            \@endif
344          ]]
345          set {
346          }
347          values {
348             name_cb: Efl.Access.Reading_Info_Cb; [[reading information callback]]
349             data: const (void_ptr);
350          }
351       }
352       //
353       //TIZEN_ONLY(20230414): Support org.a11y.atspi.Value.Text property.
354       @property value_text_cb @beta {
355          [[The callback for textual representation of value carried by object.]]
356          set {
357          }
358          values {
359             value_text_cb: Efl.Access.Reading_Info_Cb; [[The callback for textual representation of value]]
360             data: const (void_ptr);
361          }
362       }
363       @property value_text @beta {
364          [[Textual representation of value carried by object.]]
365          get {
366          }
367          set {
368          }
369          values {
370             value_text: string; [[Textual representation of value carried by object]]
371          }
372       }
373       //
374       @property relation_set @protected @beta {
375          [[An all relations between accessible object and other accessible objects.]]
376          get {
377          }
378          values {
379             relations: Efl.Access.Relation_Set; [[Accessible relation set]]
380          }
381       }
382       @property role @beta {
383          [[The role of the object in accessibility domain.]]
384          get {
385          }
386          set {
387          }
388          values {
389             role: Efl.Access.Role; [[Accessible role]]
390          }
391       }
392       //TIZEN_ONLY(20181024): Fix parent-children incosistencies in atspi tree
393       @property access_parent {
394          [[Gets object's accessible parent.]]
395          get {
396          }
397          set {
398          }
399          values {
400             parent: Efl.Access.Object; [[Accessible parent]]
401          }
402       }
403       //
404       //TIZEN_ONLY(20190922): add name callback, description callback.
405       @property description_cb @beta {
406          [[Sets contextual information callback about widget.
407
408            \@if WEARABLE \@since_tizen 3.0
409            \@endif
410          ]]
411          set {
412          }
413          values {
414             description_cb: Efl.Access.Reading_Info_Cb; [[The function called to provide the accessible description.]]
415             data: const (void_ptr); [[The data passed to \@c description_cb.]]
416          }
417       }
418       //
419       //TIZEN_ONLY(20170405) Add gesture method to accessible interface
420       @property gesture_cb @beta{
421          [[Sets gesture callback to give widget.
422
423            Warning: Please do not abuse this API. The purpose of this API is
424            to support special application such as screen-reader guidance.
425            Before using this API, please check if there is another way.
426
427            \@if WEARABLE \@since_tizen 3.0
428            \@endif
429          ]]
430          set {
431          }
432          values {
433             gesture_cb: Efl.Access.Gesture_Cb;
434             data: const (void_ptr);
435          }
436       }
437       gesture_do @protected {
438          [[Handles gesture on given widget.]]
439          params {
440             @in gesture_info: Efl.Access.Gesture_Info;
441          }
442          return: bool;
443       }
444       //
445       @property access_children @protected @beta {
446          [[Gets object's accessible children.]]
447          get {
448          }
449          values {
450             children: list<Efl.Access.Object> @move; [[List of widget's children]]
451          }
452       }
453       @property role_name @protected @beta {
454          [[Gets human-readable string identifying object accessibility role.]]
455          get {
456          }
457          values {
458             role_name: string; [[Accessible role name]]
459          }
460       }
461       @property attributes @protected @beta {
462          [[Gets key-value pairs identifying object extra attributes. Must be free by a user.]]
463          get {
464             [[Gets key-value pairs indentifying object extra attributes. Must be free by a user.]]
465          }
466          values {
467             attributes: list<Efl.Access.Attribute> @move; [[List of object attributes.
468                                                                          Must be freed by the user]]
469          }
470       }
471       attribute_append {
472          [[Add key-value pair identifying object extra attributes
473
474            \@if WEARABLE \@since_tizen 3.0
475            \@endif
476          ]]
477          params {
478             @in key: string; [[The string key to give extra information]]
479             @in value: string; [[The string value to give extra information]]
480          }
481       }
482       attribute_del {
483          [[delete key-value pair identifying object extra attributes when key is given
484          ]]
485          params {
486             @in key: string; [[The string key to identify the key-value pair]]
487          }
488       }
489       attributes_clear {
490          [[Removes all attributes in accessible object.]]
491       }
492       @property reading_info_type @protected {
493          [[Reading information of an accessible object.
494          
495            If no reading information is set, 0 is returned which means all four reading information types will be
496            read from object highlight.
497            If set to 0, existing reading info will be deleted.
498               \@if WEARABLE \@since_tizen 3.0
499               \@endif
500          ]]
501          get {
502          }
503          set {
504          }
505          values {
506             reading_info: Efl.Access.Reading_Info_Type_Mask; [[Reading information types]]
507          }
508       }
509       @property index_in_parent @protected @beta {
510          [[Gets index of the child in parent's children list.]]
511          get {
512          }
513          values {
514             idx: int; [[Index in children list]]
515          }
516       }
517       @property description @beta {
518          [[Contextual information about object.]]
519          get {
520          }
521          set {
522          }
523          values {
524             description: string; [[Accessible contextual information]]
525          }
526       }
527       @property state_set @protected @beta {
528          [[Gets set describing object accessible states.]]
529          get {
530          }
531          values {
532             states: Efl.Access.State_Set; [[Accessible state set]]
533          }
534       }
535       event_handler_add @static @protected @beta {
536          [[Register accessibility event listener]]
537          params {
538               @in cb: Efl.Event_Cb; [[Callback]]
539               @in data: void_ptr; [[Data]]
540          }
541          return: ptr(Efl.Access.Event.Handler); [[Event handler]]
542       }
543       event_handler_del @static @protected @beta {
544          [[Deregister accessibility event listener]]
545          params {
546               @in handler: ptr(Efl.Access.Event.Handler); [[Event handler]]
547          }
548       }
549       event_emit @static @protected @beta {
550           [[Emit event]]
551          params {
552             @in accessible: Efl.Access.Object; [[Accessibility object.]]
553             @in event: ptr(const(Efl.Event_Description)); [[Accessibility event type.]]
554             @in event_info: void_ptr; [[Accessibility event details.]]
555          }
556       }
557       @property translation_domain @beta {
558          [[The translation domain of "name" and "description"
559            properties.
560
561            Translation domain should be set if the application wants to support i18n
562            for accessibility "name" and "description" properties.
563
564            When translation domain is set, values of "name" and "description"
565            properties will be translated with the dgettext function using the
566            current translation domain as the "domainname" parameter.
567
568            It is the application developer's responsibility to ensure that
569            translation files are loaded and bound to the translation domain
570            when accessibility is enabled.]]
571          get {
572          }
573          set {
574          }
575          values {
576             domain: string; [[Translation domain]]
577          }
578       }
579       relationship_append @beta {
580          [[Defines the relationship between two accessible objects.
581
582            Adds a unique relationship between source object and relation_object of a
583            given type.
584
585            Relationships can be queried by Assistive Technology clients to
586            provide customized feedback, improving overall user experience.
587
588            Relationship_append API is asymmetric, which means that
589            appending, for example, relation EFL_ACCESS_RELATION_TYPE_FLOWS_TO from object A to B,
590            do NOT append relation EFL_ACCESS_RELATION_TYPE_FLOWS_FROM from object B to
591            object A.]]
592          return: bool; [[$true if relationship was successfully appended, $false otherwise]]
593          params {
594             @in type: Efl.Access.Relation_Type; [[Relation type]]
595             @in relation_object: const(Efl.Access.Object); [[Object to relate to]]
596          }
597       }
598       relationship_remove @beta {
599          [[Removes the relationship between two accessible objects.
600
601           If relation_object is $NULL function removes all relations
602           of the given type.
603          ]]
604          params {
605             @in type: Efl.Access.Relation_Type; [[Relation type]]
606             @in relation_object: const(Efl.Access.Object); [[Object to remove relation from]]
607          }
608       }
609       relationships_clear @beta {
610          [[Removes all relationships in accessible object.]]
611       }
612       @property access_root @static @beta {
613          [[Root object of accessible object hierarchy]]
614          get {
615             values {
616                ret: Efl.Object; [[Root object]]
617             }
618          }
619       }
620       //TIZEN_ONLY(20161122): add state_notify api
621       state_notify @protected {
622            [[ Notifies accessibility clients about current state of the
623               accessible object.
624
625               Function limits information broadcast to clients to types
626               specified by state_types_mask parameter.
627
628               if recursive parameter is set, function will traverse all
629               accessible children and call state_notify function on them.
630            ]]
631            params {
632                 @in state_types_mask: Efl.Access.State_Set;
633                 @in recursive: bool;
634            }
635       }
636       //
637       //TIZEN_ONLY(20160726): add API efl_access_object_can_highlight_set/get
638       @property can_highlight @protected {
639          [[The Highlightable of given widget.
640
641            \@if WEARABLE \@since_tizen 3.0
642            \@endif
643          ]]
644          get {
645          }
646          set {
647          }
648          values {
649             can_highlight: bool; [[If \@c true, the object is highlightable.]]
650          }
651       }
652       //
653       //TIZEN_ONLY(20230220): Add SetListenPostRender to accessible object
654       @property listen_render_post @protected {
655            [[ To listen render post callback
656
657               It makes to listen render post callback in window,
658               then emit render post callback to atspi client.
659            ]]
660            set {
661            }
662            values {
663               enabled: bool; [[If \@c true, start listen render post callback.]]
664            }
665       }
666       //
667    }
668    implements {
669       Efl.Object.destructor;
670    }
671    events {
672       property,changed: string; [[Called when property has changed]]
673       children,changed: Efl.Access.Event.Children_Changed.Data; [[Called when children have changed]]
674       state,changed: Efl.Access.Event.State_Changed.Data; [[Called when state has changed]]
675       bounds,changed: Efl.Access.Event.Geometry_Changed.Data; [[Called when boundaries have changed]]
676       visible,data,changed: void; [[Called when visibility has changed]]
677       active,descendant,changed: Efl.Object; [[Called when active state of descendant has changed]]
678       added: void; [[Called when item is added]]
679       removed: void; [[Called when item is removed]]
680
681       // TIZEN_ONLY
682       move,outed: void;
683       object,scroll,started: void;
684       object,scroll,finished: void;
685       //
686    }
687 }