2011-12-29 23:20:48 -08:00
|
|
|
/**
|
|
|
|
* @defgroup Label Label
|
2012-04-16 18:35:46 -07:00
|
|
|
* @ingroup Elementary
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2012-06-05 15:41:21 -07:00
|
|
|
* @image html label_inheritance_tree.png
|
|
|
|
* @image latex label_inheritance_tree.eps
|
|
|
|
*
|
2011-12-29 23:20:48 -08:00
|
|
|
* @image html img/widget/label/preview-00.png
|
|
|
|
* @image latex img/widget/label/preview-00.eps
|
|
|
|
*
|
|
|
|
* @brief Widget to display text, with simple html-like markup.
|
|
|
|
*
|
|
|
|
* The Label widget @b doesn't allow text to overflow its boundaries, if the
|
|
|
|
* text doesn't fit the geometry of the label it will be ellipsized or be
|
|
|
|
* cut. Elementary provides several styles for this widget:
|
|
|
|
* @li default - No animation
|
2012-02-16 03:39:07 -08:00
|
|
|
* @li marker - Centers the text in the label and makes it bold by default
|
2011-12-29 23:20:48 -08:00
|
|
|
* @li slide_long - The entire text appears from the right of the screen and
|
2012-02-14 00:50:40 -08:00
|
|
|
* slides until it disappears in the left of the screen(reappearing on the
|
2011-12-29 23:20:48 -08:00
|
|
|
* right again).
|
|
|
|
* @li 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.
|
|
|
|
* @li 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 any way
|
|
|
|
* they like.
|
|
|
|
*
|
2012-05-03 15:42:38 -07:00
|
|
|
* This widget inherits from the @ref 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
|
|
|
|
* @ref Layout:
|
|
|
|
* @li @c "language,changed": The program's language changed.
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
|
|
|
* See @ref tutorial_label for a demonstration of how to use a label widget.
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#define ELM_OBJ_LABEL_CLASS elm_obj_label_class_get()
|
|
|
|
|
|
|
|
const Eo_Class *elm_obj_label_class_get(void) EINA_CONST;
|
|
|
|
|
|
|
|
extern EAPI Eo_Op ELM_OBJ_LABEL_BASE_ID;
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_SET,
|
|
|
|
ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_GET,
|
|
|
|
ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_SET,
|
|
|
|
ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_GET,
|
|
|
|
ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_SET,
|
|
|
|
ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_GET,
|
2013-01-04 02:47:51 -08:00
|
|
|
ELM_OBJ_LABEL_SUB_ID_SLIDE_MODE_SET,
|
|
|
|
ELM_OBJ_LABEL_SUB_ID_SLIDE_MODE_GET,
|
2012-11-25 22:32:53 -08:00
|
|
|
ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_SET,
|
|
|
|
ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_GET,
|
|
|
|
ELM_OBJ_LABEL_SUB_ID_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
#define ELM_OBJ_LABEL_ID(sub_id) (ELM_OBJ_LABEL_BASE_ID + sub_id)
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def elm_obj_label_line_wrap_set
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* @brief Set the wrapping behavior of the label
|
|
|
|
*
|
|
|
|
* @param[in] wrap
|
|
|
|
*
|
|
|
|
* @see elm_label_line_wrap_set
|
|
|
|
*/
|
|
|
|
#define elm_obj_label_line_wrap_set(wrap) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_SET), EO_TYPECHECK(Elm_Wrap_Type, wrap)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def elm_obj_label_line_wrap_get
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* @brief Get the wrapping behavior of the label
|
|
|
|
*
|
|
|
|
* @param[out] ret
|
|
|
|
*
|
|
|
|
* @see elm_label_line_wrap_get
|
|
|
|
*/
|
|
|
|
#define elm_obj_label_line_wrap_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_GET), EO_TYPECHECK(Elm_Wrap_Type *, ret)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def elm_obj_label_wrap_width_set
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* @brief Set wrap width of the label
|
|
|
|
*
|
|
|
|
* @param[in] w
|
|
|
|
*
|
|
|
|
* @see elm_label_wrap_width_set
|
|
|
|
*/
|
|
|
|
#define elm_obj_label_wrap_width_set(w) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_SET), EO_TYPECHECK(Evas_Coord, w)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def elm_obj_label_wrap_width_get
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* @brief Get wrap width of the label
|
|
|
|
*
|
|
|
|
* @param[out] ret
|
|
|
|
*
|
|
|
|
* @see elm_label_wrap_width_get
|
|
|
|
*/
|
|
|
|
#define elm_obj_label_wrap_width_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_GET), EO_TYPECHECK(Evas_Coord *, ret)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def elm_obj_label_ellipsis_set
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* @brief Set the ellipsis behavior of the label
|
|
|
|
*
|
|
|
|
* @param[in] ellipsis
|
|
|
|
*
|
|
|
|
* @see elm_label_ellipsis_set
|
|
|
|
*/
|
|
|
|
#define elm_obj_label_ellipsis_set(ellipsis) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_SET), EO_TYPECHECK(Eina_Bool, ellipsis)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def elm_obj_label_ellipsis_get
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* @brief Get the ellipsis behavior of the label
|
|
|
|
*
|
|
|
|
* @param[out] ret
|
|
|
|
*
|
|
|
|
* @see elm_label_ellipsis_get
|
|
|
|
*/
|
|
|
|
#define elm_obj_label_ellipsis_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_GET), EO_TYPECHECK(Eina_Bool *, ret)
|
|
|
|
|
|
|
|
/**
|
2013-01-04 02:47:51 -08:00
|
|
|
* @def elm_obj_label_slide_mode_set
|
2012-11-25 22:32:53 -08:00
|
|
|
* @since 1.8
|
|
|
|
*
|
2013-01-04 02:47:51 -08:00
|
|
|
* @brief Set slide effect mode of label widget.
|
2012-11-25 22:32:53 -08:00
|
|
|
*
|
2013-01-04 02:47:51 -08:00
|
|
|
* @param[in] mode
|
2012-11-25 22:32:53 -08:00
|
|
|
*
|
2013-01-04 02:47:51 -08:00
|
|
|
* @see elm_label_slide_mode_set
|
2012-11-25 22:32:53 -08:00
|
|
|
*/
|
2013-01-04 02:47:51 -08:00
|
|
|
#define elm_obj_label_slide_mode_set(mode) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_MODE_SET), EO_TYPECHECK(Elm_Label_Slide_Mode, mode)
|
2012-11-25 22:32:53 -08:00
|
|
|
|
|
|
|
/**
|
2013-01-04 02:47:51 -08:00
|
|
|
* @def elm_obj_label_slide_mode_get
|
2012-11-25 22:32:53 -08:00
|
|
|
* @since 1.8
|
|
|
|
*
|
2013-01-04 02:47:51 -08:00
|
|
|
* @brief Get current slide effect mode.
|
2012-11-25 22:32:53 -08:00
|
|
|
*
|
|
|
|
* @param[out] ret
|
|
|
|
*
|
2013-01-04 02:47:51 -08:00
|
|
|
* @see elm_label_slide_mode_get
|
2012-11-25 22:32:53 -08:00
|
|
|
*/
|
2013-01-04 02:47:51 -08:00
|
|
|
#define elm_obj_label_slide_mode_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_MODE_GET), EO_TYPECHECK(Elm_Label_Slide_Mode *, ret)
|
2012-11-25 22:32:53 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @def elm_obj_label_slide_duration_set
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* @brief Set the slide duration (speed) of the label
|
|
|
|
*
|
|
|
|
* @param[in] duration
|
|
|
|
*
|
|
|
|
* @see elm_label_slide_duration_set
|
|
|
|
*/
|
|
|
|
#define elm_obj_label_slide_duration_set(duration) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_SET), EO_TYPECHECK(double, duration)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @def elm_obj_label_slide_duration_get
|
|
|
|
* @since 1.8
|
|
|
|
*
|
|
|
|
* @brief Get the slide duration(speed) of the label
|
|
|
|
*
|
|
|
|
* @param[out] ret
|
|
|
|
*
|
|
|
|
* @see elm_label_slide_duration_get
|
|
|
|
*/
|
|
|
|
#define elm_obj_label_slide_duration_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_GET), EO_TYPECHECK(double *, ret)
|
2013-01-04 02:47:51 -08:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
ELM_LABEL_SLIDE_MODE_NONE = 0, /**< 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;
|
|
|
|
|
2011-12-29 23:20:48 -08:00
|
|
|
/**
|
|
|
|
* @brief Add a new label to the parent
|
|
|
|
*
|
|
|
|
* @param parent The parent object
|
|
|
|
* @return The new object or NULL if it cannot be created
|
2012-04-16 18:35:46 -07:00
|
|
|
*
|
|
|
|
* @ingroup Label
|
2011-12-29 23:20:48 -08:00
|
|
|
*/
|
2011-12-30 01:48:46 -08:00
|
|
|
EAPI Evas_Object *elm_label_add(Evas_Object *parent);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Set the wrapping behavior of the label
|
|
|
|
*
|
|
|
|
* @param obj The label object
|
|
|
|
* @param wrap To wrap text or not
|
|
|
|
*
|
|
|
|
* By default no wrapping is done. Possible values for @p wrap are:
|
|
|
|
* @li ELM_WRAP_NONE - No wrapping
|
|
|
|
* @li ELM_WRAP_CHAR - wrap between characters
|
|
|
|
* @li ELM_WRAP_WORD - wrap between words
|
|
|
|
* @li ELM_WRAP_MIXED - Word wrap, and if that fails, char wrap
|
2012-04-16 18:35:46 -07:00
|
|
|
*
|
|
|
|
* @ingroup Label
|
2011-12-29 23:20:48 -08:00
|
|
|
*/
|
2011-12-30 01:48:46 -08:00
|
|
|
EAPI void elm_label_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the wrapping behavior of the label
|
|
|
|
*
|
|
|
|
* @param obj The label object
|
|
|
|
* @return Wrap type
|
|
|
|
*
|
|
|
|
* @see elm_label_line_wrap_set()
|
2012-04-16 18:35:46 -07:00
|
|
|
*
|
|
|
|
* @ingroup Label
|
2011-12-29 23:20:48 -08:00
|
|
|
*/
|
2011-12-30 01:48:46 -08:00
|
|
|
EAPI Elm_Wrap_Type elm_label_line_wrap_get(const Evas_Object *obj);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Set wrap width of the label
|
|
|
|
*
|
|
|
|
* @param obj The label object
|
|
|
|
* @param w The wrap width in pixels at a minimum where words need to wrap
|
|
|
|
*
|
|
|
|
* This function sets the maximum width size hint of the label.
|
|
|
|
*
|
|
|
|
* @warning This is only relevant if the label is inside a container.
|
2012-04-16 18:35:46 -07:00
|
|
|
*
|
|
|
|
* @ingroup Label
|
2011-12-29 23:20:48 -08:00
|
|
|
*/
|
2011-12-30 01:48:46 -08:00
|
|
|
EAPI void elm_label_wrap_width_set(Evas_Object *obj, Evas_Coord w);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get wrap width of the label
|
|
|
|
*
|
|
|
|
* @param obj The label object
|
|
|
|
* @return The wrap width in pixels at a minimum where words need to wrap
|
|
|
|
*
|
|
|
|
* @see elm_label_wrap_width_set()
|
2012-04-16 18:35:46 -07:00
|
|
|
*
|
|
|
|
* @ingroup Label
|
2011-12-29 23:20:48 -08:00
|
|
|
*/
|
2011-12-30 01:48:46 -08:00
|
|
|
EAPI Evas_Coord elm_label_wrap_width_get(const Evas_Object *obj);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Set the ellipsis behavior of the label
|
|
|
|
*
|
|
|
|
* @param obj The label object
|
|
|
|
* @param ellipsis To ellipsis text or not
|
|
|
|
*
|
|
|
|
* If set to true and the text doesn't fit in the label an ellipsis("...")
|
|
|
|
* will be shown at the end of the widget.
|
|
|
|
*
|
|
|
|
* @warning This doesn't work with slide(elm_label_slide_set()) or if the
|
2012-05-28 20:09:06 -07:00
|
|
|
* chosen wrap method was #ELM_WRAP_WORD.
|
2012-04-16 18:35:46 -07:00
|
|
|
*
|
|
|
|
* @ingroup Label
|
2011-12-29 23:20:48 -08:00
|
|
|
*/
|
2011-12-30 01:48:46 -08:00
|
|
|
EAPI void elm_label_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
2012-02-16 03:39:07 -08:00
|
|
|
* @brief Get the ellipsis behavior of the label
|
|
|
|
*
|
|
|
|
* @param obj The label object
|
|
|
|
* @return If true, an ellipsis will be shown at the end of the label area.
|
|
|
|
*
|
|
|
|
* @see elm_label_ellipsis_set()
|
2012-04-16 18:35:46 -07:00
|
|
|
*
|
|
|
|
* @ingroup Label
|
2012-02-16 03:39:07 -08:00
|
|
|
*/
|
|
|
|
EAPI Eina_Bool elm_label_ellipsis_get(const Evas_Object *obj);
|
|
|
|
|
|
|
|
/**
|
2013-01-04 02:47:51 -08:00
|
|
|
* @brief Set the slide duration (speed) of the label
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
|
|
|
* @param obj The label object
|
2013-01-04 02:47:51 -08:00
|
|
|
* @param duration The duration in seconds in moving text from slide begin position
|
|
|
|
* to slide end position
|
2012-04-16 18:35:46 -07:00
|
|
|
*
|
|
|
|
* @ingroup Label
|
2011-12-29 23:20:48 -08:00
|
|
|
*/
|
2013-01-04 02:47:51 -08:00
|
|
|
EAPI void elm_label_slide_duration_set(Evas_Object *obj, double duration);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
2013-01-04 02:47:51 -08:00
|
|
|
* @brief Get the slide duration(speed) of the label
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
|
|
|
* @param obj The label object
|
2013-01-04 02:47:51 -08:00
|
|
|
* @return The duration time in moving text from slide begin position to slide end position
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2013-01-04 02:47:51 -08:00
|
|
|
* @see elm_label_slide_duration_set()
|
2012-04-16 18:35:46 -07:00
|
|
|
*
|
|
|
|
* @ingroup Label
|
2011-12-29 23:20:48 -08:00
|
|
|
*/
|
2013-01-04 02:47:51 -08:00
|
|
|
EAPI double elm_label_slide_duration_get(const Evas_Object *obj);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
2013-01-04 02:47:51 -08:00
|
|
|
* @brief Slide only if the
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
|
|
|
* @param obj The label object
|
2012-02-16 03:39:07 -08:00
|
|
|
* @param duration The duration in seconds in moving text from slide begin position
|
2011-12-29 23:20:48 -08:00
|
|
|
* to slide end position
|
2012-04-16 18:35:46 -07:00
|
|
|
*
|
|
|
|
* @ingroup Label
|
2011-12-29 23:20:48 -08:00
|
|
|
*/
|
2013-01-04 02:47:51 -08:00
|
|
|
EAPI void elm_label_slide_area_limit_set(Evas_Object *obj, Eina_Bool limit);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
2013-01-04 02:47:51 -08:00
|
|
|
* @brief Set the slide mode of the label widget.
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
|
|
|
* @param obj The label object
|
2013-01-04 02:47:51 -08:00
|
|
|
* @param mode The slide mode
|
|
|
|
*
|
|
|
|
* elm_label_slide_mode_set() changes label slide mode.
|
|
|
|
* By default, slide mode is none. Possible values for @p mode are:
|
|
|
|
* @li ELM_LABEL_SLIDE_MODE_NONE - no slide effect
|
|
|
|
* @li ELM_LABEL_SLIDE_MODE_AUTO - slide only if the label area is bigger than
|
|
|
|
* the text width length
|
|
|
|
* @li ELM_LABEL_SLIDE_MODE_ALWAYS -slide always
|
|
|
|
*
|
|
|
|
* @warning ELM_LABEL_SLIDE_MODE_AUTO, ELM_LABEL_SLIDE_MODE_ALWAYS only work
|
|
|
|
* with the themes "slide_short", "slide_long" and "slide_bounce".
|
|
|
|
* @warning ELM_LABEL_SLIDE_MODE_AUTO, 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.
|
2011-12-29 23:20:48 -08:00
|
|
|
*
|
2013-01-04 02:47:51 -08:00
|
|
|
* @see elm_label_slide_mode_get().
|
2012-04-16 18:35:46 -07:00
|
|
|
*
|
|
|
|
* @ingroup Label
|
2011-12-29 23:20:48 -08:00
|
|
|
*/
|
2013-01-04 02:47:51 -08:00
|
|
|
EAPI void elm_label_slide_mode_set(Evas_Object *obj, Elm_Label_Slide_Mode mode);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the slide mode of the label widget.
|
|
|
|
*
|
|
|
|
* @param obj The label object
|
|
|
|
* @return The slide mode
|
|
|
|
*
|
|
|
|
* @see elm_label_slide_set()
|
|
|
|
*
|
|
|
|
* @ingroup Label
|
|
|
|
*/
|
|
|
|
EAPI Elm_Label_Slide_Mode elm_label_slide_mode_get(const Evas_Object *obj);
|
2011-12-29 23:20:48 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|