Tizen Native API
Textblock Object Functions

Functions

void evas_object_textblock_text_markup_set (Evas_Textblock *obj, const char *text)
 Sets the tetxblock's text to the markup text.
const char * evas_object_textblock_text_markup_get (const Evas_Textblock *obj)
 Return the markup of the object.
void evas_object_textblock_valign_set (Evas_Textblock *obj, double align)
 Sets the vertical alignment of text within the textblock object as a whole.
double evas_object_textblock_valign_get (const Evas_Textblock *obj)
 Gets the vertical alignment of a textblock.
void evas_object_textblock_bidi_delimiters_set (Evas_Textblock *obj, const char *delim)
 Sets the BiDi delimiters used in the textblock.
const char * evas_object_textblock_bidi_delimiters_get (const Evas_Textblock *obj)
 Gets the BiDi delimiters used in the textblock.
void evas_object_textblock_replace_char_set (Evas_Textblock *obj, const char *ch)
 Set the "replacement character" to use for the given textblock object.
void evas_object_textblock_legacy_newline_set (Evas_Textblock *obj, Eina_Bool mode)
 Sets newline mode. When true, newline character will behave as a paragraph separator.
Eina_Bool evas_object_textblock_legacy_newline_get (const Evas_Textblock *obj)
 Gets newline mode. When true, newline character behaves as a paragraph separator.
void evas_object_textblock_style_set (Evas_Textblock *obj, const Evas_Textblock_Style *ts)
 Set the objects style to ts.
const Evas_Textblock_Styleevas_object_textblock_style_get (const Evas_Textblock *obj)
 Return the style of an object.
const
Evas_Object_Textblock_Node_Format
evas_textblock_node_format_first_get (const Evas_Textblock *obj)
 Get the first format node.
void evas_object_textblock_size_formatted_get (const Evas_Textblock *obj, Evas_Coord *w, Evas_Coord *h)
 Get the formatted width and height. This calculates the actual size after restricting the textblock to the current size of the object.
const
Evas_Object_Textblock_Node_Format
evas_textblock_node_format_last_get (const Evas_Textblock *obj)
 Gets the last format node.
Evas_Textblock_Cursorevas_object_textblock_cursor_get (const Evas_Textblock *obj)
 Return the object's main cursor.
void evas_object_textblock_size_native_get (const Evas_Textblock *obj, Evas_Coord *w, Evas_Coord *h)
 Get the native width and height. This calculates the actual size without taking account the current size of the object.
