5715366f2d14658fa8d5291d0150cdae4f073307
[framework/uifw/elementary.git] / src / lib / elm_check.h
1 /**
2  * @defgroup Check Check
3  *
4  * @image html img/widget/check/preview-00.png
5  * @image latex img/widget/check/preview-00.eps
6  * @image html img/widget/check/preview-01.png
7  * @image latex img/widget/check/preview-01.eps
8  * @image html img/widget/check/preview-02.png
9  * @image latex img/widget/check/preview-02.eps
10  *
11  * @brief The check widget allows for toggling a value between true and
12  * false.
13  *
14  * Check objects are a lot like radio objects in layout and functionality
15  * except they do not work as a group, but independently and only toggle the
16  * value of a boolean from false to true (0 or 1). elm_check_state_set() sets
17  * the boolean state (1 for true, 0 for false), and elm_check_state_get()
18  * returns the current state. For convenience, like the radio objects, you
19  * can set a pointer to a boolean directly with elm_check_state_pointer_set()
20  * for it to modify.
21  *
22  * Signals that you can add callbacks for are:
23 <<<<<<< HEAD
24  * "changed" - This is called whenever the user changes the state of one of
25  *             the check object(event_info is NULL).
26  *
27  * Default contents parts of the check widget that you can use for are:
28 =======
29  * "changed" - This is called whenever the user changes the state of the check
30  *             objects(event_info is NULL).
31  *
32  * Default content parts of the check widget that you can use for are:
33 >>>>>>> remotes/origin/upstream
34  * @li "icon" - An icon of the check
35  *
36  * Default text parts of the check widget that you can use for are:
37  * @li "default" - A label of the check
38  * @li "on" - On state label of the check
39  * @li "off" - Off state label of the check
40  *
41  * Supported elm_object common APIs.
42  * @li elm_object_disabled_set
43  * @li elm_object_disabled_get
44  * @li elm_object_part_text_set
45  * @li elm_object_part_text_get
46  * @li elm_object_part_content_set
47  * @li elm_object_part_content_get
48  * @li elm_object_part_content_unset
49 <<<<<<< HEAD
50 =======
51  * @li elm_object_signal_emit
52  * @li elm_object_signal_callback_add
53  * @li elm_object_signal_callback_del
54 >>>>>>> remotes/origin/upstream
55  *
56  * @ref tutorial_check should give you a firm grasp of how to use this widget.
57  * 
58  * @{
59  */
60
61 /**
62  * @brief Add a new Check object
63  *
64  * @param parent The parent object
65  * @return The new object or NULL if it cannot be created
66  */
67 EAPI Evas_Object *                elm_check_add(Evas_Object *parent);
68
69 /**
70  * @brief Set the on/off state of the check object
71  *
72  * @param obj The check object
73  * @param state The state to use (1 == on, 0 == off)
74  *
75 <<<<<<< HEAD
76  * This sets the state of the check. If set
77  * with elm_check_state_pointer_set() the state of that variable is also
78  * changed. Calling this @b doesn't cause the "changed" signal to be emited.
79 =======
80  * This sets the state of the check. If set with elm_check_state_pointer_set()
81  * the state of that variable is also changed. Calling this @b doesn't cause
82  * the "changed" signal to be emitted.
83 >>>>>>> remotes/origin/upstream
84  */
85 EAPI void                         elm_check_state_set(Evas_Object *obj, Eina_Bool state);
86
87 /**
88  * @brief Get the state of the check object
89  *
90  * @param obj The check object
91  * @return The boolean state
92  */
93 EAPI Eina_Bool                    elm_check_state_get(const Evas_Object *obj);
94
95 /**
96  * @brief Set a convenience pointer to a boolean to change
97  *
98  * @param obj The check object
99  * @param statep Pointer to the boolean to modify
100  *
101  * This sets a pointer to a boolean, that, in addition to the check objects
102  * state will also be modified directly. To stop setting the object pointed
103  * to simply use NULL as the @p statep parameter. If @p statep is not NULL,
104  * then when this is called, the check objects state will also be modified to
105  * reflect the value of the boolean @p statep points to, just like calling
106  * elm_check_state_set().
107  */
108 EAPI void                         elm_check_state_pointer_set(Evas_Object *obj, Eina_Bool *statep);
109
110 /**
111  * @}
112  */