2 * @defgroup Multibuttonentry Multibuttonentry
5 * @image html multibuttonentry_inheritance_tree.png
6 * @image latex multibuttonentry_inheritance_tree.eps
8 * A multi-button entry is a widget letting an user enter text and
9 * each chunk of text managed as a set of buttons. Each text button is
10 * inserted by pressing the "return" key. If there is no space in the
11 * current row, a new button is added to the next row. When a text
12 * button is pressed, it will become focused. Backspace removes the
13 * focus. When the multi-button entry loses focus, items longer than
14 * one line are shrunk to one line.
16 * The typical use case of multi-button entry is composing
17 * emails/messages to a group of addresses, each of which is an item
18 * that can be clicked for further actions.
20 * This widget inherits from the @ref Layout one, so that all the
21 * functions acting on it also work for multi-button entry objects
24 * This widget emits the following signals, besides the ones sent from
26 * - @c "item,selected" - this is called when an item is selected by
27 * api, user interaction, and etc. this is also called when a
28 * user press back space while cursor is on the first field of
30 * - @c "item,added" - when a new multi-button entry item is added.
31 * - @c "item,deleted" - when a multi-button entry item is deleted.
32 * - @c "item,clicked" - this is called when an item is clicked by user
33 * interaction. Both "item,selected" and "item,clicked" are needed.
34 * - @c "clicked" - when multi-button entry is clicked.
35 * - @c "focused" - when multi-button entry is focused.
36 * - @c "unfocused" - when multi-button entry is unfocused.
37 * - @c "expanded" - when multi-button entry is expanded.
38 * - @c "contracted" - when multi-button entry is contracted.
39 * - @c "expand,state,changed" - when shrink mode state of
40 * multi-button entry is changed.
42 * Default text parts of the multi-button entry widget that you can use are:
43 * @li "default" - A label of the multi-button entry
45 * Default text parts of multi-button entry @b items that you can use are:
46 * @li "default" - A label of the multi-button entry item
48 * Supported elm_object_item common APIs.
49 * @li @ref elm_object_item_part_text_set
50 * @li @ref elm_object_item_part_text_get
54 * @addtogroup Multibuttonentry
59 * @brief Callback to be invoked when an item is added to the multibuttonentry.
61 * @param obj The parent object
62 * @param item_label The label corresponding to the added item.
63 * @param item_data data specific to this item.
64 * @param data data specific to the multibuttonentry.
67 * EINA_FALSE otherwise.
69 * @ingroup Multibuttonentry
71 typedef Eina_Bool (*Elm_Multibuttonentry_Item_Filter_Cb)(Evas_Object *obj, const char *item_label, const void *item_data, const void *data);
74 * @brief Add a new multibuttonentry to the parent
76 * @param parent The parent object
77 * @return The new object or NULL if it cannot be created
80 * @ingroup Multibuttonentry
82 EAPI Evas_Object *elm_multibuttonentry_add(Evas_Object *parent);
86 * Get the entry of the multibuttonentry object
88 * @param obj The multibuttonentry object
89 * @return The entry object, or NULL if none
91 * @ingroup Multibuttonentry
93 EAPI Evas_Object *elm_multibuttonentry_entry_get(const Evas_Object *obj);
96 * Get the value of expanded state.
97 * In expanded state, the complete entry will be displayed.
98 * Otherwise, only single line of the entry will be displayed.
100 * @param obj The multibuttonentry object
101 * @return EINA_TRUE if the widget is in expanded state. EINA_FALSE if not.
103 * @ingroup Multibuttonentry
105 EAPI Eina_Bool elm_multibuttonentry_expanded_get(const Evas_Object *obj);
108 * Set/Unset the multibuttonentry to expanded state.
109 * In expanded state, the complete entry will be displayed.
110 * Otherwise, only single line of the entry will be displayed.
112 * @param obj The multibuttonentry object
113 * @param expanded the value of expanded state.
114 * Set this to EINA_TRUE for expanded state.
115 * Set this to EINA_FALSE for single line state.
117 * @ingroup Multibuttonentry
119 EAPI void elm_multibuttonentry_expanded_set(Evas_Object *obj, Eina_Bool expanded);
122 * Prepend a new item to the multibuttonentry
124 * @param obj The multibuttonentry object
125 * @param label The label of new item
126 * @param func The callback function to be invoked when this item is pressed.
127 * @param data The pointer to the data to be attached
128 * @return A handle to the item added or NULL if not possible
130 * @see Use elm_object_item_del() to delete the item.
132 * @ingroup Multibuttonentry
134 EAPI Elm_Object_Item *elm_multibuttonentry_item_prepend(Evas_Object *obj, const char *label, Evas_Smart_Cb func, const void *data);
137 * Append a new item to the multibuttonentry
139 * @param obj The multibuttonentry object
140 * @param label The label of new item
141 * @param func The callback function to be invoked when this item is pressed.
142 * @param data The pointer to the data to be attached
143 * @return A handle to the item added or NULL if not possible
145 * @see Use elm_object_item_del() to delete the item.
147 * @ingroup Multibuttonentry
149 EAPI Elm_Object_Item *elm_multibuttonentry_item_append(Evas_Object *obj, const char *label, Evas_Smart_Cb func, const void *data);
152 * Add a new item to the multibuttonentry before the indicated object
155 * @param obj The multibuttonentry object
156 * @param before The item before which to add it
157 * @param label The label of new item
158 * @param func The callback function to be invoked when this item is pressed.
159 * @param data The pointer to the data to be attached
160 * @return A handle to the item added or NULL if not possible
162 * @see Use elm_object_item_del() to delete the item.
164 * @ingroup Multibuttonentry
166 EAPI Elm_Object_Item *elm_multibuttonentry_item_insert_before(Evas_Object *obj, Elm_Object_Item *before, const char *label, Evas_Smart_Cb func, const void *data);
169 * Add a new item to the multibuttonentry after the indicated object
171 * @param obj The multibuttonentry object
172 * @param after The item after which to add it
173 * @param label The label of new item
174 * @param func The callback function to be invoked when this item is pressed.
175 * @param data The pointer to the data to be attached
176 * @return A handle to the item added or NULL if not possible
178 * @see Use elm_object_item_del() to delete the item.
180 * @ingroup Multibuttonentry
182 EAPI Elm_Object_Item *elm_multibuttonentry_item_insert_after(Evas_Object *obj, Elm_Object_Item *after, const char *label, Evas_Smart_Cb func, const void *data);
185 * Get a list of items in the multibuttonentry
187 * @param obj The multibuttonentry object
188 * @return The list of items, or NULL if none
190 * @ingroup Multibuttonentry
192 EAPI const Eina_List *elm_multibuttonentry_items_get(const Evas_Object *obj);
195 * Get the first item in the multibuttonentry
197 * @param obj The multibuttonentry object
198 * @return The first item, or NULL if none
200 * @ingroup Multibuttonentry
202 EAPI Elm_Object_Item *elm_multibuttonentry_first_item_get(const Evas_Object *obj);
205 * Get the last item in the multibuttonentry
207 * @param obj The multibuttonentry object
208 * @return The last item, or NULL if none
210 * @ingroup Multibuttonentry
212 EAPI Elm_Object_Item *elm_multibuttonentry_last_item_get(const Evas_Object *obj);
215 * Get the selected item in the multibuttonentry
217 * @param obj The multibuttonentry object
218 * @return The selected item, or NULL if none
220 * @ingroup Multibuttonentry
222 EAPI Elm_Object_Item *elm_multibuttonentry_selected_item_get(const Evas_Object *obj);
225 * Set the selected state of an item
228 * @param selected if it's EINA_TRUE, select the item otherwise, unselect the item
230 * @ingroup Multibuttonentry
232 EAPI void elm_multibuttonentry_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
236 * Get the selected state of an item
239 * @return EINA_TRUE if the item is selected, EINA_FALSE otherwise.
241 * @ingroup Multibuttonentry
243 EAPI Eina_Bool elm_multibuttonentry_item_selected_get(const Elm_Object_Item *it);
246 * Remove all items in the multibuttonentry.
248 * @param obj The multibuttonentry object
250 * @ingroup Multibuttonentry
252 EAPI void elm_multibuttonentry_clear(Evas_Object *obj);
255 * Get the previous item in the multibuttonentry
258 * @return The item before the item @p it
260 * @ingroup Multibuttonentry
262 EAPI Elm_Object_Item *elm_multibuttonentry_item_prev_get(const Elm_Object_Item *it);
265 * Get the next item in the multibuttonentry
268 * @return The item after the item @p it
270 * @ingroup Multibuttonentry
272 EAPI Elm_Object_Item *elm_multibuttonentry_item_next_get(const Elm_Object_Item *it);
275 * Append an item filter function for text inserted in the Multibuttonentry
277 * Append the given callback to the list. This functions will be called
278 * whenever any text is inserted into the Multibuttonentry, with the text to be inserted
279 * as a parameter. The callback function is free to alter the text in any way
280 * it wants, but it must remember to free the given pointer and update it.
281 * If the new text is to be discarded, the function can free it and set it text
282 * parameter to NULL. This will also prevent any following filters from being
285 * @param obj The multibuttonentry object
286 * @param func The function to use as item filter
287 * @param data User data to pass to @p func
289 * @ingroup Multibuttonentry
291 EAPI void elm_multibuttonentry_item_filter_append(Evas_Object *obj, Elm_Multibuttonentry_Item_Filter_Cb func, const void *data);
294 * Prepend a filter function for text inserted in the Multibuttonentry
296 * Prepend the given callback to the list. See elm_multibuttonentry_item_filter_append()
297 * for more information
299 * @param obj The multibuttonentry object
300 * @param func The function to use as text filter
301 * @param data User data to pass to @p func
303 * @ingroup Multibuttonentry
305 EAPI void elm_multibuttonentry_item_filter_prepend(Evas_Object *obj, Elm_Multibuttonentry_Item_Filter_Cb func, const void *data);
308 * Remove a filter from the list
310 * Removes the given callback from the filter list. See elm_multibuttonentry_item_filter_append()
311 * for more information.
313 * @param obj The multibuttonentry object
314 * @param func The filter function to remove
315 * @param data The user data passed when adding the function
317 * @ingroup Multibuttonentry
319 EAPI void elm_multibuttonentry_item_filter_remove(Evas_Object *obj, Elm_Multibuttonentry_Item_Filter_Cb func, const void *data);
322 * Sets if the multibuttonentry is to be editable or not.
324 * @param obj The multibuttonentry object
325 * @param editable If EINA_TRUE, user can add/delete item in multibuttonentry, if not, the multibuttonentry is non-editable.
327 * @ingroup Multibuttonentry
331 EAPI void elm_multibuttonentry_editable_set(Evas_Object *obj, Eina_Bool editable);
334 * Gets whether the multibuttonentry is editable or not.
336 * @param obj The multibuttonentry object
337 * @return EINA_TRUE if the multibuttonentry is editable by the user. EINA_FALSE if not.
339 * @ingroup Multibuttonentry
343 EAPI Eina_Bool elm_multibuttonentry_editable_get(const Evas_Object *obj);