elementary/map - map supports language,changed
[framework/uifw/elementary.git] / src / lib / elm_radio.h
1 /**
2  * @defgroup Radio Radio
3  * @ingroup Elementary
4  *
5  * @image html radio_inheritance_tree.png
6  * @image latex radio_inheritance_tree.eps
7  *
8  * @image html img/widget/radio/preview-00.png
9  * @image latex img/widget/radio/preview-00.eps
10  *
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.
13  *
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.
17  *
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
22  * object.
23  *
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.
35  *
36  * This widget inherits from the @ref Layout one, so that all the
37  * functions acting on it also work for radio objects.
38  *
39  * This widget emits the following signals, besides the ones sent from
40  * @ref Layout:
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.
43  *
44  * Default text parts of the radio widget that you can use for are:
45  * @li "default" - Label of the radio
46  *
47  * Default content parts of the radio widget that you can use for are:
48  * @li "icon" - An icon of the radio
49  *
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
58  *
59  * @ref tutorial_radio show most of this API in action.
60  * @{
61  */
62
63 /**
64  * @brief Add a new radio to the parent
65  *
66  * @param parent The parent object
67  * @return The new object or NULL if it cannot be created
68  *
69  * @ingroup Radio
70  */
71 EAPI Evas_Object                 *elm_radio_add(Evas_Object *parent);
72
73 /**
74  * @brief Add this radio to a group of other radio objects
75  *
76  * @param obj The radio object
77  * @param group Any object whose group the @p obj is to join.
78  *
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.
83  *
84  * @ingroup Radio
85  */
86 EAPI void                         elm_radio_group_add(Evas_Object *obj, Evas_Object *group);
87
88 /**
89  * @brief Set the integer value that this radio object represents
90  *
91  * @param obj The radio object
92  * @param value The value to use if this radio object is selected
93  *
94  * This sets the value of the radio.
95  *
96  * @ingroup Radio
97  */
98 EAPI void                         elm_radio_state_value_set(Evas_Object *obj, int value);
99
100 /**
101  * @brief Get the integer value that this radio object represents
102  *
103  * @param obj The radio object
104  * @return The value used if this radio object is selected
105  *
106  * This gets the value of the radio.
107  * @see elm_radio_value_set()
108  *
109  * @ingroup Radio
110  */
111 EAPI int                          elm_radio_state_value_get(const Evas_Object *obj);
112
113 /**
114  * @brief Set the value of the radio group.
115  *
116  * @param obj The radio object (any radio object of the group).
117  * @param value The value to use for the group
118  *
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.
121  *
122  * @ingroup Radio
123  */
124 EAPI void                         elm_radio_value_set(Evas_Object *obj, int value);
125
126 /**
127  * @brief Get the value of the radio group
128  *
129  * @param obj The radio object (any radio object of the group).
130  * @return The integer state
131  *
132  * @ingroup Radio
133  */
134 EAPI int                          elm_radio_value_get(const Evas_Object *obj);
135
136 /**
137  * @brief Set a convenience pointer to a integer to change when radio group
138  * value changes.
139  *
140  * @param obj The radio object (any object of a group)
141  * @param valuep Pointer to the integer to modify
142  *
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().
149  *
150  * @ingroup Radio
151  */
152 EAPI void                         elm_radio_value_pointer_set(Evas_Object *obj, int *valuep);
153
154 /**
155  * @brief Get the selected radio object.
156  *
157  * @param obj Any radio object (any object of a group)
158  * @return The selected radio object
159  *
160  * @ingroup Radio
161  */
162 EAPI Evas_Object                 *elm_radio_selected_object_get(Evas_Object *obj);
163
164 /**
165  * @}
166  */