Eina_Bool evas_object_textblock_line_number_geometry_get (const Evas_Textblock *obj, int line, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
 Get the geometry of a line number.
const char * evas_object_textblock_replace_char_get (Evas_Textblock *obj)
 Get the "replacement character" for given textblock object. Returns.
void evas_object_textblock_style_user_pop (Evas_Textblock *obj)
 Del the from the top of the user style stack.
Evas_Textblock_Cursorevas_object_textblock_cursor_new (const Evas_Textblock *obj)
 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.
const Eina_Listevas_textblock_node_format_list_get (const Evas_Textblock *obj, const char *anchor)
 Gets the list format node corresponding to anchor.
const Evas_Textblock_Styleevas_object_textblock_style_user_peek (const Evas_Textblock *obj)
 Get (don't remove) the style at the top of the user style stack.
void evas_textblock_node_format_remove_pair (Evas_Textblock *obj, Evas_Object_Textblock_Node_Format *n)
 Removes a format node and its match. That is it removes a <tag> </tag> pair.
void evas_object_textblock_style_user_push (Evas_Textblock *obj, Evas_Textblock_Style *ts)
 Push ts to the top of the user style stack.
const char * evas_textblock_escape_string_get (const char *escape)
 Returns the unescaped version of escape.
const char * evas_textblock_string_escape_get (const char *string, int *len_ret)
 Returns the escaped version of the string.
const char * evas_textblock_escape_string_range_get (const char *escape_start, const char *escape_end)
 Return the unescaped version of the string between start and end.
Evas_Textblock_Styleevas_textblock_style_new (void)
 Creates a new textblock style.
void evas_textblock_style_free (Evas_Textblock_Style *ts)
 Destroys a textblock style.
void evas_textblock_style_set (Evas_Textblock_Style *ts, const char *text)
 Sets the style ts to the style passed as text by text. Expected a string consisting of many (or none) tag='format' pairs.
const char * evas_textblock_style_get (const Evas_Textblock_Style *ts)
 Return the text of the style ts.
void evas_object_textblock_text_markup_prepend (Evas_Textblock_Cursor *cur, const char *text)
 Prepends markup to the cursor cur.
void evas_textblock_cursor_free (Evas_Textblock_Cursor *cur)
 Free the cursor and unassociate it from the object.
void evas_textblock_cursor_paragraph_first (Evas_Textblock_Cursor *cur)
 Sets the cursor to the start of the first text node.
void evas_textblock_cursor_paragraph_last (Evas_Textblock_Cursor *cur)
 sets the cursor to the end of the last text node.
Eina_Bool evas_textblock_cursor_paragraph_next (Evas_Textblock_Cursor *cur)
 Advances to the start of the next text node.
Eina_Bool evas_textblock_cursor_paragraph_prev (Evas_Textblock_Cursor *cur)
 Advances to the end of the previous text node.
const
Evas_Object_Textblock_Node_Format
evas_textblock_node_format_next_get (const Evas_Object_Textblock_Node_Format *n)
 Returns the next format node (after n)
const
Evas_Object_Textblock_Node_Format
evas_textblock_node_format_prev_get (const Evas_Object_Textblock_Node_Format *n)
 Returns the prev format node (after n)
void evas_textblock_cursor_set_at_format (Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *n)
 Sets the cursor to point to the place where format points to.
const
Evas_Object_Textblock_Node_Format
evas_textblock_cursor_format_get (const Evas_Textblock_Cursor *cur)
 Return the format node at the position pointed by cur.
const char * evas_textblock_node_format_text_get (const Evas_Object_Textblock_Node_Format *fnode)
 Get the text format representation of the format node.
void evas_textblock_cursor_at_format_set (Evas_Textblock_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt)
 Set the cursor to point to the position of fmt.
Eina_Bool evas_textblock_cursor_format_is_visible_get (const Evas_Textblock_Cursor *cur)
 Check if the current cursor position is a visible format. This way is more efficient than evas_textblock_cursor_format_get() to check for the existence of a visible format.
Eina_Bool evas_textblock_cursor_format_next (Evas_Textblock_Cursor *cur)
 Advances to the next format node.
Eina_Bool evas_textblock_cursor_format_prev (Evas_Textblock_Cursor *cur)
 Advances to the previous format node.
Eina_Bool evas_textblock_cursor_is_format (const Evas_Textblock_Cursor *cur)
 Returns true if the cursor points to a format.
Eina_Bool evas_textblock_cursor_char_next (Evas_Textblock_Cursor *cur)
 Advances 1 char forward.
Eina_Bool evas_textblock_cursor_char_prev (Evas_Textblock_Cursor *cur)
 Advances 1 char backward.
Eina_Bool evas_textblock_cursor_word_start (Evas_Textblock_Cursor *cur)
 Moves the cursor to the start of the word under the cursor.
Eina_Bool evas_textblock_cursor_word_end (Evas_Textblock_Cursor *cur)
 Moves the cursor to the end of the word under the cursor.
void evas_textblock_cursor_paragraph_char_first (Evas_Textblock_Cursor *cur)
 Go to the first char in the node the cursor is pointing on.
void evas_textblock_cursor_paragraph_char_last (Evas_Textblock_Cursor *cur)
 Go to the last char in a text node.
void evas_textblock_cursor_line_char_first (Evas_Textblock_Cursor *cur)
 Go to the start of the current line.
void evas_textblock_cursor_line_char_last (Evas_Textblock_Cursor *cur)
 Go to the end of the current line.
int evas_textblock_cursor_pos_get (const Evas_Textblock_Cursor *cur)
 Return the current cursor pos.
void evas_textblock_cursor_pos_set (Evas_Textblock_Cursor *cur, int pos)
 Set the cursor pos.
Eina_Bool evas_textblock_cursor_line_set (Evas_Textblock_Cursor *cur, int line)
 Go to the start of the line passed.
int evas_textblock_cursor_compare (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2)
 Compare two cursors.
void evas_textblock_cursor_copy (const Evas_Textblock_Cursor *cur, Evas_Textblock_Cursor *cur_dest)
 Make cur_dest point to the same place as cur. Does not work if they don't point to the same object.
int evas_textblock_cursor_text_append (Evas_Textblock_Cursor *cur, const char *text)
 Adds text to the current cursor position and set the cursor to *before* the start of the text just added.
int evas_textblock_cursor_text_prepend (Evas_Textblock_Cursor *cur, const char *text)
 Adds text to the current cursor position and set the cursor to *after* the start of the text just added.
Eina_Bool evas_textblock_cursor_format_append (Evas_Textblock_Cursor *cur, const char *format)
 Check if the current cursor position points to the terminating null of the last paragraph. (shouldn't be allowed to point to the terminating null of any previous paragraph anyway.
Eina_Bool evas_textblock_cursor_format_prepend (Evas_Textblock_Cursor *cur, const char *format)
 Adds format to the current cursor position. If the format being added is a visible format, add it *before* the cursor position, otherwise, add it after. This behavior is because visible formats are like characters and invisible should be stacked in a way that the last one is added last. If the format is visible the cursor is advanced after it.
void evas_textblock_cursor_char_delete (Evas_Textblock_Cursor *cur)
 Delete the character at the location of the cursor. If there's a format pointing to this position, delete it as well.
void evas_textblock_cursor_range_delete (Evas_Textblock_Cursor *cur1, Evas_Textblock_Cursor *cur2)
 Delete the range between cur1 and cur2.
const char * evas_textblock_cursor_paragraph_text_get (const Evas_Textblock_Cursor *cur)
 Return the text of the paragraph cur points to - returns the text in markup.
int evas_textblock_cursor_paragraph_text_length_get (const Evas_Textblock_Cursor *cur)
 Return the length of the paragraph, cheaper the eina_unicode_strlen()
Eina_Bool evas_textblock_cursor_visible_range_get (Evas_Textblock_Cursor *start, Evas_Textblock_Cursor *end)
 Return the currently visible range.
Eina_Listevas_textblock_cursor_range_formats_get (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2)
 Return the format nodes in the range between cur1 and cur2.
char * evas_textblock_cursor_range_text_get (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2, Evas_Textblock_Text_Type format)
 Return the text in the range between cur1 and cur2.
char * evas_textblock_cursor_content_get (const Evas_Textblock_Cursor *cur)
 Return the content of the cursor.
Eina_Bool 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)
 Returns the geometry of two cursors (split cursor), if logical cursor is between LTR/RTL text, also considering paragraph direction. Upper cursor is shown for the text of the same direction as paragraph, lower cursor - for opposite.
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)
 Returns the geometry of the cursor. Depends on the type of cursor requested. This should be used instead of char_geometry_get because there are weird special cases with BiDi text. in '_' cursor mode (i.e a line below the char) it's the same as char_geometry get, except for the case of the last char of a line which depends on the paragraph direction.
int evas_textblock_cursor_char_geometry_get (const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
 Returns the geometry of the char at cur.
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)
 Returns the geometry of the pen at cur.
int evas_textblock_cursor_line_geometry_get (const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
 Returns the geometry of the line at cur.
Eina_Bool evas_textblock_cursor_char_coord_set (Evas_Textblock_Cursor *cur, Evas_Coord x, Evas_Coord y)
 Set the position of the cursor according to the X and Y coordinates.
int evas_textblock_cursor_line_coord_set (Evas_Textblock_Cursor *cur, Evas_Coord y)
 Set the cursor position according to the y coord.
Eina_Listevas_textblock_cursor_range_geometry_get (const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2)
 Get the geometry of a range.
Eina_Bool evas_textblock_cursor_eol_get (const Evas_Textblock_Cursor *cur)
 Checks if the cursor points to the end of the line.
Evas_Objectevas_object_textblock_add (Evas *e)
 Adds a textblock to the given evas.
char * evas_textblock_text_markup_to_utf8 (const Evas_Object *obj, const char *text)
 Return the plain version of the markup.
char * evas_textblock_text_utf8_to_markup (const Evas_Object *obj, const char *text)
 Return the markup version of the plain text.
void evas_object_textblock_clear (Evas_Object *obj)
 Clear the textblock object.

Typedefs

typedef struct
_Evas_Textblock_Style 
Evas_Textblock_Style
typedef struct
_Evas_Textblock_Cursor 
Evas_Textblock_Cursor
typedef struct
_Evas_Object_Textblock_Node_Format 
Evas_Object_Textblock_Node_Format
typedef enum
_Evas_Textblock_Text_Type 
Evas_Textblock_Text_Type
typedef enum
_Evas_Textblock_Cursor_Type 
Evas_Textblock_Cursor_Type

Functions used to create and manipulate textblock objects. Unlike Text Object Functions, these handle complex text, doing multiple styles and multiline text based on HTML-like tags. Of these extra features will be heavier on memory and processing cost.

Textblock Object Tutorial

This part explains about the textblock object's API and proper usage. The main user of the textblock object is the edje entry object in Edje, so that's a good place to learn from, but I think this document is more than enough, if it's not, please contact me and I'll update it.

Introduction

The textblock objects is, as implied, an object that can show big chunks of text. Textblock supports many features including: Text formatting, automatic and manual text alignment, embedding items (for example icons) and more. Textblock has three important parts, the text paragraphs, the format nodes and the cursors.

You can use markup to format text, for example: "<font_size=50>Big!</font_size>". You can also put more than one style directive in one tag: "<font_size=50 color=#F00>Big and Red!</font_size>". Please notice that we used </font_size> although the format also included color, this is because the first format determines the matching closing tag's name. You can also use anonymous tags, like: "<font_size=30>Big</>" which just pop any type of format, but it's advised to use the named alternatives instead.

Textblock Object Cursors

A textblock Cursor is data type that represents a position in a textblock. Each cursor contains information about the paragraph it points to, the position in that paragraph and the object itself. Cursors register to textblock objects upon creation, this means that once you created a cursor, it belongs to a specific obj and you can't for example copy a cursor into a cursor of a different object. Registered cursors also have the added benefit of updating automatically upon textblock changes, this means that if you have a cursor pointing to a specific character, it'll still point to it even after you change the whole object completely (as long as the char was not deleted), this is not possible without updating, because as mentioned, each cursor holds a character position. There are many functions that handle cursors, just check out the evas_textblock_cursor* functions. For creation and deletion of cursors check out:

See also:
evas_object_textblock_cursor_new()
evas_textblock_cursor_free()
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).

Textblock Object Paragraphs

The textblock object is made out of text splitted to paragraphs (delimited by the paragraph separation character). Each paragraph has many (or none) format nodes associated with it which are responsible for the formatting of that paragraph.

Textblock Object Format Nodes

As explained in Textblock Object Paragraphs each one of the format nodes is associated with a paragraph. There are two types of format nodes, visible and invisible: Visible: formats that a cursor can point to, i.e formats that occupy space, for example: newlines, tabs, items and etc. Some visible items are made of two parts, in this case, only the opening tag is visible. A closing tag (i.e a </tag> tag) should NEVER be visible. Invisible: formats that don't occupy space, for example: bold and underline. Being able to access format nodes is very important for some uses. For example, edje uses the format to create links in the text (and pop popups above them when clicked). For the textblock object a is just a formatting instruction (how to color the text), but edje utilizes the access to the format nodes to make it do more. For more information, take a look at all the evas_textblock_node_format_* functions. The translation of <tag> tags to actual format is done according to the tags defined in the style, see evas_textblock_style_set

Special Formats

Textblock supports various format directives that can be used in markup. In addition to the mentioned format directives, textblock allows creating additional format directives using tags that can be set in the style see evas_textblock_style_set .

For more details see evas_textblock_style_page

Textblock supports the following formats:

  • font - Font description in fontconfig like format, e.g: Sans:style=Italic:lang=hi. or Serif:style=Bold.
  • 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.
  • 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.
  • 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.
  • lang - Overrides the language defined in font. E.g: lang=he is the same as font=:lang=he.
  • font_fallbacks - A comma delimited list of fonts to try if finding the main font fails.
  • font_size - The font size in points.
  • font_source - The source of the font, e.g an eet file.
  • color - Text color in one of the following formats: #RRGGBB, #RRGGBBAA, #RGB, and #RGBA.
  • underline_color - color in one of the following formats: #RRGGBB, #RRGGBBAA, #RGB, and #RGBA.
  • underline2_color - color in one of the following formats: #RRGGBB, #RRGGBBAA, #RGB, and #RGBA.
  • outline_color - color in one of the following formats: #RRGGBB, #RRGGBBAA, #RGB, and #RGBA.
  • shadow_color - color in one of the following formats: #RRGGBB, #RRGGBBAA, #RGB, and #RGBA.
  • glow_color - color in one of the following formats: #RRGGBB, #RRGGBBAA, #RGB, and #RGBA.
  • glow2_color - color in one of the following formats: #RRGGBB, #RRGGBBAA, #RGB, and #RGBA.
  • strikethrough_color - color in one of the following formats: #RRGGBB, #RRGGBBAA, #RGB, and #RGBA.
  • 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%.
  • valign - Either top, bottom, middle, center, baseline, base, a value between 0.0 and 1.0, or a value between 0% to 100%.
  • wrap - word, char, mixed, or none.
  • left_margin - Either reset, or a pixel value indicating the margin.
  • right_margin - Either reset, or a pixel value indicating the margin.
  • underline - on, off, single, or double.
  • strikethrough - on or off
  • backing_color - Background color in one of the following formats: #RRGGBB, #RRGGBBAA, #RGB, and #RGBA.
  • backing - Enable/disable background color. ex) on or off
  • 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.
  • tabstops - Pixel value for tab width.
  • linesize - Force a line size in pixels.
  • linerelsize - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
  • linegap - Force a line gap in pixels.
  • linerelgap - Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.
  • 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.
  • linefill - Either a float value or percentage indicating how much to fill the line.
  • ellipsis - Value between 0.0-1.0 to indicate the type of ellipsis, or -1.0 to indicate ellipsis isn't wanted.
  • password - on or off. This is used to specifically turn replacing chars with the replacement char (i.e password mode) on and off.
