From: Hyoyoung Chang <hyoyoung@gmail.com>
[framework/uifw/elementary.git] / src / lib / elm_radio.h
1 /**
2  * @defgroup Radio Radio
3  *
4  * @image html img/widget/radio/preview-00.png
5  * @image latex img/widget/radio/preview-00.eps
6  *
7  * @brief Radio is a widget that allows for 1 or more options to be displayed
8  * and have the user choose only 1 of them.
9  *
10  * A radio object contains an indicator, an optional Label and an optional
11  * icon object. While it's possible to have a group of only one radio they,
12  * are normally used in groups of 2 or more. 
13  *
14  * elm_radio objects are grouped in a slightly different, compared to other
15  * UI toolkits. There is no seperate group name/id to remember or manage.
16  * The members represent the group, there are the group. To make a group,
17  * use elm_radio_group_add() and pass existing radio object and the new radio 
18  * object. 
19  *
20  * The radio object(s) will select from one of a set
21  * of integer values, so any value they are configuring needs to be mapped to
22  * a set of integers. To configure what value that radio object represents,
23  * use  elm_radio_state_value_set() to set the integer it represents. To set
24  * the value the whole group(which one is currently selected) is to indicate
25  * use elm_radio_value_set() on any group member, and to get the groups value
26  * use elm_radio_value_get(). For convenience the radio objects are also able
27  * to directly set an integer(int) to the value that is selected. To specify
28  * the pointer to this integer to modify, use elm_radio_value_pointer_set().
29  * The radio objects will modify this directly. That implies the pointer must
30  * point to valid memory for as long as the radio objects exist.
31  *
32  * Signals that you can add callbacks for are:
33  * @li changed - This is called whenever the user changes the state of one of
34  * the radio objects within the group of radio objects that work together.
35  *
36  * Default text parts of the radio widget that you can use for are:
37  * @li "default" - Label of the radio
38  *
39  * Default content parts of the radio widget that you can use for are:
40  * @li "icon" - An icon of the radio
41  *
42  * Supported elm_object common APIs.
43  * @li elm_object_part_text_set
44  * @li elm_object_part_text_get
45  * @li elm_object_part_content_set
46  * @li elm_object_part_content_get
47  * @li elm_object_part_content_unset
48  * @li elm_object_disabled_set
49  * @li elm_object_disabled_get
50  *
51  * @ref tutorial_radio show most of this API in action.
52  * @{
53  */
54
55 /**
56  * @brief Add a new radio to the parent
57  *
58  * @param parent The parent object
59  * @return The new object or NULL if it cannot be created
60  */
61 EAPI Evas_Object                 *elm_radio_add(Evas_Object *parent);
62
63 /**
64  * @brief Add this radio to a group of other radio objects
65  *
66  * @param obj The radio object
67  * @param group Any object whose group the @p obj is to join.
68  *
69  * Radio objects work in groups. Each member should have a different integer
70  * value assigned. In order to have them work as a group, they need to know
71  * about each other. This adds the given radio object to the group of which
72  * the group object indicated is a member.
73  */
74 EAPI void                         elm_radio_group_add(Evas_Object *obj, Evas_Object *group);
75
76 /**
77  * @brief Set the integer value that this radio object represents
78  *
79  * @param obj The radio object
80  * @param value The value to use if this radio object is selected
81  *
82  * This sets the value of the radio.
83  */
84 EAPI void                         elm_radio_state_value_set(Evas_Object *obj, int value);
85
86 /**
87  * @brief Get the integer value that this radio object represents
88  *
89  * @param obj The radio object
90  * @return The value used if this radio object is selected
91  *
92  * This gets the value of the radio.
93  *
94  * @see elm_radio_value_set()
95  */
96 EAPI int                          elm_radio_state_value_get(const Evas_Object *obj);
97
98 /**
99  * @brief Set the value of the radio group.
100  *
101  * @param obj The radio object (any radio object of the group).
102  * @param value The value to use for the group
103  *
104  * This sets the value of the radio group and will also set the value if
105  * pointed to, to the value supplied, but will not call any callbacks.
106  */
107 EAPI void                         elm_radio_value_set(Evas_Object *obj, int value);
108
109 /**
110  * @brief Get the value of the radio group
111  *
112  * @param obj The radio object (any radio object of the group).
113  * @return The integer state
114  */
115 EAPI int                          elm_radio_value_get(const Evas_Object *obj);
116
117 /**
118  * @brief Set a convenience pointer to a integer to change when radio group
119  * value changes.
120  *
121  * @param obj The radio object (any object of a group)
122  * @param valuep Pointer to the integer to modify
123  *
124  * This sets a pointer to a integer, that, in addition to the radio objects
125  * state will also be modified directly. To stop setting the object pointed
126  * to simply use NULL as the @p valuep argument. If valuep is not NULL, then
127  * when this is called, the radio objects state will also be modified to
128  * reflect the value of the integer valuep points to, just like calling
129  * elm_radio_value_set().
130  */
131 EAPI void                         elm_radio_value_pointer_set(Evas_Object *obj, int *valuep);
132
133 /**
134  * @brief Get the selected radio object.
135  *
136  * @param obj Any radio object (any object of a group)
137  * @return The selected radio object
138  */
139 EAPI Evas_Object                 *elm_radio_selected_object_get(Evas_Object *obj);
140
141 /**
142  * @}
143  */