10c2637e234935ca2c57edb7586dfa6ef9e1dad4
[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       @property relation_set @protected @beta {
354          [[An all relations between accessible object and other accessible objects.]]
355          get {
356          }
357          values {
358             relations: Efl.Access.Relation_Set; [[Accessible relation set]]
359          }
360       }
361       @property role @beta {
362          [[The role of the object in accessibility domain.]]
363          get {
364          }
365          set {
366          }
367          values {
368             role: Efl.Access.Role; [[Accessible role]]
369          }
370       }
371       //TIZEN_ONLY(20181024): Fix parent-children incosistencies in atspi tree
372       @property access_parent {
373          [[Gets object's accessible parent.]]
374          get {
375          }
376          set {
377          }
378          values {
379             parent: Efl.Access.Object; [[Accessible parent]]
380          }
381       }
382       //
383       //TIZEN_ONLY(20190922): add name callback, description callback.
384       @property description_cb @beta {
385          [[Sets contextual information callback about widget.
386
387            \@if WEARABLE \@since_tizen 3.0
388            \@endif
389          ]]
390          set {
391          }
392          values {
393             description_cb: Efl.Access.Reading_Info_Cb; [[The function called to provide the accessible description.]]
394             data: const (void_ptr); [[The data passed to \@c description_cb.]]
395          }
396       }
397       //
398       //TIZEN_ONLY(20170405) Add gesture method to accessible interface
399       @property gesture_cb @beta{
400          [[Sets gesture callback to give widget.
401
402            Warning: Please do not abuse this API. The purpose of this API is
403            to support special application such as screen-reader guidance.
404            Before using this API, please check if there is another way.
405
406            \@if WEARABLE \@since_tizen 3.0
407            \@endif
408          ]]
409          set {
410          }
411          values {
412             gesture_cb: Efl.Access.Gesture_Cb;
413             data: const (void_ptr);
414          }
415       }
416       gesture_do @protected {
417          [[Handles gesture on given widget.]]
418          params {
419             @in gesture_info: Efl.Access.Gesture_Info;
420          }
421          return: bool;
422       }
423       //
424       @property access_children @protected @beta {
425          [[Gets object's accessible children.]]
426          get {
427          }
428          values {
429             children: list<Efl.Access.Object> @move; [[List of widget's children]]
430          }
431       }
432       @property role_name @protected @beta {
433          [[Gets human-readable string identifying object accessibility role.]]
434          get {
435          }
436          values {
437             role_name: string; [[Accessible role name]]
438          }
439       }
440       @property attributes @protected @beta {
441          [[Gets key-value pairs identifying object extra attributes. Must be free by a user.]]
442          get {
443             [[Gets key-value pairs indentifying object extra attributes. Must be free by a user.]]
444          }
445          values {
446             attributes: list<Efl.Access.Attribute> @move; [[List of object attributes.
447                                                                          Must be freed by the user]]
448          }
449       }
450       attribute_append {
451          [[Add key-value pair identifying object extra attributes
452
453            \@if WEARABLE \@since_tizen 3.0
454            \@endif
455          ]]
456          params {
457             @in key: string; [[The string key to give extra information]]
458             @in value: string; [[The string value to give extra information]]
459          }
460       }
461       attribute_del {
462          [[delete key-value pair identifying object extra attributes when key is given
463          ]]
464          params {
465             @in key: string; [[The string key to identify the key-value pair]]
466          }
467       }
468       attributes_clear {
469          [[Removes all attributes in accessible object.]]
470       }
471       @property reading_info_type @protected {
472          [[Reading information of an accessible object.
473          
474            If no reading information is set, 0 is returned which means all four reading information types will be
475            read from object highlight.
476            If set to 0, existing reading info will be deleted.
477               \@if WEARABLE \@since_tizen 3.0
478               \@endif
479          ]]
480          get {
481          }
482          set {
483          }
484          values {
485             reading_info: Efl.Access.Reading_Info_Type_Mask; [[Reading information types]]
486          }
487       }
488       @property index_in_parent @protected @beta {
489          [[Gets index of the child in parent's children list.]]
490          get {
491          }
492          values {
493             idx: int; [[Index in children list]]
494          }
495       }
496       @property description @beta {
497          [[Contextual information about object.]]
498          get {
499          }
500          set {
501          }
502          values {
503             description: string; [[Accessible contextual information]]
504          }
505       }
506       @property state_set @protected @beta {
507          [[Gets set describing object accessible states.]]
508          get {
509          }
510          values {
511             states: Efl.Access.State_Set; [[Accessible state set]]
512          }
513       }
514       event_handler_add @static @protected @beta {
515          [[Register accessibility event listener]]
516          params {
517               @in cb: Efl.Event_Cb; [[Callback]]
518               @in data: void_ptr; [[Data]]
519          }
520          return: ptr(Efl.Access.Event.Handler); [[Event handler]]
521       }
522       event_handler_del @static @protected @beta {
523          [[Deregister accessibility event listener]]
524          params {
525               @in handler: ptr(Efl.Access.Event.Handler); [[Event handler]]
526          }
527       }
528       event_emit @static @protected @beta {
529           [[Emit event]]
530          params {
531             @in accessible: Efl.Access.Object; [[Accessibility object.]]
532             @in event: ptr(const(Efl.Event_Description)); [[Accessibility event type.]]
533             @in event_info: void_ptr; [[Accessibility event details.]]
534          }
535       }
536       @property translation_domain @beta {
537          [[The translation domain of "name" and "description"
538            properties.
539
540            Translation domain should be set if the application wants to support i18n
541            for accessibility "name" and "description" properties.
542
543            When translation domain is set, values of "name" and "description"
544            properties will be translated with the dgettext function using the
545            current translation domain as the "domainname" parameter.
546
547            It is the application developer's responsibility to ensure that
548            translation files are loaded and bound to the translation domain
549            when accessibility is enabled.]]
550          get {
551          }
552          set {
553          }
554          values {
555             domain: string; [[Translation domain]]
556          }
557       }
558       relationship_append @beta {
559          [[Defines the relationship between two accessible objects.
560
561            Adds a unique relationship between source object and relation_object of a
562            given type.
563
564            Relationships can be queried by Assistive Technology clients to
565            provide customized feedback, improving overall user experience.
566
567            Relationship_append API is asymmetric, which means that
568            appending, for example, relation EFL_ACCESS_RELATION_TYPE_FLOWS_TO from object A to B,
569            do NOT append relation EFL_ACCESS_RELATION_TYPE_FLOWS_FROM from object B to
570            object A.]]
571          return: bool; [[$true if relationship was successfully appended, $false otherwise]]
572          params {
573             @in type: Efl.Access.Relation_Type; [[Relation type]]
574             @in relation_object: const(Efl.Access.Object); [[Object to relate to]]
575          }
576       }
577       relationship_remove @beta {
578          [[Removes the relationship between two accessible objects.
579
580           If relation_object is $NULL function removes all relations
581           of the given type.
582          ]]
583          params {
584             @in type: Efl.Access.Relation_Type; [[Relation type]]
585             @in relation_object: const(Efl.Access.Object); [[Object to remove relation from]]
586          }
587       }
588       relationships_clear @beta {
589          [[Removes all relationships in accessible object.]]
590       }
591       @property access_root @static @beta {
592          [[Root object of accessible object hierarchy]]
593          get {
594             values {
595                ret: Efl.Object; [[Root object]]
596             }
597          }
598       }
599       //TIZEN_ONLY(20161122): add state_notify api
600       state_notify @protected {
601            [[ Notifies accessibility clients about current state of the
602               accessible object.
603
604               Function limits information broadcast to clients to types
605               specified by state_types_mask parameter.
606
607               if recursive parameter is set, function will traverse all
608               accessible children and call state_notify function on them.
609            ]]
610            params {
611                 @in state_types_mask: Efl.Access.State_Set;
612                 @in recursive: bool;
613            }
614       }
615       //
616       //TIZEN_ONLY(20160726): add API efl_access_object_can_highlight_set/get
617       @property can_highlight @protected {
618          [[The Highlightable of given widget.
619
620            \@if WEARABLE \@since_tizen 3.0
621            \@endif
622          ]]
623          get {
624          }
625          set {
626          }
627          values {
628             can_highlight: bool; [[If \@c true, the object is highlightable.]]
629          }
630       }
631       //
632       //TIZEN_ONLY(20230220): Add SetListenPostRender to accessible object
633       @property listen_render_post @protected {
634            [[ To listen render post callback
635
636               It makes to listen render post callback in window,
637               then emit render post callback to atspi client.
638            ]]
639            set {
640            }
641            values {
642               enabled: bool; [[If \@c true, start listen render post callback.]]
643            }
644       }
645       //
646    }
647    implements {
648       Efl.Object.destructor;
649    }
650    events {
651       property,changed: string; [[Called when property has changed]]
652       children,changed: Efl.Access.Event.Children_Changed.Data; [[Called when children have changed]]
653       state,changed: Efl.Access.Event.State_Changed.Data; [[Called when state has changed]]
654       bounds,changed: Efl.Access.Event.Geometry_Changed.Data; [[Called when boundaries have changed]]
655       visible,data,changed: void; [[Called when visibility has changed]]
656       active,descendant,changed: Efl.Object; [[Called when active state of descendant has changed]]
657       added: void; [[Called when item is added]]
658       removed: void; [[Called when item is removed]]
659
660       // TIZEN_ONLY
661       move,outed: void;
662       object,scroll,started: void;
663       object,scroll,finished: void;
664       //
665    }
666 }