Warning:
We don't guarantee any proper results if you create a Textblock object without setting the evas engine.

Typedef Documentation

A textblock cursor object, used to maipulate the cursor of an evas textblock

See also:
evas_object_textblock_cursor_new

Cursor type for evas textblock.

Text type for evas textblock.


Enumeration Type Documentation

Cursor type for evas textblock.

Enumerator:
EVAS_TEXTBLOCK_CURSOR_UNDER 

cursor type is under

EVAS_TEXTBLOCK_CURSOR_BEFORE 

cursor type is before

Text type for evas textblock.

Enumerator:
EVAS_TEXTBLOCK_TEXT_RAW 

textblock text of type raw

EVAS_TEXTBLOCK_TEXT_PLAIN 

textblock text of type plain

EVAS_TEXTBLOCK_TEXT_MARKUP 

textblock text of type markup


Function Documentation

Adds a textblock to the given evas.

Parameters:
[in]eThe given evas.
Since :
2.3
Returns:
The new textblock object.
const char* evas_object_textblock_bidi_delimiters_get ( const Evas_Textblock *  obj)

Gets the BiDi delimiters used in the textblock.

Since :
2.3
Remarks:
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.
Returns:
A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
Since (EFL) :
1.1
Parameters:
[in]objThe textblock object
void evas_object_textblock_bidi_delimiters_set ( Evas_Textblock *  obj,
const char *  delim 
)

