================================================================
[framework/uifw/elementary.git] / src / lib / elm_navigationbar.c
1 #include <Elementary.h>
2 #include "elm_priv.h"
3
4 /**
5  * @defgroup NavigationBar NavigationBar
6  * @ingroup Elementary
7  *
8  * The Navigationbar is an object that allows flipping (with animation) between 1 or
9  * more of objects, much like a stack of windows within the window. It also displays title
10  * area above all the pages consisting of title,function buttons.
11  *
12  * Objects can be pushed or popped from the stack.
13  * Pushes and pops will animate (and a pop will delete the object once the
14  * animation is finished). Objects are pushed to the top with 
15  * elm_navigationbar_push() and when the top item is no longer
16  * wanted, simply pop it with elm_navigationbar_pop() and it will also be
17  * deleted. You can query which objects are the top and bottom with 
18  * elm_navigationbar_content_bottom_get() and elm_navigationbar_content_top_get().
19  */
20
21 typedef struct _Widget_Data Widget_Data;
22 typedef struct _Item Item;
23 typedef struct _Transit_Cb_Data Transit_Cb_Data;
24
25 struct _Widget_Data
26 {
27    Eina_List *stack;
28    Evas_Object *base;
29    Evas_Object *pager;
30    Eina_Bool hidden :1;
31    Eina_Bool popping: 1;
32  };
33
34 struct _Item
35 {
36    Evas_Object *obj;
37    const char *title;
38    const char *subtitle;
39    Evas_Object *title_obj;
40    Eina_List *title_list;
41    Evas_Object *fn_btn1;
42    Evas_Object *fn_btn2;
43    Evas_Object *fn_btn3;
44    Evas_Object *back_btn;
45    Evas_Object *content;
46    int fn_btn1_w;
47    int fn_btn2_w;
48    int fn_btn3_w;
49    int title_w;
50 };
51
52 struct _Transit_Cb_Data
53 {
54    Item* prev_it;
55    Item* it;
56    Eina_Bool pop;
57    Eina_Bool first_page;
58 };
59
60 static const char *widtype = NULL;
61
62 static void _del_hook(Evas_Object *obj);
63 static void _theme_hook(Evas_Object *obj);
64 static void _sizing_eval(Evas_Object *obj);
65 static void _resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
66 static void _item_sizing_eval(Item *it);
67 static void _delete_item(Item *it);
68 static void _back_button_clicked(void *data, Evas_Object *obj, void *event_info);
69 static int _set_button_width(Evas_Object *obj);
70 static Eina_Bool _button_set(Evas_Object *obj, Evas_Object *prev_btn, Evas_Object *new_btn, Eina_Bool back_btn);
71 static Evas_Object *_multiple_object_set(Evas_Object *obj, Evas_Object *sub_obj, Eina_List *list, int width);
72 static Item *_check_item_is_added(Evas_Object *obj, Evas_Object *content);
73 static void _transition_complete_cb(void *data);
74 static void _elm_navigationbar_back_button_set(Evas_Object *obj, Evas_Object *content, Evas_Object *button);
75 static Evas_Object *_elm_navigationbar_back_button_get(Evas_Object *obj, Evas_Object *content);
76 static void _elm_navigationbar_function_button1_set(Evas_Object *obj, Evas_Object *content, Evas_Object *button);
77 static Evas_Object *_elm_navigationbar_function_button1_get(Evas_Object *obj, Evas_Object *content);
78 static void _elm_navigationbar_function_button2_set(Evas_Object *obj, Evas_Object *content, Evas_Object *button);
79 static Evas_Object *_elm_navigationbar_function_button2_get(Evas_Object *obj, Evas_Object *content);
80 static void _elm_navigationbar_function_button3_set(Evas_Object *obj, Evas_Object *content, Evas_Object *button);
81 static Evas_Object *_elm_navigationbar_function_button3_get(Evas_Object *obj, Evas_Object *content);
82
83 static void
84 _del_hook(Evas_Object *obj)
85 {
86    Widget_Data *wd = elm_widget_data_get(obj);
87    Eina_List *list;
88    Item *it;
89    
90    EINA_LIST_FOREACH(wd->stack, list, it)
91      _delete_item(it);
92    eina_list_free(wd->stack);
93    free(wd);
94 }
95
96 static void
97 _theme_hook(Evas_Object *obj)
98 {
99    Widget_Data *wd = elm_widget_data_get(obj);
100    Eina_List *list = NULL;
101    Item *it = NULL;
102    char buf_fn[4096];
103    char buf_bk[4096];
104    
105    if (!wd) return;
106    _elm_theme_object_set(obj, wd->base, "navigationbar", "base", elm_widget_style_get(obj));
107    edje_object_scale_set(wd->base, elm_widget_scale_get(obj) * _elm_config->scale);
108    EINA_LIST_FOREACH(wd->stack, list, it)
109      {
110         if (it->fn_btn1)
111          {  
112             snprintf(buf_fn, sizeof(buf_fn), "navigationbar_functionbutton/%s", elm_widget_style_get(obj));
113             elm_object_style_set(it->fn_btn1, buf_fn);            
114          }
115         if (it->fn_btn2)
116          {        
117             snprintf(buf_fn, sizeof(buf_fn), "navigationbar_functionbutton/%s", elm_widget_style_get(obj));
118             elm_object_style_set(it->fn_btn2, buf_fn);               
119          }
120         if (it->fn_btn3)
121          {
122             snprintf(buf_fn, sizeof(buf_fn), "navigationbar_functionbutton/%s", elm_widget_style_get(obj));
123             elm_object_style_set(it->fn_btn3, buf_fn);            
124          }
125         snprintf(buf_bk, sizeof(buf_bk), "navigationbar_backbutton/%s", elm_widget_style_get(obj));
126         elm_object_style_set(it->back_btn, buf_bk);
127      }
128    edje_object_message_signal_process(wd->base);
129    _sizing_eval(obj);
130 }
131
132 static void
133 _delete_item(Item *it)
134 {
135    Eina_List *ll;
136    if (!it) return;
137    Evas_Object *list_obj;
138    
139    if(it->back_btn)
140      evas_object_del(it->back_btn);
141    if(it->fn_btn1)
142      {
143         elm_object_unfocus(it->fn_btn1);
144         evas_object_del(it->fn_btn1);
145      }
146    if(it->fn_btn2)
147      {
148         elm_object_unfocus(it->fn_btn2);
149         evas_object_del(it->fn_btn2);
150      }
151    if(it->fn_btn3)
152      {
153         elm_object_unfocus(it->fn_btn3);
154         evas_object_del(it->fn_btn3); 
155      }
156    if (it->title) 
157      eina_stringshare_del(it->title);
158    if (it->subtitle) 
159      eina_stringshare_del(it->subtitle);
160    EINA_LIST_FOREACH(it->title_list, ll, list_obj)
161      evas_object_del(list_obj);
162    eina_list_free(it->title_list);
163    free(it);   
164 }
165
166 static void
167 _sizing_eval(Evas_Object *obj)
168 {
169    Widget_Data *wd = elm_widget_data_get(obj);
170    Evas_Coord minw = -1, minh = -1;
171    Evas_Coord w = -1, h = -1;
172    Eina_List *list;
173
174    edje_object_size_min_calc(wd->base, &minw, &minh);
175    evas_object_size_hint_min_get(obj, &w, &h);
176    if (w > minw) minw = w;
177    if (h > minw) minh = h;
178
179    evas_object_size_hint_min_set(obj, minw, minh);
180    evas_object_size_hint_max_set(obj, -1, -1);
181
182    list = eina_list_last(wd->stack);
183    if (list)
184      {
185         Item *it = list->data;
186         _item_sizing_eval(it);
187      }
188 }
189
190 static void
191 _item_sizing_eval(Item *it)
192 {
193    if (!it) return;
194    Widget_Data *wd = elm_widget_data_get(it->obj);
195    Evas_Coord pad, height, minw, w;
196    int pad_count = 2;
197
198    edje_object_size_min_calc(wd->base, &minw, NULL);
199    evas_object_geometry_get(wd->base, NULL, NULL, &w, NULL);
200    if (w < minw) w = minw;   
201    edje_object_part_geometry_get(wd->base, "elm.rect.pad1", NULL, NULL, &pad, NULL);
202    edje_object_part_geometry_get(wd->base, "elm.swallow.title", NULL, NULL, NULL, &height);
203
204    if (it->fn_btn1) 
205      {
206         it->fn_btn1_w = _set_button_width(it->fn_btn1);
207         pad_count++;
208      }
209    else if (it->back_btn)
210      {
211         it->fn_btn1_w = _set_button_width(it->back_btn);
212         pad_count++;
213      }
214    if (it->fn_btn2)
215      {
216         it->fn_btn2_w = _set_button_width(it->fn_btn2);
217         pad_count++;
218      }
219    if (it->fn_btn3)
220      {
221         it->fn_btn3_w = _set_button_width(it->fn_btn3);
222         pad_count++;
223      }
224    if (it->title_list)
225      {  
226         it->title_w = _set_button_width(it->title_obj);
227         it->title_obj = _multiple_object_set(it->obj, it->title_obj, it->title_list, it->title_w);
228         evas_object_resize(it->title_obj, it->title_w, height);
229         evas_object_size_hint_min_set(it->title_obj, it->title_w, height);
230      }
231 }
232
233 static void
234 _resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
235 {
236    _sizing_eval(obj);
237 }
238
239 static void 
240 _transition_complete_cb(void *data)
241 {
242    Transit_Cb_Data *cb = data;
243    if (!cb) return;
244    Evas_Object *navi_bar = NULL;
245    Evas_Object *content = NULL;
246    Widget_Data *wd = NULL;
247    Item *prev_it = cb->prev_it;
248    Item *it = cb->it;
249
250    if (prev_it)
251      {
252         navi_bar = prev_it->obj;
253      }
254    else if (it)
255      {
256         navi_bar = it->obj;
257      }
258    wd = elm_widget_data_get(navi_bar);
259    if (cb->pop && prev_it)
260      {
261         Eina_List *ll;
262         ll = eina_list_last(wd->stack);
263         if (ll->data == prev_it)
264           {
265              _delete_item(prev_it);
266              wd->stack = eina_list_remove_list(wd->stack, ll);
267           }
268      }  
269    else if (prev_it)
270      {
271         evas_object_hide(prev_it->fn_btn1);
272         evas_object_hide(prev_it->back_btn);
273         evas_object_hide(prev_it->title_obj);
274         evas_object_hide(prev_it->fn_btn2);
275         evas_object_hide(prev_it->fn_btn3);
276      }
277    if ((it) && (!wd->hidden))
278      {
279         edje_object_part_text_set(wd->base, "elm.text", it->title);
280         if (!cb->first_page)
281           {
282              if (cb->pop)
283                {
284                   edje_object_signal_emit(wd->base, "elm,action,pop", "elm");
285                }
286              else
287                {
288                   edje_object_signal_emit(wd->base, "elm,action,push", "elm");
289                }
290              edje_object_signal_emit(wd->base, "elm,state,rect,enabled", "elm");
291           }
292         if (it->title_obj) 
293           {
294              edje_object_part_swallow(wd->base, "elm.swallow.title", it->title_obj);
295              edje_object_signal_emit(wd->base, "elm,state,retract,title", "elm");
296           }
297         if (it->title) 
298           {
299              edje_object_signal_emit(wd->base, "elm,state,retract,title", "elm");
300           }
301         if (it->subtitle) 
302           {
303              edje_object_part_text_set(wd->base, "elm.text.sub", it->subtitle);
304           }
305         else
306           edje_object_part_text_set(wd->base, "elm.text.sub", NULL);
307         if (it->fn_btn1) 
308           {
309              edje_object_signal_emit(wd->base, "elm,state,item,add,leftpad", "elm");
310              edje_object_part_swallow(wd->base, "elm.swallow.btn1", it->fn_btn1);
311           }
312         else if (it->back_btn) 
313           {
314              edje_object_signal_emit(wd->base, "elm,state,item,add,leftpad", "elm");
315              edje_object_part_swallow(wd->base, "elm.swallow.btn1", it->back_btn);
316           }
317         else
318           edje_object_signal_emit(wd->base, "elm,state,item,reset,leftpad", "elm");
319         if (it->fn_btn2) 
320           {
321              edje_object_signal_emit(wd->base, "elm,state,item,add,rightpad", "elm");
322              edje_object_part_swallow(wd->base, "elm.swallow.btn2", it->fn_btn2);
323           }
324         else
325           edje_object_signal_emit(wd->base, "elm,state,item,reset,rightpad", "elm");
326         if (it->fn_btn3) 
327           {
328              edje_object_signal_emit(wd->base, "elm,state,item,add,rightpad2", "elm");
329              edje_object_signal_emit(wd->base, "elm,state,item,fn_btn3_set", "elm");
330              edje_object_part_swallow(wd->base, "elm.swallow.btn3", it->fn_btn3);
331           }
332         else
333           edje_object_signal_emit(wd->base, "elm,state,item,reset,rightpad2", "elm");  
334         if ((it->title_obj) && (it->title))
335           {
336              edje_object_signal_emit(wd->base, "elm,state,extend,title", "elm");
337           }  
338         content = it->content;
339      }
340    edje_object_message_signal_process(wd->base);
341 }
342
343 static void 
344 _back_button_clicked(void *data, Evas_Object *obj, void *event_info)
345 {
346    Item *it = data;
347    
348    elm_navigationbar_pop(it->obj);
349 }
350
351 static void 
352 _hide_finished(void *data, Evas_Object *obj, void *event_info)
353 {
354    Evas_Object *navi_bar = data; 
355    Widget_Data *wd =  elm_widget_data_get(navi_bar);
356    wd->popping = EINA_FALSE;
357    evas_object_smart_callback_call(navi_bar, "hide,finished", event_info);
358    edje_object_signal_emit(wd->base, "elm,state,rect,disabled", "elm");
359 }
360
361 static int
362 _set_button_width(Evas_Object *obj)
363 {
364    Evas_Coord minw = -1, minh = -1, maxw= -1, maxh = -1;
365    Evas_Coord w = 0, h = 0;
366
367    evas_object_size_hint_min_get(obj, &minw, &minh);
368    evas_object_size_hint_max_get(obj, &maxw, &maxh);
369    evas_object_geometry_get(obj, NULL, NULL, &w, &h);
370    if (w < minw) w = minw;
371    if (h < minh) h = minh;
372    if ((maxw >= 0) && (w > maxw)) w = maxw;
373    if ((maxh >= 0) && (h > maxh)) h = maxh;
374    evas_object_resize(obj, w, h);
375    return w;
376 }
377
378 static Eina_Bool 
379 _button_set(Evas_Object *obj, Evas_Object *prev_btn, Evas_Object *new_btn, Eina_Bool back_btn)
380 {
381    char buf[4096];
382    Eina_Bool changed = EINA_FALSE;
383    
384    if (prev_btn) 
385      {
386         evas_object_del(prev_btn);
387         prev_btn = NULL;
388      }
389    if (new_btn) 
390      {
391         if (back_btn) 
392           {
393              snprintf(buf, sizeof(buf), "navigationbar_backbutton/%s", elm_widget_style_get(obj));
394              elm_object_style_set(new_btn, buf);
395           }
396         else 
397           {           
398              snprintf(buf, sizeof(buf), "navigationbar_functionbutton/%s", elm_widget_style_get(obj));
399              elm_object_style_set(new_btn, buf);             
400           }
401         elm_widget_sub_object_add(obj, new_btn);
402         changed = EINA_TRUE;
403      }
404    return changed;
405 }
406
407 static Item *
408 _check_item_is_added(Evas_Object *obj, Evas_Object *content)
409 {
410    Widget_Data *wd = elm_widget_data_get(obj);
411    Eina_List *ll;
412    Item *it;
413    
414    EINA_LIST_FOREACH(wd->stack, ll, it)
415      {
416         if (it->content == content) 
417           {
418              return it;
419           }
420      }
421    return NULL;
422 }
423
424 static Evas_Object *
425 _multiple_object_set(Evas_Object *obj, Evas_Object *sub_obj, Eina_List *list, int width)
426 {
427    Widget_Data *wd = elm_widget_data_get(obj);
428    Eina_List *ll;
429    Evas_Object *new_obj, *list_obj;
430    Evas_Coord pad, height;
431    char buf[32];
432    int num = 1;
433    int count;
434    
435    edje_object_part_geometry_get(wd->base, "elm.rect.pad1", NULL, NULL, &pad, NULL);
436    edje_object_part_geometry_get(wd->base, "elm.swallow.title", NULL, NULL, NULL, &height);
437    if (!sub_obj)
438      {
439         new_obj = elm_layout_add(obj);
440         elm_widget_sub_object_add(obj, new_obj);
441         elm_layout_theme_set(new_obj, "navigationbar", "title", elm_widget_style_get(obj));
442      }
443    else 
444      new_obj = sub_obj;
445    count = eina_list_count(list);
446    EINA_LIST_FOREACH(list, ll, list_obj)
447      {  
448         evas_object_resize(list_obj, (width-(count-1)*pad)/count, height);
449         evas_object_size_hint_min_set(list_obj, (width-(count-1)*pad)/count, height);    
450         memset(buf, 0, sizeof(buf));
451         sprintf(buf, "elm,state,item,add,%d", num);
452         edje_object_signal_emit(elm_layout_edje_get(new_obj), buf, "elm");
453         memset(buf, 0, sizeof(buf));
454         sprintf(buf, "elm.swallow.title%d", num++);
455         elm_layout_content_set(new_obj, buf, list_obj);
456      }
457    return new_obj;
458 }
459
460 static void
461 _multiple_object_unset(Item *it, Eina_List **list)
462 {
463    Evas_Object *list_obj = NULL;
464    Eina_List *l = NULL;
465    Evas_Object *temp_obj;
466    char buf[1024];
467    int num = 1;
468    if (it->title_obj)
469      {
470         EINA_LIST_FOREACH (it->title_list, l, list_obj)
471           {
472              memset(buf, 0, sizeof(buf));
473              sprintf(buf, "elm.swallow.title%d", num++);
474              temp_obj = elm_layout_content_unset(it->title_obj, buf);
475              *list = eina_list_append(*list, temp_obj);
476              evas_object_hide(temp_obj);
477           }
478         eina_list_free(it->title_list);
479         it->title_list = NULL;
480      }
481 }
482
483
484 /**
485  * Add a new navigationbar to the parent
486  *
487  * @param[in] parent The parent object
488  * @return The new object or NULL if it cannot be created
489  *
490  * @ingroup NavigationBar
491  */
492 EAPI Evas_Object *
493 elm_navigationbar_add(Evas_Object *parent)
494 {
495    Evas_Object *obj;
496    Evas *e;
497    Widget_Data *wd;
498
499    wd = ELM_NEW(Widget_Data);
500    e = evas_object_evas_get(parent);
501    obj = elm_widget_add(e);
502    ELM_SET_WIDTYPE(widtype, "navigationbar");
503    elm_widget_type_set(obj, "navigationbar");
504    elm_widget_sub_object_add(parent, obj);
505    elm_widget_data_set(obj, wd);
506    elm_widget_del_hook_set(obj, _del_hook);
507    elm_widget_theme_hook_set(obj, _theme_hook);
508
509    wd->base = edje_object_add(e);
510    _elm_theme_object_set(obj, wd->base, "navigationbar", "base", "default");
511    elm_widget_resize_object_set(obj, wd->base);
512
513    wd->pager = elm_pager_add(obj);
514    elm_object_style_set(wd->pager, "navigationbar");
515    elm_widget_sub_object_add(obj, wd->pager);
516    edje_object_part_swallow(wd->base, "elm.swallow.content", wd->pager);
517    evas_object_smart_callback_add(wd->pager, "hide,finished", _hide_finished, obj); 
518    evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, NULL);  
519
520    _sizing_eval(obj);
521    return obj;
522 }
523
524 /**
525  * Push an object to the top of the NavigationBar stack (and show it)
526  * The object pushed becomes a child of the navigationbar and will be controlled
527  * it is deleted when the navigationbar is deleted or when the content is popped.
528  *
529  * @param[in] obj The NavigationBar object
530  * @param[in] title The title string
531  * @param[in] fn_btn1 The left button
532  * @param[in] fn_btn2 The right button
533  * @param[in] fn_btn3 The button placed before right most button.
534  * @param[in] content The object to push
535  *
536  * @ingroup NavigationBar
537  */
538 EAPI void 
539 elm_navigationbar_push(Evas_Object *obj, const char *title, Evas_Object *fn_btn1, Evas_Object *fn_btn2, Evas_Object *fn_btn3, Evas_Object *content)
540 {
541    ELM_CHECK_WIDTYPE(obj, widtype);
542    Widget_Data *wd = elm_widget_data_get(obj);
543    Eina_List *ll;
544    Item *it;
545    Item *prev_it = NULL;
546
547    if (!wd) return;
548    it = _check_item_is_added(obj, content);
549    if (it) return;
550    if (!it) it = ELM_NEW(Item); 
551    if (!it) return;
552    
553    // add and set new items      
554    _button_set(obj, NULL, fn_btn1, EINA_FALSE);
555    _button_set(obj, NULL, fn_btn2, EINA_FALSE);
556    _button_set(obj, NULL, fn_btn3, EINA_FALSE);
557    
558    ll = eina_list_last(wd->stack);
559    if (ll)
560      {
561         prev_it = ll->data;
562      }
563    it->obj = obj;
564    it->fn_btn1 = fn_btn1;
565    it->fn_btn2 = fn_btn2;
566    it->fn_btn3 = fn_btn3;
567    it->content = content;
568
569    if (!fn_btn1 && prev_it)
570    {
571       char *prev_title = NULL;
572
573       it->back_btn = elm_button_add(obj);
574       prev_title = (char *)prev_it->title;
575       if (prev_title)
576          {
577             elm_button_label_set(it->back_btn, prev_title); 
578          }
579       else
580          {
581             elm_button_label_set(it->back_btn, "Previous");
582          }
583       evas_object_smart_callback_add(it->back_btn, "clicked", _back_button_clicked, it); 
584       _button_set(obj, NULL, it->back_btn, EINA_TRUE);
585       elm_object_focus_allow_set(it->back_btn, EINA_FALSE);
586    }
587    
588    eina_stringshare_replace(&it->title, title);
589    edje_object_part_text_set(wd->base, "elm.text", title);
590    _item_sizing_eval(it);
591
592    Transit_Cb_Data *cb = ELM_NEW(Transit_Cb_Data);    
593    // unswallow items and start transition
594    if (prev_it)
595      {
596         cb->prev_it = prev_it;
597         cb->it = it;
598         cb->pop = EINA_FALSE;
599         cb->first_page = EINA_FALSE;
600         if (prev_it->title_obj) edje_object_part_unswallow(wd->base, prev_it->title_obj);
601         if (prev_it->fn_btn1) edje_object_part_unswallow(wd->base, prev_it->fn_btn1);
602         else if (prev_it->back_btn) edje_object_part_unswallow(wd->base, prev_it->back_btn);
603         if (prev_it->fn_btn2) edje_object_part_unswallow(wd->base, prev_it->fn_btn2);
604         if (prev_it->fn_btn3) edje_object_part_unswallow(wd->base, prev_it->fn_btn3);
605      }
606    else  
607      {
608         cb->prev_it = NULL;
609         cb->it = it;
610         cb->pop = EINA_FALSE;   
611         cb->first_page = EINA_TRUE;
612      }  
613    _transition_complete_cb(cb);
614    free(cb);
615    elm_pager_content_push(wd->pager, it->content); 
616    //push item into the stack. it should be always the tail
617    if (!_check_item_is_added(obj, content))
618      wd->stack = eina_list_append(wd->stack, it); 
619    else
620      {
621         EINA_LIST_FOREACH(wd->stack, ll, it)
622           {
623              if (it->content == content) 
624                {
625                   wd->stack = eina_list_demote_list(wd->stack, ll);
626                   break;
627                }
628           }
629      }
630    _sizing_eval(obj);
631 }
632
633 /**
634  * This pops the object that is on top (visible) in the navigationbar, makes it disappear, then deletes the object. 
635  * The object that was underneath it, on the stack will become visible.
636  *
637  * @param[in] obj The NavigationBar object
638  *
639  * @ingroup NavigationBar
640  */
641 EAPI void 
642 elm_navigationbar_pop(Evas_Object *obj)
643 {
644    ELM_CHECK_WIDTYPE(obj, widtype);
645    Widget_Data *wd = elm_widget_data_get(obj);
646    Eina_List *ll;
647    Item *it = NULL;
648    Item *prev_it = NULL;
649    
650    if(wd->popping) return;
651    if (!wd->stack) return;
652
653    //find item to be popped and to be shown
654    ll = eina_list_last(wd->stack);
655    if (ll)
656      {
657         prev_it = ll->data;
658         ll = ll->prev;
659         if (ll)
660           {
661              it = ll->data;
662           }
663      }
664    //unswallow items and start trasition
665    Transit_Cb_Data *cb = ELM_NEW(Transit_Cb_Data);
666    if (prev_it && it) 
667      {
668         cb->prev_it = prev_it;
669         cb->it = it;
670         cb->pop = EINA_TRUE; 
671         if (prev_it->title_obj) edje_object_part_unswallow(wd->base, prev_it->title_obj);
672         if (prev_it->fn_btn1) edje_object_part_unswallow(wd->base, prev_it->fn_btn1);
673         else if (prev_it->back_btn) edje_object_part_unswallow(wd->base, prev_it->back_btn);
674         if (prev_it->fn_btn2) edje_object_part_unswallow(wd->base, prev_it->fn_btn2);
675         if (prev_it->fn_btn3) edje_object_part_unswallow(wd->base, prev_it->fn_btn3);
676         _item_sizing_eval(it);
677      }
678    else if (prev_it)
679      {
680         cb->prev_it = prev_it;
681         cb->it = NULL;
682         cb->pop = EINA_TRUE;
683         cb->first_page = EINA_FALSE;
684      }
685    _transition_complete_cb(cb);
686    wd->popping = EINA_TRUE;
687    //pop content from pager
688    elm_pager_content_pop(wd->pager);
689    if (prev_it && !it)
690       {
691          edje_object_part_text_set(wd->base, "elm.text", NULL);
692       }
693    free(cb);
694 }
695    
696 /**
697  * This Pops to the given content object (and update it) by deleting rest of the objects in between.
698  *
699  * @param[in] obj The NavigationBar object
700  * @param[in] content the object to show
701  *
702  * @ingroup NavigationBar
703  */
704 EAPI void 
705 elm_navigationbar_to_content_pop(Evas_Object *obj, Evas_Object *content)
706 {
707    ELM_CHECK_WIDTYPE(obj, widtype);
708    if (!content) return;
709    Widget_Data *wd = elm_widget_data_get(obj);
710    Eina_List *ll;
711    Item *it = NULL;
712    Item *prev_it = NULL;
713
714    if (!wd->stack) return;
715    //find item to be popped and to be shown
716    ll = eina_list_last(wd->stack);
717    if (ll)
718      {
719         prev_it = ll->data;
720         ll =  ll->prev;   
721         while (ll) 
722           {
723              it = ll->data;    
724              if (it->obj && (it->content != content)) 
725                { 
726                   _delete_item(ll->data);
727                   wd->stack = eina_list_remove_list(wd->stack, ll);
728                   it = NULL;
729                }
730              else
731                break;
732              ll =  ll->prev;   
733           }
734      }
735    if (prev_it && it) 
736      {
737         //unswallow items and start trasition
738         Transit_Cb_Data *cb = ELM_NEW(Transit_Cb_Data);
739         cb->prev_it = prev_it;
740         cb->it = it;
741         cb->pop = EINA_TRUE;
742         cb->first_page = EINA_FALSE;
743         if (prev_it->title_obj) edje_object_part_unswallow(wd->base, prev_it->title_obj);
744         if (prev_it->fn_btn1) edje_object_part_unswallow(wd->base, prev_it->fn_btn1);
745         else if (prev_it->back_btn) edje_object_part_unswallow(wd->base, prev_it->back_btn);
746         if (prev_it->fn_btn2) edje_object_part_unswallow(wd->base, prev_it->fn_btn2);
747         if (prev_it->fn_btn3) edje_object_part_unswallow(wd->base, prev_it->fn_btn3);
748         _item_sizing_eval(it);
749         _transition_complete_cb(cb);
750         //pop content from pager
751         elm_pager_to_content_pop(wd->pager, content);
752      }
753 }
754
755 /**
756  * Set the title string for the pushed content
757  *
758  * @param[in] obj The NavigationBar object
759  * @param[in] content The object to push or pushed
760  * @param[in] title The title string
761  *
762  * @ingroup NavigationBar
763  */
764 EAPI void
765 elm_navigationbar_title_label_set(Evas_Object *obj, Evas_Object *content, const char *title)
766 {
767    ELM_CHECK_WIDTYPE(obj, widtype);
768    Widget_Data *wd = elm_widget_data_get(obj);
769    Eina_List *ll;
770    Item *it;
771
772    if (!wd) return;
773    EINA_LIST_FOREACH(wd->stack, ll, it)
774      {
775         if (it->content == content) 
776           {
777              eina_stringshare_replace(&it->title, title);
778              edje_object_part_text_set(wd->base, "elm.text", title);
779              if (!wd->hidden)
780                {
781                   if ((it->title_obj) && (it->title))
782                     { 
783                        edje_object_signal_emit(wd->base, "elm,state,extend,title", "elm");
784                     }
785                   else
786                     edje_object_signal_emit(wd->base, "elm,state,retract,title", "elm");
787                }
788              _item_sizing_eval(it);
789              break;
790           }
791      }
792 }
793
794 /**
795  * Return the title string of the pushed content
796  *
797  * @param[in] obj The NavigationBar object
798  * @param[in] content The object to push or pushed
799  * @return The title string or NULL if none
800  *
801  * @ingroup NavigationBar
802  */
803 EAPI const char *
804 elm_navigationbar_title_label_get(Evas_Object *obj, Evas_Object *content)
805 {
806    ELM_CHECK_WIDTYPE(obj, widtype)NULL;
807    Widget_Data *wd = elm_widget_data_get(obj);
808    Eina_List *ll;
809    Item *it;
810
811    if (!wd) return NULL;
812    EINA_LIST_FOREACH(wd->stack, ll, it)
813      {
814         if (it->content == content) 
815           return it->title;
816      }
817    return NULL;
818 }
819
820 /**
821  * Add a title object for the content.
822  *
823  * @param[in] obj The NavigationBar object
824  * @param[in] content The object pushed
825  * @param[in] title_obj a title object (normally button or segment_control)
826  *
827  * @ingroup NavigationBar
828  */
829 EAPI void
830 elm_navigationbar_title_object_add(Evas_Object *obj, Evas_Object *content, Evas_Object *title_obj)
831 {
832    ELM_CHECK_WIDTYPE(obj, widtype);
833    Widget_Data *wd = elm_widget_data_get(obj);
834    Eina_List *ll;
835    Item *it;
836    Item *last_it;
837
838    if (!title_obj) return;
839    if (!content) return;
840    if (!wd) return;
841    it = _check_item_is_added(obj, content);
842    if (!it) 
843      {
844         ERR("[ERROR]Push the Item first, later add the title object");
845         return;
846      } 
847    it->title_list = eina_list_append(it->title_list, title_obj);  
848    if (it->obj) _item_sizing_eval(it);  
849    //update if the content is the top item
850    ll = eina_list_last(wd->stack);
851    if (ll) 
852      {
853         last_it = ll->data;
854         if (last_it->content == content) 
855           {
856              Evas_Object *swallow;
857              swallow = edje_object_part_swallow_get(wd->base, "elm.swallow.title");
858              if (swallow) {
859                 edje_object_part_unswallow(wd->base, swallow);
860                 evas_object_hide(swallow);
861              }
862              edje_object_part_swallow(wd->base, "elm.swallow.title", it->title_obj);
863              if (!wd->hidden)
864                {
865                   if (it->fn_btn3)
866                     {
867                        edje_object_signal_emit(wd->base, "elm,state,item,add,rightpad2", "elm");
868                        edje_object_signal_emit(wd->base, "elm,state,item,fn_btn3_set", "elm");
869                     }        
870                   if ((it->title_obj) && (it->title))
871                     { 
872                        edje_object_signal_emit(wd->base, "elm,state,extend,title", "elm");
873                     }
874                }
875              _item_sizing_eval(it);  
876           }
877      }
878 }
879
880 /**
881  * Unset the list of title objects corresponding to given content and returns it to  
882  * the application.
883  * @param[in] obj The NavigationBar object
884  * @param[in] content The content object pushed
885  * @param[out] list updates the list with title objects list, this list has to be freed and the
886  * objects have to be deleted by application.
887  * @ingroup NavigationBar
888  */
889 EAPI void
890 elm_navigationbar_title_object_list_unset(Evas_Object *obj, Evas_Object *content, Eina_List **list)
891 {
892    ELM_CHECK_WIDTYPE(obj, widtype);
893    Widget_Data *wd = elm_widget_data_get(obj);
894    if (!wd) return;
895    Eina_List *ll;
896    Item *it;
897    Item *last_it = NULL;
898    ll = eina_list_last(wd->stack);
899
900    if (ll) 
901      {
902         last_it = ll->data;
903      }
904    EINA_LIST_FOREACH(wd->stack, ll, it)
905      {
906         if (it->content == content)   
907           {
908              if (last_it->content == it->content) 
909                {
910                   Evas_Object *swallow;
911                   swallow = edje_object_part_swallow_get(wd->base, "elm.swallow.title");
912                   if (swallow) 
913                     {
914                        edje_object_part_unswallow(wd->base, swallow);
915                        evas_object_hide(swallow);
916                     }
917                } 
918              _multiple_object_unset(it, list);   
919              evas_object_del(it->title_obj);
920              it->title_obj = NULL;      
921              if (!wd->hidden)
922                {
923                   edje_object_signal_emit(wd->base, "elm,state,retract,title", "elm");
924                   if(it->fn_btn3)
925                      {
926                         edje_object_signal_emit(wd->base, "elm,state,item,add,rightpad2", "elm");
927                         edje_object_signal_emit(wd->base, "elm,state,item,fn_btn3_set", "elm");
928                      }
929                }
930              _item_sizing_eval(it);
931          }
932      }
933 }
934
935
936 /**
937  * Return the list of title objects of the pushed content.
938  *
939  * @param[in] obj The NavigationBar object
940  * @param[in] content The object to push or pushed
941  * @return The list of title objects
942  *
943  * @ingroup NavigationBar
944  */
945 EAPI Eina_List *
946 elm_navigationbar_title_object_list_get(Evas_Object *obj, Evas_Object *content)
947 {
948    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
949    Widget_Data *wd = elm_widget_data_get(obj);
950    Eina_List *ll;
951    Item *it;
952
953    if (!wd) return NULL;
954    EINA_LIST_FOREACH(wd->stack, ll, it)
955      {
956         if (it->content == content)   
957           return it->title_list;
958      }  
959    return NULL;
960 }
961
962 static void
963 _elm_navigationbar_back_button_set(Evas_Object *obj, Evas_Object *content, Evas_Object *button)
964 {
965    Widget_Data *wd = elm_widget_data_get(obj);
966    Eina_List *ll;
967    Item *it;
968    Eina_Bool changed;
969
970    if (!wd) return;
971    EINA_LIST_FOREACH(wd->stack, ll, it)
972      {
973         if (it->content == content) 
974           {
975              if(it->back_btn == button)
976                return;
977              changed = _button_set(obj, it->back_btn, button, EINA_TRUE);
978              it->back_btn = button;
979              _item_sizing_eval(it);
980              break;
981           }
982      }
983    
984    //update if the content is the top item
985    ll = eina_list_last(wd->stack);
986    if (ll) 
987      {
988         it = ll->data;
989         if (it->back_btn && changed && (it->content == content) && (!it->fn_btn1)) 
990           {
991              edje_object_part_swallow(wd->base, "elm.swallow.btn1", it->back_btn);   
992              evas_object_smart_callback_add(it->back_btn, "clicked", _back_button_clicked, it); 
993           }
994      }
995 }
996
997 static Evas_Object *
998 _elm_navigationbar_back_button_get(Evas_Object *obj, Evas_Object *content)
999 {
1000    Widget_Data *wd = elm_widget_data_get(obj);
1001    Eina_List *ll;
1002    Item *it;
1003    
1004    if (!wd) return NULL;
1005    EINA_LIST_FOREACH(wd->stack, ll, it)
1006      {
1007         if (it->content == content)
1008           return it->back_btn;
1009      }  
1010    return NULL;
1011 }
1012
1013 static void 
1014 _elm_navigationbar_function_button1_set(Evas_Object *obj, Evas_Object *content, Evas_Object *button)
1015 {
1016    Widget_Data *wd = elm_widget_data_get(obj);
1017    Eina_List *ll;
1018    Item *it;
1019    Eina_Bool changed;
1020
1021    if (!wd) return;
1022    EINA_LIST_FOREACH(wd->stack, ll, it)
1023      {
1024         if (it->content == content) 
1025           {
1026              if(it->fn_btn1 == button)
1027                return;
1028              changed = _button_set(obj, it->fn_btn1, button, EINA_FALSE);
1029              it->fn_btn1 = button;
1030              _item_sizing_eval(it);
1031              break;
1032           }
1033      }
1034
1035    //update if the content is the top item
1036    ll = eina_list_last(wd->stack);
1037    if (ll)
1038      {
1039         it = ll->data;
1040         if (it->fn_btn1 && changed && (it->content == content)) 
1041           {
1042              if (edje_object_part_swallow_get(wd->base, "elm.swallow.btn1") == it->back_btn)
1043                {
1044                   edje_object_part_unswallow(wd->base, it->back_btn);
1045                   evas_object_hide(it->back_btn);
1046                }
1047              edje_object_part_swallow(wd->base, "elm.swallow.btn1", it->fn_btn1);
1048           }
1049      }
1050 }
1051
1052 static Evas_Object *
1053 _elm_navigationbar_function_button1_get(Evas_Object *obj, Evas_Object *content)
1054 {
1055    Widget_Data *wd = elm_widget_data_get(obj);
1056    Eina_List *ll;
1057    Item *it;
1058    
1059    if (!wd) return NULL;
1060    EINA_LIST_FOREACH(wd->stack, ll, it)
1061      {
1062         if (it->content == content) 
1063           return it->fn_btn1;
1064      }  
1065    return NULL;
1066 }
1067
1068 static void 
1069 _elm_navigationbar_function_button2_set(Evas_Object *obj, Evas_Object *content, Evas_Object *button)
1070 {
1071    Widget_Data *wd = elm_widget_data_get(obj);
1072    Eina_List *ll;
1073    Item *it;
1074    Eina_Bool changed;
1075
1076    if (!wd) return;
1077    EINA_LIST_FOREACH(wd->stack, ll, it)
1078      {
1079         if (it->content == content) 
1080           {
1081              if(it->fn_btn2 == button)
1082                return;
1083              changed = _button_set(obj, it->fn_btn2, button, EINA_FALSE);
1084              it->fn_btn2 = button;
1085              _item_sizing_eval(it);
1086              break;
1087           }
1088      } 
1089     
1090    //update if the content is the top item
1091    ll = eina_list_last(wd->stack);
1092    if (ll) 
1093       {
1094          it = ll->data;
1095          if (it->fn_btn2 && changed && (it->content == content)) 
1096             {
1097                edje_object_part_swallow(wd->base, "elm.swallow.btn2", it->fn_btn2);
1098             }
1099       }
1100 }
1101
1102 static Evas_Object *
1103 _elm_navigationbar_function_button2_get(Evas_Object *obj, 
1104                               Evas_Object *content)
1105 {
1106    Widget_Data *wd = elm_widget_data_get(obj);
1107    Eina_List *ll;
1108    Item *it;
1109
1110    if (!wd) return NULL;
1111    EINA_LIST_FOREACH(wd->stack, ll, it)
1112      {
1113         if (it->content == content) 
1114           return it->fn_btn2;
1115      }
1116    return NULL;
1117 }
1118
1119 static void 
1120 _elm_navigationbar_function_button3_set(Evas_Object *obj, Evas_Object *content, Evas_Object *button)
1121 {
1122    Widget_Data *wd = elm_widget_data_get(obj);
1123    Eina_List *ll;
1124    Item *it;
1125    Eina_Bool changed;
1126
1127    if (!wd) return;
1128    EINA_LIST_FOREACH(wd->stack, ll, it)
1129      {
1130         if (it->content == content) 
1131           {
1132              if(it->fn_btn3 == button)
1133                return;
1134              changed = _button_set(obj, it->fn_btn3, button, EINA_FALSE);
1135              it->fn_btn3 = button;
1136              _item_sizing_eval(it);
1137              break;
1138           }
1139      } 
1140
1141    //update if the content is the top item
1142    ll = eina_list_last(wd->stack);
1143    if (ll) 
1144      {
1145         it = ll->data;
1146         if (it->fn_btn3 && changed && (it->content == content)) 
1147           {
1148              edje_object_signal_emit(wd->base, "elm,state,item,add,rightpad2", "elm");
1149              edje_object_signal_emit(wd->base, "elm,state,item,fn_btn3_set", "elm");
1150              edje_object_part_swallow(wd->base, "elm.swallow.btn3", it->fn_btn3);
1151           }
1152         else
1153           edje_object_signal_emit(wd->base, "elm,state,retract,title", "elm");
1154      }
1155 }
1156
1157 static Evas_Object *
1158 _elm_navigationbar_function_button3_get(Evas_Object *obj, 
1159                               Evas_Object *content)
1160 {
1161    Widget_Data *wd = elm_widget_data_get(obj);
1162    Eina_List *ll;
1163    Item *it;
1164
1165    if (!wd) return NULL;
1166    EINA_LIST_FOREACH(wd->stack, ll, it)
1167      {
1168         if (it->content == content) 
1169           return it->fn_btn3;
1170      }
1171    return NULL;
1172 }
1173
1174 /**
1175  * Return the content object at the top of the NavigationBar stack
1176  *
1177  * @param[in] obj The NavigationBar object
1178  * @return The top content object or NULL if none
1179  *
1180  * @ingroup NavigationBar
1181  */
1182 EAPI Evas_Object *
1183 elm_navigationbar_content_top_get(Evas_Object *obj)
1184 {
1185    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1186    Widget_Data *wd = elm_widget_data_get(obj);
1187    
1188    if (!wd) return NULL;
1189    return elm_pager_content_top_get(wd->pager);
1190 }
1191
1192 /**
1193  * Return the content object at the bottom of the NavigationBar stack
1194  *
1195  * @param[in] obj The NavigationBar object
1196  * @return The bottom content object or NULL if none
1197  *
1198  * @ingroup NavigationBar
1199  */
1200 EAPI Evas_Object *
1201 elm_navigationbar_content_bottom_get(Evas_Object *obj)
1202 {
1203    ELM_CHECK_WIDTYPE(obj, widtype)NULL;
1204    Widget_Data *wd = elm_widget_data_get(obj);
1205    
1206    if (!wd) return NULL;
1207    return elm_pager_content_bottom_get(wd->pager);
1208 }
1209
1210 /**
1211  * This hides the title area of navigationbar.
1212  *
1213  * @param[in] obj The NavigationBar object
1214  * @param[in] hidden if EINA_TRUE the title area is hidden.
1215  *
1216  * @ingroup NavigationBar
1217  */
1218 EAPI void
1219 elm_navigationbar_hidden_set(Evas_Object *obj, 
1220                         Eina_Bool hidden)
1221 {
1222    ELM_CHECK_WIDTYPE(obj, widtype);
1223    Widget_Data *wd = elm_widget_data_get(obj);
1224    
1225    if (!wd) return;
1226    if (hidden) 
1227      edje_object_signal_emit(wd->base, "elm,state,item,moveup", "elm");
1228    else 
1229      edje_object_signal_emit(wd->base, "elm,state,item,movedown", "elm");
1230    wd->hidden = hidden;
1231 }
1232
1233 /**
1234  * Set the button object of the pushed content.
1235  *
1236  * @param[in] obj The NavigationBar object
1237  * @param[in] content The object to push or pushed
1238  * @param[in] button The button
1239  * @param[in] button_type Indicates the position
1240  *
1241  * @ingroup NavigationBar
1242  */
1243 EAPI void 
1244 elm_navigationbar_title_button_set(Evas_Object *obj, Evas_Object *content, Evas_Object *button, Elm_Navi_Button_Type button_type)
1245 {
1246    ELM_CHECK_WIDTYPE(obj, widtype);
1247    if (!content) return;
1248    
1249    switch(button_type)
1250      {
1251       case ELM_NAVIGATIONBAR_FUNCTION_BUTTON1:
1252         _elm_navigationbar_function_button1_set(obj, content, button);
1253         break;
1254       case ELM_NAVIGATIONBAR_FUNCTION_BUTTON2:
1255         _elm_navigationbar_function_button2_set(obj, content, button);
1256         break;
1257       case ELM_NAVIGATIONBAR_FUNCTION_BUTTON3:
1258         _elm_navigationbar_function_button3_set(obj, content, button);
1259         break;
1260       case ELM_NAVIGATIONBAR_BACK_BUTTON:
1261         _elm_navigationbar_back_button_set(obj, content, button);
1262         break;
1263       default: 
1264         break;
1265      }        
1266    _sizing_eval(obj);
1267 }
1268
1269 /**
1270  * Return the button object of the pushed content
1271  *
1272  * @param[in] obj The NavigationBar object
1273  * @param[in] content The object to push or pushed
1274  * @param[in] button_type Indicates the position
1275  * @return The button object or NULL if none
1276  *
1277  * @ingroup NavigationBar
1278  */
1279 EAPI Evas_Object *
1280 elm_navigationbar_title_button_get(Evas_Object *obj, Evas_Object *content, Elm_Navi_Button_Type button_type)
1281 {
1282    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1283    Evas_Object *button=NULL;
1284    
1285    if (!content || !obj) return NULL;   
1286    switch(button_type)
1287      {
1288       case ELM_NAVIGATIONBAR_FUNCTION_BUTTON1:
1289         button  = _elm_navigationbar_function_button1_get(obj, content);
1290         break;
1291       case ELM_NAVIGATIONBAR_FUNCTION_BUTTON2:
1292         button = _elm_navigationbar_function_button2_get(obj, content);
1293         break;
1294       case ELM_NAVIGATIONBAR_FUNCTION_BUTTON3:
1295         button  = _elm_navigationbar_function_button3_get(obj, content);
1296         break;
1297       case ELM_NAVIGATIONBAR_BACK_BUTTON:
1298         button = _elm_navigationbar_back_button_get(obj, content);
1299         break;
1300       default: 
1301         break;
1302      }  
1303    return button;
1304 }
1305
1306 /**
1307  * Set the sub title string for the pushed content.
1308  *
1309  * @param[in] obj The NavigationBar object
1310  * @param[in] content The object to push or pushed
1311  * @param[in] subtitle The subtitle string
1312  *
1313  * @ingroup NavigationBar
1314  */
1315 EAPI void 
1316 elm_navigationbar_subtitle_label_set(Evas_Object *obj, Evas_Object *content, const char *subtitle)
1317 {
1318    ELM_CHECK_WIDTYPE(obj, widtype);
1319    Widget_Data *wd = elm_widget_data_get(obj);
1320    Eina_List *ll;
1321    Item *it;
1322
1323    if (!wd) return;
1324    EINA_LIST_FOREACH(wd->stack, ll, it)
1325      {
1326         if (it->content == content) 
1327           {
1328              eina_stringshare_replace(&it->subtitle, subtitle);
1329              edje_object_part_text_set(wd->base, "elm.text.sub", subtitle);
1330              _item_sizing_eval(it);
1331              break;
1332           }
1333      }
1334 }
1335
1336 /**
1337  * Return the subtitle string of the pushed content.
1338  *
1339  * @param[in] obj The NavigationBar object
1340  * @param[in] content The object to push or pushed
1341  * @return The subtitle string or NULL if none
1342  *
1343  * @ingroup NavigationBar
1344  */
1345 EAPI const char *
1346 elm_navigationbar_subtitle_label_get(Evas_Object *obj, Evas_Object *content)
1347 {
1348    ELM_CHECK_WIDTYPE(obj, widtype)NULL;
1349    Widget_Data *wd = elm_widget_data_get(obj);
1350    Eina_List *ll;
1351    Item *it;
1352
1353    if (!wd) return NULL;
1354    EINA_LIST_FOREACH(wd->stack, ll, it)
1355      {
1356         if (it->content == content) 
1357           return it->subtitle;
1358      }
1359    return NULL;
1360 }
1361
1362 /**
1363  * deprecate this This disables content area animation on push/pop.
1364  *
1365  * @param[in] obj The NavigationBar object
1366  * @param[in] disable  if EINA_TRUE animation is disabled.
1367  *
1368  * @ingroup NavigationBar
1369  */
1370 EAPI void 
1371 elm_navigationbar_animation_disable_set(Evas_Object *obj, Eina_Bool disable)
1372 {
1373    ELM_CHECK_WIDTYPE(obj, widtype);
1374    Widget_Data *wd = elm_widget_data_get(obj);
1375    
1376    elm_pager_animation_disabled_set(wd->pager, disable);
1377 }
1378
1379 /**
1380  * This disables content area animation on push/pop.
1381  *
1382  * @param[in] obj The NavigationBar object
1383  * @param[in] disable  if EINA_TRUE animation is disabled.
1384  *
1385  * @ingroup NavigationBar
1386  */
1387 EAPI void 
1388 elm_navigationbar_animation_disabled_set(Evas_Object *obj, Eina_Bool disable)
1389 {
1390    ELM_CHECK_WIDTYPE(obj, widtype);
1391    Widget_Data *wd = elm_widget_data_get(obj);
1392    
1393    elm_pager_animation_disabled_set(wd->pager, disable);
1394 }
1395