summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_access.h
blob: ec1d9afe257eaa524c080763f025f89df79cb29d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#ifndef EFL_ACCESS_H
#define EFL_ACCESS_H

#ifdef EFL_BETA_API_SUPPORT

#ifdef EFL_EO_API_SUPPORT
#include "efl_access.eo.h"
#endif
#ifndef EFL_NOLEGACY_API_SUPPORT
#include "efl_access.eo.legacy.h"
#endif

/*
 * Sets a particilar state type for given state set.
 */
#define STATE_TYPE_SET(state_set, type)   (state_set|= (1ULL << type))

/**
 * Unsets a particilar state type for given state set.
 */
#define STATE_TYPE_UNSET(state_set, type) (state_set &= ~(1ULL << type))

/**
 * Gets value of a particilar state type for given state set.
 */
#define STATE_TYPE_GET(state_set, type)   (state_set & (1ULL << type))

/**
 * Free Efl_Access_Attributes_List
 */
EAPI void efl_access_attributes_list_free(Eina_List *list);

/**
 * Frees relation.
 */
EAPI void efl_access_relation_free(Efl_Access_Relation *relation);

/**
 * Clones relation.
 */
EAPI Efl_Access_Relation * efl_access_relation_clone(const Efl_Access_Relation *relation);

/**
 * Appends relation to relation set
 */
EAPI Eina_Bool efl_access_relation_set_relation_append(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type, const Eo *rel_obj);

/**
 * Removes relation from relation set
 */
EAPI void efl_access_relation_set_relation_remove(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type, const Eo *rel_obj);

/**
 * Removes all relation from relation set of a given type
 */
EAPI void efl_access_relation_set_relation_type_remove(Efl_Access_Relation_Set *set, Efl_Access_Relation_Type type);

/**
 * Frees Efl_Access_Relation_Set
 */
EAPI void efl_access_relation_set_free(Efl_Access_Relation_Set set);

/**
 * Clones Efl_Access_Relation_Set
 */
EAPI Efl_Access_Relation_Set efl_access_relation_set_clone(const Efl_Access_Relation_Set set);

#ifdef EFL_EO_API_SUPPORT

/**
 * Emits Accessible 'StateChanged' signal.
 */
#define efl_access_state_changed_signal_emit(obj, tp, nvl) \
   { do { \
      Efl_Access_Event_State_Changed_Data evinfo; \
      evinfo.type = (tp); \
      evinfo.new_value = (nvl); \
      efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_STATE_CHANGED, (void*)&evinfo); \
   } while(0); }

/**
 * Emits Accessible 'BoundsChanged' signal.
 */
#define efl_access_bounds_changed_signal_emit(obj, x, y, width, height) \
   do { \
         Efl_Access_Event_Geometry_Changed_Data evinfo = { x, y, width, height }; \
         efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_BOUNDS_CHANGED, (void*)&evinfo); \
   } while(0);

/**
 * Emits Accessible 'PropertyChanged' signal for 'Name' property.
 */
#define efl_access_name_changed_signal_emit(obj) \
   efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_PROPERTY_CHANGED, "name");

/**
 * Emits Accessible 'PropertyChanged' signal for 'Description' property.
 */
#define efl_access_description_changed_signal_emit(obj) \
   efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_PROPERTY_CHANGED, "description");

/**
 * Emits Accessible 'PropertyChanged' signal for 'Parent' property.
 */
#define efl_access_parent_changed_signal_emit(obj) \
   efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_PROPERTY_CHANGED, "parent");

/**
 * Emits Accessible 'PropertyChanged' signal for 'Role' property.
 */
#define efl_access_role_changed_signal_emit(obj) \
   efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_PROPERTY_CHANGED, "role");

/**
 * Emits Accessible 'PropertyChanged' signal for 'Value' property.
 */
#define efl_access_value_changed_signal_emit(obj) \
   efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_PROPERTY_CHANGED, "value");

/**
 * Emits Accessible 'ChildrenChanged' signal with added child as argument.
 */
#define efl_access_children_changed_added_signal_emit(obj, child) \
   do { \
      Efl_Access_Event_Children_Changed_Data atspi_data = { EINA_TRUE, child }; \
   efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_CHILDREN_CHANGED, &atspi_data); \
   } while(0);

/**
 * Emits Accessible 'ChildrenChanged' signal with deleted child as argument.
 */
#define efl_access_children_changed_del_signal_emit(obj, child) \
   do { \
      Efl_Access_Event_Children_Changed_Data atspi_data = { EINA_FALSE, child }; \
      efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_CHILDREN_CHANGED, &atspi_data); \
   } while(0);

/**
 * Emits Accessible 'ActiveDescendantChanged' signal.
 */
#define efl_access_active_descendant_changed_signal_emit(obj, child) \
   efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_ACTIVE_DESCENDANT_CHANGED, child);

/**
 * Emits Accessible 'VisibleDataChanged' signal.
 */
#define efl_access_visible_data_changed_signal_emit(obj) \
   efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_VISIBLE_DATA_CHANGED, NULL);

/**
 * Emits Accessible 'AddAccessible' signal.
 */
#define efl_access_added(obj) \
   efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_ADDED, NULL);

/**
 * Emits Accessible 'RemoveAccessible' signal.
 */
#define efl_access_removed(obj) \
   efl_access_event_emit(EFL_ACCESS_MIXIN, obj, EFL_ACCESS_EVENT_REMOVED, NULL);

#endif

#endif
#endif