Sets the BiDi delimiters used in the textblock.

Since :
2.3
Remarks:
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 (EFL) :
1.1
Parameters:
[in]objThe textblock object
[in]delimA null terminated string of delimiters, e.g ",|".

Clear the textblock object.

Remarks:
Does *NOT* free the Evas object itself.
Since :
2.3
Parameters:
[in]objthe object to clear.
Returns:
nothing.
Evas_Textblock_Cursor* evas_object_textblock_cursor_get ( const Evas_Textblock *  obj)

Return the object's main cursor.

Since :
2.3
Returns:
The obj's main cursor.
Parameters:
[in]objThe textblock object
Evas_Textblock_Cursor* evas_object_textblock_cursor_new ( const Evas_Textblock *  obj)

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.

Since :
2.3
Remarks:
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).
Returns:
the new cursor.
Parameters:
[in]objThe textblock object
Eina_Bool evas_object_textblock_legacy_newline_get ( const Evas_Textblock *  obj)

Gets newline mode. When true, newline character behaves as a paragraph separator.

Since :
2.3
Returns:
EINA_TRUE if in legacy mode, EINA_FALSE otherwise.
Since (EFL) :
1.1
Parameters:
[in]objThe textblock object
void evas_object_textblock_legacy_newline_set ( Evas_Textblock *  obj,
Eina_Bool  mode 
)

