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" - this is called when an item is selected by api, user
17 * interaction, and etc. this is also called when a user press back space
18 * while cursor is on the first field of entry.
19 * - @c "item,added" - when a new multibuttonentry item is added.
20 * - @c "item,deleted" - when a multibuttonentry item is deleted.
21 * - @c "item,clicked" - this is called when an item is clicked by user
22 * interaction. Both "item,selected" and "item,clicked" are needed.
23 * - @c "clicked" - when multibuttonentry is clicked.
24 * - @c "focused" - when multibuttonentry is focused.
25 * - @c "unfocused" - when multibuttonentry is unfocused.
26 * - @c "expanded" - when multibuttonentry is expanded.
27 * - @c "contracted" - when multibuttonentry is contracted.
28 * - @c "expand,state,changed" - when shrink mode state of multibuttonentry is changed.
30 * Default text parts of the multibuttonentry widget that you can use for are:
31 * @li "default" - A label of the multibuttonentry
33 * Default text parts of the multibuttonentry items that you can use for are:
34 * @li "default" - A label of the multibuttonentry item
36 * Supported elm_object common APIs.
37 * @li elm_object_signal_emit
38 * @li elm_object_part_text_set
39 * @li elm_object_part_text_get
41 * Supported elm_object_item common APIs.
42 * @li elm_object_item_part_text_set
43 * @li elm_object_item_part_text_get
48 * @addtogroup Multibuttonentry
53 * @brief Callback to be invoked when an item is added to the multibuttonentry.
55 * @param obj The parent object
56 * @param item_label The label corresponding to the added item.
57 * @param item_data data specific to this item.
58 * @param data data specific to the multibuttonentry.
61 * EINA_FALSE otherwise.
63 * @ingroup Multibuttonentry
65 typedef Eina_Bool (*Elm_Multibuttonentry_Item_Filter_Cb)(Evas_Object *obj, const char *item_label, void *item_data, void *data);
68 * @brief Add a new multibuttonentry to the parent
70 * @param parent The parent object
71 * @return The new object or NULL if it cannot be created
74 * @ingroup Multibuttonentry
76 EAPI Evas_Object *elm_multibuttonentry_add(Evas_Object *parent);
80 * Get the entry of the multibuttonentry object
82 * @param obj The multibuttonentry object
83 * @return The entry object, or NULL if none
85 * @ingroup Multibuttonentry
87 EAPI Evas_Object *elm_multibuttonentry_entry_get(const Evas_Object *obj);
90 * Get the value of expanded state.
91 * In expanded state, the complete entry will be displayed.
92 * Otherwise, only single line of the entry will be displayed.
94 * @param obj The multibuttonentry object
95 * @return EINA_TRUE if the widget is in expanded state. EINA_FALSE if not.
97 * @ingroup Multibuttonentry
99 EAPI Eina_Bool elm_multibuttonentry_expanded_get(const Evas_Object *obj);
102 * Set/Unset the multibuttonentry to expanded state.
103 * In expanded state, the complete entry will be displayed.
104 * Otherwise, only single line of the entry will be displayed.
106 * @param obj The multibuttonentry object
107 * @param expanded the value of expanded state.
108 * Set this to EINA_TRUE for expanded state.
109 * Set this to EINA_FALSE for single line state.
111 * @ingroup Multibuttonentry
113 EAPI void elm_multibuttonentry_expanded_set(Evas_Object *obj, Eina_Bool expanded);
116 * Prepend a new item to the multibuttonentry
118 * @param obj The multibuttonentry object
119 * @param label The label of new item
120 * @param func The callback function to be invoked when this item is pressed.
121 * @param data The pointer to the data to be attached
122 * @return A handle to the item added or NULL if not possible
124 * @see Use elm_object_item_del() to delete the item.
126 * @ingroup Multibuttonentry
128 EAPI Elm_Object_Item *elm_multibuttonentry_item_prepend(Evas_Object *obj, const char *label, Evas_Smart_Cb func, void *data);
131 * Append a new item to the multibuttonentry
133 * @param obj The multibuttonentry object
134 * @param label The label of new item
135 * @param func The callback function to be invoked when this item is pressed.
136 * @param data The pointer to the data to be attached
137 * @return A handle to the item added or NULL if not possible
139 * @see Use elm_object_item_del() to delete the item.
141 * @ingroup Multibuttonentry
143 EAPI Elm_Object_Item *elm_multibuttonentry_item_append(Evas_Object *obj, const char *label, Evas_Smart_Cb func, void *data);
146 * Add a new item to the multibuttonentry before the indicated object
149 * @param obj The multibuttonentry object
150 * @param before The item before which to add it
151 * @param label The label of new item
152 * @param func The callback function to be invoked when this item is pressed.
153 * @param data The pointer to the data to be attached
154 * @return A handle to the item added or NULL if not possible
156 * @see Use elm_object_item_del() to delete the item.
158 * @ingroup Multibuttonentry
160 EAPI Elm_Object_Item *elm_multibuttonentry_item_insert_before(Evas_Object *obj, Elm_Object_Item *before, const char *label, Evas_Smart_Cb func, void *data);
163 * Add a new item to the multibuttonentry after the indicated object
165 * @param obj The multibuttonentry object
166 * @param after The item after which to add it
167 * @param label The label of new item
168 * @param func The callback function to be invoked when this item is pressed.
169 * @param data The pointer to the data to be attached
170 * @return A handle to the item added or NULL if not possible
172 * @see Use elm_object_item_del() to delete the item.
174 * @ingroup Multibuttonentry
176 EAPI Elm_Object_Item *elm_multibuttonentry_item_insert_after(Evas_Object *obj, Elm_Object_Item *after, const char *label, Evas_Smart_Cb func, void *data);
179 * Get a list of items in the multibuttonentry
181 * @param obj The multibuttonentry object
182 * @return The list of items, or NULL if none
184 * @ingroup Multibuttonentry
186 EAPI const Eina_List *elm_multibuttonentry_items_get(const Evas_Object *obj);
189 * Get the first item in the multibuttonentry
191 * @param obj The multibuttonentry object
192 * @return The first item, or NULL if none
194 * @ingroup Multibuttonentry
196 EAPI Elm_Object_Item *elm_multibuttonentry_first_item_get(const Evas_Object *obj);
199 * Get the last item in the multibuttonentry
201 * @param obj The multibuttonentry object
202 * @return The last item, or NULL if none
204 * @ingroup Multibuttonentry
206 EAPI Elm_Object_Item *elm_multibuttonentry_last_item_get(const Evas_Object *obj);
209 * Get the selected item in the multibuttonentry
211 * @param obj The multibuttonentry object
212 * @return The selected item, or NULL if none
214 * @ingroup Multibuttonentry
216 EAPI Elm_Object_Item *elm_multibuttonentry_selected_item_get(const Evas_Object *obj);
219 * Set the selected state of an item
222 * @param selected if it's EINA_TRUE, select the item otherwise, unselect the item
224 * @ingroup Multibuttonentry
226 EAPI void elm_multibuttonentry_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
230 * Get the selected state of an item
233 * @return EINA_TRUE if the item is selected, EINA_FALSE otherwise.
235 * @ingroup Multibuttonentry
237 EAPI Eina_Bool elm_multibuttonentry_item_selected_get(const Elm_Object_Item *it);
240 * Remove all items in the multibuttonentry.
242 * @param obj The multibuttonentry object
244 * @ingroup Multibuttonentry
246 EAPI void elm_multibuttonentry_clear(Evas_Object *obj);
249 * Get the previous item in the multibuttonentry
252 * @return The item before the item @p it
254 * @ingroup Multibuttonentry
256 EAPI Elm_Object_Item *elm_multibuttonentry_item_prev_get(const Elm_Object_Item *it);
259 * Get the next item in the multibuttonentry
262 * @return The item after the item @p it
264 * @ingroup Multibuttonentry
266 EAPI Elm_Object_Item *elm_multibuttonentry_item_next_get(const Elm_Object_Item *it);
269 * Append an item filter function for text inserted in the Multibuttonentry
271 * Append the given callback to the list. This functions will be called
272 * whenever any text is inserted into the Multibuttonentry, with the text to be inserted
273 * as a parameter. The callback function is free to alter the text in any way
274 * it wants, but it must remember to free the given pointer and update it.
275 * If the new text is to be discarded, the function can free it and set it text
276 * parameter to NULL. This will also prevent any following filters from being
279 * @param obj The multibuttonentry object
280 * @param func The function to use as item filter
281 * @param data User data to pass to @p func
283 * @ingroup Multibuttonentry
285 EAPI void elm_multibuttonentry_item_filter_append(Evas_Object *obj, Elm_Multibuttonentry_Item_Filter_Cb func, void *data);
288 * Prepend a filter function for text inserted in the Multibuttonentry
290 * Prepend the given callback to the list. See elm_multibuttonentry_item_filter_append()
291 * for more information
293 * @param obj The multibuttonentry object
294 * @param func The function to use as text filter
295 * @param data User data to pass to @p func
297 * @ingroup Multibuttonentry
299 EAPI void elm_multibuttonentry_item_filter_prepend(Evas_Object *obj, Elm_Multibuttonentry_Item_Filter_Cb func, void *data);
302 * Remove a filter from the list
304 * Removes the given callback from the filter list. See elm_multibuttonentry_item_filter_append()
305 * for more information.
307 * @param obj The multibuttonentry object
308 * @param func The filter function to remove
309 * @param data The user data passed when adding the function
311 * @ingroup Multibuttonentry
313 EAPI void elm_multibuttonentry_item_filter_remove(Evas_Object *obj, Elm_Multibuttonentry_Item_Filter_Cb func, void *data);