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