Sets newline mode. When true, newline character will behave as a paragraph separator.

Since :
2.3
Since (EFL) :
1.1
Parameters:
[in]objThe textblock object
[in]modeEINA_TRUE for legacy mode, EINA_FALSE otherwise.
Eina_Bool evas_object_textblock_line_number_geometry_get ( const Evas_Textblock *  obj,
int  line,
Evas_Coord cx,
Evas_Coord cy,
Evas_Coord cw,
Evas_Coord ch 
)

Get the geometry of a line number.

Since :
2.3
Returns:
EINA_TRUE on success, EINA_FALSE otherwise.
Parameters:
[in]objThe textblock object
[in]linethe line number.
[out]cxx coord of the line.
[out]cyy coord of the line.
[out]cww coord of the line.
[out]chh coord of the line.
const char* evas_object_textblock_replace_char_get ( Evas_Textblock *  obj)

Get the "replacement character" for given textblock object. Returns.

Since :
2.3

NULL if no replacement character is in use.

Returns:
Replacement character or NULL.
Parameters:
[in]objThe textblock object
void evas_object_textblock_replace_char_set ( Evas_Textblock *  obj,
const char *  ch 
)

Set the "replacement character" to use for the given textblock object.

Since :
2.3
Parameters:
[in]objThe textblock object
[in]chThe charset name.
void evas_object_textblock_size_formatted_get ( const Evas_Textblock *  obj,
Evas_Coord w,
Evas_Coord h 
)

Get the formatted width and height. This calculates the actual size after restricting the textblock to the current size of the object.

Since :
2.3
Remarks:
The main difference between this and 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.
Returns:
Returns no value.
See also:
evas_object_textblock_size_native_get
Parameters:
[in]objThe textblock object
[out]wthe width of the object.
[out]hthe height of the object
void evas_object_textblock_size_native_get ( const Evas_Textblock *  obj,
Evas_Coord w,
Evas_Coord h 
)

Get the native width and height. This calculates the actual size without taking account the current size of the object.

Since :
2.3
Remarks:
The main difference between this and 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.
Returns:
Returns no value.
Parameters:
[in]objThe textblock object
[out]wthe width returned
[out]hthe height returned
const Evas_Textblock_Style* evas_object_textblock_style_get ( const Evas_Textblock *  obj)

Return the style of an object.

Since :
2.3
Returns:
the style of the object.
Parameters:
[in]objThe textblock object
void evas_object_textblock_style_set ( Evas_Textblock *  obj,
const Evas_Textblock_Style ts 
)

Set the objects style to ts.

Since :
2.3
Returns:
Returns no value.
Parameters:
[in]objThe textblock object
[in]tsthe style to set.
const Evas_Textblock_Style* evas_object_textblock_style_user_peek ( const Evas_Textblock *  obj)

