summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/efl_canvas_text.eo
blob: 6600e7acaec36b42d27b3701c6260de1dece155d (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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
import efl_text_types;

struct Efl.Canvas.Text.Style; [[EFL text style data structure]]

class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties, Efl.Canvas.Filter.Internal,
Efl.Text.Font, Efl.Text.Style, Efl.Text.Format, Efl.Text.Cursor, Efl.Text.Annotate)
{
   [[Efl canvas text class]]
   legacy_prefix: evas_object_textblock;
   methods {
      @property is_empty {
         [[Whether the object is empty (no text) or not

           @since 1.18
         ]]
         get {
            legacy: null;
         }
         values {
            is_empty: bool; [[$true if empty, $false otherwise]]
         }
      }
      visible_range_get {
         [[Returns the currently visible range.

           The given $start and $end cursor act like an out-variables here,
           as these are set to the positions of the start and the end of the
           visible range in the text, respectively.

           @since 1.18
         ]]
         return: bool; [[$true on success, $false otherwise]]
         params {
            @in start: ptr(Efl.Text.Cursor.Cursor); [[Range start position]]
            @in end: ptr(Efl.Text.Cursor.Cursor); [[Range end position]]
         }
      }
      @property style_insets {
         [[Gets the left, right, top and bottom insets of the text.

           The inset is any applied padding on the text.

           @since 1.18
         ]]
         get {}
         values {
            l: int; [[Left padding]]
            r: int; [[Right padding]]
            t: int; [[Top padding]]
            b: int; [[Bottom padding]]
         }
      }
      @property bidi_delimiters {
         [[BiDi delimiters are used for in-paragraph separation of bidi
           segments. This is useful for example in recipients fields of
           e-mail clients where bidi oddities can occur when mixing RTL
           and LTR.

           @since 1.18
         ]]
         set {}
         get {}
         values {
            delim: string; [[A null terminated string of delimiters, e.g ",|" or $null if empty]]
         }
      }
      @property legacy_newline {
         [[When $true, newline character will behave as a paragraph separator.

           @since 1.18
         ]]
         set {}
         get {}
         values {
            mode: bool; [[$true for legacy mode, $false otherwise]]
         }
      }
      @property style {
         [[The text style of the object.

           $key is how you reference the style (for deletion or fetching). $NULL
           as key indicates the style has the highest priority (default style).
           The style priority is the order of creation, styles created first
           are applied first with the exception of $NULL which is implicitly
           first.

           Set $style to $NULL to delete it.

           @since 1.18
         ]]
         set {
            legacy: null;
         }
         get {
            legacy: null;
         }
         keys {
            key: string; [[The name to the style. $NULL is the default style]]
         }
         values {
            style: string; [[The style]]
         }
      }
      @property size_formatted {
         [[The formatted width and height.

           This calculates the actual size after restricting the
           textblock to the current size of the object.

           The main difference between this and @.size_native.get
           is that the "native" function does not wrapping into account
           it just calculates the real width of the object if it was
           placed on an infinite canvas, while this function gives the
           size after wrapping according to the size restrictions of the
           object.

           For example for a textblock containing the text:
           "You shall not pass!" with no margins or padding and assuming
           a monospace font and a size of 7x10 char widths (for simplicity)
           has a native size of 19x1 and a formatted size of 5x4.

           @since 1.18
         ]]
         get {}
         values {
            w: int; [[The width of the object.]]
            h: int; [[The height of the object.]]
         }
      }
      @property size_native {
         [[The native width and height.

           This calculates the actual size without taking account the
           current size of the object.

           The main difference between this and @.size_formatted.get
           is that the "native" function does not take wrapping into
           account it just calculates the real width of the object if
           it was placed on an infinite canvas, while the "formatted"
           function gives the size after  wrapping text according to
           the size restrictions of the object.

           For example for a textblock containing the text:
           "You shall not pass!" with no margins or padding and assuming
           a monospace font and a size of 7x10 char widths (for simplicity)
           has a native size of 19x1 and a formatted size of 5x4.

           @since 1.18
         ]]
         get {}
         values {
            w: int; [[The width returned.]]
            h: int; [[The height returned.]]
         }
      }
      range_text_get {
         [[Returns the text in the range between $cur1 and $cur2.

           @since 1.18
         ]]
         legacy: null;
         return: string @owned; [[The text in the given range]]
         params {
            @in cur1: const(ptr(Efl.Text.Cursor.Cursor)); [[Start of range]]
            @in cur2: const(ptr(Efl.Text.Cursor.Cursor)); [[End of range]]
         }
      }
      range_geometry_get {
         [[Get the geometry of a range in the text.

           The geometry is represented as rectangles for each of the line
           segments in the given range [$cur1, $cur2].

           @since 1.19
         ]]
         legacy: null;
         params {
             @in cur1: const(ptr(Efl.Text.Cursor.Cursor)); [[Start of range]]
             @in cur2: const(ptr(Efl.Text.Cursor.Cursor)); [[End of range]]
         }
         return: iterator<Eina.Rectangle> @owned; [[
            Iterator on all geoemtries of the given range
         ]]
      }
      range_simple_geometry_get {
         [[Get the "simple" geometry of a range.

           The geometry is the geometry in which rectangles in middle lines of
           range are merged into one big rectangle. This is an optimized
           version of @.range_geometry_get.

           @since 1.19
         ]]
         legacy: null;
         params {
             @in cur1: ptr(const(Efl.Text.Cursor.Cursor)); [[Start of range]]
             @in cur2: ptr(const(Efl.Text.Cursor.Cursor)); [[End of range]]
         }
         return: iterator<Eina.Rectangle> @owned; [[
            Iterator on all simple geometries of the given range
         ]]
      }
      range_delete {
         [[Deletes the range between given cursors.

           This removes all the text in given range [$start,$end].
         ]]
         legacy: null;
         params {
            @in cur1: ptr(Efl.Text.Cursor.Cursor); [[Range start position]]
            @in cur2: ptr(Efl.Text.Cursor.Cursor); [[Range end position]]
         }
      }
      // Obstacles
      obstacle_add {
         [[Add obstacle evas object $eo_obs to be observed during layout
           of text.

           The textblock does the layout of the text according to the
           position of the obstacle.

           @since 1.18
         ]]
         params {
            @in eo_obs: Efl.Canvas.Object; [[Obstacle object]]
         }
         return: bool; [[$true on success, $false otherwise.]]
      }
      obstacle_del {
         [[Removes $eo_obs from observation during text layout.

           @since 1.18
         ]]
         params {
            @in eo_obs: Efl.Canvas.Object; [[Obstacle object]]
         }
         return: bool; [[$true on success, $false otherwise.]]
      }
      obstacles_update {
         [[Triggers for relayout due to obstacles' state change.

           The obstacles alone don't affect the layout, until this is
           called. Use this after doing changes (moving, positioning etc.)
           in the obstacles that you  would like to be considered in the
           layout.

           For example: if you have just repositioned the obstacles to
           differrent coordinates relative to the textblock, you need to
           call this so it will consider this new state and will relayout
           the text.

           @since 1.18
         ]]
      }
   }
   implements {
      Efl.Object.constructor;
      Efl.Object.destructor;
      Efl.Canvas.Object.paragraph_direction { get; set; }
      Efl.Text.text { get; set; }
      Efl.Gfx.Filter.filter_program { get; set; }
      Efl.Gfx.Filter.filter_data { get; set; }
      Efl.Gfx.Filter.filter_source { get; set; }
      Efl.Canvas.Filter.Internal.filter_dirty;
      Efl.Canvas.Filter.Internal.filter_input_render;
      Efl.Canvas.Filter.Internal.filter_state_prepare;
      Efl.Text.Font.font { get; set; }
      Efl.Text.Font.font_source { get; set; }
      Efl.Text.Font.font_fallbacks { get; set; }
      Efl.Text.Font.font_lang { get; set; }
      Efl.Text.Font.font_weight { get; set; }
      Efl.Text.Font.font_slant { get; set; }
      Efl.Text.Font.font_width { get; set; }
      Efl.Text.Style.normal_color { get; set; }
      Efl.Text.Style.backing_type { get; set; }
      Efl.Text.Style.backing_color { get; set; }
      Efl.Text.Style.underline_type { get; set; }
      Efl.Text.Style.underline_color { get; set; }
      Efl.Text.Style.underline_height { get; set; }
      Efl.Text.Style.underline_dashed_color { get; set; }
      Efl.Text.Style.underline_dashed_width { get; set; }
      Efl.Text.Style.underline_dashed_gap { get; set; }
      Efl.Text.Style.underline2_type { get; set; }
      Efl.Text.Style.underline2_color { get; set; }
      Efl.Text.Style.strikethrough_type { get; set; }
      Efl.Text.Style.strikethrough_color { get; set; }
      Efl.Text.Style.effect_type { get; set; }
      Efl.Text.Style.outline_color { get; set; }
      Efl.Text.Style.shadow_direction { get; set; }
      Efl.Text.Style.shadow_color { get; set; }
      Efl.Text.Style.glow_color { get; set; }
      Efl.Text.Style.glow2_color { get; set; }
      Efl.Text.Style.gfx_filter { get; set; }
      Efl.Text.Format.ellipsis { get; set; }
      Efl.Text.Format.wrap { get; set; }
      Efl.Text.Format.multiline { get; set; }
      Efl.Text.Format.halign { get; set; }
      Efl.Text.Format.valign { get; set; }
      Efl.Text.Format.linegap { get; set; }
      Efl.Text.Format.linerelgap { get; set; }
      Efl.Text.Format.tabstops { get; set; }
      Efl.Text.Format.password { get; set; }
      Efl.Text.Format.replacement_char { get; set; }
      Efl.Text.Cursor.cursor { get; }
      Efl.Text.Cursor.cursor_position { set; get; }
      Efl.Text.Cursor.cursor_content { get; }
      Efl.Text.Cursor.cursor_geometry { get; }
      Efl.Text.Cursor.cursor_new;
      Efl.Text.Cursor.cursor_free;
      Efl.Text.Cursor.cursor_equal;
      Efl.Text.Cursor.cursor_compare;
      Efl.Text.Cursor.cursor_copy;
      Efl.Text.Cursor.cursor_char_next;
      Efl.Text.Cursor.cursor_char_prev;
      Efl.Text.Cursor.cursor_paragraph_char_first;
      Efl.Text.Cursor.cursor_paragraph_char_last;
      Efl.Text.Cursor.cursor_word_start;
      Efl.Text.Cursor.cursor_word_end;
      Efl.Text.Cursor.cursor_line_char_first;
      Efl.Text.Cursor.cursor_line_char_last;
      Efl.Text.Cursor.cursor_paragraph_first;
      Efl.Text.Cursor.cursor_paragraph_last;
      Efl.Text.Cursor.cursor_paragraph_next;
      Efl.Text.Cursor.cursor_paragraph_prev;
      Efl.Text.Cursor.cursor_line_jump_by;
      Efl.Text.Cursor.cursor_coord_set;
      Efl.Text.Cursor.cursor_text_insert;
      Efl.Text.Cursor.cursor_char_delete;
      Efl.Text.Annotate.annotation { set; get; }
      Efl.Text.Annotate.range_annotations_get;
      Efl.Text.Annotate.annotation_insert;
      Efl.Text.Annotate.annotation_del;
      Efl.Text.Annotate.object_item_geometry_get;
      Efl.Text.Annotate.annotation_positions_get;
      Efl.Text.Annotate.cursor_object_item_annotation { get; }
      Efl.Text.Annotate.cursor_object_item_insert;
   }
   events {
      cursor,changed; [[Called when cursor changed]]
      changed; [[Called when canvas text changed ]]
      style_insets,changed; [[Called when the property @.style_insets changed.]]
   }
}