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 * This sets a new object to a widget as a content object. If any object was
39 * already set as a content object in the same part, previous object will be
40 * deleted automatically.
42 * @note Elementary objects may have many contents
46 EAPI void elm_object_part_content_set(Evas_Object *obj, const char *part, Evas_Object *content);
48 #define elm_object_content_set(obj, content) elm_object_part_content_set((obj), NULL, (content))
51 * Get a content of an object
53 * @param obj The Elementary object
54 * @param part The content part name to get (NULL for the default content)
55 * @return content of the object or NULL for any error
57 * @note Elementary objects may have many contents
61 EAPI Evas_Object *elm_object_part_content_get(const Evas_Object *obj, const char *part);
63 #define elm_object_content_get(obj) elm_object_part_content_get((obj), NULL)
66 * Unset a content of an object
68 * @param obj The Elementary object
69 * @param part The content part name to unset (NULL for the default content)
71 * @note Elementary objects may have many contents
75 EAPI Evas_Object *elm_object_part_content_unset(Evas_Object *obj, const char *part);
77 #define elm_object_content_unset(obj) elm_object_part_content_unset((obj), NULL)
80 * Set the text to read out when in accessibility mode
82 * @param obj The object which is to be described
83 * @param txt The text that describes the widget to people with poor or no vision
87 EAPI void elm_object_access_info_set(Evas_Object *obj, const char *txt);
90 * Get a named object from the children
92 * @param obj The parent object whose children to look at
93 * @param name The name of the child to find
94 * @param recurse Set to the maximum number of levels to recurse (0 == none, 1 is only look at 1 level of children etc.)
95 * @return The found object of that name, or NULL if none is found
97 * This function searches the children (or recursively children of
98 * children and so on) of the given @p obj object looking for a child with
99 * the name of @p name. If the child is found the object is returned, or
100 * NULL is returned. You can set the name of an object with
101 * evas_object_name_set(). If the name is not unique within the child
102 * objects (or the tree is @p recurse is greater than 0) then it is
103 * undefined as to which child of that name is returned, so ensure the name
104 * is unique amongst children. If recurse is set to -1 it will recurse
109 EAPI Evas_Object *elm_object_name_find(const Evas_Object *obj, const char *name, int recurse);
112 * @defgroup Styles Styles
114 * Widgets can have different styles of look. These generic API's
115 * set styles of widgets, if they support them (and if the theme(s)
118 * @ref general_functions_example_page "This" example contemplates
119 * some of these functions.
123 * Set the style to used by a given widget
125 * @param obj The Elementary widget to style
126 * @param style The name of the style to use on it
127 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
129 * This sets the style (by name) that will define the appearance of a
130 * widget. Styles vary from widget to widget and may also be defined
131 * by other themes by means of extensions and overlays.
133 * @see elm_theme_extension_add()
134 * @see elm_theme_extension_del()
135 * @see elm_theme_overlay_add()
136 * @see elm_theme_overlay_del()
140 EAPI Eina_Bool elm_object_style_set(Evas_Object *obj, const char *style);
143 * Get the style used by the widget
145 * This gets the style being used for that widget. Note that the string
146 * pointer is only valid as long as the object is valid and the style doesn't
149 * @param obj The Elementary widget to query for its style
150 * @return The style name used
152 * @see elm_object_style_set()
156 EAPI const char *elm_object_style_get(const Evas_Object *obj);
159 * Set the disabled state of an Elementary object.
161 * @param obj The Elementary object to operate on
162 * @param disabled The state to put in in: @c EINA_TRUE for
163 * disabled, @c EINA_FALSE for enabled
165 * Elementary objects can be @b disabled, in which state they won't
166 * receive input and, in general, will be themed differently from
167 * their normal state, usually greyed out. Useful for contexts
168 * where you don't want your users to interact with some of the
169 * parts of you interface.
171 * This sets the state for the widget, either disabling it or
176 EAPI void elm_object_disabled_set(Evas_Object *obj, Eina_Bool disabled);
179 * Get the disabled state of an Elementary object.
181 * @param obj The Elementary object to operate on
182 * @return @c EINA_TRUE, if the widget is disabled, @c EINA_FALSE
183 * if it's enabled (or on errors)
185 * This gets the state of the widget, which might be enabled or disabled.
189 EAPI Eina_Bool elm_object_disabled_get(const Evas_Object *obj);
192 * @defgroup WidgetNavigation Widget Tree Navigation
194 * These functions provide checks for if a Evas_Object is an Elementary widget,
195 * the possibility of getting a widget's parent, top level parent and getting a
196 * string representation of a widget's type.
200 * Check if the given Evas Object is an Elementary widget.
202 * @param obj the object to query.
203 * @return @c EINA_TRUE if it is an elementary widget variant,
204 * @c EINA_FALSE otherwise
205 * @ingroup WidgetNavigation
207 EAPI Eina_Bool elm_object_widget_check(const Evas_Object *obj);
210 * Get the first parent of the given object that is an Elementary
213 * @param obj the Elementary object to query parent from.
214 * @return the parent object that is an Elementary widget, or @c
215 * NULL, if it was not found.
217 * Use this to query for an object's parent widget.
219 * @note Most of Elementary users wouldn't be mixing non-Elementary
220 * smart objects in the objects tree of an application, as this is
221 * an advanced usage of Elementary with Evas. So, except for the
222 * application's window, which is the root of that tree, all other
223 * objects would have valid Elementary widget parents.
225 * @ingroup WidgetNavigation
227 EAPI Evas_Object *elm_object_parent_widget_get(const Evas_Object *obj);
230 * Get the top level parent of an Elementary widget.
232 * @param obj The object to query.
233 * @return The top level Elementary widget, or @c NULL if parent cannot be
235 * @ingroup WidgetNavigation
237 EAPI Evas_Object *elm_object_top_widget_get(const Evas_Object *obj);
240 * Get the string that represents this Elementary widget.
242 * @note Elementary is weird and exposes itself as a single
243 * Evas_Object_Smart_Class of type "elm_widget", so
244 * evas_object_type_get() always return that, making debug and
245 * language bindings hard. This function tries to mitigate this
246 * problem, but the solution is to change Elementary to use
247 * proper inheritance.
249 * @param obj the object to query.
250 * @return Elementary widget name, or @c NULL if not a valid widget.
251 * @ingroup WidgetNavigation
253 EAPI const char *elm_object_widget_type_get(const Evas_Object *obj);
256 * Send a signal to the widget edje object.
258 * This function sends a signal to the edje object of the obj. An
259 * edje program can respond to a signal by specifying matching
260 * 'signal' and 'source' fields.
262 * @param obj The object
263 * @param emission The signal's name.
264 * @param source The signal's source.
267 EAPI void elm_object_signal_emit(Evas_Object *obj, const char *emission, const char *source);
270 * Add a callback for a signal emitted by widget edje object.
272 * This function connects a callback function to a signal emitted by the
273 * edje object of the obj.
274 * Globs can occur in either the emission or source name.
276 * @param obj The object
277 * @param emission The signal's name.
278 * @param source The signal's source.
279 * @param func The callback function to be executed when the signal is
281 * @param data A pointer to data to pass in to the callback function.
284 EAPI void elm_object_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data);
287 * Remove a signal-triggered callback from a widget edje object.
289 * @param obj The object handle
290 * @param emission The signal's name.
291 * @param source The signal's source.
292 * @param func The callback function to be executed when the signal is
294 * @return The data pointer of the signal callback or @c NULL, on
297 * This function removes the @b last callback, previously attached to
298 * a signal emitted by an undelying Edje object of @a obj, whose
299 * parameters @a emission, @a source and @c func match exactly with
300 * those passed to a previous call to
301 * elm_object_signal_callback_add(). The data pointer that was passed
302 * to this call will be returned.
306 EAPI void *elm_object_signal_callback_del(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func);
309 * Add a callback for input events (key up, key down, mouse wheel)
310 * on a given Elementary widget
312 * @param obj The widget to add an event callback on
313 * @param func The callback function to be executed when the event
315 * @param data Data to pass in to @p func
317 * Every widget in an Elementary interface set to receive focus,
318 * with elm_object_focus_allow_set(), will propagate @b all of its
319 * key up, key down and mouse wheel input events up to its parent
320 * object, and so on. All of the focusable ones in this chain which
321 * had an event callback set, with this call, will be able to treat
322 * those events. There are two ways of making the propagation of
323 * these event upwards in the tree of widgets to @b cease:
324 * - Just return @c EINA_TRUE on @p func. @c EINA_FALSE will mean
325 * the event was @b not processed, so the propagation will go on.
326 * - The @c event_info pointer passed to @p func will contain the
327 * event's structure and, if you OR its @c event_flags inner
328 * value to @c EVAS_EVENT_FLAG_ON_HOLD, you're telling Elementary
329 * one has already handled it, thus killing the event's
332 * @note Your event callback will be issued on those events taking
333 * place only if no other child widget of @p obj has consumed the
336 * @note Not to be confused with @c
337 * evas_object_event_callback_add(), which will add event callbacks
338 * per type on general Evas objects (no event propagation
339 * infrastructure taken in account).
341 * @note Not to be confused with @c
342 * elm_object_signal_callback_add(), which will add callbacks to @b
343 * signals coming from a widget's theme, not input events.
345 * @note Not to be confused with @c
346 * edje_object_signal_callback_add(), which does the same as
347 * elm_object_signal_callback_add(), but directly on an Edje
350 * @note Not to be confused with @c
351 * evas_object_smart_callback_add(), which adds callbacks to smart
352 * objects' <b>smart events</b>, and not input events.
354 * @see elm_object_event_callback_del()
358 EAPI void elm_object_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data);
361 * Remove an event callback from a widget.
363 * This function removes a callback, previously attached to event emission
365 * The parameters func and data must match exactly those passed to
366 * a previous call to elm_object_event_callback_add(). The data pointer that
367 * was passed to this call will be returned.
369 * @param obj The object
370 * @param func The callback function to be executed when the event is
372 * @param data Data to pass in to the callback function.
373 * @return The data pointer
376 EAPI void *elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data);