Get (don't remove) the style at the top of the user style stack.

Since :
2.3
Returns:
the style of the object.
See also:
evas_object_textblock_style_get
Since (EFL) :
1.2
Parameters:
[in]objThe textblock object
void evas_object_textblock_style_user_pop ( Evas_Textblock *  obj)

Del the from the top of the user style stack.

Since :
2.3
See also:
evas_object_textblock_style_get
Since (EFL) :
1.2
Parameters:
[in]objThe textblock object
void evas_object_textblock_style_user_push ( Evas_Textblock *  obj,
Evas_Textblock_Style ts 
)

Push ts to the top of the user style stack.

Since :
2.3
Remarks:
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.
Returns:
Returns no value.
See also:
evas_object_textblock_style_set
Since (EFL) :
1.2
Parameters:
[in]objThe textblock object
[in]tsthe style to set.
const char* evas_object_textblock_text_markup_get ( const Evas_Textblock *  obj)

Return the markup of the object.

Since :
2.3
Returns:
the markup text of the object.
Parameters:
[in]objThe textblock object
void evas_object_textblock_text_markup_prepend ( Evas_Textblock_Cursor cur,
const char *  text 
)

Prepends markup to the cursor cur.

Since :
2.3
Remarks:
assumes text does not include the unicode object replacement char (0xFFFC)
Parameters:
[in]curthe cursor to prepend to.
[in]textthe markup text to prepend.
Returns:
Return no value.
void evas_object_textblock_text_markup_set ( Evas_Textblock *  obj,
const char *  text 
)

Sets the tetxblock's text to the markup text.

Since :
2.3
Remarks:
assumes text does not include the unicode object replacement char (0xFFFC)
Returns:
Return no value.
Parameters:
[in]objThe textblock object
[in]textthe markup text to use.
double evas_object_textblock_valign_get ( const Evas_Textblock *  obj)

Gets the vertical alignment of a textblock.

Since :
2.3
Returns:
The alignment set for the object.
Since (EFL) :
1.1
Parameters:
[in]objThe textblock object
void evas_object_textblock_valign_set ( Evas_Textblock *  obj,
double  align 
)

Sets the vertical alignment of text within the textblock object as a whole.

Since :
2.3
Remarks:
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 (EFL) :
1.1
Parameters:
[in]objThe textblock object
[in]alignA value between 0.0 and 1.0.

Set the cursor to point to the position of fmt.

Since :
2.3
Parameters:
[in]curthe cursor to update
[in]fmtthe format to update according to.

Set the position of the cursor according to the X and Y coordinates.

Since :
2.3
Parameters:
[in]curthe cursor to set.
[in]xcoord to set by.
[in]ycoord to set by.
Returns:
EINA_TRUE on success, EINA_FALSE otherwise.

Delete the character at the location of the cursor. If there's a format pointing to this position, delete it as well.

Since :
2.3
Parameters:
[in]curthe cursor pointing to the current location.
Returns:
Returns no value.

Returns the geometry of the char at cur.

Since :
2.3
Parameters:
[in]curthe position of the char.
[out]cxthe x of the char.
[out]cythe y of the char.
[out]cwthe w of the char.
[out]chthe h of the char.
Returns:
line number of the char on success, -1 on error.

Advances 1 char forward.

Since :
2.3
Parameters:
[in]curthe cursor to advance.
Returns:
EINA_TRUE on success EINA_FALSE otherwise.

Advances 1 char backward.

Since :
2.3
Parameters:
[in]curthe cursor to advance.
Returns:
EINA_TRUE on success EINA_FALSE otherwise.

Compare two cursors.

Since :
2.3
Parameters:
[in]cur1the first cursor.
[in]cur2the second cursor.
Returns:
-1 if cur1 < cur2, 0 if cur1 == cur2 and 1 otherwise.

Return the content of the cursor.

Since :
2.3
Remarks:
Free the returned string pointer when done (if it is not NULL).
Parameters:
[in]curthe cursor
Returns:
the text in the range, terminated by a nul byte (may be utf8).

Make cur_dest point to the same place as cur. Does not work if they don't point to the same object.

Since :
2.3
Parameters:
[in]curthe source cursor.
[in]cur_destdestination cursor.
Returns:
Returns no value.

Checks if the cursor points to the end of the line.

Since :
2.3
Parameters:
[in]curthe cursor to check.
Returns:
EINA_TRUE if true, EINA_FALSE otherwise.

Check if the current cursor position points to the terminating null of the last paragraph. (shouldn't be allowed to point to the terminating null of any previous paragraph anyway.

Adds format to the current cursor position. If the format being added is a visible format, add it *before* the cursor position, otherwise, add it after. This behavior is because visible formats are like characters and invisible should be stacked in a way that the last one is added last.

This function works with native formats, that means that style defined tags like
won't work here. For those kind of things use markup prepend.

Parameters:
curthe cursor to where to add format at.
formatthe format to add.
Returns:
Returns true if a visible format was added, false otherwise.
See also:
evas_textblock_cursor_format_prepend()
Since :
2.3
Parameters:
[in]curthe cursor to look at.
Returns:
EINA_TRUE if the cursor points to the terminating null, EINA_FALSE otherwise.

Return the format node at the position pointed by cur.

Since :
2.3
Parameters:
[in]curthe position to look at.
Returns:
the format node if found, NULL otherwise.
See also:
evas_textblock_cursor_format_is_visible_get()

Check if the current cursor position is a visible format. This way is more efficient than evas_textblock_cursor_format_get() to check for the existence of a visible format.

Since :
2.3
Parameters:
[in]curthe cursor to look at.
Returns:
EINA_TRUE if the cursor points to a visible format, EINA_FALSE otherwise.
See also:
evas_textblock_cursor_format_get()

Advances to the next format node.

Since :
2.3
Parameters:
[in]curthe cursor to be updated.
Returns:
EINA_TRUE on success EINA_FALSE otherwise.

Adds format to the current cursor position. If the format being added is a visible format, add it *before* the cursor position, otherwise, add it after. This behavior is because visible formats are like characters and invisible should be stacked in a way that the last one is added last. If the format is visible the cursor is advanced after it.

Since :
2.3
Remarks:
This function works with native formats, that means that style defined tags like
won't work here. For those kind of things use markup prepend.
Parameters:
[in]curthe cursor to where to add format at.
[in]formatthe format to add.
Returns:
Returns true if a visible format was added, false otherwise.
See also:
evas_textblock_cursor_format_prepend()

Advances to the previous format node.

Since :
2.3
Parameters:
[in]curthe cursor to update.
Returns:
EINA_TRUE on success EINA_FALSE otherwise.

Free the cursor and unassociate it from the object.

Note:
do not use it to free unassociated cursors.
Since :
2.3
Parameters:
[in]curthe cursor to free.
Returns:
Returns no value.

Returns the geometry of two cursors (split cursor), if logical cursor is between LTR/RTL text, also considering paragraph direction. Upper cursor is shown for the text of the same direction as paragraph, lower cursor - for opposite.

Since :
2.3
Remarks:
Split cursor geometry is valid only in '|' cursor mode. In this case EINA_TRUE is returned and cx2, cy2, cw2, ch2 are set, otherwise it behaves like cursor_geometry_get.
Parameters:
[in]curthe cursor.
[out]cxthe x of the cursor (or upper cursor)
[out]cythe y of the cursor (or upper cursor)
[out]cwthe width of the cursor (or upper cursor)
[out]chthe height of the cursor (or upper cursor)
[out]cx2the x of the lower cursor
[out]cy2the y of the lower cursor
[out]cw2the width of the lower cursor
[out]ch2the height of the lower cursor
[in]ctypethe type of the cursor.
Returns:
EINA_TRUE for split cursor, EINA_FALSE otherwise
Since (EFL) :
1.8
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 
)

Returns the geometry of the cursor. Depends on the type of cursor requested. This should be used instead of char_geometry_get because there are weird special cases with BiDi text. in '_' cursor mode (i.e a line below the char) it's the same as char_geometry get, except for the case of the last char of a line which depends on the paragraph direction.

Since :
2.3
Remarks:
in '|' cursor mode (i.e a line between two chars) it is very variable. For example consider the following visual string: abcCBA (ABC are rtl chars), a cursor pointing on A should actually draw a '|' between the c and the C.
Parameters:
[in]curthe cursor.
[out]cxthe x of the cursor
[out]cythe y of the cursor
[out]cwthe width of the cursor
[out]chthe height of the cursor
[out]dirthe direction of the cursor, can be NULL.
[in]ctypethe type of the cursor.
Returns:
line number of the char on success, -1 on error.

Returns true if the cursor points to a format.

Since :
2.3
Parameters:
[in]curthe cursor to check.
Returns:
EINA_TRUE if a cursor points to a format EINA_FALSE otherwise.

Go to the start of the current line.

Since :
2.3
Parameters:
[in]curthe cursor to update.
Returns:
Returns no value.

Go to the end of the current line.

Since :
2.3
Parameters:
[in]curthe cursor to update.
Returns:
Returns no value.

Set the cursor position according to the y coord.

Since :
2.3
Parameters:
[in]curthe cur to be set.
[in]ythe coord to set by.
Returns:
the line number found, -1 on error.

Returns the geometry of the line at cur.

Since :
2.3
Parameters:
[in]curthe position of the line.
[out]cxthe x of the line.
[out]cythe y of the line.
[out]cwthe width of the line.
[out]chthe height of the line.
Returns:
line number of the line on success, -1 on error.

Go to the start of the line passed.

Since :
2.3
Parameters:
[in]curcursor to update.
[in]linenumer to set.
Returns:
EINA_TRUE on success, EINA_FALSE on error.

Go to the first char in the node the cursor is pointing on.

Since :
2.3
Parameters:
[in]curthe cursor to update.
Returns:
Returns no value.

Go to the last char in a text node.

Since :
2.3
Parameters:
[in]curthe cursor to update.
Returns:
Returns no value.

Sets the cursor to the start of the first text node.

Since :
2.3
Parameters:
[in]curthe cursor to update.
Returns:
Returns no value.

sets the cursor to the end of the last text node.

Since :
2.3
Parameters:
[in]curthe cursor to set.
Returns:
Returns no value.

Advances to the start of the next text node.

Since :
2.3
Parameters:
[in]curthe cursor to update
Returns:
EINA_TRUE if it managed to advance a paragraph, EINA_FALSE otherwise.

Advances to the end of the previous text node.

Since :
2.3
Parameters:
[in]curthe cursor to update
Returns:
EINA_TRUE if it managed to advance a paragraph, EINA_FALSE otherwise.

Return the text of the paragraph cur points to - returns the text in markup.

Since :
2.3
Parameters:
[in]curthe cursor pointing to the paragraph.
Returns:
the text on success, NULL otherwise.

Return the length of the paragraph, cheaper the eina_unicode_strlen()

Since :
2.3
Parameters:
[in]curthe position of the paragraph.
Returns:
the length of the paragraph on success, -1 otehrwise.
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 
)

