2 * Set a text of an object
4 * @param obj The Elementary object
5 * @param part The text part name to set (NULL for the default part)
6 * @param text The new text of the part
8 * @note Elementary objects may have many text parts (e.g. Action Slider)
12 EAPI void elm_object_part_text_set(Evas_Object *obj, const char *part, const char *text);
14 #define elm_object_text_set(obj, text) elm_object_part_text_set((obj), NULL, (text))
17 * Get a text of an object
19 * @param obj The Elementary object
20 * @param part The text part name to get (NULL for the default part)
21 * @return text of the part or NULL for any error
23 * @note Elementary objects may have many text parts (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 the content on part of a given container widget
34 * @param obj The Elementary container widget
35 * @param part The container's part name to set (some might accept
36 * @c NULL for the default part)
37 * @param content The new content for that part
39 * All widgets deriving from the @ref elm-container-class may hold
40 * child objects as content at given parts. This sets new content to
41 * a given part. If any object was already set as a content object in
42 * the same part, the previous object will be deleted automatically
43 * with this call. If you wish to preserve it, issue
44 * elm_object_part_content_unset() on it first.
46 * @see elm_object_part_content_set()
50 EAPI void elm_object_part_content_set(Evas_Object *obj, const char *part, Evas_Object *content);
52 #define elm_object_content_set(obj, content) elm_object_part_content_set((obj), NULL, (content))
55 * Get the content on a part of a given container widget
57 * @param obj The Elementary container widget
58 * @param part The container's part name to get (some might accept
59 * @c NULL for the default part)
60 * @return content of the object at the given part or @c NULL, on
63 * @see elm_object_part_content_set() for more details
67 EAPI Evas_Object *elm_object_part_content_get(const Evas_Object *obj, const char *part);
69 #define elm_object_content_get(obj) elm_object_part_content_get((obj), NULL)
72 * Unset the content on a part of a given container widget
74 * @param obj The Elementary container widget
75 * @param part The container's part name to unset (some might accept
76 * @c NULL for the default part)
77 * @return content of the object at the given part or @c NULL, on
80 * @see elm_object_part_content_set() for more details
84 EAPI Evas_Object *elm_object_part_content_unset(Evas_Object *obj, const char *part);
86 #define elm_object_content_unset(obj) elm_object_part_content_unset((obj), NULL)
89 * Set the text to read out when in accessibility mode
91 * @param obj The object which is to be described
92 * @param txt The text that describes the widget to people with poor or no vision
96 EAPI void elm_object_access_info_set(Evas_Object *obj, const char *txt);
99 * Get a named object from the children
101 * @param obj The parent object whose children to look at
102 * @param name The name of the child to find
103 * @param recurse Set to the maximum number of levels to recurse (0 == none, 1 is only look at 1 level of children etc.)
104 * @return The found object of that name, or NULL if none is found
106 * This function searches the children (or recursively children of
107 * children and so on) of the given @p obj object looking for a child with
108 * the name of @p name. If the child is found the object is returned, or
109 * NULL is returned. You can set the name of an object with
110 * evas_object_name_set(). If the name is not unique within the child
111 * objects (or the tree is @p recurse is greater than 0) then it is
112 * undefined as to which child of that name is returned, so ensure the name
113 * is unique amongst children. If recurse is set to -1 it will recurse
118 EAPI Evas_Object *elm_object_name_find(const Evas_Object *obj, const char *name, int recurse);
121 * @defgroup Styles Styles
123 * Widgets can have different styles of look. These generic API's
124 * set styles of widgets, if they support them (and if the theme(s)
127 * @ref general_functions_example_page "This" example contemplates
128 * some of these functions.
132 * Set the style to used by a given widget
134 * @param obj The Elementary widget to style
135 * @param style The name of the style to use on it
136 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
138 * This sets the style (by name) that will define the appearance of a
139 * widget. Styles vary from widget to widget and may also be defined
140 * by other themes by means of extensions and overlays.
142 * @see elm_theme_extension_add()
143 * @see elm_theme_extension_del()
144 * @see elm_theme_overlay_add()
145 * @see elm_theme_overlay_del()
149 EAPI Eina_Bool elm_object_style_set(Evas_Object *obj, const char *style);
152 * Get the style used by the widget
154 * This gets the style being used for that widget. Note that the string
155 * pointer is only valid as long as the object is valid and the style doesn't
158 * @param obj The Elementary widget to query for its style
159 * @return The style name used
161 * @see elm_object_style_set()
165 EAPI const char *elm_object_style_get(const Evas_Object *obj);
168 * Set the disabled state of an Elementary object.
170 * @param obj The Elementary object to operate on
171 * @param disabled The state to put in in: @c EINA_TRUE for
172 * disabled, @c EINA_FALSE for enabled
174 * Elementary objects can be @b disabled, in which state they won't
175 * receive input and, in general, will be themed differently from
176 * their normal state, usually greyed out. Useful for contexts
177 * where you don't want your users to interact with some of the
178 * parts of you interface.
180 * This sets the state for the widget, either disabling it or
185 EAPI void elm_object_disabled_set(Evas_Object *obj, Eina_Bool disabled);
188 * Get the disabled state of an Elementary object.
190 * @param obj The Elementary object to operate on
191 * @return @c EINA_TRUE, if the widget is disabled, @c EINA_FALSE
192 * if it's enabled (or on errors)
194 * This gets the state of the widget, which might be enabled or disabled.
198 EAPI Eina_Bool elm_object_disabled_get(const Evas_Object *obj);
201 * @defgroup WidgetNavigation Widget Tree Navigation
203 * These functions provide checks for if a Evas_Object is an Elementary widget,
204 * the possibility of getting a widget's parent, top level parent and getting a
205 * string representation of a widget's type.
209 * Check if the given Evas Object is an Elementary widget.
211 * @param obj the object to query.
212 * @return @c EINA_TRUE if it is an elementary widget variant,
213 * @c EINA_FALSE otherwise
214 * @ingroup WidgetNavigation
216 EAPI Eina_Bool elm_object_widget_check(const Evas_Object *obj);
219 * Get the first parent of the given object that is an Elementary
222 * @param obj the Elementary object to query parent from.
223 * @return the parent object that is an Elementary widget, or @c
224 * NULL, if it was not found.
226 * Use this to query for an object's parent widget.
228 * @note Most of Elementary users wouldn't be mixing non-Elementary
229 * smart objects in the objects tree of an application, as this is
230 * an advanced usage of Elementary with Evas. So, except for the
231 * application's window, which is the root of that tree, all other
232 * objects would have valid Elementary widget parents.
234 * @ingroup WidgetNavigation
236 EAPI Evas_Object *elm_object_parent_widget_get(const Evas_Object *obj);
239 * Get the top level parent of an Elementary widget.
241 * @param obj The object to query.
242 * @return The top level Elementary widget, or @c NULL if parent cannot be
244 * @ingroup WidgetNavigation
246 EAPI Evas_Object *elm_object_top_widget_get(const Evas_Object *obj);
249 * Get the string that represents this Elementary widget.
251 * @note Elementary is weird and exposes itself as a single
252 * Evas_Object_Smart_Class of type "elm_widget", so
253 * evas_object_type_get() always return that, making debug and
254 * language bindings hard. This function tries to mitigate this
255 * problem, but the solution is to change Elementary to use
256 * proper inheritance.
258 * @param obj the object to query.
259 * @return Elementary widget name, or @c NULL if not a valid widget.
260 * @ingroup WidgetNavigation
262 EAPI const char *elm_object_widget_type_get(const Evas_Object *obj);
265 * Send a signal to the widget edje object.
267 * This function sends a signal to the edje object of the obj. An
268 * edje program can respond to a signal by specifying matching
269 * 'signal' and 'source' fields.
271 * @param obj The object
272 * @param emission The signal's name.
273 * @param source The signal's source.
276 EAPI void elm_object_signal_emit(Evas_Object *obj, const char *emission, const char *source);
279 * Add a callback for a signal emitted by widget edje object.
281 * This function connects a callback function to a signal emitted by the
282 * edje object of the obj.
283 * Globs can occur in either the emission or source name.
285 * @param obj The object
286 * @param emission The signal's name.
287 * @param source The signal's source.
288 * @param func The callback function to be executed when the signal is
290 * @param data A pointer to data to pass in to the callback function.
293 EAPI void elm_object_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data);
296 * Remove a signal-triggered callback from a widget edje object.
298 * @param obj The object handle
299 * @param emission The signal's name.
300 * @param source The signal's source.
301 * @param func The callback function to be executed when the signal is
303 * @return The data pointer of the signal callback or @c NULL, on
306 * This function removes the @b last callback, previously attached to
307 * a signal emitted by an undelying Edje object of @a obj, whose
308 * parameters @a emission, @a source and @c func match exactly with
309 * those passed to a previous call to
310 * elm_object_signal_callback_add(). The data pointer that was passed
311 * to this call will be returned.
315 EAPI void *elm_object_signal_callback_del(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func);
318 * Add a callback for input events (key up, key down, mouse wheel)
319 * on a given Elementary widget
321 * @param obj The widget to add an event callback on
322 * @param func The callback function to be executed when the event
324 * @param data Data to pass in to @p func
326 * Every widget in an Elementary interface set to receive focus,
327 * with elm_object_focus_allow_set(), will propagate @b all of its
328 * key up, key down and mouse wheel input events up to its parent
329 * object, and so on. All of the focusable ones in this chain which
330 * had an event callback set, with this call, will be able to treat
331 * those events. There are two ways of making the propagation of
332 * these event upwards in the tree of widgets to @b cease:
333 * - Just return @c EINA_TRUE on @p func. @c EINA_FALSE will mean
334 * the event was @b not processed, so the propagation will go on.
335 * - The @c event_info pointer passed to @p func will contain the
336 * event's structure and, if you OR its @c event_flags inner
337 * value to @c EVAS_EVENT_FLAG_ON_HOLD, you're telling Elementary
338 * one has already handled it, thus killing the event's
341 * @note Your event callback will be issued on those events taking
342 * place only if no other child widget of @p obj has consumed the
345 * @note Not to be confused with @c
346 * evas_object_event_callback_add(), which will add event callbacks
347 * per type on general Evas objects (no event propagation
348 * infrastructure taken in account).
350 * @note Not to be confused with @c
351 * elm_object_signal_callback_add(), which will add callbacks to @b
352 * signals coming from a widget's theme, not input events.
354 * @note Not to be confused with @c
355 * edje_object_signal_callback_add(), which does the same as
356 * elm_object_signal_callback_add(), but directly on an Edje
359 * @note Not to be confused with @c
360 * evas_object_smart_callback_add(), which adds callbacks to smart
361 * objects' <b>smart events</b>, and not input events.
363 * @see elm_object_event_callback_del()
367 EAPI void elm_object_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data);
370 * Remove an event callback from a widget.
372 * This function removes a callback, previously attached to event emission
374 * The parameters func and data must match exactly those passed to
375 * a previous call to elm_object_event_callback_add(). The data pointer that
376 * was passed to this call will be returned.
378 * @param obj The object
379 * @param func The callback function to be executed when the event is
381 * @param data Data to pass in to the callback function.
382 * @return The data pointer
385 EAPI void *elm_object_event_callback_del(Evas_Object *obj, Elm_Event_Cb func, const void *data);
388 * Disable the orientation mode of a given widget.
390 * Orientation Mode is used for widgets to change it's styles or to send signals
391 * whenever it's window degree is changed. If the orientation mode is enabled
392 * and the widget has different looks and styles for the window degree(0, 90,
393 * 180, 270), it will apply a style that is readied for the current degree,
394 * otherwise, it will send signals to it's own edje to change it's states if
395 * the style doesn't be readied.
397 * @param obj The Elementary object to operate on orientation mode.
398 * @param disabled The state to put in in: @c EINA_TRUE for disabled,
399 * @c EINA_FALSE for enabled.
405 EAPI void elm_object_orientation_mode_disabled_set(Evas_Object *obj, Eina_Bool disabled);
408 * Get the orientation mode of a given widget.
410 * @param obj The Elementary widget to query for its orientation mode.
411 * @return @c EINA_TRUE, if the orientation mode is disabled, @c EINA_FALSE
412 * if the orientation mode is enabled (or on errors)
413 * @see elm_object_orientation_mode_disabled_set()
419 EAPI Eina_Bool elm_object_orientation_mode_disabled_get(const Evas_Object *obj);