2 * @defgroup Multibuttonentry Multibuttonentry
4 * A Multibuttonentry is a widget to allow a user enter text and manage it as a number
5 * of buttons. Each text button is inserted by pressing the "return" key.
6 * If there is no space in the current row, a new button is added to the next row.
7 * When a text button is pressed, it will become focused.
8 * Backspace removes the focus.
9 * When the Multibuttonentry loses focus items longer than one line are shrunk
12 * Typical use case of multibuttonentry is, composing emails/messages to a group
13 * of addresses, each of which is an item that can be clicked for further actions.
15 * Smart callbacks one can register:
16 * - @c "item,selected" - when item is selected. May be called on backspace key.
17 * - @c "item,added" - when a new multibuttonentry item is added.
18 * - @c "item,deleted" - when a multibuttonentry item is deleted.
19 * - @c "item,clicked" - selected item of multibuttonentry is clicked.
20 * - @c "clicked" - when multibuttonentry is clicked.
21 * - @c "focused" - when multibuttonentry is focused.
22 * - @c "unfocused" - when multibuttonentry is unfocused.
23 * - @c "expanded" - when multibuttonentry is expanded.
24 * - @c "contracted" - when multibuttonentry is contracted.
25 * - @c "shrink,state,changed" - when shrink mode state of multibuttonentry is
28 * Default text parts of the multibuttonentry widget that you can use for are:
29 * @li "default" - A label of the multibuttonentry
31 * Default text parts of the multibuttonentry items that you can use for are:
32 * @li "default" - A label of the multibuttonentry item
34 * Supported elm_object common APIs.
35 * @li elm_object_signal_emit
36 * @li elm_object_part_text_set
37 * @li elm_object_part_text_get
39 * Supported elm_object_item common APIs.
40 * @li elm_object_item_part_text_set
41 * @li elm_object_item_part_text_get
46 * 1. docs are lacking.
48 * 3. should use the elm_object_part_text_set to set guide text.
49 * 5. bugs: offset bug with the "tap to add recipient" + delete doesn't delete items but backspace does. */
52 * @addtogroup Multibuttonentry
56 typedef Eina_Bool (*Elm_Multibuttonentry_Item_Filter_callback)(Evas_Object *obj, const char *item_label, void *item_data, void *data);
59 * @brief Add a new multibuttonentry to the parent
61 * @param parent The parent object
62 * @return The new object or NULL if it cannot be created
65 * @ingroup Multibuttonentry
67 EAPI Evas_Object *elm_multibuttonentry_add(Evas_Object *parent);
71 * Get the entry of the multibuttonentry object
73 * @param obj The multibuttonentry object
74 * @return The entry object, or NULL if none
76 * @ingroup Multibuttonentry
78 EAPI Evas_Object *elm_multibuttonentry_entry_get(const Evas_Object *obj);
83 * @param obj The multibuttonentry object
84 * @return The guide text, or NULL if none
86 * @ingroup Multibuttonentry
88 EAPI const char *elm_multibuttonentry_guide_text_get(const Evas_Object *obj);
93 * @param obj The multibuttonentry object
94 * @param guidetext The guide text string
96 * @ingroup Multibuttonentry
98 EAPI void elm_multibuttonentry_guide_text_set(Evas_Object *obj, const char *guidetext);
101 * Get the value of expanded state.
102 * In expanded state, the complete entry will be displayed.
103 * Otherwise, only single line of the entry will be displayed.
105 * @param obj The multibuttonentry object
106 * @return EINA_TRUE if the widget is in expanded state. EINA_FALSE if not.
108 * @ingroup Multibuttonentry
110 EAPI Eina_Bool elm_multibuttonentry_expanded_get(const Evas_Object *obj);
113 * Set/Unset the multibuttonentry to expanded state.
114 * In expanded state, the complete entry will be displayed.
115 * Otherwise, only single line of the entry will be displayed.
117 * @param obj The multibuttonentry object
118 * @param expanded the value of expanded state.
119 * Set this to EINA_TRUE for expanded state.
120 * Set this to EINA_FALSE for single line state.
122 * @ingroup Multibuttonentry
124 EAPI void elm_multibuttonentry_expanded_set(Evas_Object *obj, Eina_Bool expanded);
127 * Prepend a new item to the multibuttonentry
129 * @param obj The multibuttonentry object
130 * @param label The label of new item
131 * @param data The pointer to the data to be attached
132 * @return A handle to the item added or NULL if not possible
134 * @ingroup Multibuttonentry
136 EAPI Elm_Object_Item *elm_multibuttonentry_item_prepend(Evas_Object *obj, const char *label, void *data);
139 * Append a new item to the multibuttonentry
141 * @param obj The multibuttonentry object
142 * @param label The label of new item
143 * @param data The pointer to the data to be attached
144 * @return A handle to the item added or NULL if not possible
146 * @ingroup Multibuttonentry
148 // XXX: use support selected callback like other item_append APIs.
149 // EAPI Elm_Object_Item *elm_multibuttonentry_item_append(Evas_Object *obj, const char *label, Evas_Smart_Cb func, void *data);
150 EAPI Elm_Object_Item *elm_multibuttonentry_item_append(Evas_Object *obj, const char *label, void *data);
153 * Add a new item to the multibuttonentry before the indicated object
156 * @param obj The multibuttonentry object
157 * @param before The item before which to add it
158 * @param label The label of new item
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 * @ingroup Multibuttonentry
164 EAPI Elm_Object_Item *elm_multibuttonentry_item_insert_before(Evas_Object *obj, Elm_Object_Item *before, const char *label, void *data);
167 * Add a new item to the multibuttonentry after the indicated object
169 * @param obj The multibuttonentry object
170 * @param after The item after which to add it
171 * @param label The label of new item
172 * @param data The pointer to the data to be attached
173 * @return A handle to the item added or NULL if not possible
175 * @ingroup Multibuttonentry
177 EAPI Elm_Object_Item *elm_multibuttonentry_item_insert_after(Evas_Object *obj, Elm_Object_Item *after, const char *label, void *data);
180 * Get a list of items in the multibuttonentry
182 * @param obj The multibuttonentry object
183 * @return The list of items, or NULL if none
185 * @ingroup Multibuttonentry
187 EAPI const Eina_List *elm_multibuttonentry_items_get(const Evas_Object *obj);
190 * Get the first item in the multibuttonentry
192 * @param obj The multibuttonentry object
193 * @return The first item, or NULL if none
195 * @ingroup Multibuttonentry
197 EAPI Elm_Object_Item *elm_multibuttonentry_first_item_get(const Evas_Object *obj);
200 * Get the last item in the multibuttonentry
202 * @param obj The multibuttonentry object
203 * @return The last item, or NULL if none
205 * @ingroup Multibuttonentry
207 EAPI Elm_Object_Item *elm_multibuttonentry_last_item_get(const Evas_Object *obj);
210 * Get the selected item in the multibuttonentry
212 * @param obj The multibuttonentry object
213 * @return The selected item, or NULL if none
215 * @ingroup Multibuttonentry
217 EAPI Elm_Object_Item *elm_multibuttonentry_selected_item_get(const Evas_Object *obj);
220 * Set the selected state of an item
223 * @param selected if it's EINA_TRUE, select the item otherwise, unselect the item
225 * @ingroup Multibuttonentry
227 EAPI void elm_multibuttonentry_item_select(Elm_Object_Item *it, Eina_Bool selected);
230 * unselect all items.
232 * @param obj The multibuttonentry object
234 * @ingroup Multibuttonentry
236 EAPI void elm_multibuttonentry_item_unselect_all(Evas_Object *obj);
239 * Remove all items in the multibuttonentry.
241 * @param obj The multibuttonentry object
243 * @ingroup Multibuttonentry
245 EAPI void elm_multibuttonentry_clear(Evas_Object *obj);
248 * Get the previous item in the multibuttonentry
251 * @return The item before the item @p it
253 * @ingroup Multibuttonentry
255 EAPI Elm_Object_Item *elm_multibuttonentry_item_prev_get(const Elm_Object_Item *it);
258 * Get the next item in the multibuttonentry
261 * @return The item after the item @p it
263 * @ingroup Multibuttonentry
265 EAPI Elm_Object_Item *elm_multibuttonentry_item_next_get(const Elm_Object_Item *it);
268 * Append an item filter function for text inserted in the Multibuttonentry
270 * Append the given callback to the list. This functions will be called
271 * whenever any text is inserted into the Multibuttonentry, with the text to be inserted
272 * as a parameter. The callback function is free to alter the text in any way
273 * it wants, but it must remember to free the given pointer and update it.
274 * If the new text is to be discarded, the function can free it and set it text
275 * parameter to NULL. This will also prevent any following filters from being
278 * @param obj The multibuttonentry object
279 * @param func The function to use as item filter
280 * @param data User data to pass to @p func
282 * @ingroup Multibuttonentry
284 EAPI void elm_multibuttonentry_item_filter_append(Evas_Object *obj, Elm_Multibuttonentry_Item_Filter_callback func, void *data);
287 * Prepend a filter function for text inserted in the Multibuttonentry
289 * Prepend the given callback to the list. See elm_multibuttonentry_item_filter_append()
290 * for more information
292 * @param obj The multibuttonentry object
293 * @param func The function to use as text filter
294 * @param data User data to pass to @p func
296 * @ingroup Multibuttonentry
298 EAPI void elm_multibuttonentry_item_filter_prepend(Evas_Object *obj, Elm_Multibuttonentry_Item_Filter_callback func, void *data);
301 * Remove a filter from the list
303 * Removes the given callback from the filter list. See elm_multibuttonentry_item_filter_append()
304 * for more information.
306 * @param obj The multibuttonentry object
307 * @param func The filter function to remove
308 * @param data The user data passed when adding the function
310 * @ingroup Multibuttonentry
312 EAPI void elm_multibuttonentry_item_filter_remove(Evas_Object *obj, Elm_Multibuttonentry_Item_Filter_callback func, void *data);