2 * @defgroup Label Label
4 * @image html img/widget/label/preview-00.png
5 * @image latex img/widget/label/preview-00.eps
7 * @brief Widget to display text, with simple html-like markup.
9 * The Label widget @b doesn't allow text to overflow its boundaries, if the
10 * text doesn't fit the geometry of the label it will be ellipsized or be
11 * cut. Elementary provides several styles for this widget:
12 * @li default - No animation
13 * @li marker - Centers the text in the label and make it bold by default
14 * @li slide_long - The entire text appears from the right of the screen and
15 * slides until it disappears in the left of the screen(reappering on the
17 * @li slide_short - The text appears in the left of the label and slides to
18 * the right to show the overflow. When all of the text has been shown the
20 * @li slide_bounce - The text appears in the left of the label and slides to
21 * the right to show the overflow. When all of the text has been shown the
22 * animation reverses, moving the text to the left.
24 * Custom themes can of course invent new markup tags and style them any way
27 * The following signals may be emitted by the label widget:
28 * @li "language,changed": The program's language changed.
30 * See @ref tutorial_label for a demonstration of how to use a label widget.
35 * @brief Add a new label to the parent
37 * @param parent The parent object
38 * @return The new object or NULL if it cannot be created
41 elm_label_add(Evas_Object *parent)
45 * @brief Set the label on the label object
47 * @param obj The label object
48 * @param label The label will be used on the label object
49 * @deprecated See elm_object_text_set()
51 EINA_DEPRECATED EAPI void elm_label_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1);
54 * @brief Get the label used on the label object
56 * @param obj The label object
57 * @return The string inside the label
58 * @deprecated See elm_object_text_get()
60 EINA_DEPRECATED EAPI const char *elm_label_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
63 * @brief Set the wrapping behavior of the label
65 * @param obj The label object
66 * @param wrap To wrap text or not
68 * By default no wrapping is done. Possible values for @p wrap are:
69 * @li ELM_WRAP_NONE - No wrapping
70 * @li ELM_WRAP_CHAR - wrap between characters
71 * @li ELM_WRAP_WORD - wrap between words
72 * @li ELM_WRAP_MIXED - Word wrap, and if that fails, char wrap
74 EAPI void elm_label_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap) EINA_ARG_NONNULL(1);
77 * @brief Get the wrapping behavior of the label
79 * @param obj The label object
82 * @see elm_label_line_wrap_set()
84 EAPI Elm_Wrap_Type elm_label_line_wrap_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
87 * @brief Set wrap width of the label
89 * @param obj The label object
90 * @param w The wrap width in pixels at a minimum where words need to wrap
92 * This function sets the maximum width size hint of the label.
94 * @warning This is only relevant if the label is inside a container.
96 EAPI void elm_label_wrap_width_set(Evas_Object *obj, Evas_Coord w) EINA_ARG_NONNULL(1);
99 * @brief Get wrap width of the label
101 * @param obj The label object
102 * @return The wrap width in pixels at a minimum where words need to wrap
104 * @see elm_label_wrap_width_set()
106 EAPI Evas_Coord elm_label_wrap_width_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
109 * @brief Set wrap height of the label
111 * @param obj The label object
112 * @param h The wrap height in pixels at a minimum where words need to wrap
114 * This function sets the maximum height size hint of the label.
116 * @warning This is only relevant if the label is inside a container.
118 EAPI void elm_label_wrap_height_set(Evas_Object *obj, Evas_Coord h) EINA_ARG_NONNULL(1);
121 * @brief get wrap width of the label
123 * @param obj The label object
124 * @return The wrap height in pixels at a minimum where words need to wrap
126 EAPI Evas_Coord elm_label_wrap_height_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
129 * @brief Set the font size on the label object.
131 * @param obj The label object
132 * @param size font size
134 * @warning NEVER use this. It is for hyper-special cases only. use styles
135 * instead. e.g. "default", "marker", "slide_long" etc.
137 EAPI void elm_label_fontsize_set(Evas_Object *obj, int fontsize) EINA_ARG_NONNULL(1);
140 * @brief Set the text color on the label object
142 * @param obj The label object
143 * @param r Red property background color of The label object
144 * @param g Green property background color of The label object
145 * @param b Blue property background color of The label object
146 * @param a Alpha property background color of The label object
148 * @warning NEVER use this. It is for hyper-special cases only. use styles
149 * instead. e.g. "default", "marker", "slide_long" etc.
151 EAPI void elm_label_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a) EINA_ARG_NONNULL(1);
154 * @brief Set the text align on the label object
156 * @param obj The label object
157 * @param align align mode ("left", "center", "right")
159 * @warning NEVER use this. It is for hyper-special cases only. use styles
160 * instead. e.g. "default", "marker", "slide_long" etc.
162 EAPI void elm_label_text_align_set(Evas_Object *obj, const char *alignmode) EINA_ARG_NONNULL(1);
165 * @brief Set background color of the label
167 * @param obj The label object
168 * @param r Red property background color of The label object
169 * @param g Green property background color of The label object
170 * @param b Blue property background color of The label object
171 * @param a Alpha property background alpha of The label object
173 * @warning NEVER use this. It is for hyper-special cases only. use styles
174 * instead. e.g. "default", "marker", "slide_long" etc.
176 EAPI void elm_label_background_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a) EINA_ARG_NONNULL(1);
179 * @brief Set the ellipsis behavior of the label
181 * @param obj The label object
182 * @param ellipsis To ellipsis text or not
184 * If set to true and the text doesn't fit in the label an ellipsis("...")
185 * will be shown at the end of the widget.
187 * @warning This doesn't work with slide(elm_label_slide_set()) or if the
188 * choosen wrap method was ELM_WRAP_WORD.
190 EAPI void elm_label_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis) EINA_ARG_NONNULL(1);
193 * @brief Set the text slide of the label
195 * @param obj The label object
196 * @param slide To start slide or stop
198 * If set to true, the text of the label will slide/scroll through the length of
201 * @warning This only works with the themes "slide_short", "slide_long" and
204 EAPI void elm_label_slide_set(Evas_Object *obj, Eina_Bool slide) EINA_ARG_NONNULL(1);
207 * @brief Get the text slide mode of the label
209 * @param obj The label object
210 * @return slide slide mode value
212 * @see elm_label_slide_set()
214 EAPI Eina_Bool elm_label_slide_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
217 * @brief Set the slide duration(speed) of the label
219 * @param obj The label object
220 * @return The duration in seconds in moving text from slide begin position
221 * to slide end position
223 EAPI void elm_label_slide_duration_set(Evas_Object *obj, double duration) EINA_ARG_NONNULL(1);
226 * @brief Get the slide duration(speed) of the label
228 * @param obj The label object
229 * @return The duration time in moving text from slide begin position to slide end position
231 * @see elm_label_slide_duration_set()
233 EAPI double elm_label_slide_duration_get(Evas_Object *obj) EINA_ARG_NONNULL(1);