2 * @defgroup Hoversel Hoversel
4 * @image html img/widget/hoversel/preview-00.png
5 * @image latex img/widget/hoversel/preview-00.eps
7 * A hoversel is a button that pops up a list of items (automatically
8 * choosing the direction to display) that have a label and, optionally, an
9 * icon to select from. It is a convenience widget to avoid the need to do
10 * all the piecing together yourself. It is intended for a small number of
11 * items in the hoversel menu (no more than 8), though is capable of many
14 * Signals that you can add callbacks for are:
15 * "clicked" - the user clicked the hoversel button and popped up the sel
16 * "selected" - an item in the hoversel list is selected. event_info is the item
17 * "dismissed" - the hover is dismissed
19 * Default content parts of the hoversel widget that you can use for are:
20 * @li "icon" - An icon of the hoversel
22 * Default text parts of the hoversel widget that you can use for are:
23 * @li "default" - Label of the hoversel
25 * Supported elm_object common APIs.
26 * @li elm_object_disabled_set
27 * @li elm_object_disabled_get
28 * @li elm_object_part_text_set
29 * @li elm_object_part_text_get
30 * @li elm_object_part_content_set
31 * @li elm_object_part_content_unset
33 * Supported elm_object_item common APIs.
34 * @li elm_object_item_part_text_get
36 * See @ref tutorial_hoversel for an example.
41 * @brief Add a new Hoversel object
43 * @param parent The parent object
44 * @return The new object or NULL if it cannot be created
46 EAPI Evas_Object *elm_hoversel_add(Evas_Object *parent);
49 * @brief This sets the hoversel to expand horizontally.
51 * @param obj The hoversel object
52 * @param horizontal If true, the hover will expand horizontally to the
55 * @note The initial button will display horizontally regardless of this
58 EAPI void elm_hoversel_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
61 * @brief This returns whether the hoversel is set to expand horizontally.
63 * @param obj The hoversel object
64 * @return If true, the hover will expand horizontally to the right.
66 * @see elm_hoversel_horizontal_set()
68 EAPI Eina_Bool elm_hoversel_horizontal_get(const Evas_Object *obj);
71 * @brief Set the Hover parent
73 * @param obj The hoversel object
74 * @param parent The parent to use
76 * Sets the hover parent object, the area that will be darkened when the
77 * hoversel is clicked. Should probably be the window that the hoversel is
78 * in. See @ref Hover objects for more information.
80 EAPI void elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
83 * @brief Get the Hover parent
85 * @param obj The hoversel object
86 * @return The used parent
88 * Gets the hover parent object.
90 * @see elm_hoversel_hover_parent_set()
92 EAPI Evas_Object *elm_hoversel_hover_parent_get(const Evas_Object *obj);
95 * @brief This triggers the hoversel popup from code, the same as if the user
96 * had clicked the button.
98 * @param obj The hoversel object
100 EAPI void elm_hoversel_hover_begin(Evas_Object *obj);
103 * @brief This dismisses the hoversel popup as if the user had clicked
106 * @param obj The hoversel object
108 EAPI void elm_hoversel_hover_end(Evas_Object *obj);
111 * @brief Returns whether the hoversel is expanded.
113 * @param obj The hoversel object
114 * @return This will return EINA_TRUE if the hoversel is expanded or
115 * EINA_FALSE if it is not expanded.
117 EAPI Eina_Bool elm_hoversel_expanded_get(const Evas_Object *obj);
120 * @brief This will remove all the children items from the hoversel.
122 * @param obj The hoversel object
124 * @warning Should @b not be called while the hoversel is active; use
125 * elm_hoversel_expanded_get() to check first.
127 * @see elm_object_item_del()
129 EAPI void elm_hoversel_clear(Evas_Object *obj);
132 * @brief Get the list of items within the given hoversel.
134 * @param obj The hoversel object
135 * @return Returns a list of Elm_Object_Item*
137 * @see elm_hoversel_item_add()
139 EAPI const Eina_List *elm_hoversel_items_get(const Evas_Object *obj);
142 * @brief Add an item to the hoversel button
144 * @param obj The hoversel object
145 * @param label The text label to use for the item (NULL if not desired)
146 * @param icon_file An image file path on disk to use for the icon or standard
147 * icon name (NULL if not desired)
148 * @param icon_type The icon type if relevant
149 * @param func Convenience function to call when this item is selected
150 * @param data Data to pass to item-related functions
151 * @return A handle to the item added.
153 * This adds an item to the hoversel to show when it is clicked. Note: if you
154 * need to use an icon from an edje file then use
155 * elm_hoversel_item_icon_set() right after this function, and set
156 * icon_file to NULL here.
158 * For more information on what @p icon_file and @p icon_type are, see the
159 * @ref Icon "icon documentation".
161 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);
164 * @brief This sets the icon for the given hoversel item.
166 * @param it The item to set the icon
167 * @param icon_file An image file path on disk to use for the icon or standard
169 * @param icon_group The edje group to use if @p icon_file is an edje file. Set this
170 * to NULL if the icon is not an edje file
171 * @param icon_type The icon type
173 * The icon can be loaded from the standard set, from an image file, or from
176 * @see elm_hoversel_item_add()
178 EAPI void elm_hoversel_item_icon_set(Elm_Object_Item *it, const char *icon_file, const char *icon_group, Elm_Icon_Type icon_type);
181 * @brief Get the icon object of the hoversel item
183 * @param it The item to get the icon from
184 * @param icon_file The image file path on disk used for the icon or standard
186 * @param icon_group The edje group used if @p icon_file is an edje file. NULL
187 * if the icon is not an edje file
188 * @param icon_type The icon type
190 * @see elm_hoversel_item_icon_set()
191 * @see elm_hoversel_item_add()
193 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);