remove eina_pure and eina_nonnull because really.. they screw up
[framework/uifw/elementary.git] / src / lib / elc_ctxpopup.h
1 /**
2  * @defgroup Ctxpopup Ctxpopup
3  *
4  * @image html img/widget/ctxpopup/preview-00.png
5  * @image latex img/widget/ctxpopup/preview-00.eps
6  *
7  * @brief Context popup widet.
8  *
9  * A ctxpopup is a widget that, when shown, pops up a list of items.
10  * It automatically chooses an area inside its parent object's view
11  * (set via elm_ctxpopup_add() and elm_ctxpopup_hover_parent_set()) to
12  * optimally fit into it. In the default theme, it will also point an
13  * arrow to it's top left position at the time one shows it. Ctxpopup
14  * items have a label and/or an icon. It is intended for a small
15  * number of items (hence the use of list, not genlist).
16  *
17  * @note Ctxpopup is a especialization of @ref Hover.
18  *
19  * Signals that you can add callbacks for are:
20  * "dismissed" - the ctxpopup was dismissed
21  *
22  * Default contents parts of the ctxpopup widget that you can use for are:
23  * @li "default" - A content of the ctxpopup
24  *
25  * Default contents parts of the ctxpopup items that you can use for are:
26  * @li "icon" - An icon in the title area
27  *
28  * Default text parts of the ctxpopup items that you can use for are:
29  * @li "default" - Title label in the title area
30  *
31  * @ref tutorial_ctxpopup shows the usage of a good deal of the API.
32  * @{
33  */
34
35 typedef enum
36 {
37    ELM_CTXPOPUP_DIRECTION_DOWN, /**< ctxpopup show appear below clicked area */
38    ELM_CTXPOPUP_DIRECTION_RIGHT, /**< ctxpopup show appear to the right of the clicked area */
39    ELM_CTXPOPUP_DIRECTION_LEFT, /**< ctxpopup show appear to the left of the clicked area */
40    ELM_CTXPOPUP_DIRECTION_UP, /**< ctxpopup show appear above the clicked area */
41    ELM_CTXPOPUP_DIRECTION_UNKNOWN, /**< ctxpopup does not determine it's direction yet*/
42 } Elm_Ctxpopup_Direction; /**< Direction in which to show the popup */
43
44 /**
45  * @brief Add a new Ctxpopup object to the parent.
46  *
47  * @param parent Parent object
48  * @return New object or @c NULL, if it cannot be created
49  *
50  * @ingroup Ctxpopup
51  */
52 EAPI Evas_Object                 *elm_ctxpopup_add(Evas_Object *parent);
53
54 /**
55  * @brief Set the Ctxpopup's parent
56  *
57  * @param obj The ctxpopup object
58  * @param parent The parent to use
59  *
60  * Set the parent object.
61  *
62  * @note elm_ctxpopup_add() will automatically call this function
63  * with its @c parent argument.
64  *
65  * @see elm_ctxpopup_add()
66  * @see elm_hover_parent_set()
67  *
68  * @ingroup Ctxpopup
69  */
70 EAPI void                         elm_ctxpopup_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
71
72 /**
73  * @brief Get the Ctxpopup's parent
74  *
75  * @param obj The ctxpopup object
76  *
77  * @see elm_ctxpopup_hover_parent_set() for more information
78  *
79  * @ingroup Ctxpopup
80  */
81 EAPI Evas_Object                 *elm_ctxpopup_hover_parent_get(const Evas_Object *obj);
82
83 /**
84  * @brief Clear all items in the given ctxpopup object.
85  *
86  * @param obj Ctxpopup object
87  *
88  * @ingroup Ctxpopup
89  */
90 EAPI void                         elm_ctxpopup_clear(Evas_Object *obj);
91
92 /**
93  * @brief Change the ctxpopup's orientation to horizontal or vertical.
94  *
95  * @param obj Ctxpopup object
96  * @param horizontal @c EINA_TRUE for horizontal mode, @c EINA_FALSE for vertical
97  *
98  * @ingroup Ctxpopup
99  */
100 EAPI void                         elm_ctxpopup_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
101
102 /**
103  * @brief Get the value of current ctxpopup object's orientation.
104  *
105  * @param obj Ctxpopup object
106  * @return @c EINA_TRUE for horizontal mode, @c EINA_FALSE for vertical mode (or errors)
107  *
108  * @see elm_ctxpopup_horizontal_set()
109  *
110  * @ingroup Ctxpopup
111  */
112 EAPI Eina_Bool                    elm_ctxpopup_horizontal_get(const Evas_Object *obj);
113
114 /**
115  * @brief Add a new item to a ctxpopup object.
116  *
117  * @param obj Ctxpopup object
118  * @param icon Icon to be set on new item
119  * @param label The Label of the new item
120  * @param func Convenience function called when item selected
121  * @param data Data passed to @p func
122  * @return A handle to the item added or @c NULL, on errors
123  *
124  * @warning Ctxpopup can't hold both an item list and a content at the same
125  * time. When an item is added, any previous content will be removed.
126  *
127  * @see elm_ctxpopup_content_set()
128  *
129  * @ingroup Ctxpopup
130  */
131 EAPI Elm_Object_Item             *elm_ctxpopup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data);
132
133 /**
134  * @brief Delete the given item in a ctxpopup object.
135  *
136  * @param it Ctxpopup item to be deleted
137  *
138  * @see elm_ctxpopup_item_append()
139  *
140  * @ingroup Ctxpopup
141  */
142 EAPI void                         elm_ctxpopup_item_del(Elm_Object_Item *it);
143
144 /**
145  * @brief Set the direction priority of a ctxpopup.
146  *
147  * @param obj Ctxpopup object
148  * @param first 1st priority of direction
149  * @param second 2nd priority of direction
150  * @param third 3th priority of direction
151  * @param fourth 4th priority of direction
152  *
153  * This functions gives a chance to user to set the priority of ctxpopup
154  * showing direction. This doesn't guarantee the ctxpopup will appear in the
155  * requested direction.
156  *
157  * @see Elm_Ctxpopup_Direction
158  *
159  * @ingroup Ctxpopup
160  */
161 EAPI void                         elm_ctxpopup_direction_priority_set(Evas_Object *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth);
162
163 /**
164  * @brief Get the direction priority of a ctxpopup.
165  *
166  * @param obj Ctxpopup object
167  * @param first 1st priority of direction to be returned
168  * @param second 2nd priority of direction to be returned
169  * @param third 3th priority of direction to be returned
170  * @param fourth 4th priority of direction to be returned
171  *
172  * @see elm_ctxpopup_direction_priority_set() for more information.
173  *
174  * @ingroup Ctxpopup
175  */
176 EAPI void                         elm_ctxpopup_direction_priority_get(Evas_Object *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth);
177
178 /**
179  * @brief Get the current direction of a ctxpopup.
180  *
181  * @param obj Ctxpopup object
182  * @return current direction of a ctxpopup
183  *
184  * @warning Once the ctxpopup showed up, the direction would be determined
185  *
186  * @ingroup Ctxpopup
187  */
188 EAPI Elm_Ctxpopup_Direction       elm_ctxpopup_direction_get(const Evas_Object *obj);
189
190 /**
191  * @}
192  */