Returns the geometry of the pen at cur.

Since :
2.3
Parameters:
[in]curthe position of the char.
[out]cpen_xthe pen_x of the char.
[out]cythe y of the char.
[out]cadvthe adv of the char.
[out]chthe h of the char.
Returns:
line number of the char on success, -1 on error.

Return the current cursor pos.

Since :
2.3
Parameters:
[in]curthe cursor to take the position from.
Returns:
the position or -1 on error

Set the cursor pos.

Since :
2.3
Parameters:
[in]curthe cursor to be set.
[in]posthe pos to set.

Delete the range between cur1 and cur2.

Since :
2.3
Parameters:
[in]cur1one side of the range.
[in]cur2the second side of the range
Returns:
Returns no value.

Return the format nodes in the range between cur1 and cur2.

Since :
2.3
Parameters:
[in]cur1one side of the range.
[in]cur2the other side of the range
Returns:
the foramt nodes in the range. You have to free it.
Since (EFL) :
1.1

Get the geometry of a range.

Since :
2.3
Parameters:
[in]cur1one side of the range.
[in]cur2other side of the range.
Returns:
a list of Rectangles representing the geometry of the range.

Return the text in the range between cur1 and cur2.

Since :
2.3
Parameters:
[in]cur1one side of the range.
[in]cur2the other side of the range
[in]formatThe form on which to return the text. Markup - in textblock markup. Plain - UTF8.
Returns:
the text in the range
See also:
elm_entry_markup_to_utf8()

Sets the cursor to point to the place where format points to.

Since :
2.3
Parameters:
[in]curthe cursor to update.
[in]nthe format node to update according.
Deprecated:
Use evas_textblock_cursor_at_format_set instead Deprecated since Tizen 2.4
int evas_textblock_cursor_text_append ( Evas_Textblock_Cursor cur,
const char *  text 
)

Adds text to the current cursor position and set the cursor to *before* the start of the text just added.

