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
50 Eina_Bool popme : 1;
\r
53 struct _function_button
\r
59 static const char *widtype = NULL;
\r
60 static void _del_hook(Evas_Object *obj);
\r
61 static void _theme_hook(Evas_Object *obj);
\r
62 static void _sizing_eval(Evas_Object *obj);
\r
63 static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
\r
64 static void _sub_del(void *data, Evas_Object *obj, void *event_info);
\r
68 _del_hook(Evas_Object *obj)
\r
70 Widget_Data *wd = elm_widget_data_get(obj);
\r
77 _content_unset(Elm_Navigationbar_ex_Item* item)
\r
79 if(!item) return NULL;
\r
80 Evas_Object *content = NULL;
\r
81 if(!item->content) return NULL;
\r
82 content = item->content;
\r
83 elm_widget_sub_object_del(item->obj,item->content);
\r
84 edje_object_part_unswallow(item->base,item->content);
\r
85 item->content = NULL;
\r
86 evas_object_hide(content);
\r
91 _theme_hook(Evas_Object *obj)
\r
93 Widget_Data *wd = elm_widget_data_get(obj);
\r
96 Elm_Navigationbar_ex_Item *it;
\r
98 EINA_LIST_FOREACH(wd->stack, l, it)
\r
102 edje_object_scale_set(it->base, elm_widget_scale_get(obj) *
\r
103 _elm_config->scale);
\r
104 EINA_LIST_FOREACH(it->fnbtn_list, bl, btn)
\r
106 if(btn->btn_id == ELM_NAVIGATIONBAR_EX_BACK_BUTTON)
\r
108 snprintf(buf_fn, sizeof(buf_fn), "navigationbar_backbutton/%s", elm_widget_style_get(obj));
\r
109 elm_object_style_set(btn->btn, buf_fn);
\r
113 snprintf(buf_fn, sizeof(buf_fn), "navigationbar_functionbutton/%s", elm_widget_style_get(obj));
\r
114 elm_object_style_set(btn->btn, buf_fn);
\r
122 _sizing_eval(Evas_Object *obj)
\r
124 Widget_Data *wd = elm_widget_data_get(obj);
\r
125 Evas_Coord minw = -1, minh = -1;
\r
127 Elm_Navigationbar_ex_Item *it;
\r
129 EINA_LIST_FOREACH(wd->stack, l, it)
\r
131 if (it->minw > minw) minw = it->minw;
\r
132 if (it->minh > minh) minh = it->minh;
\r
134 evas_object_size_hint_min_set(obj, minw, minh);
\r
135 evas_object_size_hint_max_set(obj, -1, -1);
\r
139 _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
\r
141 Elm_Navigationbar_ex_Item *it = data;
\r
142 Evas_Coord minw = -1, minh = -1;
\r
143 evas_object_size_hint_min_get(it->content, &minw, &minh);
\r
144 // FIXME: why is this needed? how does edje get this unswallowed or
\r
145 // lose its callbacks to edje
\r
146 edje_object_part_swallow(it->base, "elm.swallow.content", it->content);
\r
147 edje_object_size_min_calc(it->base, &it->minw, &it->minh);
\r
148 _sizing_eval(it->obj);
\r
152 _eval_top(Evas_Object *obj, Eina_Bool push)
\r
154 Widget_Data *wd = elm_widget_data_get(obj);
\r
155 Eina_Bool animate=EINA_TRUE;
\r
156 Elm_Navigationbar_ex_Item *ittop;
\r
158 if (!wd->stack) return;
\r
159 ittop = eina_list_last(wd->stack)->data;
\r
160 if (ittop != wd->top)
\r
163 const char *onshow, *onhide;
\r
168 edje_object_signal_emit(o, "elm,action,hide", "elm");
\r
169 onhide = edje_object_data_get(o, "onhide");
\r
172 if (!strcmp(onhide, "raise")) evas_object_raise(o);
\r
173 else if (!strcmp(onhide, "lower")) evas_object_lower(o);
\r
178 animate = EINA_FALSE;
\r
182 evas_object_show(o);
\r
186 edje_object_signal_emit(o, "elm,action,show,push", "elm");
\r
188 edje_object_signal_emit(o, "elm,action,show,pop", "elm");
\r
191 edje_object_signal_emit(o, "elm,action,show,noanimate", "elm");
\r
192 onshow = edje_object_data_get(o, "onshow");
\r
195 if (!strcmp(onshow, "raise")) evas_object_raise(o);
\r
196 else if (!strcmp(onshow, "lower")) evas_object_lower(o);
\r
202 _move(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
\r
204 Widget_Data *wd = elm_widget_data_get(data);
\r
207 Elm_Navigationbar_ex_Item *it;
\r
209 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
\r
210 EINA_LIST_FOREACH(wd->stack, l, it)
\r
211 evas_object_move(it->base, x, y);
\r
215 _sub_del(void *data, Evas_Object *obj __UNUSED__, void *event_info)
\r
217 Widget_Data *wd = elm_widget_data_get(data);
\r
218 Evas_Object *sub = event_info;
\r
219 Eina_List *l,*list;
\r
220 fn_button *btn_data;
\r
221 Elm_Navigationbar_ex_Item *it;
\r
223 EINA_LIST_FOREACH(wd->stack, l, it)
\r
225 if (it->content == sub)
\r
227 wd->stack = eina_list_remove_list(wd->stack, l);
\r
228 evas_object_event_callback_del_full
\r
229 (sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, it);
\r
230 if (it->title) eina_stringshare_del(it->title);
\r
231 if (it->subtitle) eina_stringshare_del(it->subtitle);
\r
232 EINA_LIST_FOREACH(it->fnbtn_list, list, btn_data)
\r
234 evas_object_del(btn_data->btn);
\r
238 if(it->item_style) eina_stringshare_del(it->item_style);
\r
239 if(it->title_obj) evas_object_del(it->title_obj);
\r
240 evas_object_del(it->base);
\r
241 _eval_top(it->obj, EINA_FALSE);
\r
249 _resize(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
\r
251 Widget_Data *wd = elm_widget_data_get(data);
\r
254 Elm_Navigationbar_ex_Item *it;
\r
256 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
\r
257 EINA_LIST_FOREACH(wd->stack, l, it) evas_object_resize(it->base, w, h);
\r
261 _signal_hide_finished(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
\r
263 Elm_Navigationbar_ex_Item *it = data;
\r
264 Evas_Object *obj2 = it->obj;
\r
265 Widget_Data *wd = elm_widget_data_get(it->obj);
\r
266 evas_object_hide(it->base);
\r
267 edje_object_signal_emit(it->base, "elm,action,reset", "elm");
\r
268 evas_object_smart_callback_call(obj2, "hide,finished", it->content);
\r
269 edje_object_message_signal_process(it->base);
\r
274 evas_object_del(it->content);
\r
278 _content_unset(it);
\r
281 _sizing_eval(obj2);
\r
284 static void _item_promote(Elm_Navigationbar_ex_Item* item)
\r
287 Widget_Data *wd = elm_widget_data_get(item->obj);
\r
289 Elm_Navigationbar_ex_Item *it;
\r
291 EINA_LIST_FOREACH(wd->stack, l, it)
\r
295 wd->stack = eina_list_remove_list(wd->stack, l);
\r
296 wd->stack = eina_list_append(wd->stack, it);
\r
297 _eval_top(it->obj, EINA_FALSE);
\r
304 _process_deletions(Widget_Data *wd)
\r
307 Elm_Navigationbar_ex_Item *it;
\r
308 fn_button *btn_data;
\r
310 EINA_LIST_FREE(wd->to_delete, it)
\r
312 evas_object_event_callback_del_full
\r
313 (it->content, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, it);
\r
314 if (it->title) eina_stringshare_del(it->title);
\r
315 if (it->subtitle) eina_stringshare_del(it->subtitle);
\r
316 if(it->item_style) eina_stringshare_del(it->item_style);
\r
317 EINA_LIST_FOREACH(it->fnbtn_list, list, btn_data)
\r
319 evas_object_del(btn_data->btn);
\r
323 if(it->title_obj) evas_object_del(it->title_obj);
\r
324 if(it->content) evas_object_del(it->content);
\r
325 evas_object_del(it->base);
\r
326 _eval_top(it->obj, EINA_FALSE);
\r
333 * Add a new navigationbar_ex to the parent
\r
335 * @param parent The parent object
\r
336 * @return The new object or NULL if it cannot be created
\r
338 * @ingroup Navigationbar_ex
\r
341 elm_navigationbar_ex_add(Evas_Object *parent)
\r
347 wd = ELM_NEW(Widget_Data);
\r
348 e = evas_object_evas_get(parent);
\r
349 obj = elm_widget_add(e);
\r
350 ELM_SET_WIDTYPE(widtype, "navigationbar_ex");
\r
351 elm_widget_type_set(obj, "navigationbar_ex");
\r
352 elm_widget_sub_object_add(parent, obj);
\r
353 elm_widget_data_set(obj, wd);
\r
354 elm_widget_del_hook_set(obj, _del_hook);
\r
355 elm_widget_theme_hook_set(obj, _theme_hook);
\r
357 wd->clip = evas_object_rectangle_add(e);
\r
358 elm_widget_resize_object_set(obj, wd->clip);
\r
359 elm_widget_sub_object_add(obj, wd->clip);
\r
361 wd->rect = evas_object_rectangle_add(e);
\r
362 elm_widget_sub_object_add(obj, wd->rect);
\r
363 evas_object_color_set(wd->rect, 255, 255, 255, 0);
\r
364 evas_object_clip_set(wd->rect, wd->clip);
\r
366 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _move, obj);
\r
367 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, obj);
\r
369 evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
\r
370 wd->del_on_pop = EINA_TRUE;
\r
376 * Push an object along with its style to the top of the Navigationbar_ex stack (and show it)
\r
378 * The object pushed becomes a child of the Navigationbar_ex and will be controlled
\r
379 * it will be deleted when the Navigationbar_ex is deleted.
\r
381 * @param[in] obj The Navigationbar_ex object
\r
382 * @param[in] content The object to push
\r
383 * @param[in] item_style The style of the page
\r
384 * @return The Navigationbar_ex Item or NULL
\r
385 * @ingroup Navigationbar_ex
\r
387 EAPI Elm_Navigationbar_ex_Item*
\r
388 elm_navigationbar_ex_item_push(Evas_Object *obj, Evas_Object *content, const char* item_style)
\r
390 ELM_CHECK_WIDTYPE(obj, widtype)NULL;
\r
391 Widget_Data *wd = elm_widget_data_get(obj);
\r
392 Elm_Navigationbar_ex_Item *it = ELM_NEW(Elm_Navigationbar_ex_Item);
\r
393 Evas_Coord x, y, w, h;
\r
395 if (!wd) return NULL;
\r
396 if (!content) return NULL;
\r
397 if (!item_style) return NULL;
\r
398 if (!it) return NULL;
\r
400 it->content = content;
\r
401 it->base = edje_object_add(evas_object_evas_get(obj));
\r
402 evas_object_smart_member_add(it->base, obj);
\r
403 evas_object_geometry_get(obj, &x, &y, &w, &h);
\r
404 evas_object_move(it->base, x, y);
\r
405 evas_object_resize(it->base, w, h);
\r
406 evas_object_clip_set(it->base, wd->clip);
\r
407 elm_widget_sub_object_add(obj, it->base);
\r
408 elm_widget_sub_object_add(obj, it->content);
\r
409 strncpy(buf, "item/", sizeof(buf));
\r
410 strncat(buf, item_style, sizeof(buf) - strlen(buf));
\r
411 if (!eina_stringshare_replace(&it->item_style, item_style)) return NULL;
\r
413 _elm_theme_object_set(obj, it->base, "navigationbar_ex", buf, elm_widget_style_get(obj));
\r
414 edje_object_signal_callback_add(it->base, "elm,action,hide,finished", "",
\r
415 _signal_hide_finished, it);
\r
416 evas_object_event_callback_add(it->content,
\r
417 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
\r
418 _changed_size_hints, it);
\r
419 edje_object_part_swallow(it->base, "elm.swallow.content", it->content);
\r
420 edje_object_size_min_calc(it->base, &it->minw, &it->minh);
\r
421 evas_object_show(it->content);
\r
422 wd->stack = eina_list_append(wd->stack, it);
\r
423 _eval_top(obj, EINA_TRUE);
\r
429 * Set the title string for the pushed Item.
\r
430 * @param[in] item The Navigationbar_ex Item
\r
431 * @param[in] title The title string
\r
433 * @ingroup Navigationbar_ex
\r
436 elm_navigationbar_ex_item_title_label_set( Elm_Navigationbar_ex_Item* item,
\r
440 if (!eina_stringshare_replace(&item->title, title)) return;
\r
442 edje_object_part_text_set(item->base, "elm.text", item->title);
\r
446 * Return the title string of the pushed item.
\r
448 * @param[in] item The Navigationbar_ex Item
\r
449 * @return The title string or NULL if none
\r
451 * @ingroup Navigationbar_ex
\r
454 elm_navigationbar_ex_item_title_label_get(Elm_Navigationbar_ex_Item* item)
\r
456 if(!item) return NULL;
\r
457 return item->title;
\r
461 * Set the sub title string for the pushed content
\r
463 * @param[in] item The Navigationbar_ex Item
\r
464 * @param[in] subtitle The subtitle string
\r
466 * @ingroup Navigationbar_ex
\r
469 elm_navigationbar_ex_item_subtitle_label_set( Elm_Navigationbar_ex_Item* item,
\r
470 const char *subtitle)
\r
473 if (!eina_stringshare_replace(&item->subtitle, subtitle)) return;
\r
475 edje_object_part_text_set(item->base, "elm.text.sub", item->subtitle);
\r
479 * Return the subtitle string of the pushed content
\r
481 * @param[in] item The Navigationbar_ex Item
\r
482 * @return The subtitle string or NULL if none
\r
484 * @ingroup Navigationbar_ex
\r
487 elm_navigationbar_ex_item_subtitle_label_get(Elm_Navigationbar_ex_Item* item)
\r
489 if(!item) return NULL;
\r
490 return item->subtitle;
\r
494 * Set the button object of the pushed content
\r
496 * @param[in] item The Navigationbar_ex Item
\r
497 * @param[in] btn_label The button label
\r
498 * @param[in] icon The button icon
\r
499 * @param[in] button_type Indicates the position[use macros of type Elm_Navi_ex_Button_Type
\r
500 * if more function buttons are required you can use values ELM_NAVIGATIONBAR_EX_MAX and more]
\r
501 * @param[in] func Callback function called when button is clicked.
\r
502 * @param[in] data Callback data that would be sent when button is clicked.
\r
503 * @ingroup Navigationbar_ex
\r
506 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
510 char buf[1024],theme[1024];
\r
511 fn_button *btn_det;
\r
512 btn = elm_button_add(item->obj);
\r
513 btn_det = ELM_NEW(btn_det);
\r
514 if(button_type == ELM_NAVIGATIONBAR_EX_BACK_BUTTON)
\r
516 snprintf(theme, sizeof(theme), "navigationbar_backbutton/%s", elm_widget_style_get(item->obj));
\r
517 elm_object_style_set(btn, theme);
\r
518 snprintf(buf, sizeof(buf), "elm.swallow.back");
\r
522 snprintf(theme, sizeof(theme), "navigationbar_functionbutton/%s", elm_widget_style_get(item->obj));
\r
523 elm_object_style_set(btn, theme);
\r
524 snprintf(buf, sizeof(buf), "elm.swallow.btn%d", button_type);
\r
527 elm_button_label_set(btn, btn_label);
\r
529 elm_button_icon_set(btn, icon);
\r
530 elm_object_focus_allow_set(btn, EINA_FALSE);
\r
531 evas_object_smart_callback_add(btn, "clicked", func, data);
\r
532 edje_object_part_swallow(item->base, buf, btn);
\r
533 elm_widget_sub_object_add(item->obj, btn);
\r
534 btn_det->btn = btn;
\r
535 btn_det->btn_id = button_type;
\r
536 item->fnbtn_list = eina_list_append(item->fnbtn_list, btn_det);
\r
540 * Return the button object of the pushed content
\r
542 * @param[in] item The Navigationbar_ex Item
\r
543 * @param[in] button_type Indicates the position
\r
544 * @return The button object or NULL if none
\r
546 * @ingroup Navigationbar_ex
\r
549 elm_navigationbar_ex_item_title_button_get(Elm_Navigationbar_ex_Item* item, int button_type)
\r
551 fn_button *btn_det;
\r
553 EINA_LIST_FOREACH(item->fnbtn_list, bl, btn_det)
\r
555 if(btn_det->btn_id == button_type)
\r
556 return btn_det->btn;
\r
563 * Sets a title object for the Item
\r
564 * @param[in] item The Navigationbar_ex Item
\r
565 * @param[in] title_obj Title object (normally segment_control/searchbar)
\r
567 * @ingroup Navigationbar_ex
\r
570 elm_navigationbar_ex_item_title_object_set(Elm_Navigationbar_ex_Item* item,
\r
571 Evas_Object *title_obj)
\r
574 if(item->title_obj) evas_object_del(item->title_obj);
\r
575 item->title_obj = title_obj;
\r
578 elm_widget_sub_object_add(item->obj,title_obj);
\r
579 edje_object_part_swallow(item->base, "elm.swallow.title", title_obj);
\r
581 _sizing_eval(item->obj);
\r
585 * Hides the title area of the item.
\r
586 * @param[in] item The Navigationbar_ex Item
\r
587 * @param[in] hidden if EINA_TRUE the title area is hidden else its shown.
\r
589 * @ingroup Navigationbar_ex
\r
593 elm_navigationbar_ex_item_title_hidden_set(Elm_Navigationbar_ex_Item* item,
\r
598 if (hidden) edje_object_signal_emit(item->base, "elm,state,item,moveup", "elm");
\r
599 else edje_object_signal_emit(item->base, "elm,state,item,movedown", "elm");
\r
600 _sizing_eval(item->obj);
\r
604 * unsets a title object for the item, the return object has to be deleted
\r
605 * by application if not added again in to navigationbar.
\r
607 * @param[in] item The Navigationbar_ex Item
\r
608 * @return The title object or NULL if none is set
\r
610 * @ingroup Navigationbar_ex
\r
613 elm_navigationbar_ex_item_title_object_unset(Elm_Navigationbar_ex_Item* item)
\r
615 if(!item) return NULL;
\r
616 Evas_Object *title_obj=NULL;
\r
617 if(!item->title_obj) return NULL;
\r
618 title_obj = item->title_obj;
\r
619 elm_widget_sub_object_del(item->obj,item->title_obj);
\r
620 edje_object_part_unswallow(item->base,item->title_obj);
\r
621 item->title_obj = NULL;
\r
626 * Returns the title object of the pushed content.
\r
628 * @param[in] item The Navigationbar_ex Item
\r
629 * @return The title object or NULL if none is set
\r
631 * @ingroup Navigationbar_ex
\r
634 elm_navigationbar_ex_item_title_object_get(Elm_Navigationbar_ex_Item* item)
\r
636 if(!item) return NULL;
\r
637 return item->title_obj;
\r
642 * unsets the content of the item, the return object has to be deleted
\r
643 * by application if not added again in to navigationbar, when the content
\r
644 * is unset the corresponding item would be deleted, when this content is pushed again
\r
645 * a new item would be created again.
\r
647 * @param[in] item The Navigationbar_ex Item
\r
648 * @return The content object or NULL if none is set
\r
650 * @ingroup Navigationbar_ex
\r
652 EAPI Evas_Object *elm_navigationbar_ex_item_content_unset(Elm_Navigationbar_ex_Item* item)
\r
654 Evas_Object *content = _content_unset(item);
\r
660 * returns the content of the item.
\r
662 * @param[in] item The Navigationbar_ex Item
\r
663 * @return The content object or NULL if none is set
\r
665 * @ingroup Navigationbar_ex
\r
667 EAPI Evas_Object *elm_navigationbar_ex_item_content_get(Elm_Navigationbar_ex_Item* item)
\r
669 if(!item) return NULL;
\r
670 return item->content;
\r
674 * set whether the content pushed has to be deleted on pop.
\r
675 * if false the item is not deleted but only removed from the stack
\r
676 * the pointer of the content is sent along with hide,finished signal.
\r
678 * @param[in] obj The Navigationbar_ex object.
\r
679 * @param[in] del_on_pop if set the content is deleted on pop else unset, by default the value is EINA_TRUE.
\r
681 * @ingroup Navigationbar_ex
\r
683 EAPI void elm_navigationbar_ex_delete_on_pop_set(Evas_Object *obj, Eina_Bool del_on_pop)
\r
685 ELM_CHECK_WIDTYPE(obj, widtype);
\r
686 Widget_Data *wd = elm_widget_data_get(obj);
\r
688 wd->del_on_pop = del_on_pop;
\r
692 * Sets the style of the navigationbar item.
\r
693 * @param[in] item The Navigationbar_ex Item
\r
694 * @param[in] item_style Navigationbar Item style, this can be used when the style of the item has to be dynamically set.
\r
696 * @ingroup Navigationbar_ex
\r
699 elm_navigationbar_ex_item_style_set(Elm_Navigationbar_ex_Item* item, const char* item_style)
\r
703 strncpy(buf, "item/", sizeof(buf));
\r
704 strncat(buf, item_style, sizeof(buf) - strlen(buf));
\r
705 if (!eina_stringshare_replace(&item->item_style, item_style)) return;
\r
706 _elm_theme_object_set(item->obj, item->base, "navigationbar2", buf, elm_widget_style_get(item->obj));
\r
708 edje_object_part_text_set(item->base, "elm.text", item->title);
\r
710 edje_object_part_text_set(item->base, "elm.text.sub", item->subtitle);
\r
714 * returns the style of the item.
\r
716 * @param[in] item The Navigationbar_ex Item
\r
717 * @return The item style.
\r
719 * @ingroup Navigationbar_ex
\r
721 EAPI const char* elm_navigationbar_ex_item_style_get(Elm_Navigationbar_ex_Item* item)
\r
723 if(!item) return NULL;
\r
724 return item->item_style;
\r
729 * Promote an object already in the stack to the top of the stack
\r
731 * This will take the indicated object and promote it to the top of the stack
\r
732 * as if it had been pushed there. The object must already be inside the
\r
733 * Navigationbar_ex stack to work.
\r
735 * @param item The Navigationbar_ex item to promote.
\r
736 * @ingroup Navigationbar_ex
\r
739 elm_navigationbar_ex_item_promote(Elm_Navigationbar_ex_Item* item)
\r
741 _item_promote(item);
\r
745 * Pop to the inputted Navigationbar_ex item
\r
746 * the rest of the items are deleted.
\r
748 * @param[in] item The Navigationbar_ex item
\r
750 * @ingroup Navigationbar_ex
\r
752 EAPI void elm_navigationbar_ex_to_item_pop(Elm_Navigationbar_ex_Item* item)
\r
755 Widget_Data *wd = elm_widget_data_get(item->obj);
\r
756 Elm_Navigationbar_ex_Item *it = NULL;
\r
759 if (!wd->stack) return;
\r
760 list = eina_list_last(wd->stack);
\r
768 wd->to_delete = eina_list_append(wd->to_delete, it);
\r
769 wd->stack = eina_list_remove_list(wd->stack, list);
\r
777 _eval_top(it->obj, EINA_FALSE);
\r
779 _process_deletions(wd);
\r
783 * Pop the object that is on top of the Navigationbar_ex stack
\r
784 * This pops the object that is on top (visible) in the navigationbar, makes it disappear, then deletes/unsets the object
\r
785 * based on del_on_pop variable.
\r
786 * The object that was underneath it on the stack will become visible.
\r
788 * @param[in] obj The Navigationbar_ex object
\r
790 * @ingroup Navigationbar_ex
\r
793 elm_navigationbar_ex_item_pop(Evas_Object *obj)
\r
795 ELM_CHECK_WIDTYPE(obj, widtype);
\r
796 Widget_Data *wd = elm_widget_data_get(obj);
\r
798 Elm_Navigationbar_ex_Item *it;
\r
800 if (!wd->stack) return;
\r
801 it = eina_list_last(wd->stack)->data;
\r
802 it->popme = EINA_TRUE;
\r
803 ll = eina_list_last(wd->stack);
\r
811 const char *onhide;
\r
816 edje_object_signal_emit(o, "elm,action,hide", "elm");
\r
817 onhide = edje_object_data_get(o, "onhide");
\r
820 if (!strcmp(onhide, "raise")) evas_object_raise(o);
\r
821 else if (!strcmp(onhide, "lower")) evas_object_lower(o);
\r
835 * Return the item at the bottom of the Navigationbar_ex stack
\r
837 * @param obj The Navigationbar_ex object
\r
838 * @return The bottom item or NULL if none
\r
840 * @ingroup Navigationbar_ex
\r
842 EAPI Elm_Navigationbar_ex_Item*
\r
843 elm_navigationbar_ex_item_bottom_get(const Evas_Object *obj)
\r
845 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
\r
846 Widget_Data *wd = elm_widget_data_get(obj);
\r
847 Elm_Navigationbar_ex_Item *it;
\r
848 if (!wd) return NULL;
\r
849 if (!wd->stack) return NULL;
\r
850 it = wd->stack->data;
\r
855 * Return the item at the top of the Navigationbar_ex stack
\r
857 * @param obj The Navigationbar_ex object
\r
858 * @return The top object or NULL if none
\r
860 * @ingroup Navigationbar_ex
\r
862 EAPI Elm_Navigationbar_ex_Item*
\r
863 elm_navigationbar_ex_item_top_get(const Evas_Object *obj)
\r
865 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
\r
866 Widget_Data *wd = elm_widget_data_get(obj);
\r
867 Elm_Navigationbar_ex_Item *it;
\r
868 if (!wd) return NULL;
\r
869 if (!wd->stack) return NULL;
\r
870 it = eina_list_last(wd->stack)->data;
\r