Tizen Native API

Widget to display text, with simple html-like markup.

label_inheritance_tree.png

The Label widget doesn't allow text to overflow its boundaries, if the text doesn't fit the geometry of the label, it is ellipsized or cut. Elementary provides several styles for this widget:

  • default - No animation.
  • marker - Centers the text in the label and makes it bold by default.
  • slide_long - The entire text appears from the right of the screen and slides until it disappears in the left of the screen(reappearing on the right again).
  • slide_short - The text appears in the left of the label and slides to the right to show the overflow. When all of the text has been shown the position is reset.
  • slide_bounce - The text appears in the left of the label and slides to the right to show the overflow. When all of the text has been shown the animation reverses, moving the text to the left.

Custom themes can of course invent new markup tags and style them in any way they like.

This widget inherits from the Layout one, so that all the functions acting on it also work for label objects.

This widget emits the following signals, besides the ones sent from Layout :

  • "language,changed": The program's language is changed.
  • "slide,end": The slide has ended.

Functions

Evas_Objectelm_label_add (Evas_Object *parent)
 Adds a new label to the parent.
void elm_label_line_wrap_set (Evas_Object *obj, Elm_Wrap_Type wrap)
 Sets the wrapping behavior of the label.
Elm_Wrap_Type elm_label_line_wrap_get (const Evas_Object *obj)
 Gets the wrapping behavior of the label.
void elm_label_wrap_width_set (Evas_Object *obj, Evas_Coord w)
 Sets the wrap width of the label.
Evas_Coord elm_label_wrap_width_get (const Evas_Object *obj)
 Gets the wrap width of the label.
void elm_label_ellipsis_set (Evas_Object *obj, Eina_Bool ellipsis)
 Sets the ellipsis behavior of the label.
Eina_Bool elm_label_ellipsis_get (const Evas_Object *obj)
 Gets the ellipsis behavior of the label.
void elm_label_slide_duration_set (Evas_Object *obj, double duration)
 Sets the slide duration (speed) of the label.
double elm_label_slide_duration_get (const Evas_Object *obj)
 Gets the slide duration(speed) of the label.
void elm_label_slide_mode_set (Evas_Object *obj, Elm_Label_Slide_Mode mode)
 Sets the slide mode of the label widget.
Elm_Label_Slide_Mode elm_label_slide_mode_get (const Evas_Object *obj)
 Gets the slide mode of the label widget.
void elm_label_slide_go (Evas_Object *obj)
 Starts the slide effect.

Typedefs

typedef Evas_Object *(* Elm_Label_Item_Provider_Cb )(void *data, Evas_Object *label, const char *item)
 Called to provide items.

Typedef Documentation

Called to provide items.

Since :
2.3.1
Remarks:
If it returns an object handle other than NULL (it should create an object to do this), then this object is used to replace the current item. If not, the next provider is called until one provides an item object, or the default provider in the label does.
Parameters:
[in]dataThe data specified as the last parameter when adding the provider
[in]labelThe label object
[in]textA pointer to the item href string in the text
Returns:
The object to be placed in the label like an icon, or another element

Enumeration Type Documentation

Enumeration of Elm Label Slide Mode type

Enumerator:
ELM_LABEL_SLIDE_MODE_NONE 

No slide effect

ELM_LABEL_SLIDE_MODE_AUTO 

Slide only if the label area is bigger than the text width length

ELM_LABEL_SLIDE_MODE_ALWAYS 

Slide always


Function Documentation

Adds a new label to the parent.

Since :
2.3.1
Parameters:
[in]parentThe parent object
Returns:
The new object, otherwise NULL if it cannot be created

Gets the ellipsis behavior of the label.

Since :
2.3.1
Parameters:
[in]objThe label object
Returns:
true if ellipsis are shown at the end of the label area, otherwise false
See also:
elm_label_ellipsis_set()
void elm_label_ellipsis_set ( Evas_Object obj,
Eina_Bool  ellipsis 
)

Sets the ellipsis behavior of the label.

Since :
2.3.1
Remarks:
If set to true and the text doesn't fit in the label, ellipsis("...") are shown at the end of the widget.
This doesn't work with slide or if the chosen wrap method is ELM_WRAP_WORD.
Parameters:
[in]objThe label object
[in]ellipsisThe boolean value that indicates whether to add ellipsis to text

Gets the wrapping behavior of the label.

Since :
2.3.1
Parameters:
[in]objThe label object
Returns:
The wrap type
See also:
elm_label_line_wrap_set()

Sets the wrapping behavior of the label.

Since :
2.3.1
Remarks:
By default no wrapping is done. Possible values for wrap are:
  • ELM_WRAP_NONE - No wrapping.
  • ELM_WRAP_CHAR - Wrap between characters.
  • ELM_WRAP_WORD - Wrap between words.
  • ELM_WRAP_MIXED - Word wrap, and if that fails, char wrap.
Parameters:
[in]objThe label object
[in]wrapThe boolean that indicates whether to wrap the text
double elm_label_slide_duration_get ( const Evas_Object obj)

Gets the slide duration(speed) of the label.

Since :
2.3.1
Parameters:
[in]objThe label object
Returns:
The duration time in moving text from slide begin position to slide end position
See also:
elm_label_slide_duration_set()
void elm_label_slide_duration_set ( Evas_Object obj,
double  duration 
)

Sets the slide duration (speed) of the label.

Since :
2.3.1
Parameters:
[in]objThe label object
[in]durationThe duration in seconds in moving text from slide begin position to slide end position

Starts the slide effect.

Since :
2.3.1
Parameters:
[in]objThe label object
See also:
elm_label_slide_mode_set()

Gets the slide mode of the label widget.

Since :
2.3.1
Parameters:
[in]objThe label object
Returns:
The slide mode
See also:
elm_label_slide_mode_set()

Sets the slide mode of the label widget.

Since :
2.3.1
Remarks:
elm_label_slide_mode_set() changes the label slide mode. By default, the slide mode is none. Possible values for mode are:
  • ELM_LABEL_SLIDE_MODE_NONE - No slide effect.
  • ELM_LABEL_SLIDE_MODE_AUTO - Slide only if the label area is bigger than the text width length.
  • ELM_LABEL_SLIDE_MODE_ALWAYS -Slide always.
ELM_LABEL_SLIDE_MODE_AUTO and ELM_LABEL_SLIDE_MODE_ALWAYS only works with the themes "slide_short", "slide_long", and "slide_bounce".
ELM_LABEL_SLIDE_MODE_AUTO and ELM_LABEL_SLIDE_MODE_ALWAYS don't work if the line wrap(elm_label_line_wrap_set()) or ellipsis(elm_label_ellipsis_set()) is set.
Parameters:
[in]objThe label object
[in]modeThe slide mode
See also:
elm_label_slide_mode_get()

Gets the wrap width of the label.

Since :
2.3.1
Parameters:
[in]objThe label object
Returns:
The wrap width in pixels at a minimum where words need to wrap
See also:
elm_label_wrap_width_set()

Sets the wrap width of the label.

This function sets the maximum width size hint of the label.

Since :
2.3.1
Remarks:
This is only relevant if the label is inside a container.
Parameters:
[in]objThe label object
[in]wThe wrap width in pixels at a minimum where words need to wrap