5 * @image html menu_inheritance_tree.png
6 * @image latex menu_inheritance_tree.eps
8 * @image html img/widget/menu/preview-00.png
9 * @image latex img/widget/menu/preview-00.eps
11 * A menu is a list of items displayed above its parent. When the menu is
12 * showing its parent is darkened. Each item can have a sub-menu. The menu
13 * object can be used to display a menu on a right click event, in a toolbar,
16 * Signals that you can add callbacks for are:
17 * @li "clicked" - the user clicked the empty space in the menu to dismiss.
19 * Default content parts of the menu items that you can use for are:
20 * @li "default" - A main content of the menu item
22 * Default text parts of the menu items that you can use for are:
23 * @li "default" - label in the menu item
25 * Supported elm_object_item common APIs.
26 * @li @ref elm_object_item_part_text_set
27 * @li @ref elm_object_item_part_text_get
28 * @li @ref elm_object_item_part_content_set
29 * @li @ref elm_object_item_part_content_get
30 * @li @ref elm_object_item_disabled_set
31 * @li @ref elm_object_item_disabled_get
33 * @see @ref tutorial_menu
38 * @brief Add a new menu to the parent
40 * @param parent The parent object.
41 * @return The new object or NULL if it cannot be created.
45 EAPI Evas_Object *elm_menu_add(Evas_Object *parent);
48 * @brief Set the parent for the given menu widget
50 * @param obj The menu object.
51 * @param parent The new parent.
55 EAPI void elm_menu_parent_set(Evas_Object *obj, Evas_Object *parent);
58 * @brief Get the parent for the given menu widget
60 * @param obj The menu object.
63 * @see elm_menu_parent_set()
67 EAPI Evas_Object *elm_menu_parent_get(const Evas_Object *obj);
70 * @brief Move the menu to a new position
72 * @param obj The menu object.
73 * @param x The new position.
74 * @param y The new position.
76 * Sets the top-left position of the menu to (@p x,@p y).
78 * @note @p x and @p y coordinates are relative to parent.
82 EAPI void elm_menu_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
85 * @brief Close a opened menu
87 * @param obj the menu object
90 * Hides the menu and all it's sub-menus.
94 EAPI void elm_menu_close(Evas_Object *obj);
97 * @brief Returns a list of @p item's items.
99 * @param obj The menu object
100 * @return An Eina_List* of @p item's items
104 EAPI const Eina_List *elm_menu_items_get(const Evas_Object *obj);
107 * @brief Get the Evas_Object of an Elm_Object_Item
109 * @param it The menu item object.
110 * @return The edje object containing the swallowed content
112 * @warning Don't manipulate this object!
116 EAPI Evas_Object *elm_menu_item_object_get(const Elm_Object_Item *it);
119 * @brief Add an item at the end of the given menu widget
121 * @param obj The menu object.
122 * @param parent The parent menu item (optional)
123 * @param icon An icon display on the item. The icon will be destroyed by the menu.
124 * @param label The label of the item.
125 * @param func Function called when the user select the item.
126 * @param data Data sent by the callback.
127 * @return Returns the new item.
131 EAPI Elm_Object_Item *elm_menu_item_add(Evas_Object *obj, Elm_Object_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
134 * @brief Set the icon of a menu item to the standard icon with name @p icon
136 * @param it The menu item object.
137 * @param icon The name of icon object to set for the content of @p item
139 * Once this icon is set, any previously set icon will be deleted.
143 EAPI void elm_menu_item_icon_name_set(Elm_Object_Item *it, const char *icon);
146 * @brief Get the string representation from the icon of a menu item
148 * @param it The menu item object.
149 * @return The string representation of @p item's icon or NULL
151 * @see elm_menu_item_icon_name_set()
155 EAPI const char *elm_menu_item_icon_name_get(const Elm_Object_Item *it);
158 * @brief Set the selected state of @p item.
160 * @param it The menu item object.
161 * @param selected The selected/unselected state of the item
165 EAPI void elm_menu_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
168 * @brief Get the selected state of @p item.
170 * @param it The menu item object.
171 * @return The selected/unselected state of the item
173 * @see elm_menu_item_selected_set()
177 EAPI Eina_Bool elm_menu_item_selected_get(const Elm_Object_Item *it);
180 * @brief Add a separator item to menu @p obj under @p parent.
182 * @param obj The menu object
183 * @param parent The item to add the separator under
184 * @return The created item or NULL on failure
186 * This is item is a @ref Separator.
190 EAPI Elm_Object_Item *elm_menu_item_separator_add(Evas_Object *obj, Elm_Object_Item *parent);
193 * @brief Returns whether @p item is a separator.
195 * @param it The item to check
196 * @return If true, @p item is a separator
198 * @see elm_menu_item_separator_add()
202 EAPI Eina_Bool elm_menu_item_is_separator(Elm_Object_Item *it);
205 * @brief Returns a list of @p item's subitems.
208 * @return An Eina_List* of @p item's subitems
210 * @see elm_menu_add()
214 EAPI const Eina_List *elm_menu_item_subitems_get(const Elm_Object_Item *it);
217 * @brief Get the position of a menu item
219 * @param it The menu item
220 * @return The item's index
222 * This function returns the index position of a menu item in a menu.
223 * For a sub-menu, this number is relative to the first item in the sub-menu.
225 * @note Index values begin with 0
229 EAPI unsigned int elm_menu_item_index_get(const Elm_Object_Item *it);
232 * @brief Get the selected item in the menu
234 * @param obj The menu object
235 * @return The selected item, or NULL if none
237 * @see elm_menu_item_selected_get()
238 * @see elm_menu_item_selected_set()
242 EAPI Elm_Object_Item *elm_menu_selected_item_get(const Evas_Object *obj);
245 * @brief Get the last item in the menu
247 * @param obj The menu object
248 * @return The last item, or NULL if none
252 EAPI Elm_Object_Item *elm_menu_last_item_get(const Evas_Object *obj);
255 * @brief Get the first item in the menu
257 * @param obj The menu object
258 * @return The first item, or NULL if none
262 EAPI Elm_Object_Item *elm_menu_first_item_get(const Evas_Object *obj);
265 * @brief Get the next item in the menu.
267 * @param it The menu item object.
268 * @return The item after it, or NULL if none
272 EAPI Elm_Object_Item *elm_menu_item_next_get(const Elm_Object_Item *it);
275 * @brief Get the previous item in the menu.
277 * @param it The menu item object.
278 * @return The item before it, or NULL if none
282 EAPI Elm_Object_Item *elm_menu_item_prev_get(const Elm_Object_Item *it);