[multibuttenentry] merged with opensource r75453.
[framework/uifw/elementary.git] / src / lib / elm_label.h
1 /**
2  * @defgroup Label Label
3  * @ingroup Elementary
4  *
5  * @image html img/widget/label/preview-00.png
6  * @image latex img/widget/label/preview-00.eps
7  *
8  * @brief Widget to display text, with simple html-like markup.
9  *
10  * The Label widget @b doesn't allow text to overflow its boundaries, if the
11  * text doesn't fit the geometry of the label it will be ellipsized or be
12  * cut. Elementary provides several styles for this widget:
13  * @li default - No animation
14  * @li marker - Centers the text in the label and makes it bold by default
15  * @li slide_long - The entire text appears from the right of the screen and
16  * slides until it disappears in the left of the screen(reappearing on the
17  * right again).
18  * @li slide_short - The text appears in the left of the label and slides to
19  * the right to show the overflow. When all of the text has been shown the
20  * position is reset.
21  * @li slide_bounce - The text appears in the left of the label and slides to
22  * the right to show the overflow. When all of the text has been shown the
23  * animation reverses, moving the text to the left.
24  *
25  * Custom themes can of course invent new markup tags and style them any way
26  * they like.
27  *
28  * The following signals may be emitted by the label widget:
29  * @li "language,changed": The program's language changed.
30  *
31  * See @ref tutorial_label for a demonstration of how to use a label widget.
32  * @{
33  */
34
35 /**
36  * @brief Add a new label to the parent
37  *
38  * @param parent The parent object
39  * @return The new object or NULL if it cannot be created
40  *
41  * @ingroup Label
42  */
43 EAPI Evas_Object                *elm_label_add(Evas_Object *parent);
44
45 /**
46  * @brief Set the wrapping behavior of the label
47  *
48  * @param obj The label object
49  * @param wrap To wrap text or not
50  *
51  * By default no wrapping is done. Possible values for @p wrap are:
52  * @li ELM_WRAP_NONE - No wrapping
53  * @li ELM_WRAP_CHAR - wrap between characters
54  * @li ELM_WRAP_WORD - wrap between words
55  * @li ELM_WRAP_MIXED - Word wrap, and if that fails, char wrap
56  *
57  * @ingroup Label
58  */
59 EAPI void                        elm_label_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap);
60
61 /**
62  * @brief Get the wrapping behavior of the label
63  *
64  * @param obj The label object
65  * @return Wrap type
66  *
67  * @see elm_label_line_wrap_set()
68  *
69  * @ingroup Label
70  */
71 EAPI Elm_Wrap_Type               elm_label_line_wrap_get(const Evas_Object *obj);
72
73 /**
74  * @brief Set wrap width of the label
75  *
76  * @param obj The label object
77  * @param w The wrap width in pixels at a minimum where words need to wrap
78  *
79  * This function sets the maximum width size hint of the label.
80  *
81  * @warning This is only relevant if the label is inside a container.
82  *
83  * @ingroup Label
84  */
85 EAPI void                        elm_label_wrap_width_set(Evas_Object *obj, Evas_Coord w);
86
87 /**
88  * @brief Get wrap width of the label
89  *
90  * @param obj The label object
91  * @return The wrap width in pixels at a minimum where words need to wrap
92  *
93  * @see elm_label_wrap_width_set()
94  *
95  * @ingroup Label
96  */
97 EAPI Evas_Coord                  elm_label_wrap_width_get(const Evas_Object *obj);
98
99 /**
100  * @brief Set the ellipsis behavior of the label
101  *
102  * @param obj The label object
103  * @param ellipsis To ellipsis text or not
104  *
105  * If set to true and the text doesn't fit in the label an ellipsis("...")
106  * will be shown at the end of the widget.
107  *
108  * @warning This doesn't work with slide(elm_label_slide_set()) or if the
109  * chosen wrap method was ELM_WRAP_WORD.
110  *
111  * @ingroup Label
112  */
113 EAPI void                        elm_label_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis);
114
115 /**
116  * @brief Get the ellipsis behavior of the label
117  *
118  * @param obj The label object
119  * @return If true, an ellipsis will be shown at the end of the label area.
120  *
121  * @see elm_label_ellipsis_set()
122  *
123  * @ingroup Label
124  */
125 EAPI Eina_Bool                   elm_label_ellipsis_get(const Evas_Object *obj);
126
127 /**
128  * @brief Set sliding effect of label widget.
129  *
130  * @param obj The label object
131  * @param slide If true, sliding effect will be shown
132  *
133  * If set to true, the text of the label will slide/scroll through the length of
134  * label.
135  *
136  * @warning This only works with the themes "slide_short", "slide_long" and
137  * "slide_bounce".
138  *
139  * @ingroup Label
140  */
141 EAPI void                        elm_label_slide_set(Evas_Object *obj, Eina_Bool slide);
142
143 /**
144  * @brief Get whether sliding effect is shown or not.
145  *
146  * @param obj The label object
147  * @return If true, sliding effect is shown.
148  *
149  * @see elm_label_slide_set()
150  *
151  * @ingroup Label
152  */
153 EAPI Eina_Bool                   elm_label_slide_get(const Evas_Object *obj);
154
155 /**
156  * @brief Set the slide duration(speed) of the label
157  *
158  * @param obj The label object
159  * @param duration The duration in seconds in moving text from slide begin position
160  * to slide end position
161  *
162  * @ingroup Label
163  */
164 EAPI void                        elm_label_slide_duration_set(Evas_Object *obj, double duration);
165
166 /**
167  * @brief Get the slide duration(speed) of the label
168  *
169  * @param obj The label object
170  * @return The duration time in moving text from slide begin position to slide end position
171  *
172  * @see elm_label_slide_duration_set()
173  *
174  * @ingroup Label
175  */
176 EAPI double                      elm_label_slide_duration_get(const Evas_Object *obj);
177
178 /**
179  * @}
180  */