2 * @defgroup Button Button
5 * @image html button_inheritance_tree.png
6 * @image latex button_inheritance_tree.eps
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
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.
18 * This widget inherits from the @ref Layout one, so that all the
19 * functions acting on it also work for button objects.
21 * This widget emits the following signals, besides the ones sent from
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
30 * Also, defined in the default theme, the button has the following styles
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.
42 * Default content parts of the button widget that you can use for are:
43 * @li "icon" - An icon of the button
45 * Default text parts of the button widget that you can use for are:
46 * @li "default" - Label of the button
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
58 * Here is some sample code using it:
59 * @li @ref button_example_00
60 * @li @ref button_example_01
69 * Add a new button to the parent's canvas
71 * @param parent The parent object
72 * @return The new object or NULL if it cannot be created
76 EAPI Evas_Object *elm_button_add(Evas_Object *parent);
79 * Turn on/off the autorepeat event generated when the button is kept pressed
81 * When off, no autorepeat is performed and buttons emit a normal @c clicked
82 * signal when they are clicked.
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().
90 * @param obj The button object
91 * @param on A bool to turn on/off the event
95 EAPI void elm_button_autorepeat_set(Evas_Object *obj, Eina_Bool on);
98 * Get whether the autorepeat feature is enabled
100 * @param obj The button object
101 * @return EINA_TRUE if autorepeat is on, EINA_FALSE otherwise
103 * @see elm_button_autorepeat_set()
107 EAPI Eina_Bool elm_button_autorepeat_get(const Evas_Object *obj);
110 * Set the initial timeout before the autorepeat event is generated
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
117 * @param obj The button object
118 * @param t Timeout in seconds
120 * @see elm_button_autorepeat_set()
121 * @see elm_button_autorepeat_gap_timeout_set()
125 EAPI void elm_button_autorepeat_initial_timeout_set(Evas_Object *obj, double t);
128 * Get the initial timeout before the autorepeat event is generated
130 * @param obj The button object
131 * @return Timeout in seconds
133 * @see elm_button_autorepeat_initial_timeout_set()
137 EAPI double elm_button_autorepeat_initial_timeout_get(const Evas_Object *obj);
140 * Set the interval between each generated autorepeat event
142 * After the first @c repeated event is fired, all subsequent ones will
143 * follow after a delay of @p t seconds for each.
145 * @param obj The button object
146 * @param t Interval in seconds
148 * @see elm_button_autorepeat_initial_timeout_set()
152 EAPI void elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t);
155 * Get the interval between each generated autorepeat event
157 * @param obj The button object
158 * @return Interval in seconds
162 EAPI double elm_button_autorepeat_gap_timeout_get(const Evas_Object *obj);