2 * @defgroup Flipselector Flip Selector
5 * @image html flipselector_inheritance_tree.png
6 * @image latex flipselector_inheritance_tree.eps
8 * @image html img/widget/flipselector/preview-00.png
9 * @image latex img/widget/flipselector/preview-00.eps
11 * A flip selector is a widget to show a set of @b text items, one
12 * at a time, with the same sheet switching style as the @ref Clock
13 * "clock" widget, when one changes the current displaying sheet
14 * (thus, the "flip" in the name).
16 * User clicks to flip sheets which are @b held for some time will
17 * make the flip selector to flip continuously and automatically for
18 * the user. The interval between flips will keep growing in time,
19 * so that it helps the user to reach an item which is distant from
20 * the current selection.
22 * This widget inherits from the @ref Layout one, so that all the
23 * functions acting on it also work for flip selector objects.
25 * This widget emits the following signals, besides the ones sent from
27 * - @c "selected" - when the widget's selected text item is changed
28 * - @c "overflowed" - when the widget's current selection is changed
29 * from the first item in its list to the last
30 * - @c "underflowed" - when the widget's current selection is changed
31 * from the last item in its list to the first
33 * Available styles for it:
36 * Default text parts of the flipselector items that you can use for are:
37 * @li "default" - label of the flipselector item
39 * Supported elm_object common APIs.
40 * @li @ref elm_object_disabled_set
41 * @li @ref elm_object_disabled_get
43 * Supported elm_object_item common APIs.
44 * @li @ref elm_object_item_text_set
45 * @li @ref elm_object_item_part_text_set
46 * @li @ref elm_object_item_signal_emit
48 * Here is an example on its usage:
49 * @li @ref flipselector_example
53 * @addtogroup Flipselector
58 * Add a new flip selector widget to the given parent Elementary
61 * @param parent The parent object
62 * @return a new flip selector widget handle or @c NULL, on errors
64 * This function inserts a new flip selector widget on the canvas.
66 * @ingroup Flipselector
68 EAPI Evas_Object *elm_flipselector_add(Evas_Object *parent);
71 * Programmatically select the next item of a flip selector widget
73 * @param obj The flipselector object
75 * @note The selection will be animated. Also, if it reaches the
76 * end of its list of member items, it will continue with the first
79 * @ingroup Flipselector
81 EAPI void elm_flipselector_flip_next(Evas_Object *obj);
84 * Programmatically select the previous item of a flip selector
87 * @param obj The flipselector object
89 * @note The selection will be animated. Also, if it reaches the
90 * beginning of its list of member items, it will continue with the
93 * @ingroup Flipselector
95 EAPI void elm_flipselector_flip_prev(Evas_Object *obj);
98 * Append a (text) item to a flip selector widget
100 * @param obj The flipselector object
101 * @param label The (text) label of the new item
102 * @param func Convenience callback function to take place when
104 * @param data Data passed to @p func, above
105 * @return A handle to the item added or @c NULL, on errors
107 * The widget's list of labels to show will be appended with the
108 * given value. If the user wishes so, a callback function pointer
109 * can be passed, which will get called when this same item is
112 * @note The current selection @b won't be modified by appending an
113 * element to the list.
115 * @note The maximum length of the text label is going to be
116 * determined <b>by the widget's theme</b>. Strings larger than
117 * that value are going to be @b truncated.
119 * @ingroup Flipselector
121 EAPI Elm_Object_Item *elm_flipselector_item_append(Evas_Object *obj, const char *label, Evas_Smart_Cb func, void *data);
124 * Prepend a (text) item to a flip selector widget
126 * @param obj The flipselector object
127 * @param label The (text) label of the new item
128 * @param func Convenience callback function to take place when
130 * @param data Data passed to @p func, above
131 * @return A handle to the item added or @c NULL, on errors
133 * The widget's list of labels to show will be prepended with the
134 * given value. If the user wishes so, a callback function pointer
135 * can be passed, which will get called when this same item is
138 * @note The current selection @b won't be modified by prepending
139 * an element to the list.
141 * @note The maximum length of the text label is going to be
142 * determined <b>by the widget's theme</b>. Strings larger than
143 * that value are going to be @b truncated.
145 * @ingroup Flipselector
147 EAPI Elm_Object_Item *elm_flipselector_item_prepend(Evas_Object *obj, const char *label, Evas_Smart_Cb func, void *data);
150 * Get the internal list of items in a given flip selector widget.
152 * @param obj The flipselector object
153 * @return The list of items (#Elm_Object_Item as data) or
156 * This list is @b not to be modified in any way and must not be
157 * freed. Use the list members with functions like
158 * elm_object_item_text_set(),
159 * elm_object_item_text_get(),
160 * elm_object_item_del(),
161 * elm_flipselector_item_selected_get(),
162 * elm_flipselector_item_selected_set().
164 * @warning This list is only valid until @p obj object's internal
165 * items list is changed. It should be fetched again with another
166 * call to this function when changes happen.
168 * @ingroup Flipselector
170 EAPI const Eina_List *elm_flipselector_items_get(const Evas_Object *obj);
173 * Get the first item in the given flip selector widget's list of
176 * @param obj The flipselector object
177 * @return The first item or @c NULL, if it has no items (and on
180 * @see elm_flipselector_item_append()
181 * @see elm_flipselector_last_item_get()
183 * @ingroup Flipselector
185 EAPI Elm_Object_Item *elm_flipselector_first_item_get(const Evas_Object *obj);
188 * Get the last item in the given flip selector widget's list of
191 * @param obj The flipselector object
192 * @return The last item or @c NULL, if it has no items (and on
195 * @see elm_flipselector_item_prepend()
196 * @see elm_flipselector_first_item_get()
198 * @ingroup Flipselector
200 EAPI Elm_Object_Item *elm_flipselector_last_item_get(const Evas_Object *obj);
203 * Get the currently selected item in a flip selector widget.
205 * @param obj The flipselector object
206 * @return The selected item or @c NULL, if the widget has no items
209 * @ingroup Flipselector
211 EAPI Elm_Object_Item *elm_flipselector_selected_item_get(const Evas_Object *obj);
214 * Set whether a given flip selector widget's item should be the
215 * currently selected one.
217 * @param it The flip selector item
218 * @param selected @c EINA_TRUE to select it, @c EINA_FALSE to unselect.
220 * This sets whether @p item is or not the selected (thus, under
221 * display) one. If @p item is different than the one under display,
222 * the latter will be unselected. If the @p item is set to be
223 * unselected, on the other hand, the @b first item in the widget's
224 * internal members list will be the new selected one.
226 * @see elm_flipselector_item_selected_get()
228 * @ingroup Flipselector
230 EAPI void elm_flipselector_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
233 * Get whether a given flip selector widget's item is the currently
236 * @param it The flip selector item
237 * @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise
240 * @see elm_flipselector_item_selected_set()
242 * @ingroup Flipselector
244 EAPI Eina_Bool elm_flipselector_item_selected_get(const Elm_Object_Item *it);
247 * Gets the item before @p item in a flip selector widget's internal list of
250 * @param it The item to fetch previous from
251 * @return The item before the @p item, in its parent's list. If there is no
252 * previous item for @p item or there's an error, @c NULL is returned.
254 * @see elm_flipselector_item_next_get()
256 * @ingroup Flipselector
258 EAPI Elm_Object_Item *elm_flipselector_item_prev_get(const Elm_Object_Item *it);
261 * Gets the item after @p item in a flip selector widget's
262 * internal list of items.
264 * @param it The item to fetch next from
265 * @return The item after the @p item, in its parent's list. If there is no next
266 * item for @p item or there's an error, @c NULL is returned.
268 * @see elm_flipselector_item_prev_get()
270 * @ingroup Flipselector
272 EAPI Elm_Object_Item *elm_flipselector_item_next_get(const Elm_Object_Item *it);
275 * Set the interval on time updates for a user mouse button hold
276 * on a flip selector widget.
278 * @param obj The flip selector object
279 * @param interval The (first) interval value in seconds
281 * This interval value is @b decreased while the user holds the
282 * mouse pointer either flipping up or flipping down a given flip
285 * This helps the user to get to a given item distant from the
286 * current one easier/faster, as it will start to flip quicker and
287 * quicker on mouse button holds.
289 * The calculation for the next flip interval value, starting from
290 * the one set with this call, is the previous interval divided by
291 * 1.05, so it decreases a little bit.
293 * The default starting interval value for automatic flips is
296 * @see elm_flipselector_first_interval_get()
298 * @ingroup Flipselector
300 EAPI void elm_flipselector_first_interval_set(Evas_Object *obj, double interval);
303 * Get the interval on time updates for an user mouse button hold
304 * on a flip selector widget.
306 * @param obj The flip selector object
307 * @return The (first) interval value, in seconds, set on it
309 * @see elm_flipselector_first_interval_set() for more details
311 * @ingroup Flipselector
313 EAPI double elm_flipselector_first_interval_get(const Evas_Object *obj);