1 #include <Elementary.h>
\r
2 #include "elm_priv.h"
\r
5 * @defgroup Navigationbar_ex Navigationbar_ex
\r
6 * @ingroup Elementary
\r
8 * The NavigationBar_ex is an object that allows flipping (with animation) between 1 or
\r
9 * more pages of objects, much like a stack of windows within the window as well display
\r
10 * the title area for the page consisting of buttons, title, titleobjects etc:-.
\r
12 * Objects can be pushed or popped from the stack or deleted as normal.
\r
13 * Pushes and pops will animate and a pop will delete the object once the
\r
14 * animation is finished if delete_on_pop is set else the content is unset and the
\r
15 * content pointer is sent as event information in the hide,finished signal.
\r
16 * Any object in the Navigationbar_ex can be promoted to the top
\r
17 * (from its current stacking position) as well. Objects are pushed to the
\r
18 * top with elm_navigationbar_ex_item_push() and when the top item is no longer
\r
19 * wanted, simply pop it with elm_navigationbar_ex_item_pop() and it will also be
\r
20 * deleted/unset depending on delete_on_pop variable.
\r
21 * Any object you wish to promote to the top that is already in the
\r
22 * navigationbar, simply use elm_navigationbar_ex_item_promote(). If an object is no longer
\r
23 * needed and is not the top item, just delete it as normal. You can query
\r
24 * which objects are the top and bottom with elm_navigationbar_ex_item_bottom_get()
\r
25 * and elm_navigationbar_ex_item_top_get().
\r
28 typedef struct _Widget_Data Widget_Data;
\r
29 typedef struct _function_button fn_button;
\r
35 Eina_List *stack, *to_delete;
\r
36 Elm_Navigationbar_ex_Item *top;
\r
37 Evas_Object *rect, *clip;
\r
38 Eina_Bool del_on_pop : 1;
\r
41 struct _Elm_Navigationbar_ex_Item
\r
43 Evas_Object *obj, *base, *content;
\r
44 Evas_Coord minw, minh;
\r
46 const char *subtitle;
\r
47 const char *item_style;
\r
48 Eina_List *fnbtn_list;
\r
49 Evas_Object *title_obj;
\r
51 Eina_Bool popme : 1;
\r
54 struct _function_button
\r
60 static const char *widtype = NULL;
\r
61 static void _del_hook(Evas_Object *obj);
\r
62 static void _theme_hook(Evas_Object *obj);
\r
63 static void _sizing_eval(Evas_Object *obj);
\r
64 static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
\r
65 static void _sub_del(void *data, Evas_Object *obj, void *event_info);
\r
69 _del_hook(Evas_Object *obj)
\r
71 Widget_Data *wd = elm_widget_data_get(obj);
\r
78 _content_unset(Elm_Navigationbar_ex_Item* item)
\r
80 if(!item) return NULL;
\r
81 Evas_Object *content = NULL;
\r
82 if(!item->content) return NULL;
\r
83 content = item->content;
\r
84 elm_widget_sub_object_del(item->obj,item->content);
\r
85 edje_object_part_unswallow(item->base,item->content);
\r
86 item->content = NULL;
\r
87 evas_object_hide(content);
\r
92 _theme_hook(Evas_Object *obj)
\r
94 Widget_Data *wd = elm_widget_data_get(obj);
\r
97 Elm_Navigationbar_ex_Item *it;
\r
99 EINA_LIST_FOREACH(wd->stack, l, it)
\r
103 edje_object_scale_set(it->base, elm_widget_scale_get(obj) *
\r
104 _elm_config->scale);
\r
105 EINA_LIST_FOREACH(it->fnbtn_list, bl, btn)
\r
107 if(btn->btn_id == ELM_NAVIGATIONBAR_EX_BACK_BUTTON)
\r
109 snprintf(buf_fn, sizeof(buf_fn), "navigationbar_backbutton/%s", elm_widget_style_get(obj));
\r
110 elm_object_style_set(btn->btn, buf_fn);
\r
114 snprintf(buf_fn, sizeof(buf_fn), "navigationbar_functionbutton/%s", elm_widget_style_get(obj));
\r
115 elm_object_style_set(btn->btn, buf_fn);
\r
123 _sizing_eval(Evas_Object *obj)
\r
125 Widget_Data *wd = elm_widget_data_get(obj);
\r
126 Evas_Coord minw = -1, minh = -1;
\r
128 Elm_Navigationbar_ex_Item *it;
\r
130 EINA_LIST_FOREACH(wd->stack, l, it)
\r
132 if (it->minw > minw) minw = it->minw;
\r
133 if (it->minh > minh) minh = it->minh;
\r
135 evas_object_size_hint_min_set(obj, minw, minh);
\r
136 evas_object_size_hint_max_set(obj, -1, -1);
\r
140 _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
\r
142 Elm_Navigationbar_ex_Item *it = data;
\r
143 Evas_Coord minw = -1, minh = -1;
\r
144 evas_object_size_hint_min_get(it->content, &minw, &minh);
\r
145 // FIXME: why is this needed? how does edje get this unswallowed or
\r
146 // lose its callbacks to edje
\r
147 edje_object_part_swallow(it->base, "elm.swallow.content", it->content);
\r
148 edje_object_size_min_calc(it->base, &it->minw, &it->minh);
\r
149 _sizing_eval(it->obj);
\r
153 _eval_top(Evas_Object *obj, Eina_Bool push)
\r
155 Widget_Data *wd = elm_widget_data_get(obj);
\r
156 Eina_Bool animate=EINA_TRUE;
\r
157 Elm_Navigationbar_ex_Item *ittop;
\r
159 if (!wd->stack) return;
\r
160 ittop = eina_list_last(wd->stack)->data;
\r
161 if (ittop != wd->top)
\r
164 const char *onshow, *onhide;
\r
169 edje_object_signal_emit(o, "elm,action,hide", "elm");
\r
170 onhide = edje_object_data_get(o, "onhide");
\r
173 if (!strcmp(onhide, "raise")) evas_object_raise(o);
\r
174 else if (!strcmp(onhide, "lower")) evas_object_lower(o);
\r
179 animate = EINA_FALSE;
\r
183 evas_object_show(o);
\r
187 edje_object_signal_emit(o, "elm,action,show,push", "elm");
\r
189 edje_object_signal_emit(o, "elm,action,show,pop", "elm");
\r
192 edje_object_signal_emit(o, "elm,action,show,noanimate", "elm");
\r
193 onshow = edje_object_data_get(o, "onshow");
\r
196 if (!strcmp(onshow, "raise")) evas_object_raise(o);
\r
197 else if (!strcmp(onshow, "lower")) evas_object_lower(o);
\r
203 _move(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
\r
205 Widget_Data *wd = elm_widget_data_get(data);
\r
208 Elm_Navigationbar_ex_Item *it;
\r
210 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
\r
211 EINA_LIST_FOREACH(wd->stack, l, it)
\r
212 evas_object_move(it->base, x, y);
\r
216 _sub_del(void *data, Evas_Object *obj __UNUSED__, void *event_info)
\r
218 Widget_Data *wd = elm_widget_data_get(data);
\r
219 Evas_Object *sub = event_info;
\r
220 Eina_List *l,*list;
\r
221 fn_button *btn_data;
\r
222 Elm_Navigationbar_ex_Item *it;
\r
224 EINA_LIST_FOREACH(wd->stack, l, it)
\r
226 if (it->content == sub)
\r
228 wd->stack = eina_list_remove_list(wd->stack, l);
\r
229 evas_object_event_callback_del_full
\r
230 (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, it);
\r
231 if (it->title) eina_stringshare_del(it->title);
\r
232 if (it->subtitle) eina_stringshare_del(it->subtitle);
\r
233 EINA_LIST_FOREACH(it->fnbtn_list, list, btn_data)
\r
235 evas_object_del(btn_data->btn);
\r
239 if(it->item_style) eina_stringshare_del(it->item_style);
\r
240 if(it->title_obj) evas_object_del(it->title_obj);
\r
241 evas_object_del(it->base);
\r
242 _eval_top(it->obj, EINA_FALSE);
\r
250 _resize(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
\r
252 Widget_Data *wd = elm_widget_data_get(data);
\r
255 Elm_Navigationbar_ex_Item *it;
\r
257 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
\r
258 EINA_LIST_FOREACH(wd->stack, l, it) evas_object_resize(it->base, w, h);
\r
262 _signal_hide_finished(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
\r
264 Elm_Navigationbar_ex_Item *it = data;
\r
265 Evas_Object *obj2 = it->obj;
\r
266 Widget_Data *wd = elm_widget_data_get(it->obj);
\r
267 evas_object_hide(it->base);
\r
268 edje_object_signal_emit(it->base, "elm,action,reset", "elm");
\r
269 evas_object_smart_callback_call(obj2, "hide,finished", it->content);
\r
270 edje_object_message_signal_process(it->base);
\r
275 evas_object_del(it->content);
\r
279 _content_unset(it);
\r
282 _sizing_eval(obj2);
\r
285 static void _item_promote(Elm_Navigationbar_ex_Item* item)
\r
288 Widget_Data *wd = elm_widget_data_get(item->obj);
\r
290 Elm_Navigationbar_ex_Item *it;
\r
292 EINA_LIST_FOREACH(wd->stack, l, it)
\r
296 wd->stack = eina_list_remove_list(wd->stack, l);
\r
297 wd->stack = eina_list_append(wd->stack, it);
\r
298 _eval_top(it->obj, EINA_FALSE);
\r
305 _process_deletions(Widget_Data *wd)
\r
308 Elm_Navigationbar_ex_Item *it;
\r
309 fn_button *btn_data;
\r
311 EINA_LIST_FREE(wd->to_delete, it)
\r
313 evas_object_event_callback_del_full
\r
314 (it->content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, it);
\r
315 if (it->title) eina_stringshare_del(it->title);
\r
316 if (it->subtitle) eina_stringshare_del(it->subtitle);
\r
317 if(it->item_style) eina_stringshare_del(it->item_style);
\r
318 EINA_LIST_FOREACH(it->fnbtn_list, list, btn_data)
\r
320 evas_object_del(btn_data->btn);
\r
324 if(it->title_obj) evas_object_del(it->title_obj);
\r
325 if(it->content) evas_object_del(it->content);
\r
326 evas_object_del(it->base);
\r
327 _eval_top(it->obj, EINA_FALSE);
\r
334 * Add a new navigationbar_ex to the parent
\r
336 * @param[in] parent The parent object
\r
337 * @return The new object or NULL if it cannot be created
\r
339 * @ingroup Navigationbar_ex
\r
342 elm_navigationbar_ex_add(Evas_Object *parent)
\r
348 wd = ELM_NEW(Widget_Data);
\r
349 e = evas_object_evas_get(parent);
\r
350 obj = elm_widget_add(e);
\r
351 ELM_SET_WIDTYPE(widtype, "navigationbar_ex");
\r
352 elm_widget_type_set(obj, "navigationbar_ex");
\r
353 elm_widget_sub_object_add(parent, obj);
\r
354 elm_widget_data_set(obj, wd);
\r
355 elm_widget_del_hook_set(obj, _del_hook);
\r
356 elm_widget_theme_hook_set(obj, _theme_hook);
\r
358 wd->clip = evas_object_rectangle_add(e);
\r
359 elm_widget_resize_object_set(obj, wd->clip);
\r
360 elm_widget_sub_object_add(obj, wd->clip);
\r
362 wd->rect = evas_object_rectangle_add(e);
\r
363 elm_widget_sub_object_add(obj, wd->rect);
\r
364 evas_object_color_set(wd->rect, 255, 255, 255, 0);
\r
365 evas_object_clip_set(wd->rect, wd->clip);
\r
367 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move, obj);
\r
368 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj);
\r
370 evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
\r
371 wd->del_on_pop = EINA_TRUE;
\r
377 * Push an object along with its style to the top of the Navigationbar_ex stack (and show it)
\r
379 * The object pushed becomes a child of the Navigationbar_ex and will be controlled
\r
380 * it will be deleted when the Navigationbar_ex is deleted or when content is popped(depending on del_
\r
381 * on_pop variable).
\r
383 * @param[in] obj The Navigationbar_ex object
\r
384 * @param[in] content The object to push
\r
385 * @param[in] item_style The style of the page
\r
386 * @return The Navigationbar_ex Item or NULL
\r
387 * @ingroup Navigationbar_ex
\r
389 EAPI Elm_Navigationbar_ex_Item*
\r
390 elm_navigationbar_ex_item_push(Evas_Object *obj, Evas_Object *content, const char* item_style)
\r
392 ELM_CHECK_WIDTYPE(obj, widtype)NULL;
\r
393 Widget_Data *wd = elm_widget_data_get(obj);
\r
394 Elm_Navigationbar_ex_Item *it = ELM_NEW(Elm_Navigationbar_ex_Item);
\r
395 Evas_Coord x, y, w, h;
\r
397 if (!wd) return NULL;
\r
398 if (!content) return NULL;
\r
399 if (!item_style) return NULL;
\r
400 if (!it) return NULL;
\r
402 it->content = content;
\r
403 it->base = edje_object_add(evas_object_evas_get(obj));
\r
404 evas_object_smart_member_add(it->base, obj);
\r
405 evas_object_geometry_get(obj, &x, &y, &w, &h);
\r
406 evas_object_move(it->base, x, y);
\r
407 evas_object_resize(it->base, w, h);
\r
408 evas_object_clip_set(it->base, wd->clip);
\r
409 elm_widget_sub_object_add(obj, it->base);
\r
410 elm_widget_sub_object_add(obj, it->content);
\r
411 strncpy(buf, "item/", sizeof(buf));
\r
412 strncat(buf, item_style, sizeof(buf) - strlen(buf));
\r
413 if (!eina_stringshare_replace(&it->item_style, item_style)) return NULL;
\r
415 _elm_theme_object_set(obj, it->base, "navigationbar_ex", buf, elm_widget_style_get(obj));
\r
416 edje_object_signal_callback_add(it->base, "elm,action,hide,finished", "",
\r
417 _signal_hide_finished, it);
\r
418 evas_object_event_callback_add(it->content,
\r
419 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
\r
420 _changed_size_hints, it);
\r
421 edje_object_part_swallow(it->base, "elm.swallow.content", it->content);
\r
422 edje_object_size_min_calc(it->base, &it->minw, &it->minh);
\r
423 evas_object_data_set(it->base, "_elm_leaveme", obj);
\r
424 evas_object_show(it->content);
\r
425 wd->stack = eina_list_append(wd->stack, it);
\r
426 _eval_top(obj, EINA_TRUE);
\r
432 * Set the title string for the pushed Item.
\r
433 * @param[in] item The Navigationbar_ex Item
\r
434 * @param[in] title The title string
\r
436 * @ingroup Navigationbar_ex
\r
439 elm_navigationbar_ex_item_title_label_set( Elm_Navigationbar_ex_Item* item,
\r
443 if (!eina_stringshare_replace(&item->title, title)) return;
\r
445 edje_object_part_text_set(item->base, "elm.text", item->title);
\r
449 * Return the title string of the pushed item.
\r
451 * @param[in] item The Navigationbar_ex Item
\r
452 * @return The title string or NULL if none
\r
454 * @ingroup Navigationbar_ex
\r
457 elm_navigationbar_ex_item_title_label_get(Elm_Navigationbar_ex_Item* item)
\r
459 if(!item) return NULL;
\r
460 return item->title;
\r
464 * Set the sub title string for the pushed content
\r
466 * @param[in] item The Navigationbar_ex Item
\r
467 * @param[in] subtitle The subtitle string
\r
469 * @ingroup Navigationbar_ex
\r
472 elm_navigationbar_ex_item_subtitle_label_set( Elm_Navigationbar_ex_Item* item,
\r
473 const char *subtitle)
\r
476 if (!eina_stringshare_replace(&item->subtitle, subtitle)) return;
\r
478 edje_object_part_text_set(item->base, "elm.text.sub", item->subtitle);
\r
482 * Return the subtitle string of the pushed content
\r
484 * @param[in] item The Navigationbar_ex Item
\r
485 * @return The subtitle string or NULL if none
\r
487 * @ingroup Navigationbar_ex
\r
490 elm_navigationbar_ex_item_subtitle_label_get(Elm_Navigationbar_ex_Item* item)
\r
492 if(!item) return NULL;
\r
493 return item->subtitle;
\r
498 elm_navigationbar_ex_item_icon_set(Elm_Navigationbar_ex_Item* item, Evas_Object *icon)
\r
501 edje_object_part_swallow(item->base, "elm.swallow.icon", icon);
\r
502 elm_widget_sub_object_add(item->obj, icon);
\r
503 edje_object_signal_emit(item->base, "elm,state,icon,visible", "elm");
\r
508 elm_navigationbar_ex_item_icon_get(Elm_Navigationbar_ex_Item* item)
\r
510 if(!item) return NULL;
\r
516 * Set the button object of the pushed content
\r
518 * @param[in] item The Navigationbar_ex Item
\r
519 * @param[in] btn_label The button label
\r
520 * @param[in] icon The button icon
\r
521 * @param[in] button_type Indicates the position[use macros of type Elm_Navi_ex_Button_Type
\r
522 * if more function buttons are required you can use values ELM_NAVIGATIONBAR_EX_MAX and more]
\r
523 * @param[in] func Callback function called when button is clicked.
\r
524 * @param[in] data Callback data that would be sent when button is clicked.
\r
525 * @ingroup Navigationbar_ex
\r
528 elm_navigationbar_ex_item_title_button_set(Elm_Navigationbar_ex_Item* item, char *btn_label, Evas_Object *icon, int button_type, Evas_Smart_Cb func, const void *data)
\r
532 char buf[1024],theme[1024];
\r
533 fn_button *btn_det;
\r
534 btn = elm_button_add(item->obj);
\r
535 btn_det = ELM_NEW(btn_det);
\r
536 if(button_type == ELM_NAVIGATIONBAR_EX_BACK_BUTTON)
\r
538 snprintf(theme, sizeof(theme), "navigationbar_backbutton/%s", elm_widget_style_get(item->obj));
\r
539 elm_object_style_set(btn, theme);
\r
540 snprintf(buf, sizeof(buf), "elm.swallow.back");
\r
544 snprintf(theme, sizeof(theme), "navigationbar_functionbutton/%s", elm_widget_style_get(item->obj));
\r
545 elm_object_style_set(btn, theme);
\r
546 snprintf(buf, sizeof(buf), "elm.swallow.btn%d", button_type);
\r
549 elm_button_label_set(btn, btn_label);
\r
551 elm_button_icon_set(btn, icon);
\r
552 elm_object_focus_allow_set(btn, EINA_FALSE);
\r
553 evas_object_smart_callback_add(btn, "clicked", func, data);
\r
554 edje_object_part_swallow(item->base, buf, btn);
\r
555 elm_widget_sub_object_add(item->obj, btn);
\r
556 btn_det->btn = btn;
\r
557 btn_det->btn_id = button_type;
\r
558 item->fnbtn_list = eina_list_append(item->fnbtn_list, btn_det);
\r
562 * Return the button object of the pushed content
\r
564 * @param[in] item The Navigationbar_ex Item
\r
565 * @param[in] button_type Indicates the position
\r
566 * @return The button object or NULL if none
\r
568 * @ingroup Navigationbar_ex
\r
571 elm_navigationbar_ex_item_title_button_get(Elm_Navigationbar_ex_Item* item, int button_type)
\r
573 fn_button *btn_det;
\r
575 EINA_LIST_FOREACH(item->fnbtn_list, bl, btn_det)
\r
577 if(btn_det->btn_id == button_type)
\r
578 return btn_det->btn;
\r
585 * Sets a title object for the Item
\r
586 * @param[in] item The Navigationbar_ex Item
\r
587 * @param[in] title_obj Title object (normally segment_control/searchbar)
\r
589 * @ingroup Navigationbar_ex
\r
592 elm_navigationbar_ex_item_title_object_set(Elm_Navigationbar_ex_Item* item,
\r
593 Evas_Object *title_obj)
\r
596 if(item->title_obj) evas_object_del(item->title_obj);
\r
597 item->title_obj = title_obj;
\r
600 elm_widget_sub_object_add(item->obj,title_obj);
\r
601 edje_object_part_swallow(item->base, "elm.swallow.title", title_obj);
\r
603 _sizing_eval(item->obj);
\r
607 * Hides the title area of the item.
\r
608 * @param[in] item The Navigationbar_ex Item
\r
609 * @param[in] hidden if EINA_TRUE the title area is hidden else its shown.
\r
611 * @ingroup Navigationbar_ex
\r
615 elm_navigationbar_ex_item_title_hidden_set(Elm_Navigationbar_ex_Item* item,
\r
620 if (hidden) edje_object_signal_emit(item->base, "elm,state,item,moveup", "elm");
\r
621 else edje_object_signal_emit(item->base, "elm,state,item,movedown", "elm");
\r
622 _sizing_eval(item->obj);
\r
626 * Unsets a title object for the item, the return object has to be deleted
\r
627 * by application if not added again in to navigationbar.
\r
629 * @param[in] item The Navigationbar_ex Item
\r
630 * @return The title object or NULL if none is set
\r
632 * @ingroup Navigationbar_ex
\r
635 elm_navigationbar_ex_item_title_object_unset(Elm_Navigationbar_ex_Item* item)
\r
637 if(!item) return NULL;
\r
638 Evas_Object *title_obj=NULL;
\r
639 if(!item->title_obj) return NULL;
\r
640 title_obj = item->title_obj;
\r
641 elm_widget_sub_object_del(item->obj,item->title_obj);
\r
642 edje_object_part_unswallow(item->base,item->title_obj);
\r
643 item->title_obj = NULL;
\r
648 * Returns the title object of the pushed content.
\r
650 * @param[in] item The Navigationbar_ex Item
\r
651 * @return The title object or NULL if none is set
\r
653 * @ingroup Navigationbar_ex
\r
656 elm_navigationbar_ex_item_title_object_get(Elm_Navigationbar_ex_Item* item)
\r
658 if(!item) return NULL;
\r
659 return item->title_obj;
\r
664 * Unsets the content of the item, the return object has to be deleted
\r
665 * by application if not added again in to navigationbar, when the content
\r
666 * is unset the corresponding item would be deleted, when this content is pushed again
\r
667 * a new item would be created again.
\r
669 * @param[in] item The Navigationbar_ex Item
\r
670 * @return The content object or NULL if none is set
\r
672 * @ingroup Navigationbar_ex
\r
674 EAPI Evas_Object *elm_navigationbar_ex_item_content_unset(Elm_Navigationbar_ex_Item* item)
\r
676 Evas_Object *content = _content_unset(item);
\r
682 * Returns the content of the item.
\r
684 * @param[in] item The Navigationbar_ex Item
\r
685 * @return The content object or NULL if none is set
\r
687 * @ingroup Navigationbar_ex
\r
689 EAPI Evas_Object *elm_navigationbar_ex_item_content_get(Elm_Navigationbar_ex_Item* item)
\r
691 if(!item) return NULL;
\r
692 return item->content;
\r
696 * Set whether the content pushed has to be deleted on pop.
\r
697 * if false the item is not deleted but only removed from the stack
\r
698 * the pointer of the content is sent along with hide,finished signal.
\r
700 * @param[in] obj The Navigationbar_ex object.
\r
701 * @param[in] del_on_pop if set the content is deleted on pop else unset, by default the value is EINA_TRUE.
\r
703 * @ingroup Navigationbar_ex
\r
705 EAPI void elm_navigationbar_ex_delete_on_pop_set(Evas_Object *obj, Eina_Bool del_on_pop)
\r
707 ELM_CHECK_WIDTYPE(obj, widtype);
\r
708 Widget_Data *wd = elm_widget_data_get(obj);
\r
710 wd->del_on_pop = del_on_pop;
\r
714 * Sets the style of the navigationbar item.
\r
715 * @param[in] item The Navigationbar_ex Item
\r
716 * @param[in] item_style Navigationbar Item style, this can be used when the style of the item has to be dynamically set.
\r
718 * @ingroup Navigationbar_ex
\r
721 elm_navigationbar_ex_item_style_set(Elm_Navigationbar_ex_Item* item, const char* item_style)
\r
725 strncpy(buf, "item/", sizeof(buf));
\r
726 strncat(buf, item_style, sizeof(buf) - strlen(buf));
\r
727 if (!eina_stringshare_replace(&item->item_style, item_style)) return;
\r
728 _elm_theme_object_set(item->obj, item->base, "navigationbar_ex", buf, elm_widget_style_get(item->obj));
\r
730 edje_object_part_text_set(item->base, "elm.text", item->title);
\r
732 edje_object_part_text_set(item->base, "elm.text.sub", item->subtitle);
\r
736 * Returns the style of the item.
\r
738 * @param[in] item The Navigationbar_ex Item
\r
739 * @return The item style.
\r
741 * @ingroup Navigationbar_ex
\r
743 EAPI const char* elm_navigationbar_ex_item_style_get(Elm_Navigationbar_ex_Item* item)
\r
745 if(!item) return NULL;
\r
746 return item->item_style;
\r
751 * Promote an object already in the stack to the top of the stack
\r
753 * This will take the indicated object and promote it to the top of the stack
\r
754 * as if it had been pushed there. The object must already be inside the
\r
755 * Navigationbar_ex stack to work.
\r
757 * @param[in] item The Navigationbar_ex item to promote.
\r
758 * @ingroup Navigationbar_ex
\r
761 elm_navigationbar_ex_item_promote(Elm_Navigationbar_ex_Item* item)
\r
763 _item_promote(item);
\r
767 * Pop to the inputted Navigationbar_ex item
\r
768 * the rest of the items are deleted.
\r
770 * @param[in] item The Navigationbar_ex item
\r
772 * @ingroup Navigationbar_ex
\r
774 EAPI void elm_navigationbar_ex_to_item_pop(Elm_Navigationbar_ex_Item* item)
\r
777 Widget_Data *wd = elm_widget_data_get(item->obj);
\r
778 Elm_Navigationbar_ex_Item *it = NULL;
\r
781 if (!wd->stack) return;
\r
782 list = eina_list_last(wd->stack);
\r
790 wd->to_delete = eina_list_append(wd->to_delete, it);
\r
791 wd->stack = eina_list_remove_list(wd->stack, list);
\r
799 _eval_top(it->obj, EINA_FALSE);
\r
801 _process_deletions(wd);
\r
805 * Pop the object that is on top of the Navigationbar_ex stack
\r
806 * This pops the object that is on top (visible) in the navigationbar, makes it disappear, then deletes/unsets the object
\r
807 * based on del_on_pop variable.
\r
808 * The object that was underneath it on the stack will become visible.
\r
810 * @param[in] obj The Navigationbar_ex object
\r
812 * @ingroup Navigationbar_ex
\r
815 elm_navigationbar_ex_item_pop(Evas_Object *obj)
\r
817 ELM_CHECK_WIDTYPE(obj, widtype);
\r
818 Widget_Data *wd = elm_widget_data_get(obj);
\r
820 Elm_Navigationbar_ex_Item *it;
\r
822 if (!wd->stack) return;
\r
823 it = eina_list_last(wd->stack)->data;
\r
824 it->popme = EINA_TRUE;
\r
825 ll = eina_list_last(wd->stack);
\r
833 const char *onhide;
\r
838 edje_object_signal_emit(o, "elm,action,hide", "elm");
\r
839 onhide = edje_object_data_get(o, "onhide");
\r
842 if (!strcmp(onhide, "raise")) evas_object_raise(o);
\r
843 else if (!strcmp(onhide, "lower")) evas_object_lower(o);
\r
857 * Return the item at the bottom of the Navigationbar_ex stack
\r
859 * @param[in] obj The Navigationbar_ex object
\r
860 * @return The bottom item or NULL if none
\r
862 * @ingroup Navigationbar_ex
\r
864 EAPI Elm_Navigationbar_ex_Item*
\r
865 elm_navigationbar_ex_item_bottom_get(const Evas_Object *obj)
\r
867 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
\r
868 Widget_Data *wd = elm_widget_data_get(obj);
\r
869 Elm_Navigationbar_ex_Item *it;
\r
870 if (!wd) return NULL;
\r
871 if (!wd->stack) return NULL;
\r
872 it = wd->stack->data;
\r
877 * Return the item at the top of the Navigationbar_ex stack
\r
879 * @param[in] obj The Navigationbar_ex object
\r
880 * @return The top object or NULL if none
\r
882 * @ingroup Navigationbar_ex
\r
884 EAPI Elm_Navigationbar_ex_Item*
\r
885 elm_navigationbar_ex_item_top_get(const Evas_Object *obj)
\r
887 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
\r
888 Widget_Data *wd = elm_widget_data_get(obj);
\r
889 Elm_Navigationbar_ex_Item *it;
\r
890 if (!wd) return NULL;
\r
891 if (!wd->stack) return NULL;
\r
892 it = eina_list_last(wd->stack)->data;
\r