summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_toolbar_item_eo.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary/elm_toolbar_item_eo.h')
-rw-r--r--src/lib/elementary/elm_toolbar_item_eo.h410
1 files changed, 410 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_toolbar_item_eo.h b/src/lib/elementary/elm_toolbar_item_eo.h
new file mode 100644
index 0000000..44bb2d9
--- /dev/null
+++ b/src/lib/elementary/elm_toolbar_item_eo.h
@@ -0,0 +1,410 @@
1#ifndef _ELM_TOOLBAR_ITEM_EO_H_
2#define _ELM_TOOLBAR_ITEM_EO_H_
3
4#ifndef _ELM_TOOLBAR_ITEM_EO_CLASS_TYPE
5#define _ELM_TOOLBAR_ITEM_EO_CLASS_TYPE
6
7typedef Eo Elm_Toolbar_Item;
8
9#endif
10
11#ifndef _ELM_TOOLBAR_ITEM_EO_TYPES
12#define _ELM_TOOLBAR_ITEM_EO_TYPES
13
14/** Defines where to position the item in the toolbar.
15 *
16 * @ingroup Elm
17 */
18typedef enum
19{
20 ELM_TOOLBAR_ITEM_SCROLLTO_NONE = 0, /**< no scrollto */
21 ELM_TOOLBAR_ITEM_SCROLLTO_IN = 1 /* 1 >> 0 */, /**< to the nearest viewport */
22 ELM_TOOLBAR_ITEM_SCROLLTO_FIRST = 2 /* 1 >> 1 */, /**< to the first of
23 * viewport */
24 ELM_TOOLBAR_ITEM_SCROLLTO_MIDDLE = 4 /* 1 >> 2 */, /**< to the middle of
25 * viewport */
26 ELM_TOOLBAR_ITEM_SCROLLTO_LAST = 8 /* 1 >> 3 */ /**< to the last of viewport
27 */
28} Elm_Toolbar_Item_Scrollto_Type;
29
30/** State of a Elm_Toolbar_Item. Can be created with
31 * elm_toolbar_item_state_add() and removed with elm_toolbar_item_state_del().
32 *
33 * @ingroup Elm
34 */
35typedef struct _Elm_Toolbar_Item_State
36{
37 const char *label; /**< Item label */
38 const char *icon_str; /**< Item icon string */
39 Efl_Canvas_Object *icon; /**< Item icon */
40 Evas_Smart_Cb func; /**< Item callback function */
41 const void *data; /**< Item data */
42} Elm_Toolbar_Item_State;
43
44
45#endif
46/** Elementary toolbar item class
47 *
48 * @ingroup Elm_Toolbar_Item
49 */
50#define ELM_TOOLBAR_ITEM_CLASS elm_toolbar_item_class_get()
51
52EWAPI const Efl_Class *elm_toolbar_item_class_get(void);
53
54/**
55 * @brief Get the item before this one in the widget's list of items.
56 *
57 * See also @ref elm_obj_toolbar_item_next_get.
58 *
59 * @param[in] obj The object.
60 *
61 * @return The item before the object in its parent's list. If there is no
62 * previous item or in case of error, @c null is returned.
63 *
64 * @ingroup Elm_Toolbar_Item
65 */
66EOAPI Elm_Widget_Item *elm_obj_toolbar_item_prev_get(const Eo *obj);
67
68/**
69 * @brief Get the item after this one in the widget's list of items.
70 *
71 * See also @ref elm_obj_toolbar_item_prev_get.
72 *
73 * @param[in] obj The object.
74 *
75 * @return The item after the object in its parent's list. If there is no next
76 * item or in case of error, @c null is returned.
77 *
78 * @ingroup Elm_Toolbar_Item
79 */
80EOAPI Elm_Widget_Item *elm_obj_toolbar_item_next_get(const Eo *obj);
81
82/**
83 * @brief Indicates whether this item is currently selected.
84 *
85 * Set the selected state of @c item.
86 *
87 * This sets the selected state of the given item @c it. @c true for selected,
88 * @c false for not selected.
89 *
90 * If a new item is selected the previously selected will be unselected.
91 * Previously selected item can be retrieved with
92 * @ref elm_obj_toolbar_selected_item_get.
93 *
94 * Selected items will be highlighted.
95 *
96 * @param[in] obj The object.
97 * @param[in] selected The selection state.
98 *
99 * @ingroup Elm_Toolbar_Item
100 */
101EOAPI void elm_obj_toolbar_item_selected_set(Eo *obj, Eina_Bool selected);
102
103/**
104 * @brief Indicates whether this item is currently selected.
105 *
106 * Get the selected state of this item.
107 *
108 * @param[in] obj The object.
109 *
110 * @return The selection state.
111 *
112 * @ingroup Elm_Toolbar_Item
113 */
114EOAPI Eina_Bool elm_obj_toolbar_item_selected_get(const Eo *obj);
115
116/**
117 * @brief Set the priority of a toolbar item.
118 *
119 * This is used only when the toolbar shrink mode is set to
120 * #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE. When space is less
121 * than required, items with low priority will be removed from the toolbar and
122 * added to a dynamically-created menu, while items with higher priority will
123 * remain on the toolbar, with the same order they were added.
124 *
125 * @param[in] obj The object.
126 * @param[in] priority The @c item priority. The default is zero for set and 0
127 * is returned on failure.
128 *
129 * @ingroup Elm_Toolbar_Item
130 */
131EOAPI void elm_obj_toolbar_item_priority_set(Eo *obj, int priority);
132
133/**
134 * @brief Get the priority of a toolbar item.
135 *
136 * @param[in] obj The object.
137 *
138 * @return The @c item priority. The default is zero for set and 0 is returned
139 * on failure.
140 *
141 * @ingroup Elm_Toolbar_Item
142 */
143EOAPI int elm_obj_toolbar_item_priority_get(const Eo *obj);
144
145/**
146 * @brief Set the icon associated with @c item.
147 *
148 * Toolbar will load icon image from fdo or current theme. This behavior can be
149 * set by elm_toolbar_icon_order_lookup_set function. If an absolute path is
150 * provided it will load it direct from a file.
151 *
152 * @note This function does not accept relative icon path.
153 *
154 * @param[in] obj The object.
155 * @param[in] icon A string with icon name or the absolute path of an image
156 * file.
157 *
158 * @ingroup Elm_Toolbar_Item
159 */
160EOAPI void elm_obj_toolbar_item_icon_set(Eo *obj, const char *icon);
161
162/**
163 * @brief Get the string used to set the icon of @c item.
164 *
165 * @param[in] obj The object.
166 *
167 * @return A string with icon name or the absolute path of an image file.
168 *
169 * @ingroup Elm_Toolbar_Item
170 */
171EOAPI const char *elm_obj_toolbar_item_icon_get(const Eo *obj);
172
173/**
174 * @brief Get the real Evas(Edje) object created to implement the view of a
175 * given toolbar @c item.
176 *
177 * @param[in] obj The object.
178 *
179 * @return The base Edje object associated with @c it.
180 *
181 * @ingroup Elm_Toolbar_Item
182 */
183EOAPI Efl_Canvas_Object *elm_obj_toolbar_item_object_get(const Eo *obj);
184
185/**
186 * @brief Get the icon object of @c item.
187 *
188 * See also @ref elm_obj_toolbar_item_icon_set,
189 * @ref elm_obj_toolbar_item_icon_file_set,
190 * @ref elm_obj_toolbar_item_icon_memfile_set.
191 *
192 * @param[in] obj The object.
193 *
194 * @return The icon object.
195 *
196 * @ingroup Elm_Toolbar_Item
197 */
198EOAPI Efl_Canvas_Object *elm_obj_toolbar_item_icon_object_get(const Eo *obj);
199
200/**
201 * @brief Set or unset item as a separator.
202 *
203 * Items aren't set as separator by default.
204 *
205 * If set as separator it will display separator theme, so won't display icons
206 * or label.
207 *
208 * @param[in] obj The object.
209 * @param[in] separator @c true if the item is a separator, @c false otherwise
210 *
211 * @ingroup Elm_Toolbar_Item
212 */
213EOAPI void elm_obj_toolbar_item_separator_set(Eo *obj, Eina_Bool separator);
214
215/**
216 * @brief Get a value whether item is a separator or not.
217 *
218 * @param[in] obj The object.
219 *
220 * @return @c true if the item is a separator, @c false otherwise
221 *
222 * @ingroup Elm_Toolbar_Item
223 */
224EOAPI Eina_Bool elm_obj_toolbar_item_separator_get(const Eo *obj);
225
226/**
227 * @brief Get toolbar item's menu.
228 *
229 * If @c item wasn't set as menu item with @ref elm_obj_toolbar_item_menu_set,
230 * this function will set it.
231 *
232 * @param[in] obj The object.
233 *
234 * @return Item's menu object or @c null on failure.
235 *
236 * @ingroup Elm_Toolbar_Item
237 */
238EOAPI Efl_Canvas_Object *elm_obj_toolbar_item_menu_get(const Eo *obj);
239
240/**
241 * @brief Set @c state as the current state of @c it.
242 *
243 * If @c state is @c NULL, it won't select any state and the default item's
244 * icon and label will be used. It's the behavior as @ref
245 * elm_toolbar_item_state_unset.
246 *
247 * @param[in] obj The object.
248 * @param[in] state Item state
249 *
250 * @return @c true on success, @c false otherwise
251 *
252 * @ingroup Elm_Toolbar_Item
253 */
254EOAPI Eina_Bool elm_obj_toolbar_item_state_set(Eo *obj, Elm_Toolbar_Item_State *state);
255
256/**
257 * @brief Get the current state of @c it.
258 *
259 * @param[in] obj The object.
260 *
261 * @return Item state
262 *
263 * @ingroup Elm_Toolbar_Item
264 */
265EOAPI Elm_Toolbar_Item_State *elm_obj_toolbar_item_state_get(const Eo *obj);
266
267/**
268 * @brief Set the icon associated with @c item to an image in a binary buffer.
269 *
270 * @note The icon image set by this function can be changed by
271 * @ref elm_obj_toolbar_item_icon_set.
272 *
273 * @param[in] obj The object.
274 * @param[in] img The binary data that will be used as an image.
275 * @param[in] size The size of binary data @c img.
276 * @param[in] format Optional format of @c img to pass to the image loader.
277 * @param[in] key Optional key of @c img to pass to the image loader (eg. if
278 * @c img is an edje file).
279 *
280 * @return @c true on success, @c false otherwise
281 *
282 * @ingroup Elm_Toolbar_Item
283 */
284EOAPI Eina_Bool elm_obj_toolbar_item_icon_memfile_set(Eo *obj, const void *img, size_t size, const char *format, const char *key);
285
286/**
287 * @brief Set the icon associated with @c item to an image in a binary buffer.
288 *
289 * @note The icon image set by this function can be changed by
290 * elm_toolbar_item_icon_set().
291 *
292 * @param[in] obj The object.
293 * @param[in] file The file that contains the image.
294 * @param[in] key Optional key of @c img to pass to the image loader (eg. if
295 * @c img is an edje file).
296 *
297 * @return @c true on success, @c false otherwise
298 *
299 * @ingroup Elm_Toolbar_Item
300 */
301EOAPI Eina_Bool elm_obj_toolbar_item_icon_file_set(Eo *obj, const char *file, const char *key);
302
303/**
304 * @brief Add a new state to @c item.
305 *
306 * Toolbar will load icon image from fdo or current theme. This behavior can be
307 * set by elm_toolbar_icon_order_lookup_set function. If an absolute path is
308 * provided it will load it direct from a file.
309 *
310 * States created with this function can be removed with
311 * @ref elm_obj_toolbar_item_state_del.
312 *
313 * @param[in] obj The object.
314 * @param[in] icon A string with icon name or the absolute path of an image
315 * file.
316 * @param[in] label The label of the new state.
317 * @param[in] func The function to call when the item is clicked when this
318 * state is selected.
319 * @param[in] data The data to associate with the state.
320 *
321 * @return The toolbar item state, or @c null upon failure.
322 *
323 * @ingroup Elm_Toolbar_Item
324 */
325EOAPI Elm_Toolbar_Item_State *elm_obj_toolbar_item_state_add(Eo *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
326
327/**
328 * @brief Delete a previously added state to @c item.
329 *
330 * @param[in] obj The object.
331 * @param[in] state The state to be deleted.
332 *
333 * @return @c true on success or @c false on failure.
334 *
335 * @ingroup Elm_Toolbar_Item
336 */
337EOAPI Eina_Bool elm_obj_toolbar_item_state_del(Eo *obj, Elm_Toolbar_Item_State *state);
338
339/**
340 * @brief Get the state after selected state in toolbar's @c item.
341 *
342 * If last state is selected, this function will return first state.
343 *
344 * @param[in] obj The object.
345 *
346 * @return The state after current state, or @c null on failure.
347 *
348 * @ingroup Elm_Toolbar_Item
349 */
350EOAPI Elm_Toolbar_Item_State *elm_obj_toolbar_item_state_next(Eo *obj);
351
352/**
353 * @brief Get the state before selected state in toolbar's @c item.
354 *
355 * If first state is selected, this function will return last state.
356 *
357 * @param[in] obj The object.
358 *
359 * @return The state before current state, or @c null on failure.
360 *
361 * @ingroup Elm_Toolbar_Item
362 */
363EOAPI Elm_Toolbar_Item_State *elm_obj_toolbar_item_state_prev(Eo *obj);
364
365/**
366 * @brief Show a specific item, when the toolbar can be scrolled.
367 *
368 * @param[in] obj The object.
369 * @param[in] scrollto The position the item should appear at.
370 *
371 * @since 1.8
372 *
373 * @ingroup Elm_Toolbar_Item
374 */
375EOAPI void elm_obj_toolbar_item_show(Eo *obj, Elm_Toolbar_Item_Scrollto_Type scrollto);
376
377/**
378 * @brief Show a specific item with scroll animation, when the toolbar can be
379 * scrolled.
380 *
381 * @param[in] obj The object.
382 * @param[in] scrollto The position the item should appear at.
383 *
384 * @since 1.8
385 *
386 * @ingroup Elm_Toolbar_Item
387 */
388EOAPI void elm_obj_toolbar_item_bring_in(Eo *obj, Elm_Toolbar_Item_Scrollto_Type scrollto);
389
390/**
391 * @brief Set whether the toolbar item opens a menu.
392 *
393 * A toolbar item can be set to be a menu, using this function.
394 *
395 * Once it is set to be a menu, it can be manipulated through the menu-like
396 * function @ref elm_obj_toolbar_menu_parent_set and the other elm_menu
397 * functions, using the Evas_Object @c menu returned by
398 * @ref elm_obj_toolbar_item_menu_get.
399 *
400 * So, items to be displayed in this item's menu should be added with @ref
401 * elm_menu_item_add.
402 *
403 * @param[in] obj The object.
404 * @param[in] menu If @c true, @c item will opens a menu when selected.
405 *
406 * @ingroup Elm_Toolbar_Item
407 */
408EOAPI void elm_obj_toolbar_item_menu_set(Eo *obj, Eina_Bool menu);
409
410#endif