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 * How to check if an Evas Object is an Elementary widget? How to
190 * get the first elementary widget that is parent of the given
191 * object? These are all covered in widget tree navigation.
193 * @ref general_functions_example_page "This" example contemplates
194 * some of these functions.
198 * Check if the given Evas Object is an Elementary widget.
200 * @param obj the object to query.
201 * @return @c EINA_TRUE if it is an elementary widget variant,
202 * @c EINA_FALSE otherwise
203 * @ingroup WidgetNavigation
205 EAPI Eina_Bool elm_object_widget_check(const Evas_Object *obj);
208 * Get the first parent of the given object that is an Elementary
211 * @param obj the Elementary object to query parent from.
212 * @return the parent object that is an Elementary widget, or @c
213 * NULL, if it was not found.
215 * Use this to query for an object's parent widget.
217 * @note Most of Elementary users wouldn't be mixing non-Elementary
218 * smart objects in the objects tree of an application, as this is
219 * an advanced usage of Elementary with Evas. So, except for the
220 * application's window, which is the root of that tree, all other
221 * objects would have valid Elementary widget parents.
223 * @ingroup WidgetNavigation
225 EAPI Evas_Object *elm_object_parent_widget_get(const Evas_Object *obj);
228 * Get the top level parent of an Elementary widget.
230 * @param obj The object to query.
231 * @return The top level Elementary widget, or @c NULL if parent cannot be
233 * @ingroup WidgetNavigation
235 EAPI Evas_Object *elm_object_top_widget_get(const Evas_Object *obj);
238 * Get the string that represents this Elementary widget.
240 * @note Elementary is weird and exposes itself as a single
241 * Evas_Object_Smart_Class of type "elm_widget", so
242 * evas_object_type_get() always return that, making debug and
243 * language bindings hard. This function tries to mitigate this
244 * problem, but the solution is to change Elementary to use
245 * proper inheritance.
247 * @param obj the object to query.
248 * @return Elementary widget name, or @c NULL if not a valid widget.
249 * @ingroup WidgetNavigation
251 EAPI const char *elm_object_widget_type_get(const Evas_Object *obj);
254 * Send a signal to the widget edje object.
256 * This function sends a signal to the edje object of the obj. An
257 * edje program can respond to a signal by specifying matching
258 * 'signal' and 'source' fields.
260 * @param obj The object
261 * @param emission The signal's name.
262 * @param source The signal's source.
265 EAPI void elm_object_signal_emit(Evas_Object *obj, const char *emission, const char *source);
268 * Add a callback for a signal emitted by widget edje object.
270 * This function connects a callback function to a signal emitted by the
271 * edje object of the obj.
272 * Globs can occur in either the emission or source name.
274 * @param obj The object
275 * @param emission The signal's name.
276 * @param source The signal's source.
277 * @param func The callback function to be executed when the signal is
279 * @param data A pointer to data to pass in to the callback function.
282 EAPI void elm_object_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data);
285 * Remove a signal-triggered callback from a widget edje object.
287 * This function removes a callback, previously attached to a
288 * signal emitted by the edje object of the obj. The parameters
289 * emission, source and func must match exactly those passed to a
290 * previous call to elm_object_signal_callback_add(). The data
291 * pointer that was passed to this call will be returned.
293 * @param obj The object
294 * @param emission The signal's name.
295 * @param source The signal's source.
296 * @param func The callback function to be executed when the signal is
298 * @return The data pointer
301 EAPI void *elm_object_signal_callback_del(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func);
304 * Add a callback for input events (key up, key down, mouse wheel)
305 * on a given Elementary widget
307 * @param obj The widget to add an event callback on
308 * @param func The callback function to be executed when the event
310 * @param data Data to pass in to @p func
312 * Every widget in an Elementary interface set to receive focus,
313 * with elm_object_focus_allow_set(), will propagate @b all of its
314 * key up, key down and mouse wheel input events up to its parent
315 * object, and so on. All of the focusable ones in this chain which
316 * had an event callback set, with this call, will be able to treat
317 * those events. There are two ways of making the propagation of
318 * these event upwards in the tree of widgets to @b cease:
319 * - Just return @c EINA_TRUE on @p func. @c EINA_FALSE will mean
320 * the event was @b not processed, so the propagation will go on.
321 * - The @c event_info pointer passed to @p func will contain the
322 * event's structure and, if you OR its @c event_flags inner
323 * value to @c EVAS_EVENT_FLAG_ON_HOLD, you're telling Elementary
324 * one has already handled it, thus killing the event's
327 * @note Your event callback will be issued on those events taking
328 * place only if no other child widget of @p obj has consumed the
331 * @note Not to be confused with @c
332 * evas_object_event_callback_add(), which will add event callbacks
333 * per type on general Evas objects (no event propagation
334 * infrastructure taken in account).
336 * @note Not to be confused with @c
337 * elm_object_signal_callback_add(), which will add callbacks to @b
338 * signals coming from a widget's theme, not input events.
340 * @note Not to be confused with @c
341 * edje_object_signal_callback_add(), which does the same as
342 * elm_object_signal_callback_add(), but directly on an Edje
345 * @note Not to be confused with @c
346 * evas_object_smart_callback_add(), which adds callbacks to smart
347 * objects' <b>smart events</b>, and not input events.
349 * @see elm_object_event_callback_del()
353 EAPI void elm_object_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data);
356 * Remove an event callback from a widget.
358 * This function removes a callback, previously attached to event emission
360 * The parameters func and data must match exactly those passed to
361 * a previous call to elm_object_event_callback_add(). The data pointer that
362 * was passed to this call will be returned.
364 * @param obj The object
365 * @param func The callback function to be executed when the event is
367 * @param data Data to pass in to the callback function.
368 * @return The data pointer
371 EAPI void *elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data);