2 * @defgroup Hoversel Hoversel
5 * @image html img/widget/hoversel/preview-00.png
6 * @image latex img/widget/hoversel/preview-00.eps
8 * A hoversel is a button that pops up a list of items (automatically
9 * choosing the direction to display) that have a label and, optionally, an
10 * icon to select from. It is a convenience widget to avoid the need to do
11 * all the piecing together yourself. It is intended for a small number of
12 * items in the hoversel menu (no more than 8), though is capable of many
15 * Signals that you can add callbacks for are:
16 * "clicked" - the user clicked the hoversel button and popped up the sel
17 * "selected" - an item in the hoversel list is selected. event_info is the item
18 * "dismissed" - the hover is dismissed
20 * Default content parts of the hoversel widget that you can use for are:
21 * @li "icon" - An icon of the hoversel
23 * Default text parts of the hoversel widget that you can use for are:
24 * @li "default" - Label of the hoversel
26 * Supported elm_object common APIs.
27 * @li @ref elm_object_disabled_set
28 * @li @ref elm_object_disabled_get
29 * @li @ref elm_object_part_text_set
30 * @li @ref elm_object_part_text_get
31 * @li @ref elm_object_part_content_set
32 * @li @ref elm_object_part_content_unset
34 * Supported elm_object_item common APIs.
35 * @li elm_object_item_part_text_get
37 * See @ref tutorial_hoversel for an example.
42 * @brief Add a new Hoversel object
44 * @param parent The parent object
45 * @return The new object or NULL if it cannot be created
49 EAPI Evas_Object *elm_hoversel_add(Evas_Object *parent);
52 * @brief This sets the hoversel to expand horizontally.
54 * @param obj The hoversel object
55 * @param horizontal If true, the hover will expand horizontally to the
58 * @note The initial button will display horizontally regardless of this
63 EAPI void elm_hoversel_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
66 * @brief This returns whether the hoversel is set to expand horizontally.
68 * @param obj The hoversel object
69 * @return If true, the hover will expand horizontally to the right.
71 * @see elm_hoversel_horizontal_set()
75 EAPI Eina_Bool elm_hoversel_horizontal_get(const Evas_Object *obj);
78 * @brief Set the Hover parent
80 * @param obj The hoversel object
81 * @param parent The parent to use
83 * Sets the hover parent object, the area that will be darkened when the
84 * hoversel is clicked. Should probably be the window that the hoversel is
85 * in. See @ref Hover objects for more information.
89 EAPI void elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
92 * @brief Get the Hover parent
94 * @param obj The hoversel object
95 * @return The used parent
97 * Gets the hover parent object.
99 * @see elm_hoversel_hover_parent_set()
103 EAPI Evas_Object *elm_hoversel_hover_parent_get(const Evas_Object *obj);
106 * @brief This triggers the hoversel popup from code, the same as if the user
107 * had clicked the button.
109 * @param obj The hoversel object
113 EAPI void elm_hoversel_hover_begin(Evas_Object *obj);
116 * @brief This dismisses the hoversel popup as if the user had clicked
119 * @param obj The hoversel object
123 EAPI void elm_hoversel_hover_end(Evas_Object *obj);
126 * @brief Returns whether the hoversel is expanded.
128 * @param obj The hoversel object
129 * @return This will return EINA_TRUE if the hoversel is expanded or
130 * EINA_FALSE if it is not expanded.
134 EAPI Eina_Bool elm_hoversel_expanded_get(const Evas_Object *obj);
137 * @brief This will remove all the children items from the hoversel.
139 * @param obj The hoversel object
141 * @warning Should @b not be called while the hoversel is active; use
142 * elm_hoversel_expanded_get() to check first.
144 * @see elm_object_item_del()
148 EAPI void elm_hoversel_clear(Evas_Object *obj);
151 * @brief Get the list of items within the given hoversel.
153 * @param obj The hoversel object
154 * @return Returns a list of Elm_Object_Item*
156 * @see elm_hoversel_item_add()
160 EAPI const Eina_List *elm_hoversel_items_get(const Evas_Object *obj);
163 * @brief Add an item to the hoversel button
165 * @param obj The hoversel object
166 * @param label The text label to use for the item (NULL if not desired)
167 * @param icon_file An image file path on disk to use for the icon or standard
168 * icon name (NULL if not desired)
169 * @param icon_type The icon type if relevant
170 * @param func Convenience function to call when this item is selected
171 * @param data Data to pass to item-related functions
172 * @return A handle to the item added.
174 * This adds an item to the hoversel to show when it is clicked. Note: if you
175 * need to use an icon from an edje file then use
176 * elm_hoversel_item_icon_set() right after this function, and set
177 * icon_file to NULL here.
179 * For more information on what @p icon_file and @p icon_type are, see the
180 * @ref Icon "icon documentation".
184 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);
187 * @brief This sets the icon for the given hoversel item.
189 * @param it The item to set the icon
190 * @param icon_file An image file path on disk to use for the icon or standard
192 * @param icon_group The edje group to use if @p icon_file is an edje file. Set this
193 * to NULL if the icon is not an edje file
194 * @param icon_type The icon type
196 * The icon can be loaded from the standard set, from an image file, or from
199 * @see elm_hoversel_item_add()
203 EAPI void elm_hoversel_item_icon_set(Elm_Object_Item *it, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type);
206 * @brief Get the icon object of the hoversel item
208 * @param it The item to get the icon from
209 * @param icon_file The image file path on disk used for the icon or standard
211 * @param icon_group The edje group used if @p icon_file is an edje file. NULL
212 * if the icon is not an edje file
213 * @param icon_type The icon type
215 * @see elm_hoversel_item_icon_set()
216 * @see elm_hoversel_item_add()
220 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);