Fix conflicts: Map, Hover, Hoversel, Menu, Web
[framework/uifw/elementary.git] / src / lib / elc_hoversel.h
1 /**
2  * @defgroup Hoversel Hoversel
3  *
4  * @image html img/widget/hoversel/preview-00.png
5  * @image latex img/widget/hoversel/preview-00.eps
6  *
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
12  * more.
13  *
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
18  *
19  * Default content parts of the hoversel widget that you can use for are:
20  * @li "icon" - An icon of the hoversel
21  *
22  * Default text parts of the hoversel widget that you can use for are:
23  * @li "default" - Label of the hoversel
24  *
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
32  *
33  * Supported elm_object_item common APIs.
34  * @li elm_object_item_part_text_get
35  *
36  * See @ref tutorial_hoversel for an example.
37  * @{
38  */
39
40 /**
41  * @brief Add a new Hoversel object
42  *
43  * @param parent The parent object
44  * @return The new object or NULL if it cannot be created
45  */
46 EAPI Evas_Object                 *elm_hoversel_add(Evas_Object *parent);
47
48 /**
49  * @brief This sets the hoversel to expand horizontally.
50  *
51  * @param obj The hoversel object
52  * @param horizontal If true, the hover will expand horizontally to the
53  * right.
54  *
55  * @note The initial button will display horizontally regardless of this
56  * setting.
57  */
58 EAPI void                         elm_hoversel_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
59
60 /**
61  * @brief This returns whether the hoversel is set to expand horizontally.
62  *
63  * @param obj The hoversel object
64  * @return If true, the hover will expand horizontally to the right.
65  *
66  * @see elm_hoversel_horizontal_set()
67  */
68 EAPI Eina_Bool                    elm_hoversel_horizontal_get(const Evas_Object *obj);
69
70 /**
71  * @brief Set the Hover parent
72  *
73  * @param obj The hoversel object
74  * @param parent The parent to use
75  *
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.
79  */
80 EAPI void                         elm_hoversel_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
81
82 /**
83  * @brief Get the Hover parent
84  *
85  * @param obj The hoversel object
86  * @return The used parent
87  *
88  * Gets the hover parent object.
89  *
90  * @see elm_hoversel_hover_parent_set()
91  */
92 EAPI Evas_Object                 *elm_hoversel_hover_parent_get(const Evas_Object *obj);
93
94 /**
95  * @brief This triggers the hoversel popup from code, the same as if the user
96  * had clicked the button.
97  *
98  * @param obj The hoversel object
99  */
100 EAPI void                         elm_hoversel_hover_begin(Evas_Object *obj);
101
102 /**
103  * @brief This dismisses the hoversel popup as if the user had clicked
104  * outside the hover.
105  *
106  * @param obj The hoversel object
107  */
108 EAPI void                         elm_hoversel_hover_end(Evas_Object *obj);
109
110 /**
111  * @brief Returns whether the hoversel is expanded.
112  *
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.
116  */
117 EAPI Eina_Bool                    elm_hoversel_expanded_get(const Evas_Object *obj);
118
119 /**
120  * @brief This will remove all the children items from the hoversel.
121  *
122  * @param obj The hoversel object
123  *
124  * @warning Should @b not be called while the hoversel is active; use
125  * elm_hoversel_expanded_get() to check first.
126  *
127  * @see elm_object_item_del()
128  */
129 EAPI void                         elm_hoversel_clear(Evas_Object *obj);
130
131 /**
132  * @brief Get the list of items within the given hoversel.
133  *
134  * @param obj The hoversel object
135  * @return Returns a list of Elm_Object_Item*
136  *
137  * @see elm_hoversel_item_add()
138  */
139 EAPI const Eina_List             *elm_hoversel_items_get(const Evas_Object *obj);
140
141 /**
142  * @brief Add an item to the hoversel button
143  *
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.
152  *
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.
157  *
158  * For more information on what @p icon_file and @p icon_type are, see the
159  * @ref Icon "icon documentation".
160  */
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);
162
163 /**
164  * @brief This sets the icon for the given hoversel item.
165  *
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
168  * icon name
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
172  *
173  * The icon can be loaded from the standard set, from an image file, or from
174  * an edje file.
175  *
176  * @see elm_hoversel_item_add()
177  */
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);
179
180 /**
181  * @brief Get the icon object of the hoversel item
182  *
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
185  * icon name
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
189  *
190  * @see elm_hoversel_item_icon_set()
191  * @see elm_hoversel_item_add()
192  */
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);
194
195 /**
196  * @}
197  */