Initialize Tizen 2.3
[framework/uifw/elementary.git] / wearable / src / lib / elm_button.h
1 /**
2  * @defgroup Button Button
3  * @ingroup Elementary
4  *
5  * @image html button_inheritance_tree.png
6  * @image latex button_inheritance_tree.eps
7  *
8  * @image html img/widget/button/preview-00.png
9  * @image latex img/widget/button/preview-00.eps
10  * @image html img/widget/button/preview-01.png
11  * @image latex img/widget/button/preview-01.eps
12  * @image html img/widget/button/preview-02.png
13  * @image latex img/widget/button/preview-02.eps
14  *
15  * This is a push-button. Press it and run some function. It can contain
16  * a simple label and icon object and it also has an autorepeat feature.
17  *
18  * This widget inherits from the @ref Layout one, so that all the
19  * functions acting on it also work for button objects.
20  *
21  * This widget emits the following signals, besides the ones sent from
22  * @ref Layout:
23  * @li "clicked": the user clicked the button (press/release).
24  * @li "repeated": the user pressed the button without releasing it.
25  * @li "pressed": button was pressed.
26  * @li "unpressed": button was released after being pressed.
27  * In all cases, the @c event parameter of the callback will be
28  * @c NULL.
29  *
30  * Also, defined in the default theme, the button has the following styles
31  * available:
32  * @li default: a normal button.
33  * @li anchor: Like default, but the button fades away when the mouse is not
34  * over it, leaving only the text or icon.
35  * @li hoversel_vertical: Internally used by @ref Hoversel to give a
36  * continuous look across its options.
37  * @li hoversel_vertical_entry: Another internal for @ref Hoversel.
38  * @li naviframe: Internally used by @ref Naviframe for its back button.
39  * @li colorselector: Internally used by @ref Colorselector
40  * for its left and right buttons.
41  *
42  * Default content parts of the button widget that you can use for are:
43  * @li "icon" - An icon of the button
44  *
45  * Default text parts of the button widget that you can use for are:
46  * @li "default" - Label of the button
47  *
48  * Supported elm_object common APIs.
49  * @li @ref elm_object_part_text_set
50  * @li @ref elm_object_part_text_get
51  * @li @ref elm_object_part_content_set
52  * @li @ref elm_object_part_content_get
53  * @li @ref elm_object_part_content_unset
54  * @li @ref elm_object_signal_emit
55  * @li @ref elm_object_signal_callback_add
56  * @li @ref elm_object_signal_callback_del
57  *
58  * Here is some sample code using it:
59  * @li @ref button_example_00
60  * @li @ref button_example_01
61  */
62
63 /**
64  * @addtogroup Button
65  * @{
66  */
67
68 /**
69  * Add a new button to the parent's canvas
70  *
71  * @param parent The parent object
72  * @return The new object or NULL if it cannot be created
73  *
74  * @ingroup Button
75  */
76 EAPI Evas_Object                 *elm_button_add(Evas_Object *parent);
77
78 /**
79  * Turn on/off the autorepeat event generated when the button is kept pressed
80  *
81  * When off, no autorepeat is performed and buttons emit a normal @c clicked
82  * signal when they are clicked.
83  *
84  * When on, keeping a button pressed will continuously emit a @c repeated
85  * signal until the button is released. The time it takes until it starts
86  * emitting the signal is given by
87  * elm_button_autorepeat_initial_timeout_set(), and the time between each
88  * new emission by elm_button_autorepeat_gap_timeout_set().
89  *
90  * @param obj The button object
91  * @param on  A bool to turn on/off the event
92  *
93  * @ingroup Button
94  */
95 EAPI void                         elm_button_autorepeat_set(Evas_Object *obj, Eina_Bool on);
96
97 /**
98  * Get whether the autorepeat feature is enabled
99  *
100  * @param obj The button object
101  * @return EINA_TRUE if autorepeat is on, EINA_FALSE otherwise
102  *
103  * @see elm_button_autorepeat_set()
104  *
105  * @ingroup Button
106  */
107 EAPI Eina_Bool                    elm_button_autorepeat_get(const Evas_Object *obj);
108
109 /**
110  * Set the initial timeout before the autorepeat event is generated
111  *
112  * Sets the timeout, in seconds, since the button is pressed until the
113  * first @c repeated signal is emitted. If @p t is 0.0 or less, there
114  * won't be any delay and the event will be fired the moment the button is
115  * pressed.
116  *
117  * @param obj The button object
118  * @param t   Timeout in seconds
119  *
120  * @see elm_button_autorepeat_set()
121  * @see elm_button_autorepeat_gap_timeout_set()
122  *
123  * @ingroup Button
124  */
125 EAPI void                         elm_button_autorepeat_initial_timeout_set(Evas_Object *obj, double t);
126
127 /**
128  * Get the initial timeout before the autorepeat event is generated
129  *
130  * @param obj The button object
131  * @return Timeout in seconds
132  *
133  * @see elm_button_autorepeat_initial_timeout_set()
134  *
135  * @ingroup Button
136  */
137 EAPI double                       elm_button_autorepeat_initial_timeout_get(const Evas_Object *obj);
138
139 /**
140  * Set the interval between each generated autorepeat event
141  *
142  * After the first @c repeated event is fired, all subsequent ones will
143  * follow after a delay of @p t seconds for each.
144  *
145  * @param obj The button object
146  * @param t   Interval in seconds
147  *
148  * @see elm_button_autorepeat_initial_timeout_set()
149  *
150  * @ingroup Button
151  */
152 EAPI void                         elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t);
153
154 /**
155  * Get the interval between each generated autorepeat event
156  *
157  * @param obj The button object
158  * @return Interval in seconds
159  *
160  * @ingroup Button
161  */
162 EAPI double                       elm_button_autorepeat_gap_timeout_get(const Evas_Object *obj);
163
164 /**
165  * @}
166  */