2 * Set a label of an object
4 * @param obj The Elementary object
5 * @param part The text part name to set (NULL for the default label)
6 * @param label The new text of the label
8 * @note Elementary objects may have many labels (e.g. Action Slider)
12 EAPI void elm_object_part_text_set(Evas_Object *obj, const char *part, const char *label);
14 #define elm_object_text_set(obj, label) elm_object_part_text_set((obj), NULL, (label))
17 * Get a label of an object
19 * @param obj The Elementary object
20 * @param part The text part name to get (NULL for the default label)
21 * @return text of the label or NULL for any error
23 * @note Elementary objects may have many labels (e.g. Action Slider)
27 EAPI const char *elm_object_part_text_get(const Evas_Object *obj, const char *part);
29 #define elm_object_text_get(obj) elm_object_part_text_get((obj), NULL)
32 * Set a content of an object
34 * @param obj The Elementary object
35 * @param part The content part name to set (NULL for the default content)
36 * @param content The new content of the object
38 * @note Elementary objects may have many contents
42 EAPI void elm_object_part_content_set(Evas_Object *obj, const char *part, Evas_Object *content);
44 #define elm_object_content_set(obj, content) elm_object_part_content_set((obj), NULL, (content))
47 * Get a content of an object
49 * @param obj The Elementary object
50 * @param part The content part name to get (NULL for the default content)
51 * @return content of the object or NULL for any error
53 * @note Elementary objects may have many contents
57 EAPI Evas_Object *elm_object_part_content_get(const Evas_Object *obj, const char *part);
59 #define elm_object_content_get(obj) elm_object_part_content_get((obj), NULL)
62 * Unset a content of an object
64 * @param obj The Elementary object
65 * @param part The content part name to unset (NULL for the default content)
67 * @note Elementary objects may have many contents
71 EAPI Evas_Object *elm_object_part_content_unset(Evas_Object *obj, const char *part);
73 #define elm_object_content_unset(obj) elm_object_part_content_unset((obj), NULL)
76 * Set the text to read out when in accessibility mode
78 * @param obj The object which is to be described
79 * @param txt The text that describes the widget to people with poor or no vision
83 EAPI void elm_object_access_info_set(Evas_Object *obj, const char *txt);
86 * Get a named object from the children
88 * @param obj The parent object whose children to look at
89 * @param name The name of the child to find
90 * @param recurse Set to the maximum number of levels to recurse (0 == none, 1 is only look at 1 level of children etc.)
91 * @return The found object of that name, or NULL if none is found
93 * This function searches the children (or recursively children of
94 * children and so on) of the given @p obj object looking for a child with
95 * the name of @p name. If the child is found the object is returned, or
96 * NULL is returned. You can set the name of an object with
97 * evas_object_name_set(). If the name is not unique within the child
98 * objects (or the tree is @p recurse is greater than 0) then it is
99 * undefined as to which child of that name is returned, so ensure the name
100 * is unique amongst children. If recurse is set to -1 it will recurse
105 EAPI Evas_Object *elm_object_name_find(const Evas_Object *obj, const char *name, int recurse);
108 * @defgroup Styles Styles
110 * Widgets can have different styles of look. These generic API's
111 * set styles of widgets, if they support them (and if the theme(s)
114 * @ref general_functions_example_page "This" example contemplates
115 * some of these functions.
119 * Set the style to use by a widget
121 * Sets the style name that will define the appearance of a widget. Styles
122 * vary from widget to widget and may also be defined by other themes
123 * by means of extensions and overlays.
125 * @param obj The Elementary widget to style
126 * @param style The style name to use
128 * @see elm_theme_extension_add()
129 * @see elm_theme_extension_del()
130 * @see elm_theme_overlay_add()
131 * @see elm_theme_overlay_del()
135 EAPI void elm_object_style_set(Evas_Object *obj, const char *style);
138 * Get the style used by the widget
140 * This gets the style being used for that widget. Note that the string
141 * pointer is only valid as long as the object is valid and the style doesn't
144 * @param obj The Elementary widget to query for its style
145 * @return The style name used
147 * @see elm_object_style_set()
151 EAPI const char *elm_object_style_get(const Evas_Object *obj);
154 * Set the disabled state of an Elementary object.
156 * @param obj The Elementary object to operate on
157 * @param disabled The state to put in in: @c EINA_TRUE for
158 * disabled, @c EINA_FALSE for enabled
160 * Elementary objects can be @b disabled, in which state they won't
161 * receive input and, in general, will be themed differently from
162 * their normal state, usually greyed out. Useful for contexts
163 * where you don't want your users to interact with some of the
164 * parts of you interface.
166 * This sets the state for the widget, either disabling it or
171 EAPI void elm_object_disabled_set(Evas_Object *obj, Eina_Bool disabled);
174 * Get the disabled state of an Elementary object.
176 * @param obj The Elementary object to operate on
177 * @return @c EINA_TRUE, if the widget is disabled, @c EINA_FALSE
178 * if it's enabled (or on errors)
180 * This gets the state of the widget, which might be enabled or disabled.
184 EAPI Eina_Bool elm_object_disabled_get(const Evas_Object *obj);
187 * @defgroup WidgetNavigation Widget Tree Navigation.
189 * These functions provide checks for if a Evas_Object is an Elementary widget,
190 * the possibility of getting a widget's parent, top level parent and getting a
191 * string representation of a widget's type.
195 * Check if the given Evas Object is an Elementary widget.
197 * @param obj the object to query.
198 * @return @c EINA_TRUE if it is an elementary widget variant,
199 * @c EINA_FALSE otherwise
200 * @ingroup WidgetNavigation
202 EAPI Eina_Bool elm_object_widget_check(const Evas_Object *obj);
205 * Get the first parent of the given object that is an Elementary
208 * @param obj the Elementary object to query parent from.
209 * @return the parent object that is an Elementary widget, or @c
210 * NULL, if it was not found.
212 * Use this to query for an object's parent widget.
214 * @note Most of Elementary users wouldn't be mixing non-Elementary
215 * smart objects in the objects tree of an application, as this is
216 * an advanced usage of Elementary with Evas. So, except for the
217 * application's window, which is the root of that tree, all other
218 * objects would have valid Elementary widget parents.
220 * @ingroup WidgetNavigation
222 EAPI Evas_Object *elm_object_parent_widget_get(const Evas_Object *obj);
225 * Get the top level parent of an Elementary widget.
227 * @param obj The object to query.
228 * @return The top level Elementary widget, or @c NULL if parent cannot be
230 * @ingroup WidgetNavigation
232 EAPI Evas_Object *elm_object_top_widget_get(const Evas_Object *obj);
235 * Get the string that represents this Elementary widget.
237 * @note Elementary is weird and exposes itself as a single
238 * Evas_Object_Smart_Class of type "elm_widget", so
239 * evas_object_type_get() always return that, making debug and
240 * language bindings hard. This function tries to mitigate this
241 * problem, but the solution is to change Elementary to use
242 * proper inheritance.
244 * @param obj the object to query.
245 * @return Elementary widget name, or @c NULL if not a valid widget.
246 * @ingroup WidgetNavigation
248 EAPI const char *elm_object_widget_type_get(const Evas_Object *obj);
251 * Send a signal to the widget edje object.
253 * This function sends a signal to the edje object of the obj. An
254 * edje program can respond to a signal by specifying matching
255 * 'signal' and 'source' fields.
257 * @param obj The object
258 * @param emission The signal's name.
259 * @param source The signal's source.
262 EAPI void elm_object_signal_emit(Evas_Object *obj, const char *emission, const char *source);
265 * Add a callback for a signal emitted by widget edje object.
267 * This function connects a callback function to a signal emitted by the
268 * edje object of the obj.
269 * Globs can occur in either the emission or source name.
271 * @param obj The object
272 * @param emission The signal's name.
273 * @param source The signal's source.
274 * @param func The callback function to be executed when the signal is
276 * @param data A pointer to data to pass in to the callback function.
279 EAPI void elm_object_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data);
282 * Remove a signal-triggered callback from a widget edje object.
284 * This function removes a callback, previously attached to a
285 * signal emitted by the edje object of the obj. The parameters
286 * emission, source and func must match exactly those passed to a
287 * previous call to elm_object_signal_callback_add(). The data
288 * pointer that was passed to this call will be returned.
290 * @param obj The object
291 * @param emission The signal's name.
292 * @param source The signal's source.
293 * @param func The callback function to be executed when the signal is
295 * @return The data pointer
298 EAPI void *elm_object_signal_callback_del(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func);
301 * Add a callback for input events (key up, key down, mouse wheel)
302 * on a given Elementary widget
304 * @param obj The widget to add an event callback on
305 * @param func The callback function to be executed when the event
307 * @param data Data to pass in to @p func
309 * Every widget in an Elementary interface set to receive focus,
310 * with elm_object_focus_allow_set(), will propagate @b all of its
311 * key up, key down and mouse wheel input events up to its parent
312 * object, and so on. All of the focusable ones in this chain which
313 * had an event callback set, with this call, will be able to treat
314 * those events. There are two ways of making the propagation of
315 * these event upwards in the tree of widgets to @b cease:
316 * - Just return @c EINA_TRUE on @p func. @c EINA_FALSE will mean
317 * the event was @b not processed, so the propagation will go on.
318 * - The @c event_info pointer passed to @p func will contain the
319 * event's structure and, if you OR its @c event_flags inner
320 * value to @c EVAS_EVENT_FLAG_ON_HOLD, you're telling Elementary
321 * one has already handled it, thus killing the event's
324 * @note Your event callback will be issued on those events taking
325 * place only if no other child widget of @p obj has consumed the
328 * @note Not to be confused with @c
329 * evas_object_event_callback_add(), which will add event callbacks
330 * per type on general Evas objects (no event propagation
331 * infrastructure taken in account).
333 * @note Not to be confused with @c
334 * elm_object_signal_callback_add(), which will add callbacks to @b
335 * signals coming from a widget's theme, not input events.
337 * @note Not to be confused with @c
338 * edje_object_signal_callback_add(), which does the same as
339 * elm_object_signal_callback_add(), but directly on an Edje
342 * @note Not to be confused with @c
343 * evas_object_smart_callback_add(), which adds callbacks to smart
344 * objects' <b>smart events</b>, and not input events.
346 * @see elm_object_event_callback_del()
350 EAPI void elm_object_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data);
353 * Remove an event callback from a widget.
355 * This function removes a callback, previously attached to event emission
357 * The parameters func and data must match exactly those passed to
358 * a previous call to elm_object_event_callback_add(). The data pointer that
359 * was passed to this call will be returned.
361 * @param obj The object
362 * @param func The callback function to be executed when the event is
364 * @param data Data to pass in to the callback function.
365 * @return The data pointer
368 EAPI void *elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data);