1 /**
2  * @defgroup Evas_Object_Textblock_Group Textblock Object Functions
3  *
4  * Functions used to create and manipulate textblock objects. Unlike
5  * @ref Evas_Object_Text_Group, these handle complex text, doing multiple
6  * styles and multiline text based on HTML-like tags. Of these extra
7  * features will be heavier on memory and processing cost.
8  *
9  * @section Evas_Object_Textblock_Tutorial Textblock Object Tutorial
10  *
11  * This part explains about the textblock object's API and proper usage.
12  * The main user of the textblock object is the edje entry object in Edje, so
13  * that's a good place to learn from, but I think this document is more than
14  * enough, if it's not, please contact me and I'll update it.
15  *
16  * @subsection textblock_intro Introduction
17  * The textblock objects is, as implied, an object that can show big chunks of
18  * text. Textblock supports many features including: Text formatting, automatic
19  * and manual text alignment, embedding items (for example icons) and more.
20  * Textblock has three important parts, the text paragraphs, the format nodes
21  * and the cursors.
22  *
23  * You can use markup to format text, for example: "<font_size=50>Big!</font_size>".
24  * You can also put more than one style directive in one tag:
25  * "<font_size=50 color=#F00>Big and Red!</font_size>".
26  * Please notice that we used "</font_size>" although the format also included
27  * color, this is because the first format determines the matching closing tag's
28  * name. You can also use anonymous tags, like: "<font_size=30>Big</>" which
29  * just pop any type of format, but it's advised to use the named alternatives
30  * instead.
31  *
32  * @subsection textblock_cursors Textblock Object Cursors
33  * A textblock Cursor is data type that represents
34  * a position in a textblock. Each cursor contains information about the
35  * paragraph it points to, the position in that paragraph and the object itself.
36  * Cursors register to textblock objects upon creation, this means that once
37  * you created a cursor, it belongs to a specific obj and you can't for example
38  * copy a cursor "into" a cursor of a different object. Registered cursors
39  * also have the added benefit of updating automatically upon textblock changes,
40  * this means that if you have a cursor pointing to a specific character, it'll
41  * still point to it even after you change the whole object completely (as long
42  * as the char was not deleted), this is not possible without updating, because
43  * as mentioned, each cursor holds a character position. There are many
44  * functions that handle cursors, just check out the evas_textblock_cursor*
45  * functions. For creation and deletion of cursors check out:
46  * @see evas_object_textblock_cursor_new()
47  * @see evas_textblock_cursor_free()
48  * @note Cursors are generally the correct way to handle text in the textblock object, and there are enough functions to do everything you need with them (no need to get big chunks of text and processing them yourself).
49  *
50  * @subsection textblock_paragraphs Textblock Object Paragraphs
51  * The textblock object is made out of text splitted to paragraphs (delimited
52  * by the paragraph separation character). Each paragraph has many (or none)
53  * format nodes associated with it which are responsible for the formatting
54  * of that paragraph.
55  *
56  * @subsection textblock_format_nodes Textblock Object Format Nodes
57  * As explained in @ref textblock_paragraphs each one of the format nodes
58  * is associated with a paragraph.
59  * There are two types of format nodes, visible and invisible:
60  * Visible: formats that a cursor can point to, i.e formats that
61  * occupy space, for example: newlines, tabs, items and etc. Some visible items
62  * are made of two parts, in this case, only the opening tag is visible.
63  * A closing tag (i.e a \</tag\> tag) should NEVER be visible.
64  * Invisible: formats that don't occupy space, for example: bold and underline.
65  * Being able to access format nodes is very important for some uses. For
66  * example, edje uses the "<a>" format to create links in the text (and pop
67  * popups above them when clicked). For the textblock object a is just a
68  * formatting instruction (how to color the text), but edje utilizes the access
69  * to the format nodes to make it do more.
70  * For more information, take a look at all the evas_textblock_node_format_*
71  * functions.
72  * The translation of "<tag>" tags to actual format is done according to the
73  * tags defined in the style, see @ref evas_textblock_style_set
74  *
75  * @subsection textblock_special_formats Special Formats
76  * Textblock supports various format directives that can be used in markup. In
77  * addition to the mentioned format directives, textblock allows creating
78  * additional format directives using "tags" that can be set in the style see
79  * @ref evas_textblock_style_set .
80  *
81  * For more details see @ref evas_textblock_style_page
82  *
83  * Textblock supports the following formats:
84  * @li font - Font description in fontconfig like format, e.g: "Sans:style=Italic:lang=hi". or "Serif:style=Bold".
85  * @li font_weight - Overrides the weight defined in "font". E.g: "font_weight=Bold" is the same as "font=:style=Bold". Supported weights: "normal", "thin", "ultralight", "light", "book", "medium", "semibold", "bold", "ultrabold", "black", and "extrablack".
86  * @li font_style - Overrides the style defined in "font". E.g: "font_style=Italic" is the same as "font=:style=Italic". Supported styles: "normal", "oblique", and "italic".
87  * @li font_width - Overrides the width defined in "font". E.g: "font_width=Condensed" is the same as "font=:style=Condensed". Supported widths: "normal", "ultracondensed", "extracondensed", "condensed", "semicondensed", "semiexpanded", "expanded", "extraexpanded", and "ultraexpanded".
88  * @li lang - Overrides the language defined in "font". E.g: "lang=he" is the same as "font=:lang=he".
89  * @li font_fallbacks - A comma delimited list of fonts to try if finding the main font fails.
90  * @li font_size - The font size in points.
91  * @li font_source - The source of the font, e.g an eet file.
92  * @li color - Text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
93  * @li underline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
94  * @li underline2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
95  * @li outline_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
96  * @li shadow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
97  * @li glow_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
98  * @li glow2_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
99  * @li strikethrough_color - color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
100  * @li align - Either "auto" (meaning according to text direction), "left", "right", "center", "middle", a value between 0.0 and 1.0, or a value between 0% to 100%.
101  * @li valign - Either "top", "bottom", "middle", "center", "baseline", "base", a value between 0.0 and 1.0, or a value between 0% to 100%.
102  * @li wrap - "word", "char", "mixed", or "none".
103  * @li left_margin - Either "reset", or a pixel value indicating the margin.
104  * @li right_margin - Either "reset", or a pixel value indicating the margin.
105  * @li underline - "on", "off", "single", or "double".
106  * @li strikethrough - "on" or "off"
107  * @li backing_color - Background color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA".
108  * @li backing - Enable/disable background color. ex) "on" or "off"
109  * @li style - Either "off", "none", "plain", "shadow", "outline", "soft_outline", "outline_shadow", "outline_soft_shadow", "glow", "far_shadow", "soft_shadow", or "far_soft_shadow". Direction can be selected by adding "bottom_right", "bottom", "bottom_left", "left", "top_left", "top", "top_right", or "right". E.g: "style=shadow,bottom_right".
110  * @li tabstops - Pixel value for tab width.
111  * @li linesize - Force a line size in pixels.
112  * @li linerelsize - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
113  * @li linegap - Force a line gap in pixels.
114  * @li linerelgap - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
115  * @li item - Creates an empty space that should be filled by an upper layer. Use "size", "abssize", or "relsize". To define the items size, and an optional: vsize=full/ascent to define the item's position in the line.
116  * @li linefill - Either a float value or percentage indicating how much to fill the line.
117  * @li ellipsis - Value between 0.0-1.0 to indicate the type of ellipsis, or -1.0 to indicate ellipsis isn't wanted.
118  * @li password - "on" or "off". This is used to specifically turn replacing chars with the replacement char (i.e password mode) on and off.
119  *
120  * @warning We don't guarantee any proper results if you create a Textblock
121  * object without setting the evas engine.
122  *
123  * @todo put here some usage examples
124  *
125  * @ingroup Evas_Object_Specific
126  *
127  * @{
128  */
129 typedef Eo Evas_Textblock;
130 
131 /**
132  * @typedef Evas_Textblock_Style
133  *
134  * A textblock style object.
135  * @see evas_textblock_style_new()
136  * @see evas_textblock_style_get()
137  * @see evas_textblock_style_set()
138  */
139 
140 typedef struct _Efl_Canvas_Textblock_Style             Evas_Textblock_Style;
141 
142 /**
143  * @typedef Evas_Textblock_Cursor
144  *
145  * A textblock cursor object, used to maipulate the cursor of an evas textblock
146  * @see evas_object_textblock_cursor_new
147  *
148  */
149 typedef struct _Efl_Text_Cursor_Handle       Evas_Textblock_Cursor;
150 
151 /**
152  * @typedef Evas_Object_Textblock_Node_Format
153  * A format node.
154  *
155  * XXX: Adapter for legacy.
156  */
157 typedef struct _Evas_Textblock_Node_Format Evas_Object_Textblock_Node_Format;
158 
159 /**
160  * @typedef Evas_Textblock_Node_Format
161  * A format node.
162  *
163  * XXX: Adapter for legacy.
164  */
165 typedef struct _Evas_Textblock_Node_Format Evas_Textblock_Node_Format;
166 
167 /**
168  * @typedef Evas_Textblock_Rectangle
169  * General-purpose rectangle that represents some geometry in this object.
170  *
171  */
172 typedef Eina_Rectangle Evas_Textblock_Rectangle;
173 
174 /**
175  * Text type for evas textblock.
176  */
177 typedef enum _Evas_Textblock_Text_Type
178 {
179    EVAS_TEXTBLOCK_TEXT_RAW, /**< textblock text of type raw */
180    EVAS_TEXTBLOCK_TEXT_PLAIN, /**< textblock text of type plain */
181    EVAS_TEXTBLOCK_TEXT_MARKUP /**< textblock text of type markup */
182 } Evas_Textblock_Text_Type;
183 
184 /**
185  * Cursor type for evas textblock.
186  */
187 typedef enum _Evas_Textblock_Cursor_Type
188 {
189    EVAS_TEXTBLOCK_CURSOR_UNDER, /**< cursor type is under */
190    EVAS_TEXTBLOCK_CURSOR_BEFORE /**< cursor type is before */
191 } Evas_Textblock_Cursor_Type;
192 
193 /**
194  * Returns the unescaped version of escape.
195  * @param escape the string to be escaped
196  * @return the unescaped version of escape
197  */
198 EAPI const char                              *evas_textblock_escape_string_get(const char *escape) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
199 
200 /**
201  * Returns the escaped version of the string.
202  * @param string to escape
203  * @param len_ret the len of the part of the string that was used.
204  * @return the escaped string.
205  */
206 EAPI const char                              *evas_textblock_string_escape_get(const char *string, int *len_ret) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
207 
208 /**
209  * Return the unescaped version of the string between start and end.
210  *
211  * @param escape_start the start of the string.
212  * @param escape_end the end of the string.
213  * @return the unescaped version of the range
214  */
215 EAPI const char                              *evas_textblock_escape_string_range_get(const char *escape_start, const char *escape_end) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
216 
217 /**
218  * Creates a new textblock style.
219  * @return  The new textblock style.
220  */
221 EAPI Evas_Textblock_Style                    *evas_textblock_style_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
222 
223 /**
224  * Destroys a textblock style.
225  * @param ts The textblock style to free.
226  */
227 EAPI void                                     evas_textblock_style_free(Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
228 
229 /**
230  * Sets the style ts to the style passed as text by text.
231  * Expected a string consisting of many (or none) tag='format' pairs.
232  *
233  * @param ts  the style to set.
234  * @param text the text to parse - NOT NULL.
235  * @return Returns no value.
236  */
237 EAPI void                                     evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_ARG_NONNULL(1);
238 
239 /**
240  * Return the text of the style ts.
241  * @param ts  the style to get it's text.
242  * @return the text of the style or null on error.
243  */
244 EAPI const char                              *evas_textblock_style_get(const Evas_Textblock_Style *ts) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
245 
246 /**
247  * Returns the next format node (after n)
248  *
249  * @param n the current format node - not null.
250  * @return Returns the next format node, may be null.
251  */
252 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_next_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
253 
254 /**
255  * Returns the prev format node (after n)
256  *
257  * @param n the current format node - not null.
258  * @return Returns the prev format node, may be null.
259  */
260 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_node_format_prev_get(const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1);
261 
262 /**
263  * Sets the cursor to point to the place where format points to.
264  *
265  * @param cur the cursor to update.
266  * @param n the format node to update according.
267  * @deprecated duplicate of evas_textblock_cursor_at_format_set
268  */
269 EAPI void                                     evas_textblock_cursor_set_at_format(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
270 
271 /**
272  * Return the format node at the position pointed by cur.
273  *
274  * @param cur the position to look at.
275  * @return the format node if found, @c NULL otherwise.
276  * @see evas_textblock_cursor_format_is_visible_get()
277  */
278 EAPI const Evas_Object_Textblock_Node_Format *evas_textblock_cursor_format_get(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
279 
280 /**
281  * Get the text format representation of the format node.
282  *
283  * @param fnode the format node.
284  * @return the textual format of the format node.
285  */
286 EAPI const char                              *evas_textblock_node_format_text_get(const Evas_Object_Textblock_Node_Format *fnode) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
287 
288 /**
289  * Set the cursor to point to the position of fmt.
290  *
291  * @param cur the cursor to update
292  * @param fmt the format to update according to.
293  */
294 EAPI void                                     evas_textblock_cursor_at_format_set(Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt) EINA_ARG_NONNULL(1, 2);
295 
296 /**
297  * Check if the current cursor position is a visible format. This way is more
298  * efficient than evas_textblock_cursor_format_get() to check for the existence
299  * of a visible format.
300  *
301  * @param cur the cursor to look at.
302  * @return @c EINA_TRUE if the cursor points to a visible format, @c EINA_FALSE
303  * otherwise.
304  * @see evas_textblock_cursor_format_get()
305  */
306 EAPI Eina_Bool                                evas_textblock_cursor_format_is_visible_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
307 
308 /**
309  * Advances to the next format node
310  *
311  * @param cur the cursor to be updated.
312  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
313  */
314 EAPI Eina_Bool                                evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
315 
316 /**
317  * Advances to the previous format node.
318  *
319  * @param cur the cursor to update.
320  * @return @c EINA_TRUE on success @c EINA_FALSE otherwise.
321  */
322 EAPI Eina_Bool                                evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
323 
324 /**
325  * Returns true if the cursor points to a format.
326  *
327  * @param cur the cursor to check.
328  * @return  @c EINA_TRUE if a cursor points to a format @c EINA_FALSE
329  * otherwise.
330  */
331 EAPI Eina_Bool                                evas_textblock_cursor_is_format(const Evas_Textblock_Cursor *cur) EINA_ARG_NONNULL(1);
332 
333 /**
334  * Return the current cursor pos.
335  *
336  * @param cur the cursor to take the position from.
337  * @return the position or -1 on error
338  */
339 EAPI int                                      evas_textblock_cursor_pos_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
340 
341 /**
342  * Go to the start of the line passed
343  *
344  * @param cur cursor to update.
345  * @param line number to set.
346  * @return @c EINA_TRUE on success, @c EINA_FALSE on error.
347  */
348 EAPI Eina_Bool                                evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line) EINA_ARG_NONNULL(1);
349 
350 /**
351  * Adds format to the current cursor position. If the format being added is a
352  * visible format, add it *before* the cursor position, otherwise, add it after.
353  * This behavior is because visible formats are like characters and invisible
354  * should be stacked in a way that the last one is added last.
355  *
356  * This function works with native formats, that means that style defined
357  * tags like <br> won't work here. For those kind of things use markup prepend.
358  *
359  * @param cur the cursor to where to add format at.
360  * @param format the format to add.
361  * @return Returns true if a visible format was added, false otherwise.
362  * @see evas_textblock_cursor_format_prepend()
363  */
364 
365 /**
366  * Check if the current cursor position points to the terminating null of the
367  * last paragraph. (shouldn't be allowed to point to the terminating null of
368  * any previous paragraph anyway.
369  *
370  * @param cur the cursor to look at.
371  * @return @c EINA_TRUE if the cursor points to the terminating null, @c EINA_FALSE otherwise.
372  */
373 EAPI Eina_Bool                                evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
374 
375 /**
376  * Adds format to the current cursor position. If the format being added is a
377  * visible format, add it *before* the cursor position, otherwise, add it after.
378  * This behavior is because visible formats are like characters and invisible
379  * should be stacked in a way that the last one is added last.
380  * If the format is visible the cursor is advanced after it.
381  *
382  * This function works with native formats, that means that style defined
383  * tags like <br> won't work here. For those kind of things use markup prepend.
384  *
385  * @param cur the cursor to where to add format at.
386  * @param format the format to add.
387  * @return Returns true if a visible format was added, false otherwise.
388  * @see evas_textblock_cursor_format_prepend()
389  */
390 EAPI Eina_Bool                                evas_textblock_cursor_format_prepend(Evas_Textblock_Cursor *cur, const char *format) EINA_ARG_NONNULL(1, 2);
391 
392 /**
393  * Delete the range between cur1 and cur2.
394  *
395  * @param cur1 one side of the range.
396  * @param cur2 the second side of the range
397  * @return Returns no value.
398  */
399 EAPI void                                     evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2) EINA_ARG_NONNULL(1, 2);
400 
401 /**
402  * Return the text of the paragraph cur points to - returns the text in markup.
403  *
404  * @param cur the cursor pointing to the paragraph.
405  * @return the text on success, @c NULL otherwise.
406  */
407 EAPI const char                              *evas_textblock_cursor_paragraph_text_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
408 
409 /**
410  * Return the length of the paragraph, cheaper the eina_unicode_strlen()
411  *
412  * @param cur the position of the paragraph.
413  * @return the length of the paragraph on success, -1 otehrwise.
414  */
415 EAPI int                                      evas_textblock_cursor_paragraph_text_length_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
416 
417 /**
418  * Return the currently visible range.
419  *
420  * @param start the start of the range.
421  * @param end the end of the range.
422  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
423  * @since 1.1
424  */
425 EAPI Eina_Bool                                evas_textblock_cursor_visible_range_get(Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end) EINA_ARG_NONNULL(1, 2);
426 
427 /**
428  * Return the format nodes in the range between cur1 and cur2.
429  *
430  * @param cur1 one side of the range.
431  * @param cur2 the other side of the range
432  * @return the foramt nodes in the range. You have to free it.
433  * @since 1.1
434  */
435 EAPI Eina_List                               *evas_textblock_cursor_range_formats_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
436 
437 /**
438  * Return the text in the range between cur1 and cur2
439  *
440  * @param cur1 one side of the range.
441  * @param cur2 the other side of the range
442  * @param format The form on which to return the text. Markup - in textblock markup. Plain - UTF8.
443  * @return the text in the range
444  * @see elm_entry_markup_to_utf8()
445  */
446 EAPI char                                    *evas_textblock_cursor_range_text_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2, Evas_Textblock_Text_Type format) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
447 
448 /**
449  * Return the content of the cursor.
450  *
451  * Free the returned string pointer when done (if it is not NULL).
452  *
453  * @param cur the cursor
454  * @return the text in the range, terminated by a nul byte (may be utf8).
455  */
456 EAPI char                                    *evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
457 
458 /**
459  * Returns the geometry of two cursors ("split cursor"), if logical cursor is
460  * between LTR/RTL text, also considering paragraph direction.
461  * Upper cursor is shown for the text of the same direction as paragraph,
462  * lower cursor - for opposite.
463  *
464  * Split cursor geometry is valid only  in '|' cursor mode.
465  * In this case @c EINA_TRUE is returned and cx2, cy2, cw2, ch2 are set,
466  * otherwise it behaves like cursor_geometry_get.
467  *
468  * @param[in] cur the cursor.
469  * @param[out] cx the x of the cursor (or upper cursor)
470  * @param[out] cy the y of the cursor (or upper cursor)
471  * @param[out] cw the width of the cursor (or upper cursor)
472  * @param[out] ch the height of the cursor (or upper cursor)
473  * @param[out] cx2 the x of the lower cursor
474  * @param[out] cy2 the y of the lower cursor
475  * @param[out] cw2 the width of the lower cursor
476  * @param[out] ch2 the height of the lower cursor
477  * @param[in] ctype the type of the cursor.
478  * @return @c EINA_TRUE for split cursor, @c EINA_FALSE otherwise
479  * @since 1.8
480  */
481 EAPI Eina_Bool
482 evas_textblock_cursor_geometry_bidi_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_Coord *cx2, Evas_Coord *cy2, Evas_Coord *cw2, Evas_Coord *ch2, Evas_Textblock_Cursor_Type ctype);
483 
484 /**
485  * Returns the geometry of the cursor. Depends on the type of cursor requested.
486  * This should be used instead of char_geometry_get because there are weird
487  * special cases with BiDi text.
488  * in '_' cursor mode (i.e a line below the char) it's the same as char_geometry
489  * get, except for the case of the last char of a line which depends on the
490  * paragraph direction.
491  *
492  * in '|' cursor mode (i.e a line between two chars) it is very variable.
493  * For example consider the following visual string:
494  * "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually draw
495  * a '|' between the c and the C.
496  *
497  * @param cur the cursor.
498  * @param cx the x of the cursor
499  * @param cy the y of the cursor
500  * @param cw the width of the cursor
501  * @param ch the height of the cursor
502  * @param dir the direction of the cursor, can be NULL.
503  * @param ctype the type of the cursor.
504  * @return line number of the char on success, -1 on error.
505  */
506 EAPI int                                      evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_BiDi_Direction *dir, Evas_Textblock_Cursor_Type ctype) EINA_ARG_NONNULL(1);
507 
508 /**
509  * Returns the geometry of the char at cur.
510  *
511  * @param cur the position of the char.
512  * @param cx the x of the char.
513  * @param cy the y of the char.
514  * @param cw the w of the char.
515  * @param ch the h of the char.
516  * @return line number of the char on success, -1 on error.
517  */
518 EAPI int                                      evas_textblock_cursor_char_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
519 
520 /**
521  * Returns the geometry of the pen at cur.
522  *
523  * @param cur the position of the char.
524  * @param cpen_x the pen_x of the char.
525  * @param cy the y of the char.
526  * @param cadv the adv of the char.
527  * @param ch the h of the char.
528  * @return line number of the char on success, -1 on error.
529  */
530 EAPI int                                      evas_textblock_cursor_pen_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cpen_x, Evas_Coord *cy, Evas_Coord *cadv, Evas_Coord *ch) EINA_ARG_NONNULL(1);
531 
532 /**
533  * Returns the geometry of the line at cur.
534  *
535  * @param cur the position of the line.
536  * @param cx the x of the line.
537  * @param cy the y of the line.
538  * @param cw the width of the line.
539  * @param ch the height of the line.
540  * @return line number of the line on success, -1 on error.
541  */
542 EAPI int                                      evas_textblock_cursor_line_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
543 
544 /**
545  * Set the cursor position according to the y coord.
546  *
547  * @param cur the cur to be set.
548  * @param y the coord to set by.
549  * @return the line number found, -1 on error.
550  */
551 EAPI int                                      evas_textblock_cursor_line_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord y) EINA_ARG_NONNULL(1);
552 
553 /**
554  * Get the geometry of a range.
555  *
556  * @param cur1 one side of the range.
557  * @param cur2 other side of the range.
558  * @return a list of Rectangles representing the geometry of the range.
559  */
560 EAPI Eina_List                               *evas_textblock_cursor_range_geometry_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
561 
562 /**
563  * Get the simple geometry of a range.
564  * The simple geometry is the geometry in which rectangles in middle
565  * lines of range are merged into one big rectangle.
566  * @since 1.13
567  *
568  * @param cur1 one side of the range.
569  * @param cur2 other side of the range.
570  * @return an iterator of rectangles representing the geometry of the range.
571  */
572 EAPI Eina_Iterator                               *evas_textblock_cursor_range_simple_geometry_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2);
573 
574 /**
575  */
576 EAPI Eina_Bool                                evas_textblock_cursor_format_item_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
577 
578 /**
579  * Checks if the cursor points to the end of the line.
580  *
581  * @param cur the cursor to check.
582  * @return @c EINA_TRUE if true, @c EINA_FALSE otherwise.
583  */
584 EAPI Eina_Bool                                evas_textblock_cursor_eol_get(const Evas_Textblock_Cursor *cur) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
585 
586 /**
587  * @brief Advances the cursor one char backwards.
588  *
589  * @return @c true on success, @c false otherwise.
590  */
591 EAPI Eina_Bool evas_textblock_cursor_char_prev(Evas_Textblock_Cursor *obj);
592 
593 /**
594  * @brief Advances the cursor one char forward.
595  *
596  * @return @c true on success, @c false otherwise.
597  *
598  * @ingroup Evas_Textblock_Cursor
599  */
600 EAPI Eina_Bool evas_textblock_cursor_char_next(Evas_Textblock_Cursor *obj);
601 
602 /**
603  * @brief Advances the cursor one grapheme cluster backwards.
604  *
605  * @return @c true on success, @c false otherwise.
606  */
607 EAPI Eina_Bool evas_textblock_cursor_cluster_prev(Evas_Textblock_Cursor *obj);
608 
609 /**
610  * @brief Advances the cursor one grapheme cluster forward.
611  *
612  * @return @c true on success, @c false otherwise.
613  *
614  * @ingroup Evas_Textblock_Cursor
615  */
616 EAPI Eina_Bool evas_textblock_cursor_cluster_next(Evas_Textblock_Cursor *obj);
617 
618 /**
619  * @brief Advances to the start of the next text node
620  *
621  * @return @c true if managed to advance, @c false otherwise
622  *
623  * @ingroup Evas_Textblock_Cursor
624  */
625 EAPI Eina_Bool evas_textblock_cursor_paragraph_next(Evas_Textblock_Cursor *obj);
626 
627 /**
628  * @brief Advances to the end of the previous text node
629  *
630  * @return @c true if managed to advance, @c false otherwise
631  *
632  * @ingroup Evas_Textblock_Cursor
633  */
634 EAPI Eina_Bool evas_textblock_cursor_paragraph_prev(Evas_Textblock_Cursor *obj);
635 
636 /**
637  * @brief Moves the cursor to the start of the word under the cursor
638  *
639  * @return @c true on success, @c false otherwise
640  *
641  * @ingroup Evas_Textblock_Cursor
642  */
643 EAPI Eina_Bool evas_textblock_cursor_word_start(Evas_Textblock_Cursor *obj);
644 
645 /**
646  * @brief Moves the cursor to the end of the word under the cursor
647  *
648  * @return @c true on success, @c false otherwise
649  *
650  * @ingroup Evas_Textblock_Cursor
651  */
652 EAPI Eina_Bool evas_textblock_cursor_word_end(Evas_Textblock_Cursor *obj);
653 
654 /**
655  * @}
656  */
657 
658 /**
659  * @addtogroup Evas_Object_Textblock_Group
660  *
661  * @{
662  */
663 
664 /**
665  * Adds a textblock to the given evas.
666  * @param   e The given evas.
667  * @return  The new textblock object.
668  */
669 EAPI Evas_Object                             *evas_object_textblock_add(Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC;
670 
671 /**
672  * Return the plain version of the markup.
673  *
674  * Works as if you set the markup to a textblock and then retrieve the plain
675  * version of the text. i.e: <br> and <\n> will be replaced with \n, &...; with
676  * the actual char and etc.
677  *
678  * @param obj The textblock object to work with. (if @c NULL, tries the
679  * default).
680  * @param text The markup text (if @c NULL, return @c NULL).
681  * @return An allocated plain text version of the markup.
682  * @since 1.2
683  */
684 EAPI char                                    *evas_textblock_text_markup_to_utf8(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
685 
686 /**
687  * Return the markup version of the plain text.
688  *
689  * Replaces \\n -\> \<br/\> \\t -\> \<tab/\> and etc. Generally needed before you pass
690  * plain text to be set in a textblock.
691  *
692  * @param obj the textblock object to work with (if @c NULL, it just does the
693  * default behaviour, i.e with no extra object information).
694  * @param text The plain text (if @c NULL, return @c NULL).
695  * @return An allocated markup version of the plain text.
696  * @since 1.2
697  */
698 EAPI char                                    *evas_textblock_text_utf8_to_markup(const Evas_Object *obj, const char *text) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
699 
700 /**
701  * Clear the textblock object.
702  * @note Does *NOT* free the Evas object itself.
703  *
704  * @param obj the object to clear.
705  * @return nothing.
706  */
707 EAPI void                                     evas_object_textblock_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
708 
709 /**
710  * Sets given text as markup for the textblock object.
711  *
712  * @note assumes text does not include the unicode object replacement char (0xFFFC)
713  *
714  * @param obj  the textblock object.
715  * @param text the markup text to set.
716  * @return Returns no value.
717  */
718 EAPI void evas_object_textblock_text_markup_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
719 
720 /**
721  * Gets the current markup text of the textblock object.
722  *
723  * @param obj  the textblock object.
724  * @return Returns the current markup text.
725  */
726 EAPI const char *evas_object_textblock_text_markup_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
727 
728 /**
729  * Prepends markup to the cursor cur.
730  *
731  * @note assumes text does not include the unicode object replacement char (0xFFFC)
732  *
733  * @param cur  the cursor to prepend to.
734  * @param text the markup text to prepend.
735  * @return Return no value.
736  */
737 EAPI void                                     evas_object_textblock_text_markup_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
738 
739 /**
740  * Sets object's style to given style.
741  *
742  * @param obj the object we set the style on
743  * @param ts  the style to set.
744  * @return Returns no value.
745  * @see evas_textblock_style_user_push()
746  */
747 EAPI void                                     evas_object_textblock_style_set(Evas_Object *obj, const Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1, 2);
748 
749 /**
750  * Gets the object's current style.
751  *
752  * @param obj the object to get the style from.
753  * @return Returns the current active style.
754  * @see evas_textblock_style_user_peek()
755  */
756 EAPI Evas_Textblock_Style                     *evas_object_textblock_style_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
757 
758 
759 /**
760  * Pushes ts to the top of the user style stack.
761  *
762  * FIXME: API is solid but currently only supports 1 style in the
763  * stack.
764  *
765  * The user style overrides the corresponding elements of the
766  * regular style. This is the proper way to do theme overrides
767  * in code.
768  *
769  * @param obj the object to push the style.
770  * @see also evas_textblock_style_set().
771  *
772  * @since 1.2
773  */
774 EAPI void                                      evas_object_textblock_style_user_push(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1,2);
775 
776 /**
777  * Peeks at the user-styles stack
778  *
779  * @param obj the object to get the style from.
780  * @return Returns the user style at the top of the user style stack.
781  * @see evas_textblock_style_user_pop()
782  */
783 EAPI const Evas_Textblock_Style               *evas_object_textblock_style_user_peek(const Evas_Object *obj) EINA_ARG_NONNULL(1);
784 
785 /**
786  * Removes the style at the top of the user-style stack
787  *
788  * @param obj the object to remove the style from.
789  * @return Returns no value.
790  * @see evas_textblock_style_user_peek()
791  */
792 EAPI void                                     evas_object_textblock_style_user_pop(Evas_Object *obj) EINA_ARG_NONNULL(1);
793 
794 /**
795  * Gets the first format node
796  *
797  * @param obj The textblock object.
798  * @return Returns the first format node.
799  */
800 EAPI const Evas_Object_Textblock_Node_Format* evas_textblock_node_format_first_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
801 
802 /**
803  * Gets the last format node
804  *
805  * @param obj The textblock object.
806  * @return Returns the first format node.
807  */
808 EAPI const Evas_Object_Textblock_Node_Format* evas_textblock_node_format_last_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
809 
810 /**
811  * Gets a list of format nodes that match given format.
812  *
813  * @param obj The textblock object to query.
814  * @param anchor The format to find in the textblock.
815  * @return Returns a list of format nodes that match the given format.
816  */
817 EAPI const Eina_List *evas_textblock_node_format_list_get(const Evas_Object *obj, const char *anchor) EINA_ARG_NONNULL(1);
818 
819 /**
820  * Removes format node and its matching format node.
821  *
822  * @param obj The textblock object.
823  * @param n The format node to remove.
824  * @return Returns no value.
825  */
826 EAPI void evas_textblock_node_format_remove_pair(Evas_Object *obj, Evas_Object_Textblock_Node_Format *n) EINA_ARG_NONNULL(1, 2);
827 
828 /**
829  * Gets the geometry of the line specified by its number.
830  *
831  * @param obj The textblock object to query.
832  * @param line the line number of the queried line.
833  * @return Returns no value.
834  */
835 EAPI Eina_Bool evas_object_textblock_line_number_geometry_get(const Evas_Object *obj, int line, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) EINA_ARG_NONNULL(1);
836 
837 /**
838  * Make cur_dest point to the same place as cur. Does not work if they don't
839  * point to the same object.
840  *
841  * @param cur the source cursor.
842  * @param cur_dest destination cursor.
843  * @return Returns no value.
844  */
845 EAPI void                                     evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest);
846 
847 /**
848  *  Create a new cursor, associate it to the obj and init it to point
849  *  to the start of the textblock.
850  *
851  *  Association to the object means the cursor will be updated when
852  *  the object will change.
853  *
854  *  Note: if you need speed and you know what you are doing, it's
855  *  slightly faster to just allocate the cursor yourself and not
856  *  associate it. (only people developing the actual object, and
857  *  not users of the object).
858  *
859  *  @param obj The textblock to which the new cursor will associate.
860  *  @return Returns a new cursor associated with the given textblock object.
861  */
862 EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_new(const Evas_Object *obj);
863 
864 /**
865  * @brief Sets the position of the cursor according to the X and Y coordinates.
866  *
867  * @param[in] y y coord to set by.
868  *
869  * @return @c true on success, @c false otherwise.
870  */
871 EAPI Eina_Bool evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *obj, Evas_Coord x, Evas_Coord y);
872 
873 /**
874  * @brief Sets the position of the cursor according to the X and Y coordinates and
875  * grapheme clusters of text.
876  *
877  * @param[in] y y coord to set by.
878  *
879  * @return @c true on success, @c false otherwise.
880  */
881 EAPI Eina_Bool evas_textblock_cursor_cluster_coord_set(Evas_Textblock_Cursor *obj, Evas_Coord x, Evas_Coord y);
882 
883 /**
884  * Free the cursor and unassociate it from the object.
885  * @note do not use it to free unassociated cursors.
886  *
887  * @param cur the cursor to free.
888  * @return Returns no value.
889  */
890 EAPI void evas_textblock_cursor_free(Evas_Textblock_Cursor *cur);
891 
892 /**
893  * Adds text to the current cursor position and set the cursor to *before*
894  * the start of the text just added.
895  *
896  * @param cur the cursor to where to add text at.
897  * @param text the text to add.
898  * @return Returns the len of the text added.
899  * @see evas_textblock_cursor_text_prepend()
900  */
901 EAPI int evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
902 
903 /**
904  * Adds text to the current cursor position and set the cursor to *after*
905  * the start of the text just added.
906  *
907  * @param cur the cursor to where to add text at.
908  * @param text the text to add.
909  * @return Returns the len of the text added.
910  * @see evas_textblock_cursor_text_append()
911  */
912 EAPI int evas_textblock_cursor_text_prepend(Evas_Textblock_Cursor *cur, const char *text) EINA_ARG_NONNULL(1, 2);
913 
914 /**
915  * @brief The "replacement character" to use for the given textblock object.
916  *
917  * @param[in] ch The charset name.
918  *
919  * @ingroup Efl_Canvas_Textblock
920  */
921 EAPI void evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch);
922 
923 /**
924  * @brief The "replacement character" to use for the given textblock object.
925  *
926  * @return The charset name.
927  *
928  * @ingroup Efl_Canvas_Textblock
929  */
930 EAPI const char *evas_object_textblock_replace_char_get(const Evas_Object *obj);
931 
932 /**
933  * @brief The vertical alignment of text within the textblock object as a
934  * whole.
935  *
936  * Normally alignment is 0.0 (top of object). Values given should be between
937  * 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered etc.).
938  *
939  * @param[in] align The alignment set for the object.
940  *
941  * @since 1.1
942  *
943  * @ingroup Efl_Canvas_Textblock
944  */
945 EAPI void evas_object_textblock_valign_set(Evas_Object *obj, double align);
946 
947 /**
948  * @brief The vertical alignment of text within the textblock object as a
949  * whole.
950  *
951  * Normally alignment is 0.0 (top of object). Values given should be between
952  * 0.0 and 1.0 (1.0 bottom of object, 0.5 being vertically centered etc.).
953  *
954  * @return The alignment set for the object.
955  *
956  * @since 1.1
957  *
958  * @ingroup Efl_Canvas_Textblock
959  */
960 EAPI double evas_object_textblock_valign_get(const Evas_Object *obj);
961 
962 /**
963  * Sets the cursor to the start of the first text node.
964  *
965  * @param cur the cursor to update.
966  * @return Returns no value.
967  */
968 EAPI void evas_textblock_cursor_paragraph_first(Evas_Textblock_Cursor *cur);
969 
970 /**
971  * sets the cursor to the end of the last text node.
972  *
973  * @param cur the cursor to set.
974  * @return Returns no value.
975  */
976 EAPI void evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur);
977 
978 /**
979  * Compare two cursors.
980  *
981  * @param cur1 the first cursor.
982  * @param cur2 the second cursor.
983  * @return -1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.
984  */
985 EAPI int evas_textblock_cursor_compare(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2);
986 
987 /**
988  * @brief Checks if two cursors are equal
989  *
990  * This is faster than @ref evas_textblock_cursor_compare so it should be used
991  * if all we care about is equality.
992  *
993  * @param[in] cur The second cursor.
994  *
995  * @return @c true if equal
996  *
997  * @since 1.18
998  */
999 EAPI Eina_Bool evas_textblock_cursor_equal(const Evas_Textblock_Cursor *obj, const Evas_Textblock_Cursor *cur);
1000 
1001 /**
1002  * Go to the start of the current line
1003  *
1004  * @param cur the cursor to update.
1005  * @return Returns no value.
1006  */
1007 EAPI void evas_textblock_cursor_line_char_first(Evas_Textblock_Cursor *cur);
1008 
1009 /**
1010  * Go to the end of the current line.
1011  *
1012  * @param cur the cursor to update.
1013  * @return Returns no value.
1014  */
1015 EAPI void evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur);
1016 
1017 /**
1018  * Set the cursor pos.
1019  *
1020  * @param cur the cursor to be set.
1021  * @param _pos the pos to set.
1022  */
1023 EAPI void evas_textblock_cursor_pos_set(Evas_Textblock_Cursor *cur, int _pos);
1024 
1025 /**
1026  * Go to the first char in the node the cursor is pointing on.
1027  *
1028  * @param cur the cursor to update.
1029  * @return Returns no value.
1030  */
1031 EAPI void evas_textblock_cursor_paragraph_char_first(Evas_Textblock_Cursor *cur);
1032 
1033 /**
1034  * Go to the last char in a text node.
1035  *
1036  * @param cur the cursor to update.
1037  * @return Returns no value.
1038  */
1039 EAPI void evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur);
1040 
1041 /**
1042  * Deletes a single character from position pointed by given cursor.
1043  *
1044  * @param cur the cursor to update.
1045  * @return Returns no value.
1046  */
1047 EAPI void evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur);
1048 
1049 /** Get the object's main cursor.
1050  *
1051  * @ingroup Evas_Textblock
1052  */
1053 EAPI Evas_Textblock_Cursor *evas_object_textblock_cursor_get(const Evas_Object *obj);
1054 
1055 
1056 
1057 /* TEXT BLOCK FIT OPTIONS FLAGS*/
1058 #define TEXTBLOCK_FIT_MODE_NONE        0x0000
1059 #define TEXTBLOCK_FIT_MODE_WIDTH       0x0001
1060 #define TEXTBLOCK_FIT_MODE_HEIGHT      0x0002
1061 #define TEXTBLOCK_FIT_MODE_ALL         0x0003
1062 
1063 /* TEXT BLOCK ERROR CODES*/
1064 /* FIXME this hould go to other public place*/
1065 #define EVAS_ERROR_SUCCESS              0x0000
1066 #define EVAS_ERROR_INVALID_PARAM        0x0001
1067 #define EVAS_ERROR_NO_MEMORY            0x0002
1068 #define EVAS_ERROR_INVALID_OPERATION    0x0003
1069 
1070 
1071 /** Get the object's content fit options.
1072  *
1073  * @param obj The textblock object.
1074  * @param[out] p_options content fitting options.
1075  * @return Returns error code.
1076  */
1077 EAPI int evas_textblock_fit_options_get(const Evas_Object *obj,  unsigned int * p_options);
1078 
1079 /** Set the object's content fit options.
1080  *
1081  * @param obj The textblock object.
1082  * @param[in] options content fitting options.
1083  * @return Returns error code.
1084  */
1085 EAPI int evas_textblock_fit_options_set(Evas_Object *obj,  unsigned int options);
1086 
1087 /** Get the object's max and min font sizes used for fitting content.
1088  *
1089  * @param obj The textblock object.
1090  * @param[out] p_min_font_size min font size used when fitting content.
1091  * @param[out] p_max_font_size max font size used when fitting content.
1092  * @return Returns error code.
1093  */
1094 EAPI int evas_textblock_fit_size_range_get(const Evas_Object *obj,  unsigned int *p_min_font_size, unsigned int *p_max_font_size);
1095 
1096 /** Set the object's max and min font sizes used for fitting content.
1097  *
1098  * @param obj The textblock object.
1099  * @param[in] min_font_size min font size used when fitting content.
1100  * @param[in] max_font_size max font size used when fitting content.
1101  * @return Returns error code.
1102  */
1103 EAPI int evas_textblock_fit_size_range_set(Evas_Object *obj,  unsigned int min_font_size, unsigned int max_font_size);
1104 
1105 
1106 /** Get the object's fitting step size when trying fonts between min font size and
1107  *  max font size.
1108  *
1109  * @param obj The textblock object.
1110  * @param[out] p_step_size step jumps between min and max font size.
1111  * @return Returns error code.
1112  */
1113 EAPI int evas_textblock_fit_step_size_get(const Evas_Object *obj,  unsigned int *p_step_size);
1114 
1115 
1116 /** Set the object's fitting step size when trying fonts between min font size and
1117  *  max font size.
1118  *
1119  * @param obj The textblock object.
1120  * @param[out] step_size step jumps between min and max font size.
1121  * @return Returns error code.
1122  */
1123 EAPI int evas_textblock_fit_step_size_set(Evas_Object *obj,  unsigned int step_size);
1124 
1125 /** Get copy of the object's fitting font size array used internally
1126  *
1127  * @param obj The textblock object.
1128  * @param[out] p_size_array pointer to size array (passing NULL will ignore filling array).
1129  * @param[out] p_size_array_len the length of internall font sizes array.
1130  * @param[out] request_size_array request to fill specific amount in p_size_array.
1131  * @return Returns error code.
1132  */
1133 EAPI int evas_textblock_fit_size_array_get(const Evas_Object *obj,  unsigned int *p_size_array, size_t *p_size_array_len,size_t request_size_array);
1134 
1135 /** Set the object's fitting font size array that will be used internally
1136  *  Changing fitting step_size,min_font_size,max_font size will generate new array
1137  *  Internall array will be sorted
1138  *
1139  * @param obj The textblock object.
1140  * @param[in] p_size_array pointer to font sizes array.
1141  * @param[in] size_array_len the length passed font sizes array.
1142  * @return Returns error code.
1143  */
1144 EAPI int evas_textblock_fit_size_array_set(Evas_Object *obj,  const unsigned int *p_size_array, size_t size_array_len);
1145 
1146 
1147 
1148 
1149 
1150 
1151 
1152 
1153 
1154 #include "canvas/efl_canvas_textblock_eo.legacy.h"
1155 /**
1156  * @}
1157  */
1158