2 * @defgroup Flipselector Flip Selector
4 * @image html img/widget/flipselector/preview-00.png
5 * @image latex img/widget/flipselector/preview-00.eps
7 * A flip selector is a widget to show a set of @b text items, one
8 * at a time, with the same sheet switching style as the @ref Clock
9 * "clock" widget, when one changes the current displaying sheet
10 * (thus, the "flip" in the name).
12 * User clicks to flip sheets which are @b held for some time will
13 * make the flip selector to flip continuously and automatically for
14 * the user. The interval between flips will keep growing in time,
15 * so that it helps the user to reach an item which is distant from
16 * the current selection.
18 * Smart callbacks one can register to:
19 * - @c "selected" - when the widget's selected text item is changed
20 * - @c "overflowed" - when the widget's current selection is changed
21 * from the first item in its list to the last
22 * - @c "underflowed" - when the widget's current selection is changed
23 * from the last item in its list to the first
25 * Available styles for it:
28 * Default text parts of the flipselector items that you can use for are:
29 * @li "default" - label of the flipselector item
31 * Supported elm_object common APIs.
32 * @li elm_object_disabled_set
33 * @li elm_object_disabled_get
35 * Supported elm_object_item common APIs.
36 * @li elm_object_item_text_set
37 * @li elm_object_item_part_text_set
38 * @li elm_object_item_signal_emit
40 * Here is an example on its usage:
41 * @li @ref flipselector_example
45 * @addtogroup Flipselector
50 * Add a new flip selector widget to the given parent Elementary
53 * @param parent The parent object
54 * @return a new flip selector widget handle or @c NULL, on errors
56 * This function inserts a new flip selector widget on the canvas.
58 * @ingroup Flipselector
60 EAPI Evas_Object *elm_flipselector_add(Evas_Object *parent);
63 * Programmatically select the next item of a flip selector widget
65 * @param obj The flipselector object
67 * @note The selection will be animated. Also, if it reaches the
68 * end of its list of member items, it will continue with the first
71 * @ingroup Flipselector
73 EAPI void elm_flipselector_flip_next(Evas_Object *obj);
76 * Programmatically select the previous item of a flip selector
79 * @param obj The flipselector object
81 * @note The selection will be animated. Also, if it reaches the
82 * beginning of its list of member items, it will continue with the
85 * @ingroup Flipselector
87 EAPI void elm_flipselector_flip_prev(Evas_Object *obj);
90 * Append a (text) item to a flip selector widget
92 * @param obj The flipselector object
93 * @param label The (text) label of the new item
94 * @param func Convenience callback function to take place when
96 * @param data Data passed to @p func, above
97 * @return A handle to the item added or @c NULL, on errors
99 * The widget's list of labels to show will be appended with the
100 * given value. If the user wishes so, a callback function pointer
101 * can be passed, which will get called when this same item is
104 * @note The current selection @b won't be modified by appending an
105 * element to the list.
107 * @note The maximum length of the text label is going to be
108 * determined <b>by the widget's theme</b>. Strings larger than
109 * that value are going to be @b truncated.
111 * @ingroup Flipselector
113 EAPI Elm_Object_Item *elm_flipselector_item_append(Evas_Object *obj, const char *label, Evas_Smart_Cb func, void *data);
116 * Prepend a (text) item to a flip selector widget
118 * @param obj The flipselector object
119 * @param label The (text) label of the new item
120 * @param func Convenience callback function to take place when
122 * @param data Data passed to @p func, above
123 * @return A handle to the item added or @c NULL, on errors
125 * The widget's list of labels to show will be prepended with the
126 * given value. If the user wishes so, a callback function pointer
127 * can be passed, which will get called when this same item is
130 * @note The current selection @b won't be modified by prepending
131 * an element to the list.
133 * @note The maximum length of the text label is going to be
134 * determined <b>by the widget's theme</b>. Strings larger than
135 * that value are going to be @b truncated.
137 * @ingroup Flipselector
139 EAPI Elm_Object_Item *elm_flipselector_item_prepend(Evas_Object *obj, const char *label, Evas_Smart_Cb func, void *data);
142 * Get the internal list of items in a given flip selector widget.
144 * @param obj The flipselector object
145 * @return The list of items (#Elm_Object_Item as data) or
148 * This list is @b not to be modified in any way and must not be
149 * freed. Use the list members with functions like
150 * elm_object_item_text_set(),
151 * elm_object_item_text_get(),
152 * elm_object_item_del(),
153 * elm_flipselector_item_selected_get(),
154 * elm_flipselector_item_selected_set().
156 * @warning This list is only valid until @p obj object's internal
157 * items list is changed. It should be fetched again with another
158 * call to this function when changes happen.
160 * @ingroup Flipselector
162 EAPI const Eina_List *elm_flipselector_items_get(const Evas_Object *obj);
165 * Get the first item in the given flip selector widget's list of
168 * @param obj The flipselector object
169 * @return The first item or @c NULL, if it has no items (and on
172 * @see elm_flipselector_item_append()
173 * @see elm_flipselector_last_item_get()
175 * @ingroup Flipselector
177 EAPI Elm_Object_Item *elm_flipselector_first_item_get(const Evas_Object *obj);
180 * Get the last item in the given flip selector widget's list of
183 * @param obj The flipselector object
184 * @return The last item or @c NULL, if it has no items (and on
187 * @see elm_flipselector_item_prepend()
188 * @see elm_flipselector_first_item_get()
190 * @ingroup Flipselector
192 EAPI Elm_Object_Item *elm_flipselector_last_item_get(const Evas_Object *obj);
195 * Get the currently selected item in a flip selector widget.
197 * @param obj The flipselector object
198 * @return The selected item or @c NULL, if the widget has no items
201 * @ingroup Flipselector
203 EAPI Elm_Object_Item *elm_flipselector_selected_item_get(const Evas_Object *obj);
206 * Set whether a given flip selector widget's item should be the
207 * currently selected one.
209 * @param it The flip selector item
210 * @param selected @c EINA_TRUE to select it, @c EINA_FALSE to unselect.
212 * This sets whether @p item is or not the selected (thus, under
213 * display) one. If @p item is different than the one under display,
214 * the latter will be unselected. If the @p item is set to be
215 * unselected, on the other hand, the @b first item in the widget's
216 * internal members list will be the new selected one.
218 * @see elm_flipselector_item_selected_get()
220 * @ingroup Flipselector
222 EAPI void elm_flipselector_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
225 * Get whether a given flip selector widget's item is the currently
228 * @param it The flip selector item
229 * @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise
232 * @see elm_flipselector_item_selected_set()
234 * @ingroup Flipselector
236 EAPI Eina_Bool elm_flipselector_item_selected_get(const Elm_Object_Item *it);
239 * Gets the item before @p item in a flip selector widget's internal list of
242 * @param it The item to fetch previous from
243 * @return The item before the @p item, in its parent's list. If there is no
244 * previous item for @p item or there's an error, @c NULL is returned.
246 * @see elm_flipselector_item_next_get()
248 * @ingroup Flipselector
250 EAPI Elm_Object_Item *elm_flipselector_item_prev_get(const Elm_Object_Item *it);
253 * Gets the item after @p item in a flip selector widget's
254 * internal list of items.
256 * @param it The item to fetch next from
257 * @return The item after the @p item, in its parent's list. If there is no next
258 * item for @p item or there's an error, @c NULL is returned.
260 * @see elm_flipselector_item_prev_get()
262 * @ingroup Flipselector
264 EAPI Elm_Object_Item *elm_flipselector_item_next_get(const Elm_Object_Item *it);
267 * Set the interval on time updates for a user mouse button hold
268 * on a flip selector widget.
270 * @param obj The flip selector object
271 * @param interval The (first) interval value in seconds
273 * This interval value is @b decreased while the user holds the
274 * mouse pointer either flipping up or flipping down a given flip
277 * This helps the user to get to a given item distant from the
278 * current one easier/faster, as it will start to flip quicker and
279 * quicker on mouse button holds.
281 * The calculation for the next flip interval value, starting from
282 * the one set with this call, is the previous interval divided by
283 * 1.05, so it decreases a little bit.
285 * The default starting interval value for automatic flips is
288 * @see elm_flipselector_first_interval_get()
290 * @ingroup Flipselector
292 EAPI void elm_flipselector_first_interval_set(Evas_Object *obj, double interval);
295 * Get the interval on time updates for an user mouse button hold
296 * on a flip selector widget.
298 * @param obj The flip selector object
299 * @return The (first) interval value, in seconds, set on it
301 * @see elm_flipselector_first_interval_set() for more details
303 * @ingroup Flipselector
305 EAPI double elm_flipselector_first_interval_get(const Evas_Object *obj);