4 * @image html img/widget/menu/preview-00.png
5 * @image latex img/widget/menu/preview-00.eps
7 * A menu is a list of items displayed above its parent. When the menu is
8 * showing its parent is darkened. Each item can have a sub-menu. The menu
9 * object can be used to display a menu on a right click event, in a toolbar,
12 * Signals that you can add callbacks for are:
13 * @li "clicked" - the user clicked the empty space in the menu to dismiss.
16 * Default contents parts of the menu items that you can use for are:
18 * Default content parts of the menu items that you can use for are:
19 >>>>>>> remotes/origin/upstream
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 elm_object_item_part_text_set
27 * @li elm_object_item_part_text_get
28 * @li elm_object_item_part_content_set
29 * @li elm_object_item_part_content_get
30 * @li elm_object_item_disabled_set
31 * @li 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.
43 EAPI Evas_Object *elm_menu_add(Evas_Object *parent);
46 * @brief Set the parent for the given menu widget
48 * @param obj The menu object.
49 * @param parent The new parent.
51 EAPI void elm_menu_parent_set(Evas_Object *obj, Evas_Object *parent);
54 * @brief Get the parent for the given menu widget
56 * @param obj The menu object.
59 * @see elm_menu_parent_set()
61 EAPI Evas_Object *elm_menu_parent_get(const Evas_Object *obj);
64 * @brief Move the menu to a new position
66 * @param obj The menu object.
67 * @param x The new position.
68 * @param y The new position.
70 * Sets the top-left position of the menu to (@p x,@p y).
72 * @note @p x and @p y coordinates are relative to parent.
74 EAPI void elm_menu_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
77 * @brief Close a opened menu
79 * @param obj the menu object
82 * Hides the menu and all it's sub-menus.
84 EAPI void elm_menu_close(Evas_Object *obj);
87 * @brief Returns a list of @p item's items.
89 * @param obj The menu object
90 * @return An Eina_List* of @p item's items
92 EAPI const Eina_List *elm_menu_items_get(const Evas_Object *obj);
95 * @brief Get the Evas_Object of an Elm_Object_Item
97 * @param it The menu item object.
98 * @return The edje object containing the swallowed content
100 * @warning Don't manipulate this object!
103 EAPI Evas_Object *elm_menu_item_object_get(const Elm_Object_Item *it);
106 * @brief Add an item at the end of the given menu widget
108 * @param obj The menu object.
109 * @param parent The parent menu item (optional)
111 * @param icon An icon display on the item. The icon will be destryed by the menu.
113 * @param icon An icon display on the item. The icon will be destroyed by the menu.
114 >>>>>>> remotes/origin/upstream
115 * @param label The label of the item.
116 * @param func Function called when the user select the item.
117 * @param data Data sent by the callback.
118 * @return Returns the new item.
120 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);
124 * @brief Add an object swallowed in an item at the end of the given menu
127 * @param obj The menu object.
128 * @param parent The parent menu item (optional)
129 * @param subobj The object to swallow
130 * @param func Function called when the user select the item.
131 * @param data Data sent by the callback.
132 * @return Returns the new item.
134 * Add an evas object as an item to the menu.
136 EAPI Elm_Object_Item *elm_menu_item_add_object(Evas_Object *obj, Elm_Object_Item *parent, Evas_Object *subobj, Evas_Smart_Cb func, const void *data);
139 * @brief Set the icon of a menu item to the standard icon with name @p icon
141 * @param it The menu item object.
142 * @param icon The icon object to set for the content of @p item
144 * Once this icon is set, any previously set icon will be deleted.
146 EAPI void elm_menu_item_object_icon_name_set(Elm_Object_Item *it, const char *icon);
148 * @brief Set the icon of a menu item to the standard icon with name @p icon
150 * @param it The menu item object.
151 * @param icon The name of icon object to set for the content of @p item
153 * Once this icon is set, any previously set icon will be deleted.
155 EAPI void elm_menu_item_icon_name_set(Elm_Object_Item *it, const char *icon);
156 >>>>>>> remotes/origin/upstream
159 * @brief Get the string representation from the icon of a menu item
161 * @param it The menu item object.
162 * @return The string representation of @p item's icon or NULL
165 * @see elm_menu_item_object_icon_name_set()
167 EAPI const char *elm_menu_item_object_icon_name_get(const Elm_Object_Item *it);
169 * @see elm_menu_item_icon_name_set()
171 EAPI const char *elm_menu_item_icon_name_get(const Elm_Object_Item *it);
172 >>>>>>> remotes/origin/upstream
175 * @brief Set the selected state of @p item.
177 * @param it The menu item object.
178 * @param selected The selected/unselected state of the item
180 EAPI void elm_menu_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
183 * @brief Get the selected state of @p item.
185 * @param it The menu item object.
186 * @return The selected/unselected state of the item
188 * @see elm_menu_item_selected_set()
190 EAPI Eina_Bool elm_menu_item_selected_get(const Elm_Object_Item *it);
193 * @brief Add a separator item to menu @p obj under @p parent.
195 * @param obj The menu object
196 * @param parent The item to add the separator under
197 * @return The created item or NULL on failure
199 * This is item is a @ref Separator.
201 EAPI Elm_Object_Item *elm_menu_item_separator_add(Evas_Object *obj, Elm_Object_Item *parent);
204 * @brief Returns whether @p item is a separator.
206 * @param it The item to check
207 * @return If true, @p item is a separator
209 * @see elm_menu_item_separator_add()
211 EAPI Eina_Bool elm_menu_item_is_separator(Elm_Object_Item *it);
214 * @brief Returns a list of @p item's subitems.
217 * @return An Eina_List* of @p item's subitems
219 * @see elm_menu_add()
221 EAPI const Eina_List *elm_menu_item_subitems_get(const Elm_Object_Item *it);
224 * @brief Get the position of a menu item
226 * @param it The menu item
227 * @return The item's index
229 * This function returns the index position of a menu item in a menu.
230 * For a sub-menu, this number is relative to the first item in the sub-menu.
232 * @note Index values begin with 0
234 EAPI unsigned int elm_menu_item_index_get(const Elm_Object_Item *it);
238 * @brief @brief Return a menu item's owner menu
240 * @param it The menu item
241 * @return The menu object owning @p item, or NULL on failure
243 * Use this function to get the menu object owning an item.
245 EAPI Evas_Object *elm_menu_item_menu_get(const Elm_Object_Item *it);
249 >>>>>>> remotes/origin/upstream
250 * @brief Get the selected item in the menu
252 * @param obj The menu object
253 * @return The selected item, or NULL if none
255 * @see elm_menu_item_selected_get()
256 * @see elm_menu_item_selected_set()
258 EAPI Elm_Object_Item *elm_menu_selected_item_get(const Evas_Object *obj);
261 * @brief Get the last item in the menu
263 * @param obj The menu object
264 * @return The last item, or NULL if none
266 EAPI Elm_Object_Item *elm_menu_last_item_get(const Evas_Object *obj);
269 * @brief Get the first item in the menu
271 * @param obj The menu object
272 * @return The first item, or NULL if none
274 EAPI Elm_Object_Item *elm_menu_first_item_get(const Evas_Object *obj);
277 * @brief Get the next item in the menu.
279 * @param it The menu item object.
280 * @return The item after it, or NULL if none
282 EAPI Elm_Object_Item *elm_menu_item_next_get(const Elm_Object_Item *it);
285 * @brief Get the previous item in the menu.
287 * @param it The menu item object.
288 * @return The item before it, or NULL if none
290 EAPI Elm_Object_Item *elm_menu_item_prev_get(const Elm_Object_Item *it);