2 * @defgroup Radio Radio
5 * @image html radio_inheritance_tree.png
6 * @image latex radio_inheritance_tree.eps
8 * @image html img/widget/radio/preview-00.png
9 * @image latex img/widget/radio/preview-00.eps
11 * @brief Radio is a widget that allows for 1 or more options to be displayed
12 * and have the user choose only 1 of them.
14 * A radio object contains an indicator, an optional Label and an optional
15 * icon object. While it's possible to have a group of only one radio they,
16 * are normally used in groups of 2 or more.
18 * elm_radio objects are grouped in a slightly different, compared to other
19 * UI toolkits. There is no seperate group name/id to remember or manage.
20 * The members represent the group, there are the group. To make a group,
21 * use elm_radio_group_add() and pass existing radio object and the new radio
24 * The radio object(s) will select from one of a set
25 * of integer values, so any value they are configuring needs to be mapped to
26 * a set of integers. To configure what value that radio object represents,
27 * use elm_radio_state_value_set() to set the integer it represents. To set
28 * the value the whole group(which one is currently selected) is to indicate
29 * use elm_radio_value_set() on any group member, and to get the groups value
30 * use elm_radio_value_get(). For convenience the radio objects are also able
31 * to directly set an integer(int) to the value that is selected. To specify
32 * the pointer to this integer to modify, use elm_radio_value_pointer_set().
33 * The radio objects will modify this directly. That implies the pointer must
34 * point to valid memory for as long as the radio objects exist.
36 * This widget inherits from the @ref Layout one, so that all the
37 * functions acting on it also work for radio objects.
39 * This widget emits the following signals, besides the ones sent from
41 * @li changed - This is called whenever the user changes the state of one of
42 * the radio objects within the group of radio objects that work together.
44 * Default text parts of the radio widget that you can use for are:
45 * @li "default" - Label of the radio
47 * Default content parts of the radio widget that you can use for are:
48 * @li "icon" - An icon of the radio
50 * Supported elm_object common APIs.
51 * @li @ref elm_object_part_text_set
52 * @li @ref elm_object_part_text_get
53 * @li @ref elm_object_part_content_set
54 * @li @ref elm_object_part_content_get
55 * @li @ref elm_object_part_content_unset
56 * @li @ref elm_object_disabled_set
57 * @li @ref elm_object_disabled_get
59 * @ref tutorial_radio show most of this API in action.
64 * @brief Add a new radio to the parent
66 * @param parent The parent object
67 * @return The new object or NULL if it cannot be created
71 EAPI Evas_Object *elm_radio_add(Evas_Object *parent);
74 * @brief Add this radio to a group of other radio objects
76 * @param obj The radio object
77 * @param group Any object whose group the @p obj is to join.
79 * Radio objects work in groups. Each member should have a different integer
80 * value assigned. In order to have them work as a group, they need to know
81 * about each other. This adds the given radio object to the group of which
82 * the group object indicated is a member.
86 EAPI void elm_radio_group_add(Evas_Object *obj, Evas_Object *group);
89 * @brief Set the integer value that this radio object represents
91 * @param obj The radio object
92 * @param value The value to use if this radio object is selected
94 * This sets the value of the radio.
98 EAPI void elm_radio_state_value_set(Evas_Object *obj, int value);
101 * @brief Get the integer value that this radio object represents
103 * @param obj The radio object
104 * @return The value used if this radio object is selected
106 * This gets the value of the radio.
107 * @see elm_radio_value_set()
111 EAPI int elm_radio_state_value_get(const Evas_Object *obj);
114 * @brief Set the value of the radio group.
116 * @param obj The radio object (any radio object of the group).
117 * @param value The value to use for the group
119 * This sets the value of the radio group and will also set the value if
120 * pointed to, to the value supplied, but will not call any callbacks.
124 EAPI void elm_radio_value_set(Evas_Object *obj, int value);
127 * @brief Get the value of the radio group
129 * @param obj The radio object (any radio object of the group).
130 * @return The integer state
134 EAPI int elm_radio_value_get(const Evas_Object *obj);
137 * @brief Set a convenience pointer to a integer to change when radio group
140 * @param obj The radio object (any object of a group)
141 * @param valuep Pointer to the integer to modify
143 * This sets a pointer to a integer, that, in addition to the radio objects
144 * state will also be modified directly. To stop setting the object pointed
145 * to simply use NULL as the @p valuep argument. If valuep is not NULL, then
146 * when this is called, the radio objects state will also be modified to
147 * reflect the value of the integer valuep points to, just like calling
148 * elm_radio_value_set().
152 EAPI void elm_radio_value_pointer_set(Evas_Object *obj, int *valuep);
155 * @brief Get the selected radio object.
157 * @param obj Any radio object (any object of a group)
158 * @return The selected radio object
162 EAPI Evas_Object *elm_radio_selected_object_get(Evas_Object *obj);