2 * @defgroup Multibuttonentry Multibuttonentry
4 * A Multibuttonentry is a widget to allow a user enter text and manage it as a number of buttons
5 * Each text button is inserted by pressing the "return" key. If there is no space in the current row,
6 * a new button is added to the next row. When a text button is pressed, it will become focused.
7 * Backspace removes the focus.
8 * When the Multibuttonentry loses focus items longer than 1 lines are shrunk to one line.
10 * Smart callbacks one can register:
11 * - @c "item,selected" - when item is selected. May be called on backspace key.
12 * - @c "item,added" - when a new multibuttonentry item is added.
13 * - @c "item,deleted" - when a multibuttonentry item is deleted.
14 * - @c "item,clicked" - selected item of multibuttonentry is clicked.
15 * - @c "clicked" - when multibuttonentry is clicked.
16 * - @c "focused" - when multibuttonentry is focused.
17 * - @c "unfocused" - when multibuttonentry is unfocused.
18 * - @c "expanded" - when multibuttonentry is expanded.
19 * - @c "shrank" - when multibuttonentry is shrank.
20 * - @c "shrank,state,changed" - when shrink mode state of multibuttonentry is changed.
24 * @addtogroup Multibuttonentry
28 typedef struct _Multibuttonentry_Item Elm_Multibuttonentry_Item;
29 typedef Eina_Bool (*Elm_Multibuttonentry_Item_Filter_callback)(Evas_Object *obj, const char *item_label, void *item_data, void *data);
32 * @brief Add a new multibuttonentry to the parent
34 * @param parent The parent object
35 * @return The new object or NULL if it cannot be created
39 elm_multibuttonentry_add(Evas_Object *parent)
45 * @param obj The multibuttonentry object
46 * @return The label, or NULL if none
49 EAPI const char *elm_multibuttonentry_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
54 * @param obj The multibuttonentry object
55 * @param label The text label string
58 EAPI void elm_multibuttonentry_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1);
61 * Get the entry of the multibuttonentry object
63 * @param obj The multibuttonentry object
64 * @return The entry object, or NULL if none
67 EAPI Evas_Object *elm_multibuttonentry_entry_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
72 * @param obj The multibuttonentry object
73 * @return The guide text, or NULL if none
76 EAPI const char *elm_multibuttonentry_guide_text_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
81 * @param obj The multibuttonentry object
82 * @param guidetext The guide text string
85 EAPI void elm_multibuttonentry_guide_text_set(Evas_Object *obj, const char *guidetext) EINA_ARG_NONNULL(1);
88 * Get the value of shrink_mode state.
90 * @param obj The multibuttonentry object
91 * @return the value of shrink mode state.
94 EAPI int elm_multibuttonentry_shrink_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
97 * Set/Unset the multibuttonentry to shrink mode state of single line
99 * @param obj The multibuttonentry object
100 * @param shrink the value of shrink_mode state. set this to 1 to set the multibuttonentry to shrink state of single line. set this to 0 to unset the contracted state.
103 EAPI void elm_multibuttonentry_shrink_mode_set(Evas_Object *obj, int shrink) EINA_ARG_NONNULL(1);
106 * Prepend a new item to the multibuttonentry
108 * @param obj The multibuttonentry object
109 * @param label The label of new item
110 * @param data The ponter to the data to be attached
111 * @return A handle to the item added or NULL if not possible
114 EAPI Elm_Multibuttonentry_Item *elm_multibuttonentry_item_prepend(Evas_Object *obj, const char *label, void *data) EINA_ARG_NONNULL(1);
117 * Append a new item to the multibuttonentry
119 * @param obj The multibuttonentry object
120 * @param label The label of new item
121 * @param data The ponter to the data to be attached
122 * @return A handle to the item added or NULL if not possible
125 EAPI Elm_Multibuttonentry_Item *elm_multibuttonentry_item_append(Evas_Object *obj, const char *label, void *data) EINA_ARG_NONNULL(1);
128 * Add a new item to the multibuttonentry before the indicated object
131 * @param obj The multibuttonentry object
132 * @param before The item before which to add it
133 * @param label The label of new item
134 * @param data The ponter to the data to be attached
135 * @return A handle to the item added or NULL if not possible
138 EAPI Elm_Multibuttonentry_Item *elm_multibuttonentry_item_insert_before(Evas_Object *obj, Elm_Multibuttonentry_Item *before, const char *label, void *data) EINA_ARG_NONNULL(1);
141 * Add a new item to the multibuttonentry after the indicated object
143 * @param obj The multibuttonentry object
144 * @param after The item after which to add it
145 * @param label The label of new item
146 * @param data The ponter to the data to be attached
147 * @return A handle to the item added or NULL if not possible
150 EAPI Elm_Multibuttonentry_Item *elm_multibuttonentry_item_insert_after(Evas_Object *obj, Elm_Multibuttonentry_Item *after, const char *label, void *data) EINA_ARG_NONNULL(1);
153 * Get a list of items in the multibuttonentry
155 * @param obj The multibuttonentry object
156 * @return The list of items, or NULL if none
159 EAPI const Eina_List *elm_multibuttonentry_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
162 * Get the first item in the multibuttonentry
164 * @param obj The multibuttonentry object
165 * @return The first item, or NULL if none
168 EAPI Elm_Multibuttonentry_Item *elm_multibuttonentry_first_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
171 * Get the last item in the multibuttonentry
173 * @param obj The multibuttonentry object
174 * @return The last item, or NULL if none
177 EAPI Elm_Multibuttonentry_Item *elm_multibuttonentry_last_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
180 * Get the selected item in the multibuttonentry
182 * @param obj The multibuttonentry object
183 * @return The selected item, or NULL if none
186 EAPI Elm_Multibuttonentry_Item *elm_multibuttonentry_selected_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
189 * Set the selected state of an item
191 * @param item The item
192 * @param selected if it's EINA_TRUE, select the item otherwise, unselect the item
195 EAPI void elm_multibuttonentry_item_select(Elm_Multibuttonentry_Item *item, Eina_Bool selected) EINA_ARG_NONNULL(1);
198 * unselect all items.
200 * @param obj The multibuttonentry object
203 EAPI void elm_multibuttonentry_item_unselect_all(Evas_Object *obj) EINA_ARG_NONNULL(1);
206 * Delete a given item
208 * @param item The item
211 EAPI void elm_multibuttonentry_item_del(Elm_Multibuttonentry_Item *item) EINA_ARG_NONNULL(1);
214 * Remove all items in the multibuttonentry.
216 * @param obj The multibuttonentry object
219 EAPI void elm_multibuttonentry_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
222 * Get the label of a given item
224 * @param item The item
225 * @return The label of a given item, or NULL if none
228 EAPI const char *elm_multibuttonentry_item_label_get(const Elm_Multibuttonentry_Item *item) EINA_ARG_NONNULL(1);
231 * Set the label of a given item
233 * @param item The item
234 * @param str The text label string
237 EAPI void elm_multibuttonentry_item_label_set(Elm_Multibuttonentry_Item *item, const char *str) EINA_ARG_NONNULL(1);
240 * Get the previous item in the multibuttonentry
242 * @param item The item
243 * @return The item before the item @p item
246 EAPI Elm_Multibuttonentry_Item *elm_multibuttonentry_item_prev_get(const Elm_Multibuttonentry_Item *item) EINA_ARG_NONNULL(1);
249 * Get the next item in the multibuttonentry
251 * @param item The item
252 * @return The item after the item @p item
255 EAPI Elm_Multibuttonentry_Item *elm_multibuttonentry_item_next_get(const Elm_Multibuttonentry_Item *item) EINA_ARG_NONNULL(1);
258 * Append a item filter function for text inserted in the Multibuttonentry
260 * Append the given callback to the list. This functions will be called
261 * whenever any text is inserted into the Multibuttonentry, with the text to be inserted
262 * as a parameter. The callback function is free to alter the text in any way
263 * it wants, but it must remember to free the given pointer and update it.
264 * If the new text is to be discarded, the function can free it and set it text
265 * parameter to NULL. This will also prevent any following filters from being
268 * @param obj The multibuttonentryentry object
269 * @param func The function to use as item filter
270 * @param data User data to pass to @p func
273 EAPI void elm_multibuttonentry_item_filter_append(Evas_Object *obj, Elm_Multibuttonentry_Item_Filter_callback func, void *data) EINA_ARG_NONNULL(1);
276 * Prepend a filter function for text inserted in the Multibuttentry
278 * Prepend the given callback to the list. See elm_multibuttonentry_item_filter_append()
279 * for more information
281 * @param obj The multibuttonentry object
282 * @param func The function to use as text filter
283 * @param data User data to pass to @p func
286 EAPI void elm_multibuttonentry_item_filter_prepend(Evas_Object *obj, Elm_Multibuttonentry_Item_Filter_callback func, void *data) EINA_ARG_NONNULL(1);
289 * Remove a filter from the list
291 * Removes the given callback from the filter list. See elm_multibuttonentry_item_filter_append()
292 * for more information.
294 * @param obj The multibuttonentry object
295 * @param func The filter function to remove
296 * @param data The user data passed when adding the function
299 EAPI void elm_multibuttonentry_item_filter_remove(Evas_Object *obj, Elm_Multibuttonentry_Item_Filter_callback func, void *data) EINA_ARG_NONNULL(1);