summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_access_text.eo
blob: fe76de5b6e5e8f93c5c1e1328aa474cde71d1748 (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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
import eina_types;

enum @beta Efl.Access.Text_Granularity
{
   [[Text accessibility granularity]]
   char, [[Character granularity]]
   word, [[Word granularity]]
   sentence, [[Sentence granularity]]
   line, [[Line granularity]]
   paragraph [[Paragraph granularity]]
}

enum @beta Efl.Access.Text_Clip_Type
{
   [[Text clip type]]
   none, [[No clip type]]
   min, [[Minimum clip type]]
   max, [[Maximum clip type]]
   both [[Both clip types]]
}

struct @beta @free(elm_atspi_text_text_attribute_free) Efl.Access.Text_Attribute
{
   [[Text attribute]]
   name:  string; [[Text attribute name]]
   value: string; [[Text attribute value]]
}

struct @beta @free(elm_atspi_text_text_range_free) Efl.Access.Text_Range
{
   [[Text range]]
   start_offset: int; [[Range start offset]]
   end_offset : int; [[Range end offset]]
   content: ptr(char); [[Range content]]
}

struct @beta Efl.Access.Text_Change_Info
{
   [[Text change information]]
   content: string; [[Change content]]
   inserted: bool; [[$true if text got inserted]]
   pos: size; [[Change position]]
   len: size; [[Change length]]
}

interface @beta Efl.Access.Text
{
   [[Elementary accessible text interface]]
   methods {
      @property character @protected @beta {
         [[Gets single character present in accessible widget's text at given offset.]]
         get {
         }
         keys {
            offset: int; [[Position in text.]]
         }
         values {
            character: Eina.Unicode; [[Character at offset. 0 when out-of bounds offset has been given.
                                       Codepoints between DC80 and DCFF indicate that string includes invalid
                                       UTF8 chars.]]
         }
      }
      @property string @protected @beta {
         [[Gets string, start and end offset in text according to given initial offset and granularity.]]
         get {
         }
         keys {
            granularity: Efl.Access.Text_Granularity; [[Text granularity]]
            start_offset: ptr(int); [[Offset indicating start of string according to given granularity.
                                      -1 in case of error.]]
            end_offset: ptr(int); [[Offset indicating end of string according to given granularity.
                                    -1 in case of error.]]
         }
         values {
            string: mstring @move; [[Newly allocated UTF-8 encoded string. Must be free by a user.]]
         }
      }
      @property access_text @protected @beta {
         [[Gets text of accessible widget.]]
         get {
         }
         keys {
            start_offset: int; [[Position in text.]]
            end_offset: int; [[End offset of text.]]
         }
         values {
            text: mstring @move; [[UTF-8 encoded text.]]
         }
      }
      @property caret_offset @protected @beta {
          [[Offset position of the caret (cursor).]]
         get {
         }
         set {
            return: bool; [[$true if caret was successfully moved, $false otherwise.]]
         }
         values {
            offset: int; [[Offset]]
         }
      }
      @property attribute @protected @beta {
         [[Indicate if a text attribute with a given name is set]]
         get {
            return: bool; [[$true if attribute name is set, $false otherwise]]
         }
         keys {
            name: string; [[Text attribute name]]
            start_offset: ptr(int); [[Position in text from which given attribute is set.]]
            end_offset: ptr(int); [[Position in text to which given attribute is set.]]
         }
         values {
            value: mstring @move; [[Value of text attribute. Should be free()]]
         }
      }
      @property text_attributes @protected @beta {
         [[Gets list of all text attributes.]]
         get {
         }
         keys {
            start_offset: ptr(int); [[Start offset]]
            end_offset: ptr(int); [[End offset]]
         }
         values {
            attributes: list<Efl.Access.Text_Attribute> @move; [[List of text attributes]]
         }
      }
      @property default_attributes @protected @beta {
          [[Default attributes]]
         get {
         }
         values {
            attributes: list<Efl.Access.Text_Attribute> @move; [[List of default attributes]]
         }
      }
      @property character_extents @protected @beta {
          [[Character extents]]
         get {
            return: bool; [[$true if character extents, $false otherwise]]
         }
         keys {
            offset: int; [[Offset]]
            screen_coords: bool; [[If $true, x and y values will be relative to screen origin,
                                   otherwise relative to canvas]]
         }
         values {
            rect: Eina.Rect; [[Extents rectangle]]
         }
      }
      @property character_count @protected @beta {
          [[Character count]]
         get {
         }
         values {
            count: int; [[Character count]]
         }
      }
      @property offset_at_point @protected @beta {
          [[Offset at given point]]
         get {
         }
         keys {
            screen_coords: bool; [[If $true, x and y values will be relative to screen origin,
                                   otherwise relative to canvas]]
            x: int; [[X coordinate]]
            y: int; [[Y coordinate]]
         }
         values {
            offset: int; [[Offset]]
         }
      }
      @property bounded_ranges @protected @beta {
          [[Bounded ranges]]
         get {
         }
         keys {
            screen_coords: bool; [[If $true, x and y values will be relative to screen origin,
                                   otherwise relative to canvas]]
            rect: Eina.Rect; [[Bounding box]]
            xclip: Efl.Access.Text_Clip_Type; [[xclip]]
            yclip: Efl.Access.Text_Clip_Type; [[yclip]]
         }
         values {
            ranges: list<Efl.Access.Text_Range> @move; [[List of ranges]]
         }
      }
      @property range_extents @protected @beta {
          [[Range extents]]
         get {
            return: bool; [[$true if range extents, $false otherwise]]
         }
         keys {
            screen_coords: bool; [[If $true, x and y values will be relative to screen origin,
                                   otherwise relative to canvas]]
            start_offset: int; [[Start offset]]
            end_offset: int; [[End offset]]
         }
         values {
            rect: Eina.Rect; [[Range rectangle]]
         }
      }
      @property selections_count @protected @beta {
         [[Selection count property]]
         get {
         }
         values {
            count: int; [[Selection counter]]
         }
      }
      @property access_selection @protected @beta {
         [[Selection property]]
         get {
         }
         set {
            return: bool; [[$true if selection was set, $false otherwise]]
         }
         keys {
            selection_number: int; [[Selection number for identification]]
         }
         values {
            start_offset: int; [[Selection start offset]]
            end_offset: int; [[Selection end offset]]
         }
      }
      selection_add @protected @beta {
         [[Add selection]]
         params {
            @in start_offset: int; [[Start selection from this offset]]
            @in end_offset: int; [[End selection at this offset]]
         }
         return: bool; [[$true if selection was added, $false otherwise]]
      }
      selection_remove @protected @beta {
         [[Remove selection]]
         params {
            @in selection_number: int; [[Selection number to be removed]]
         }
         return: bool; [[$true if selection was removed, $false otherwise]]
      }
   }
   events {
      /* FIXME: Nobody emits these
      access,text,bounds,changed: void; [[Text bounds have changed]]
      access,text,attributes,changed: void; [[Text attributes have changed]]
      */
      access,text,caret,moved: void; [[Caret moved]]
      access,text,inserted: Efl.Access.Text_Change_Info; [[Text was inserted]]
      access,text,removed: Efl.Access.Text_Change_Info; [[Text was removed]]
      access,text,selection,changed: void; [[Text selection has changed]]
   }
}