1 #ifndef _ELM_CTXPOPUP_EO_LEGACY_H_
2 #define _ELM_CTXPOPUP_EO_LEGACY_H_
3 
4 #ifndef _ELM_CTXPOPUP_EO_CLASS_TYPE
5 #define _ELM_CTXPOPUP_EO_CLASS_TYPE
6 
7 typedef Eo Elm_Ctxpopup;
8 
9 #endif
10 
11 #ifndef _ELM_CTXPOPUP_EO_TYPES
12 #define _ELM_CTXPOPUP_EO_TYPES
13 
14 /** Direction in which to show the popup.
15  *
16  * @ingroup Elm_Ctxpopup_Group
17  */
18 typedef enum
19 {
20   ELM_CTXPOPUP_DIRECTION_DOWN = 0, /**< Ctxpopup show appear below clicked area.
21                                     */
22   ELM_CTXPOPUP_DIRECTION_RIGHT, /**< Ctxpopup show appear to the right of the
23                                  * clicked area. */
24   ELM_CTXPOPUP_DIRECTION_LEFT, /**< Ctxpopup show appear to the left of the
25                                 * clicked area. */
26   ELM_CTXPOPUP_DIRECTION_UP, /**< Ctxpopup show appear above the clicked area.
27                               */
28   ELM_CTXPOPUP_DIRECTION_UNKNOWN /**< Ctxpopup does not determine it's direction
29                                   * yet. */
30 } Elm_Ctxpopup_Direction;
31 
32 
33 #endif
34 
35 /**
36  * @brief Get the selected item in the widget.
37  *
38  * @param[in] obj The object.
39  *
40  * @return The selected item or @c null.
41  *
42  * @ingroup Elm_Ctxpopup_Group
43  */
44 EAPI Elm_Widget_Item *elm_ctxpopup_selected_item_get(const Elm_Ctxpopup *obj);
45 
46 /**
47  * @brief Get the first item in the widget.
48  *
49  * @param[in] obj The object.
50  *
51  * @return The first item or @c null.
52  *
53  * @ingroup Elm_Ctxpopup_Group
54  */
55 EAPI Elm_Widget_Item *elm_ctxpopup_first_item_get(const Elm_Ctxpopup *obj);
56 
57 /**
58  * @brief Get the last item in the widget.
59  *
60  * @param[in] obj The object.
61  *
62  * @return The last item or @c null.
63  *
64  * @ingroup Elm_Ctxpopup_Group
65  */
66 EAPI Elm_Widget_Item *elm_ctxpopup_last_item_get(const Elm_Ctxpopup *obj);
67 
68 /**
69  * @brief Returns a list of the widget item.
70  *
71  * @param[in] obj The object.
72  *
73  * @return const list to widget items
74  *
75  * @ingroup Elm_Ctxpopup_Group
76  */
77 EAPI const Eina_List *elm_ctxpopup_items_get(const Elm_Ctxpopup *obj);
78 
79 /**
80  * @brief Change the ctxpopup's orientation to horizontal or vertical.
81  *
82  * @param[in] obj The object.
83  * @param[in] horizontal @c true for horizontal mode, @c false for vertical.
84  *
85  * @ingroup Elm_Ctxpopup_Group
86  */
87 EAPI void elm_ctxpopup_horizontal_set(Elm_Ctxpopup *obj, Eina_Bool horizontal);
88 
89 /**
90  * @brief Get the value of current ctxpopup object's orientation.
91  *
92  * See also @ref elm_ctxpopup_horizontal_set.
93  *
94  * @param[in] obj The object.
95  *
96  * @return @c true for horizontal mode, @c false for vertical.
97  *
98  * @ingroup Elm_Ctxpopup_Group
99  */
100 EAPI Eina_Bool elm_ctxpopup_horizontal_get(const Elm_Ctxpopup *obj);
101 
102 /**
103  * @brief Set ctxpopup auto hide mode triggered by ctxpopup policy.
104  *
105  * Use this function when user wants ctxpopup not to hide automatically. By
106  * default, ctxpopup is dismissed whenever mouse clicked its background area,
107  * language is changed, and its parent geometry is updated(changed). Not to
108  * hide ctxpopup automatically, disable auto hide function by calling this API,
109  * then ctxpopup won't be dismissed in those scenarios.
110  *
111  * Default value of disabled is @c false.
112  *
113  * See also @ref elm_ctxpopup_auto_hide_disabled_get.
114  *
115  * @param[in] obj The object.
116  * @param[in] disabled Auto hide enable/disable.
117  *
118  * @since 1.9
119  *
120  * @ingroup Elm_Ctxpopup_Group
121  */
122 EAPI void elm_ctxpopup_auto_hide_disabled_set(Elm_Ctxpopup *obj, Eina_Bool disabled);
123 
124 /**
125  * @brief Get ctxpopup auto hide mode triggered by ctxpopup policy.
126  *
127  * See also @ref elm_ctxpopup_auto_hide_disabled_set for more information.
128  *
129  * @param[in] obj The object.
130  *
131  * @return Auto hide enable/disable.
132  *
133  * @since 1.9
134  *
135  * @ingroup Elm_Ctxpopup_Group
136  */
137 EAPI Eina_Bool elm_ctxpopup_auto_hide_disabled_get(const Elm_Ctxpopup *obj);
138 
139 /**
140  * @brief Set the Ctxpopup's parent
141  *
142  * Set the parent object.
143  *
144  * @note @ref elm_ctxpopup_add will automatically call this function with its
145  * @c parent argument.
146  *
147  * See also @ref elm_ctxpopup_add, @ref elm_hover_parent_set.
148  *
149  * @param[in] obj The object.
150  * @param[in] parent The parent to use.
151  *
152  * @ingroup Elm_Ctxpopup_Group
153  */
154 EAPI void elm_ctxpopup_hover_parent_set(Elm_Ctxpopup *obj, Efl_Canvas_Object *parent);
155 
156 /**
157  * @brief Get the Ctxpopup's parent
158  *
159  * See also @ref elm_ctxpopup_hover_parent_set for more information
160  *
161  * @param[in] obj The object.
162  *
163  * @return The parent to use.
164  *
165  * @ingroup Elm_Ctxpopup_Group
166  */
167 EAPI Efl_Canvas_Object *elm_ctxpopup_hover_parent_get(const Elm_Ctxpopup *obj);
168 
169 /**
170  * @brief Set the direction priority of a ctxpopup.
171  *
172  * This functions gives a chance to user to set the priority of ctxpopup
173  * showing direction. This doesn't guarantee the ctxpopup will appear in the
174  * requested direction.
175  *
176  * See also @ref Elm_Ctxpopup_Direction.
177  *
178  * @param[in] obj The object.
179  * @param[in] first 1st priority of direction
180  * @param[in] second 2nd priority of direction
181  * @param[in] third 3th priority of direction
182  * @param[in] fourth 4th priority of direction
183  *
184  * @ingroup Elm_Ctxpopup_Group
185  */
186 EAPI void elm_ctxpopup_direction_priority_set(Elm_Ctxpopup *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth);
187 
188 /**
189  * @brief Get the direction priority of a ctxpopup.
190  *
191  * See also @ref elm_ctxpopup_direction_priority_set for more information.
192  *
193  * @param[in] obj The object.
194  * @param[out] first 1st priority of direction
195  * @param[out] second 2nd priority of direction
196  * @param[out] third 3th priority of direction
197  * @param[out] fourth 4th priority of direction
198  *
199  * @ingroup Elm_Ctxpopup_Group
200  */
201 EAPI void elm_ctxpopup_direction_priority_get(const Elm_Ctxpopup *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth);
202 
203 /**
204  * @brief Get the current direction of a ctxpopup.
205  *
206  * @warning Once the ctxpopup showed up, the direction would be determined
207  *
208  * @param[in] obj The object.
209  *
210  * @return Direction
211  *
212  * @ingroup Elm_Ctxpopup_Group
213  */
214 EAPI Elm_Ctxpopup_Direction elm_ctxpopup_direction_get(const Elm_Ctxpopup *obj);
215 
216 /**
217  * @brief Dismiss a ctxpopup object
218  *
219  * Use this function to simulate clicking outside of the ctxpopup to dismiss
220  * it. In this way, the ctxpopup will be hidden and the "clicked" signal will
221  * be emitted.
222  * @param[in] obj The object.
223  *
224  * @ingroup Elm_Ctxpopup_Group
225  */
226 EAPI void elm_ctxpopup_dismiss(Elm_Ctxpopup *obj);
227 
228 /** Clear all items in the given ctxpopup object.
229  *
230  * @ingroup Elm_Ctxpopup_Group
231  */
232 EAPI void elm_ctxpopup_clear(Elm_Ctxpopup *obj);
233 
234 /**
235  * @brief Insert a new item to a ctxpopup object before item @c before.
236  *
237  * See also elm_object_content_set.
238  *
239  * @param[in] obj The object.
240  * @param[in] before The ctxpopup item to insert before.
241  * @param[in] label The Label of the new item
242  * @param[in] icon Icon to be set on new item
243  * @param[in] func Convenience function called when item selected
244  * @param[in] data Data passed to @c func
245  *
246  * @return A handle to the item added or @c null, on errors.
247  *
248  * @since 1.21
249  *
250  * @ingroup Elm_Ctxpopup_Group
251  */
252 EAPI Elm_Widget_Item *elm_ctxpopup_item_insert_before(Elm_Ctxpopup *obj, Elm_Widget_Item *before, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data);
253 
254 /**
255  * @brief Insert a new item to a ctxpopup object after item @c after.
256  *
257  * See also elm_object_content_set.
258  *
259  * @param[in] obj The object.
260  * @param[in] after The ctxpopup item to insert after.
261  * @param[in] label The Label of the new item
262  * @param[in] icon Icon to be set on new item
263  * @param[in] func Convenience function called when item selected
264  * @param[in] data Data passed to @c func
265  *
266  * @return A handle to the item added or @c null, on errors.
267  *
268  * @since 1.21
269  *
270  * @ingroup Elm_Ctxpopup_Group
271  */
272 EAPI Elm_Widget_Item *elm_ctxpopup_item_insert_after(Elm_Ctxpopup *obj, Elm_Widget_Item *after, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data);
273 
274 /**
275  * @brief Add a new item to a ctxpopup object.
276  *
277  * Warning:Ctxpopup can't hold both an item list and a content at the same
278  * time. When an item is added, any previous content will be removed.
279  *
280  * See also @ref elm_object_content_set.
281  *
282  * @param[in] obj The object.
283  * @param[in] label The Label of the new item
284  * @param[in] icon Icon to be set on new item
285  * @param[in] func Convenience function called when item selected
286  * @param[in] data Data passed to @c func
287  *
288  * @return A handle to the item added or @c null, on errors.
289  *
290  * @ingroup Elm_Ctxpopup_Group
291  */
292 EAPI Elm_Widget_Item *elm_ctxpopup_item_append(Elm_Ctxpopup *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data);
293 
294 /**
295  * @brief Prepend a new item to a ctxpopup object.
296  *
297  * @warning Ctxpopup can't hold both an item list and a content at the same
298  * time. When an item is added, any previous content will be removed.
299  *
300  * See also @ref elm_object_content_set.
301  *
302  * @param[in] obj The object.
303  * @param[in] label The Label of the new item
304  * @param[in] icon Icon to be set on new item
305  * @param[in] func Convenience function called when item selected
306  * @param[in] data Data passed to @c func
307  *
308  * @return A handle to the item added or @c null, on errors.
309  *
310  * @since 1.11
311  *
312  * @ingroup Elm_Ctxpopup_Group
313  */
314 EAPI Elm_Widget_Item *elm_ctxpopup_item_prepend(Elm_Ctxpopup *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data);
315 
316 #endif
317