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