Since :
2.3
Parameters:
[in]curthe cursor to where to add text at.
[in]textthe text to add.
Returns:
Returns the len of the text added.
See also:
evas_textblock_cursor_text_prepend()
int evas_textblock_cursor_text_prepend ( Evas_Textblock_Cursor cur,
const char *  text 
)

Adds text to the current cursor position and set the cursor to *after* the start of the text just added.

Since :
2.3
Parameters:
[in]curthe cursor to where to add text at.
[in]textthe text to add.
Returns:
Returns the len of the text added.
See also:
evas_textblock_cursor_text_append()

Return the currently visible range.

Since :
2.3
Parameters:
[in]startthe start of the range.
[in]endthe end of the range.
Returns:
EINA_TRUE on success, EINA_FALSE otherwise.
Since (EFL) :
1.1

Moves the cursor to the end of the word under the cursor.

Since :
2.3
Parameters:
[in]curthe cursor to move.
Returns:
EINA_TRUE on success EINA_FALSE otherwise.
Since (EFL) :
1.2

Moves the cursor to the start of the word under the cursor.

Since :
2.3
Parameters:
[in]curthe cursor to move.
Returns:
EINA_TRUE on success EINA_FALSE otherwise.
Since (EFL) :
1.2
const char* evas_textblock_escape_string_get ( const char *  escape)

Returns the unescaped version of escape.

Parameters:
[in]escapethe string to be escaped
Since :
2.3
Returns:
the unescaped version of escape
const char* evas_textblock_escape_string_range_get ( const char *  escape_start,
const char *  escape_end 
)

Return the unescaped version of the string between start and end.

Since :
2.3
Parameters:
[in]escape_startthe start of the string.
[in]escape_endthe end of the string.
Returns:
the unescaped version of the range

Get the first format node.

Since :
2.3
Parameters:
[in]objThe evas object. This must not be NULL.
Returns:
The first format node, otherwise NULL if there is no first format node.

Gets the last format node.

Since :
2.3
Parameters:
[in]objThe evas textblock. This must not be NULL.
Returns:
The last format node, otherwise NULL if there is no last format node.
const Eina_List* evas_textblock_node_format_list_get ( const Evas_Textblock *  obj,
const char *  anchor 
)

Gets the list format node corresponding to anchor.

Since :
2.3
Parameters:
[in]objThe evas object. This must not be NULL.
[in]anchorthe anchor name to get
Returns:
The list format node corresponding to the anchor, otherwise NULL if there is no list format node.
Parameters:
[in]anchorNo description supplied.

Returns the next format node (after n)

Since :
2.3
Parameters:
[in]nthe current format node - not null.
Returns:
Returns the next format node, may be null.

Returns the prev format node (after n)

Since :
2.3
Parameters:
[in]nthe current format node - not null.
Returns:
Returns the prev format node, may be null.

Removes a format node and its match. That is it removes a <tag> </tag> pair.

Since :
2.3
Remarks:
Assumes that the node is the first part of <tag>. This does not work if n is a closing tag.
Parameters:
[in]objThe Evas object of the textblock. This must not be NULL.
[in]nThe current format node. This must not be NULL.
[in]nNo description supplied.

Get the text format representation of the format node.

Since :
2.3
Parameters:
[in]fnodethe format node.
Returns:
the textual format of the format node.
const char* evas_textblock_string_escape_get ( const char *  string,
int *  len_ret 
)

Returns the escaped version of the string.

Parameters:
[in]stringto escape
[out]len_retthe len of the part of the string that was used.
Since :
2.3
Returns:
the escaped string.

Destroys a textblock style.

Parameters:
[in]tsThe textblock style to free.
Since :
2.3
const char* evas_textblock_style_get ( const Evas_Textblock_Style ts)

Return the text of the style ts.

Parameters:
[in]tsthe style to get it's text.
Since :
2.3
Returns:
the text of the style or null on error.

Creates a new textblock style.

Since :
2.3
Returns:
The new textblock style.
void evas_textblock_style_set ( Evas_Textblock_Style ts,
const char *  text 
)

Sets the style ts to the style passed as text by text. Expected a string consisting of many (or none) tag='format' pairs.

Since :
2.3
Parameters:
[in]tsthe style to set.
[in]textthe text to parse - NOT NULL.
Returns:
Returns no value.
char* evas_textblock_text_markup_to_utf8 ( const Evas_Object obj,
const char *  text 
)

Return the plain version of the markup.

Since :
2.3
Remarks:
Works as if you set the markup to a textblock and then retrieve the plain version of the text. i.e:
and <
> will be replaced with
, &...; with the actual char and etc.
Parameters:
[in]objThe textblock object to work with. (if NULL, tries the default).
[in]textThe markup text (if NULL, return NULL).
Returns:
An allocated plain text version of the markup.
Since (EFL) :
1.2
char* evas_textblock_text_utf8_to_markup ( const Evas_Object obj,
const char *  text 
)

Return the markup version of the plain text.

Since :
2.3
Remarks:
Replaces \n -> <br/> \t -> <tab/> and etc. Generally needed before you pass plain text to be set in a textblock.
Parameters:
[in]objthe textblock object to work with (if NULL, it just does the default behaviour, i.e with no extra object information).
[in]textThe plain text (if NULL, return NULL).
Returns:
An allocated markup version of the plain text.
Since (EFL) :
1.2