summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_textblock.eo
blob: 7f5e551cc5ae8488769be82e4e37856129847df0 (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
class Evas.Textblock (Evas.Object)
{
   legacy_prefix: evas_object_textblock;
   eo_prefix: evas_obj_textblock;
   properties {
      text_markup {
         set {
            /*@
            Sets the tetxblock's text to the markup text.

            @note assumes text does not include the unicode object replacement char (0xFFFC)

            @return Return no value. */
         }
         get {
            /*@
            Return the markup of the object.

            @return the markup text of the object. */
         }
         values {
            const(char)* text; /*@ the markup text to use. */
         }
      }
      valign {
         set {
            /*@
            @brief Sets the vertical alignment of text within the textblock object
            as a whole.

            Normally alignment is 0.0 (top of object). Values given should be
            between 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered
            etc.).

            @since 1.1 */
         }
         get {
            /*@
            @brief Gets the vertical alignment of a textblock

            @return The alignment set for the object.
            @since 1.1 */
         }
         values {
            double align; /*@ A value between @c 0.0 and @c 1.0. */
         }
      }
      bidi_delimiters {
         set {
            /*@
            @brief Sets the BiDi delimiters used in the textblock.

            BiDi delimiters are use 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.1 */
         }
         get {
            /*@
            @brief Gets the BiDi delimiters used in the textblock.

            BiDi delimiters are use 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.

            @return A null terminated string of delimiters, e.g ",|". If empty, returns
            @c NULL.
            @since 1.1 */
         }
         values {
            const(char)* delim; /*@ A null terminated string of delimiters, e.g ",|". */
         }
      }
      replace_char {
         set {
            /*@
            @brief Set the "replacement character" to use for the given textblock object. */
         }
         values {
            const(char)* ch; /*@ The charset name. */
         }
      }
      legacy_newline {
         set {
            /*@
            @brief Sets newline mode. When true, newline character will behave
            as a paragraph separator.

            @since 1.1 */
         }
         get {
            /*@
            @brief Gets newline mode. When true, newline character behaves
            as a paragraph separator.

            @return @c EINA_TRUE if in legacy mode, @c EINA_FALSE otherwise.
            @since 1.1 */
         }
         values {
            bool mode; /*@ @c EINA_TRUE for legacy mode, @c EINA_FALSE otherwise. */
         }
      }
      style {
         set {
            /*@
            Set the objects style to ts.
            @return Returns no value. */
         }
         get {
            /*@
            Return the style of an object.
            @return the style of the object. */
         }
         values {
            const(Evas_Textblock_Style)* ts; /*@ the style to set. */
         }
      }
      node_format_first {
         get {
            /*@ Returns the first format node. */
            legacy: evas_textblock_node_format_first_get;
         }
         values {
            const(Evas_Object_Textblock_Node_Format)* format;
         }
      }
      size_formatted {
         get {
            /*@
            Get 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 @ref evas_object_textblock_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.


            @return Returns no value.
            @see evas_object_textblock_size_native_get */
         }
         values {
            Evas_Coord w; /*@ the width of the object. */
            Evas_Coord h; /*@ the height of the object */
         }
      }
      node_format_last {
         get {
            /*@ Returns the last format node. */
            legacy: evas_textblock_node_format_last_get;
         }
         values {
            const(Evas_Object_Textblock_Node_Format)* format;
         }
      }
      cursor {
         get {
            /*@
            Return the object's main cursor.

            @return The @p obj's main cursor. */
            return: Evas_Textblock_Cursor *;
         }
      }
      size_native {
         get {
            /*@
            Get 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 @ref evas_object_textblock_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.

            @return Returns no value. */
         }
         values {
            Evas_Coord w; /*@ the width returned */
            Evas_Coord h; /*@ the height returned */
         }
      }
      style_insets {
         get {
            /*@ No description supplied by the EAPI. */
         }
         values {
            Evas_Coord l;
            Evas_Coord r;
            Evas_Coord t;
            Evas_Coord b;
         }
      }
   }
   methods {
      line_number_geometry_get @const {
         /*@
         Get the geometry of a line number.

         @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */
         return: bool;
         params {
            @in int line; /*@ the line number. */
            @out Evas_Coord cx; /*@ x coord of the line. */
            @out Evas_Coord cy; /*@ y coord of the line. */
            @out Evas_Coord cw; /*@ w coord of the line. */
            @out Evas_Coord ch; /*@ h coord of the line. */
         }
      }
      replace_char_get {
        /*@
        @brief Get the "replacement character" for given textblock object. Returns
        @c NULL if no replacement character is in use.

        @return Replacement character or @c NULL. */

        return: const(char)*;
      }
      style_user_pop {
         /*@
         Del the from the top of the user style stack.

         @see evas_object_textblock_style_get
         @since 1.2 */

      }
      cursor_new @const {
         /*@
         Create a new cursor, associate it to the obj and init it to point
         to the start of the textblock. Association to the object means the cursor
         will be updated when the object will change.

         @note if you need speed and you know what you are doing, it's slightly faster to just allocate the cursor yourself and not associate it. (only people developing the actual object, and not users of the object).

         @return the new cursor. */
         return: Evas_Textblock_Cursor *;
      }
      node_format_list_get @const {
         /*@ No description supplied by the EAPI. */
         legacy: evas_textblock_node_format_list_get;
         return: const(list<Evas.Object*>)*;
         params {
            @in const(char)* anchor;
         }
      }
      style_user_peek @const {
         /*@
         Get (don't remove) the style at the top of the user style stack.

         @return the style of the object.
         @see evas_object_textblock_style_get
         @since 1.2 */
         return: const(Evas_Textblock_Style)*;
      }
      node_format_remove_pair {
         /*@ Remove a format node and its match. */
         legacy: evas_textblock_node_format_remove_pair;
         params {
            @in Evas_Object_Textblock_Node_Format *n;
         }
      }
      clear {
         /*@
         Clear the textblock object.
         @note Does *NOT* free the Evas object itself.

         @return nothing. */

         legacy: null;
      }
      style_user_push {
         /*@
         Push ts to the top of the user style stack.

         FIXME: API is solid but currently only supports 1 style in the stack.

         The user style overrides the corresponding elements of the regular style.
         This is the proper way to do theme overrides in code.
         @return Returns no value.
         @see evas_object_textblock_style_set
         @since 1.2 */

         params {
            @in Evas_Textblock_Style *ts; /*@ the style to set. */
         }
      }
      obstacle_register {
         /*@
         Add obstacle (evas) object @p eo_obs to be observed during layout of text.
         The textblock does the layout of the text according to the position
         of the obstacle. Changes in registered obstacles are observed,
         including their visibility.
         @p fmt describes the format of the obstacles.
         Supported formats are "FLOAT", "LINE" and "DISABLED", that instruct
         the layout work to wrap text around the obstacle, add empty line(s)
         in its place, or just ignore the obstacle, respectively.

         @return Returns true on success, false on failure.

         @since 1.14 */
         params {
            @in Eo *eo_obs;
            @in Evas_Textblock_Obstacle_Format fmt;
         }
         return: bool;
      }
      obstacle_unregister {
         /*@
         Removes @p eo_obs from observation during text layout

         @return Returns true on success, false on failure.

         @since 1.14 */
         params {
            @in Eo *eo_obs;
         }
         return: bool;
      }
   }
   implements {
      Eo.Base.constructor;
      Eo.Base.destructor;
      Eo.Base.dbg_info_get;
   }
}