2 * @defgroup Hoversel Hoversel
5 * @image html hoversel_inheritance_tree.png
6 * @image latex hoversel_inheritance_tree.eps
8 * @image html img/widget/hoversel/preview-00.png
9 * @image latex img/widget/hoversel/preview-00.eps
11 * A hoversel is a button that pops up a list of items (automatically
12 * choosing the direction to display) that have a label and, optionally, an
13 * icon to select from. It is a convenience widget to avoid the need to do
14 * all the piecing together yourself. It is intended for a small number of
15 * items in the hoversel menu (no more than 8), though is capable of many
18 * This widget inherits from the @ref Button one, so that all the
19 * functions acting on it also work for hoversel objects.
21 * This widget emits the following signals, besides the ones sent from
23 * - @c "clicked" - the user clicked the hoversel button and popped up
25 * - @c "selected" - an item in the hoversel list is selected. event_info
27 * - @c "dismissed" - the hover is dismissed
29 * Default content parts of the hoversel widget that you can use for are:
30 * @li "icon" - An icon of the hoversel
32 * Default text parts of the hoversel widget that you can use for are:
33 * @li "default" - Label of the hoversel
35 * Supported elm_object common APIs.
36 * @li @ref elm_object_disabled_set
37 * @li @ref elm_object_disabled_get
38 * @li @ref elm_object_part_text_set
39 * @li @ref elm_object_part_text_get
40 * @li @ref elm_object_part_content_set
41 * @li @ref elm_object_part_content_unset
43 * Supported elm_object_item common APIs.
44 * @li elm_object_item_part_text_get
46 * See @ref tutorial_hoversel for an example.
51 * @brief Add a new Hoversel object
53 * @param parent The parent object
54 * @return The new object or NULL if it cannot be created
58 EAPI Evas_Object *elm_hoversel_add(Evas_Object *parent);
61 * @brief This sets the hoversel to expand horizontally.
63 * @param obj The hoversel object
64 * @param horizontal If true, the hover will expand horizontally to the
67 * @note The initial button will display horizontally regardless of this
72 EAPI void elm_hoversel_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
75 * @brief This returns whether the hoversel is set to expand horizontally.
77 * @param obj The hoversel object
78 * @return If true, the hover will expand horizontally to the right.
80 * @see elm_hoversel_horizontal_set()
84 EAPI Eina_Bool elm_hoversel_horizontal_get(const Evas_Object *obj);
87 * @brief Set the Hover parent
89 * @param obj The hoversel object
90 * @param parent The parent to use
92 * Sets the hover parent object, the area that will be darkened when the
93 * hoversel is clicked. Should probably be the window that the hoversel is
94 * in. See @ref Hover objects for more information.
98 EAPI void elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
101 * @brief Get the Hover parent
103 * @param obj The hoversel object
104 * @return The used parent
106 * Gets the hover parent object.
108 * @see elm_hoversel_hover_parent_set()
112 EAPI Evas_Object *elm_hoversel_hover_parent_get(const Evas_Object *obj);
115 * @brief This triggers the hoversel popup from code, the same as if the user
116 * had clicked the button.
118 * @param obj The hoversel object
122 EAPI void elm_hoversel_hover_begin(Evas_Object *obj);
125 * @brief This dismisses the hoversel popup as if the user had clicked
128 * @param obj The hoversel object
132 EAPI void elm_hoversel_hover_end(Evas_Object *obj);
135 * @brief Returns whether the hoversel is expanded.
137 * @param obj The hoversel object
138 * @return This will return EINA_TRUE if the hoversel is expanded or
139 * EINA_FALSE if it is not expanded.
143 EAPI Eina_Bool elm_hoversel_expanded_get(const Evas_Object *obj);
146 * @brief This will remove all the children items from the hoversel.
148 * @param obj The hoversel object
150 * @warning Should @b not be called while the hoversel is active; use
151 * elm_hoversel_expanded_get() to check first.
153 * @see elm_object_item_del()
157 EAPI void elm_hoversel_clear(Evas_Object *obj);
160 * @brief Get the list of items within the given hoversel.
162 * @param obj The hoversel object
163 * @return Returns a list of Elm_Object_Item*
165 * @see elm_hoversel_item_add()
169 EAPI const Eina_List *elm_hoversel_items_get(const Evas_Object *obj);
172 * @brief Add an item to the hoversel button
174 * @param obj The hoversel object
175 * @param label The text label to use for the item (NULL if not desired)
176 * @param icon_file An image file path on disk to use for the icon or standard
177 * icon name (NULL if not desired)
178 * @param icon_type The icon type if relevant
179 * @param func Convenience function to call when this item is selected
180 * @param data Data to pass to item-related functions
181 * @return A handle to the item added.
183 * This adds an item to the hoversel to show when it is clicked. Note: if you
184 * need to use an icon from an edje file then use
185 * elm_hoversel_item_icon_set() right after this function, and set
186 * icon_file to NULL here.
188 * For more information on what @p icon_file and @p icon_type are, see the
189 * @ref Icon "icon documentation".
193 EAPI Elm_Object_Item *elm_hoversel_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data);
196 * @brief This sets the icon for the given hoversel item.
198 * @param it The item to set the icon
199 * @param icon_file An image file path on disk to use for the icon or standard
201 * @param icon_group The edje group to use if @p icon_file is an edje file. Set this
202 * to NULL if the icon is not an edje file
203 * @param icon_type The icon type
205 * The icon can be loaded from the standard set, from an image file, or from
208 * @see elm_hoversel_item_add()
212 EAPI void elm_hoversel_item_icon_set(Elm_Object_Item *it, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type);
215 * @brief Get the icon object of the hoversel item
217 * @param it The item to get the icon from
218 * @param icon_file The image file path on disk used for the icon or standard
220 * @param icon_group The edje group used if @p icon_file is an edje file. NULL
221 * if the icon is not an edje file
222 * @param icon_type The icon type
224 * @see elm_hoversel_item_icon_set()
225 * @see elm_hoversel_item_add()
229 EAPI void elm_hoversel_item_icon_get(const Elm_Object_Item *it, const char **icon_file, const char **icon_group, Elm_Icon_Type *icon_type);