[elm_navigationbar]: check added if the button being added is same then dont delete it.
[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 Eina_Bool _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 Eina_Bool 
369 _button_set(Evas_Object *obj, Evas_Object *prev_btn, Evas_Object *new_btn, Eina_Bool back_btn)
370 {
371         char buf[4096];
372         Eina_Bool changed = EINA_FALSE;
373         if(prev_btn == new_btn)
374                 return changed;
375         
376         if (prev_btn) 
377         {
378                 evas_object_del(prev_btn);
379                 prev_btn = NULL;
380         }
381         if (new_btn) 
382         {
383                 if (back_btn) 
384                         {
385                                 snprintf(buf, sizeof(buf), "navigationbar_backbutton/%s", elm_widget_style_get(obj));
386                                 elm_object_style_set(new_btn, buf);
387                         }
388                 else 
389                         {                               
390                                 snprintf(buf, sizeof(buf), "navigationbar_functionbutton/%s", elm_widget_style_get(obj));
391                                 elm_object_style_set(new_btn, buf);                                     
392                         }
393                 elm_widget_sub_object_add(obj, new_btn);
394                 elm_object_focus_allow_set(new_btn, EINA_FALSE);
395                 changed = EINA_TRUE;
396         }
397         return changed;
398 }
399
400 static Item *
401 _check_item_is_added(Evas_Object *obj, Evas_Object *content)
402 {
403         Widget_Data *wd = elm_widget_data_get(obj);
404         Eina_List *ll;
405         Item *it;
406         EINA_LIST_FOREACH(wd->stack, ll, it)
407         {
408                 if (it->content == content) 
409                 {
410                         return it;
411                 }
412         }
413         return NULL;
414 }
415
416 static Evas_Object * 
417 _multiple_object_set(Evas_Object *obj, Evas_Object *sub_obj, Eina_List *list, int width)
418 {
419         Widget_Data *wd = elm_widget_data_get(obj);
420         Eina_List *ll;
421         Evas_Object *new_obj, *list_obj;
422         Evas_Coord pad, height;
423         char buf[32];
424         int num = 1;
425         int count;
426         edje_object_part_geometry_get(wd->base, "elm.rect.pad1", NULL, NULL, &pad, NULL);
427         edje_object_part_geometry_get(wd->base, "elm.swallow.title", NULL, NULL, NULL, &height);
428         if (!sub_obj)
429         {
430                 new_obj = elm_layout_add(obj);
431                 elm_widget_sub_object_add(obj, new_obj);
432                 elm_layout_theme_set(new_obj, "navigationbar", "title", elm_widget_style_get(obj));
433         }
434         else 
435                 new_obj = sub_obj;
436         count = eina_list_count(list);
437         EINA_LIST_FOREACH(list, ll, list_obj)
438         {       
439                 evas_object_resize(list_obj, (width-(count-1)*pad)/count, height);
440                 evas_object_size_hint_min_set(list_obj, (width-(count-1)*pad)/count, height);           
441         
442                 memset(buf, 0, sizeof(buf));
443                 sprintf(buf, "elm,state,item,add,%d", num);
444                 edje_object_signal_emit(elm_layout_edje_get(new_obj), buf, "elm");
445
446                 memset(buf, 0, sizeof(buf));
447                 sprintf(buf, "elm.swallow.title%d", num++);
448                 elm_layout_content_set(new_obj, buf, list_obj);
449         }
450         return new_obj;
451 }
452
453 static void
454 _multiple_object_unset(Item *it, Eina_List **list)
455 {
456         Evas_Object *list_obj = NULL;
457         Eina_List *l = NULL;
458         Evas_Object *temp_obj;
459         char buf[1024];
460         int num = 1;
461         if(it->title_obj)
462                 {
463                         EINA_LIST_FOREACH(it->title_list, l, list_obj)
464                                 {
465                                         memset(buf, 0, sizeof(buf));
466                                         sprintf(buf, "elm.swallow.title%d", num++);
467                                         temp_obj = elm_layout_content_unset(it->title_obj, buf);
468                                         *list = eina_list_append(*list, temp_obj);                                      
469                                         evas_object_hide(temp_obj);
470                                 }
471                         eina_list_free(it->title_list);
472                         it->title_list = NULL;
473                 }
474 }
475
476
477 /**
478  * Add a new navigationbar to the parent
479  *
480  * @param[in] parent The parent object
481  * @return The new object or NULL if it cannot be created
482  *
483  * @ingroup NavigationBar
484  */
485 EAPI Evas_Object *
486 elm_navigationbar_add(Evas_Object *parent)
487 {
488         Evas_Object *obj;
489         Evas *e;
490         Widget_Data *wd;
491
492         wd = ELM_NEW(Widget_Data);
493         e = evas_object_evas_get(parent);
494         obj = elm_widget_add(e);
495         ELM_SET_WIDTYPE(widtype, "navigationbar");
496         elm_widget_type_set(obj, "navigationbar");
497         elm_widget_sub_object_add(parent, obj);
498         elm_widget_data_set(obj, wd);
499         elm_widget_del_hook_set(obj, _del_hook);
500         elm_widget_theme_hook_set(obj, _theme_hook);
501
502         wd->base = edje_object_add(e);
503         _elm_theme_object_set(obj, wd->base, "navigationbar", "base", "default");
504         elm_widget_resize_object_set(obj, wd->base);
505
506         wd->pager = elm_pager_add(obj);
507         elm_object_style_set(wd->pager, "navigationbar");
508         elm_widget_sub_object_add(obj, wd->pager);
509         edje_object_part_swallow(wd->base, "elm.swallow.content", wd->pager);
510         evas_object_smart_callback_add(wd->pager, "hide,finished", _hide_finished, obj);        
511         evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, NULL);       
512
513         _sizing_eval(obj);
514         return obj;
515 }
516
517 /**
518  * Push an object to the top of the NavigationBar stack (and show it)
519  * The object pushed becomes a child of the navigationbar and will be controlled
520  * it is deleted when the navigationbar is deleted or when the content is popped.
521  *
522  * @param[in] obj The NavigationBar object
523  * @param[in] title The title string
524  * @param[in] fn_btn1 The left button
525  * @param[in] fn_btn2 The right button
526  * @param[in] fn_btn3 The button placed before right most button.
527  * @param[in] content The object to push
528  *
529  * @ingroup NavigationBar
530  */
531 EAPI void
532 elm_navigationbar_push(Evas_Object *obj, 
533                                                 const char *title,
534                                                 Evas_Object *fn_btn1, 
535                                                 Evas_Object *fn_btn2, 
536                                                 Evas_Object *fn_btn3, 
537                                                 Evas_Object *content)
538 {
539         ELM_CHECK_WIDTYPE(obj, widtype);
540         Widget_Data *wd = elm_widget_data_get(obj);
541         Eina_List *ll;
542         Item *it;
543         Item *prev_it = NULL;
544
545         if (!wd) return;
546         it = _check_item_is_added(obj, content);
547         if (it) return;
548         if (!it) it = ELM_NEW(Item); 
549         if (!it) return;
550         
551         // add and set new items                
552         _button_set(obj, NULL, fn_btn1, EINA_FALSE);
553         _button_set(obj, NULL, fn_btn2, EINA_FALSE);
554         _button_set(obj, NULL, fn_btn3, EINA_FALSE);
555         
556         ll = eina_list_last(wd->stack);
557         if (ll)
558                 {
559                         prev_it = ll->data;
560                 }
561         it->obj = obj;
562         it->fn_btn1 = fn_btn1;
563         it->fn_btn2 = fn_btn2;
564         it->fn_btn3 = fn_btn3;
565         it->content = content;
566
567         if (!fn_btn1 && prev_it)
568         {
569                 char *prev_title = NULL;
570
571                 it->back_btn = elm_button_add(obj);
572                 prev_title = (char *)prev_it->title;
573                 if(prev_title)
574                         {
575                                 elm_button_label_set(it->back_btn, prev_title); 
576                         }
577                 else
578                         {
579                                 elm_button_label_set(it->back_btn, "Previous");
580                         }
581                 evas_object_smart_callback_add(it->back_btn, "clicked", _back_button_clicked, it); 
582                 _button_set(obj, NULL, it->back_btn, EINA_TRUE);
583         }
584         
585         eina_stringshare_replace(&it->title, title);
586         edje_object_part_text_set(wd->base, "elm.text", title);
587         _item_sizing_eval(it);
588
589         Transit_Cb_Data *cb = ELM_NEW(Transit_Cb_Data);         
590         // unswallow items and start transition
591         if (prev_it)
592         {
593                 cb->prev_it = prev_it;
594                 cb->it = it;
595                 cb->pop = EINA_FALSE;
596                 cb->first_page = EINA_FALSE;
597                 if (prev_it->title_obj) edje_object_part_unswallow(wd->base, prev_it->title_obj);
598                 if (prev_it->fn_btn1) edje_object_part_unswallow(wd->base, prev_it->fn_btn1);
599                 else if (prev_it->back_btn) edje_object_part_unswallow(wd->base, prev_it->back_btn);
600                 if (prev_it->fn_btn2) edje_object_part_unswallow(wd->base, prev_it->fn_btn2);
601                 if (prev_it->fn_btn3) edje_object_part_unswallow(wd->base, prev_it->fn_btn3);
602         }
603         else  
604         {
605                 cb->prev_it = NULL;
606                 cb->it = it;
607                 cb->pop = EINA_FALSE;   
608                 cb->first_page = EINA_TRUE;
609         }       
610         _transition_complete_cb(cb);
611         free(cb);
612         elm_pager_content_push(wd->pager, it->content); 
613         //push item into the stack. it should be always the tail
614         if (!_check_item_is_added(obj, content))
615         wd->stack = eina_list_append(wd->stack, it);    
616         else
617         {
618                 EINA_LIST_FOREACH(wd->stack, ll, it)
619                 {
620                         if (it->content == content) 
621                         {
622                                 wd->stack = eina_list_demote_list(wd->stack, ll);
623                                 break;
624                         }
625                 }
626         }
627         _sizing_eval(obj);
628 }
629
630 /**
631  * This pops the object that is on top (visible) in the navigationbar, makes it disappear, then deletes the object. 
632  * The object that was underneath it, on the stack will become visible.
633  *
634  * @param[in] obj The NavigationBar object
635  *
636  * @ingroup NavigationBar
637  */
638 EAPI void
639 elm_navigationbar_pop(Evas_Object *obj)
640 {
641         ELM_CHECK_WIDTYPE(obj, widtype);
642         Widget_Data *wd = elm_widget_data_get(obj);
643         Eina_List *ll;
644         Item *it = NULL;
645         Item *prev_it = NULL;
646
647         if (!wd->stack) return;
648
649         //find item to be popped and to be shown
650         ll = eina_list_last(wd->stack);
651         if (ll)
652         {
653                 prev_it = ll->data;
654                 ll = ll->prev;
655                 if(ll)
656                         {
657                                 it = ll->data;
658                         }
659         }
660         //unswallow items and start trasition
661         Transit_Cb_Data *cb = ELM_NEW(Transit_Cb_Data);
662         if (prev_it && it) 
663         {
664                 cb->prev_it = prev_it;
665                 cb->it = it;
666                 cb->pop = EINA_TRUE;    
667                 if (prev_it->title_obj) edje_object_part_unswallow(wd->base, prev_it->title_obj);
668                 if (prev_it->fn_btn1) edje_object_part_unswallow(wd->base, prev_it->fn_btn1);
669                 else if (prev_it->back_btn) edje_object_part_unswallow(wd->base, prev_it->back_btn);
670                 if (prev_it->fn_btn2) edje_object_part_unswallow(wd->base, prev_it->fn_btn2);
671                 if (prev_it->fn_btn3) edje_object_part_unswallow(wd->base, prev_it->fn_btn3);
672                 _item_sizing_eval(it);
673                 
674         }
675         else if (prev_it)
676         {
677                 cb->prev_it = prev_it;
678                 cb->it = NULL;
679                 cb->pop = EINA_TRUE;
680                 cb->first_page = EINA_FALSE;
681         }
682         _transition_complete_cb(cb);
683         //pop content from pager
684         elm_pager_content_pop(wd->pager);
685         if(prev_it && !it)
686                 {
687                         //evas_object_del(wd->pager);
688                         edje_object_part_text_set(wd->base, "elm.text", NULL);
689                 }
690         free(cb);
691 }
692         
693 /**
694  * This Pops to the given content object (and update it) by deleting rest of the objects in between.
695  *
696  * @param[in] obj The NavigationBar object
697  * @param[in] content the object to show
698  *
699  * @ingroup NavigationBar
700  */
701 EAPI void
702 elm_navigationbar_to_content_pop(Evas_Object *obj,
703                                                                                 Evas_Object *content)
704 {
705         ELM_CHECK_WIDTYPE(obj, widtype);
706         if(!content) return;
707         Widget_Data *wd = elm_widget_data_get(obj);
708         Eina_List *ll;
709         Item *it = NULL;
710         Item *prev_it = NULL;
711
712         if (!wd->stack) return;
713
714         //find item to be popped and to be shown
715         ll = eina_list_last(wd->stack);
716         if (ll)
717         {
718                 prev_it = ll->data;
719                 ll =  ll->prev; 
720                 while (ll) 
721                 {
722                         it = ll->data;          
723                         if (it->obj && (it->content != content)) 
724                                 { 
725                                         _delete_item(ll->data);
726                                         wd->stack = eina_list_remove_list(wd->stack, ll);
727                                         it = NULL;
728                                 }
729                         else
730                                  break;
731  
732                                 ll =  ll->prev; 
733                         }
734                 }
735
736         if (prev_it && it) 
737         {
738           //unswallow items and start trasition
739                 Transit_Cb_Data *cb = ELM_NEW(Transit_Cb_Data);
740                 cb->prev_it = prev_it;
741                 cb->it = it;
742                 cb->pop = EINA_TRUE;
743                 cb->first_page = EINA_FALSE;
744                 if (prev_it->title_obj) edje_object_part_unswallow(wd->base, prev_it->title_obj);
745                 if (prev_it->fn_btn1) edje_object_part_unswallow(wd->base, prev_it->fn_btn1);
746                 else if (prev_it->back_btn) edje_object_part_unswallow(wd->base, prev_it->back_btn);
747                 if (prev_it->fn_btn2) edje_object_part_unswallow(wd->base, prev_it->fn_btn2);
748                 if (prev_it->fn_btn3) edje_object_part_unswallow(wd->base, prev_it->fn_btn3);
749                 _item_sizing_eval(it);
750                 _transition_complete_cb(cb);
751                 //pop content from pager
752                 elm_pager_to_content_pop(wd->pager, content);
753         }
754 }
755
756 /**
757  * Set the title string for the pushed content
758  *
759  * @param[in] obj The NavigationBar object
760  * @param[in] content The object to push or pushed
761  * @param[in] title The title string
762  *
763  * @ingroup NavigationBar
764  */
765 EAPI void
766 elm_navigationbar_title_label_set(Evas_Object *obj, 
767                                                         Evas_Object *content, 
768                                                         const char *title)
769 {
770         ELM_CHECK_WIDTYPE(obj, widtype);
771         Widget_Data *wd = elm_widget_data_get(obj);
772         Eina_List *ll;
773         Item *it;
774
775         if (!wd) return;
776         
777          EINA_LIST_FOREACH(wd->stack, ll, it)
778         {
779                 if (it->content == content) 
780                 {
781                         eina_stringshare_replace(&it->title, title);
782                         edje_object_part_text_set(wd->base, "elm.text", title);
783                         if(!wd->hidden)
784                                 {
785                                         if((it->title_obj)&&(it->title)){ 
786                                                 edje_object_signal_emit(wd->base, "elm,state,extend,title", "elm");
787                                         }
788                                         else
789                                                 edje_object_signal_emit(wd->base, "elm,state,retract,title", "elm");
790                                 }
791                         _item_sizing_eval(it);
792                         break;
793                 }
794         }
795 }
796
797 /**
798  * Return the title string of the pushed content
799  *
800  * @param[in] obj The NavigationBar object
801  * @param[in] content The object to push or pushed
802  * @return The title string or NULL if none
803  *
804  * @ingroup NavigationBar
805  */
806 EAPI const char *
807 elm_navigationbar_title_label_get(Evas_Object *obj, 
808                                                         Evas_Object *content)
809 {
810         ELM_CHECK_WIDTYPE(obj, widtype)NULL;
811         Widget_Data *wd = elm_widget_data_get(obj);
812         Eina_List *ll;
813         Item *it;
814
815         if (!wd) return NULL;
816
817          EINA_LIST_FOREACH(wd->stack, ll, it)
818         {
819                 if (it->content == content) 
820                         return it->title;
821         }
822         return NULL;
823 }
824
825 /**
826  * Add a title object for the content.
827  *
828  * @param[in] obj The NavigationBar object
829  * @param[in] content The object pushed
830  * @param[in] title_obj a title object (normally button or segment_control)
831  *
832  * @ingroup NavigationBar
833  */
834 EAPI void
835 elm_navigationbar_title_object_add(Evas_Object *obj,
836                                                                         Evas_Object *content,
837                                                                         Evas_Object *title_obj)
838 {
839         ELM_CHECK_WIDTYPE(obj, widtype);
840         Widget_Data *wd = elm_widget_data_get(obj);
841         Eina_List *ll;
842         Item *it;
843         Item *last_it;
844
845         if (!title_obj) return;
846         if (!content) return;
847         if (!wd) return;
848         it = _check_item_is_added(obj, content);
849         if (!it) 
850                 {
851                         ERR("[ERROR]Push the Item first, later add the title object");
852                         return;
853                 }
854         
855         it->title_list = eina_list_append(it->title_list, title_obj);   
856         if(it->obj) _item_sizing_eval(it);      
857         //update if the content is the top item
858         ll = eina_list_last(wd->stack);
859         if (ll) 
860         {
861                 last_it = ll->data;
862                 if (last_it->content == content) 
863                 {
864                         Evas_Object *swallow;
865                         swallow = edje_object_part_swallow_get(wd->base, "elm.swallow.title");
866                         if (swallow) {
867                                 edje_object_part_unswallow(wd->base, swallow);
868                                 evas_object_hide(swallow);
869                         }
870                         edje_object_part_swallow(wd->base, "elm.swallow.title", it->title_obj);
871                         if(!wd->hidden)
872                         {
873                                 if(it->fn_btn3){
874                                         edje_object_signal_emit(wd->base, "elm,state,item,add,rightpad2", "elm");
875                                         edje_object_signal_emit(wd->base, "elm,state,item,fn_btn3_set", "elm");
876                                 }                       
877                                 if((it->title_obj)&&(it->title)){ 
878                                         edje_object_signal_emit(wd->base, "elm,state,extend,title", "elm");
879                                 }
880                         }
881                         _item_sizing_eval(it);  
882                 }
883         }
884 }
885
886 /**
887  * Unset the list of title objects corresponding to given content and returns it to  
888  * the application.
889  * @param[in] obj The NavigationBar object
890  * @param[in] content The object pushed
891  * @param[in] title_obj a title object (normally button or segment_control)
892  * @param[out] list updates the list with title objects list, this list has to be freed and the
893  * objects have to be deleted by application.
894  * @ingroup NavigationBar
895  */
896 EAPI void
897 elm_navigationbar_title_object_list_unset(Evas_Object *obj,
898                                                                         Evas_Object *content, Eina_List **list)
899 {
900         ELM_CHECK_WIDTYPE(obj, widtype);
901         Widget_Data *wd = elm_widget_data_get(obj);
902         Eina_List *ll;
903         Item *it;
904         Item *last_it = NULL;
905         ll = eina_list_last(wd->stack);
906         if (ll) 
907         {
908                 last_it = ll->data;
909         }
910         
911         if (!wd) return;
912         EINA_LIST_FOREACH(wd->stack, ll, it)
913         {
914                 if (it->content == content)     
915                         {
916                                 if (last_it->content == it->content) 
917                                         {
918                                                 Evas_Object *swallow;
919                                                 swallow = edje_object_part_swallow_get(wd->base, "elm.swallow.title");
920                                                 if (swallow) {
921                                                         edje_object_part_unswallow(wd->base, swallow);
922                                                         evas_object_hide(swallow);
923                                                 }
924                                         } 
925                                 _multiple_object_unset(it, list);       
926                                 evas_object_del(it->title_obj);
927                                 it->title_obj = NULL;           
928                                 if(!wd->hidden)
929                                         {
930                                                 edje_object_signal_emit(wd->base, "elm,state,retract,title", "elm");
931                                                 if(it->fn_btn3)
932                                                         {
933                                                                 edje_object_signal_emit(wd->base, "elm,state,item,add,rightpad2", "elm");
934                                                                 edje_object_signal_emit(wd->base, "elm,state,item,fn_btn3_set", "elm");
935                                                         }
936                                         }
937                                 _item_sizing_eval(it);
938                                 
939                         }
940         }
941 }
942
943
944 /**
945  * Return the list of title objects of the pushed content.
946  *
947  * @param[in] obj The NavigationBar object
948  * @param[in] content The object to push or pushed
949  * @return The list of title objects
950  *
951  * @ingroup NavigationBar
952  */
953 EAPI Eina_List *
954 elm_navigationbar_title_object_list_get(Evas_Object *obj,
955                                                                                 Evas_Object *content)
956 {
957         ELM_CHECK_WIDTYPE(obj, widtype) NULL;
958         Widget_Data *wd = elm_widget_data_get(obj);
959         Eina_List *ll;
960         Item *it;
961
962         if (!wd) return NULL;
963         EINA_LIST_FOREACH(wd->stack, ll, it)
964         {
965                 if (it->content == content)     
966                         return it->title_list;
967         }       
968         return NULL;
969 }
970
971 static void
972 _elm_navigationbar_back_button_set(Evas_Object *obj, 
973                                                                         Evas_Object *content, 
974                                                                         Evas_Object *button)
975 {
976         Widget_Data *wd = elm_widget_data_get(obj);
977         Eina_List *ll;
978         Item *it;
979         Eina_Bool changed;
980
981         if (!wd) return;
982         
983          EINA_LIST_FOREACH(wd->stack, ll, it)
984         {
985                 if (it->content == content) 
986                 {
987                         changed = _button_set(obj, it->back_btn, button, EINA_TRUE);
988                         it->back_btn = button;
989                         _item_sizing_eval(it);
990                         break;
991                 }
992         }
993
994         //update if the content is the top item
995         ll = eina_list_last(wd->stack);
996         if (ll) 
997         {
998                 it = ll->data;
999                 if (it->back_btn && changed && (it->content == content) && (!it->fn_btn1)) 
1000                 {
1001                         edje_object_part_swallow(wd->base, "elm.swallow.btn1", it->back_btn);   
1002                         evas_object_smart_callback_add(it->back_btn, "clicked", _back_button_clicked, it); 
1003                 }
1004         }
1005 }
1006
1007 static Evas_Object *
1008 _elm_navigationbar_back_button_get(Evas_Object *obj, 
1009                                                                         Evas_Object *content)
1010 {
1011         Widget_Data *wd = elm_widget_data_get(obj);
1012         Eina_List *ll;
1013         Item *it;
1014
1015         if (!wd) return NULL;
1016
1017          EINA_LIST_FOREACH(wd->stack, ll, it)
1018         {
1019                 if (it->content == content)     
1020                         return it->back_btn;
1021         }       
1022         return NULL;
1023 }
1024
1025 static void
1026 _elm_navigationbar_function_button1_set(Evas_Object *obj, 
1027                                                                         Evas_Object *content, 
1028                                                                         Evas_Object *button)
1029 {
1030         Widget_Data *wd = elm_widget_data_get(obj);
1031         Eina_List *ll;
1032         Item *it;
1033         Eina_Bool changed;
1034
1035         if (!wd) return;
1036
1037          EINA_LIST_FOREACH(wd->stack, ll, it)
1038         {
1039                 if (it->content == content) 
1040                 {
1041                         changed = _button_set(obj, it->fn_btn1, button, EINA_FALSE);
1042                         it->fn_btn1 = button;
1043                         _item_sizing_eval(it);
1044                         break;
1045                 }
1046          }
1047
1048         //update if the content is the top item
1049         ll = eina_list_last(wd->stack);
1050         if (ll) 
1051         {
1052                 it = ll->data;
1053                 if (it->fn_btn1 && changed && (it->content == content)) 
1054                 {
1055                         if (edje_object_part_swallow_get(wd->base, "elm.swallow.btn1") == it->back_btn)
1056                         {
1057                                 edje_object_part_unswallow(wd->base, it->back_btn);
1058                                 evas_object_del(it->back_btn);
1059                                 it->back_btn = NULL;
1060                         }
1061                         edje_object_part_swallow(wd->base, "elm.swallow.btn1", it->fn_btn1);
1062                 }
1063         }
1064 }
1065
1066 static Evas_Object *
1067 _elm_navigationbar_function_button1_get(Evas_Object *obj,       
1068                                                                         Evas_Object *content)
1069 {
1070         Widget_Data *wd = elm_widget_data_get(obj);
1071         Eina_List *ll;
1072         Item *it;
1073
1074         if (!wd) return NULL;
1075
1076          EINA_LIST_FOREACH(wd->stack, ll, it)
1077         {
1078                 if (it->content == content) 
1079                         return it->fn_btn1;
1080         }       
1081         return NULL;
1082 }
1083
1084 static void
1085 _elm_navigationbar_function_button2_set(Evas_Object *obj, 
1086                                                                                 Evas_Object *content, 
1087                                                                                 Evas_Object *button)
1088 {
1089         Widget_Data *wd = elm_widget_data_get(obj);
1090         Eina_List *ll;
1091         Item *it;
1092         Eina_Bool changed;
1093
1094         if (!wd) return;
1095          EINA_LIST_FOREACH(wd->stack, ll, it)
1096                 {
1097                         if (it->content == content) 
1098                         {
1099                                 changed = _button_set(obj, it->fn_btn2, button, EINA_FALSE);
1100                                 it->fn_btn2 = button;
1101                                 _item_sizing_eval(it);
1102                                 break;
1103                         }
1104                  }      
1105          
1106         //update if the content is the top item
1107         ll = eina_list_last(wd->stack);
1108         if (ll) 
1109                 {
1110                         it = ll->data;
1111                         if (it->fn_btn2 && changed && (it->content == content)) 
1112                                 {
1113                                         edje_object_part_swallow(wd->base, "elm.swallow.btn2", it->fn_btn2);
1114                                 }
1115                 }
1116 }
1117
1118 static Evas_Object *
1119 _elm_navigationbar_function_button2_get(Evas_Object *obj, 
1120                                                                                 Evas_Object *content)
1121 {
1122         Widget_Data *wd = elm_widget_data_get(obj);
1123         Eina_List *ll;
1124         Item *it;
1125
1126         if (!wd) return NULL;
1127
1128          EINA_LIST_FOREACH(wd->stack, ll, it)
1129         {
1130                 if (it->content == content) 
1131                         return it->fn_btn2;
1132         }
1133         return NULL;
1134 }
1135
1136 static void
1137 _elm_navigationbar_function_button3_set(Evas_Object *obj, 
1138                                                                                 Evas_Object *content, 
1139                                                                                 Evas_Object *button)
1140 {
1141         Widget_Data *wd = elm_widget_data_get(obj);
1142         Eina_List *ll;
1143         Item *it;
1144         Eina_Bool changed;
1145
1146         if (!wd) return;
1147
1148          EINA_LIST_FOREACH(wd->stack, ll, it)
1149         {
1150                 if (it->content == content) 
1151                 {
1152                         changed = _button_set(obj, it->fn_btn3, button, EINA_FALSE);
1153                         it->fn_btn3 = button;
1154                         _item_sizing_eval(it);
1155                         break;
1156                 }
1157          }      
1158
1159         //update if the content is the top item
1160         ll = eina_list_last(wd->stack);
1161         if (ll) 
1162         {
1163                 it = ll->data;
1164                 if (it->fn_btn3 && changed && (it->content == content)) 
1165                         {
1166                                 edje_object_part_swallow(wd->base, "elm.swallow.btn3", it->fn_btn3);
1167                         }
1168         }
1169 }
1170
1171 static Evas_Object *
1172 _elm_navigationbar_function_button3_get(Evas_Object *obj, 
1173                                                                                 Evas_Object *content)
1174 {
1175         Widget_Data *wd = elm_widget_data_get(obj);
1176         Eina_List *ll;
1177         Item *it;
1178
1179         if (!wd) return NULL;
1180
1181          EINA_LIST_FOREACH(wd->stack, ll, it)
1182         {
1183                 if (it->content == content) 
1184                         return it->fn_btn3;
1185         }
1186         return NULL;
1187 }
1188
1189 /**
1190  * Return the content object at the top of the NavigationBar stack
1191  *
1192  * @param[in] obj The NavigationBar object
1193  * @return The top content object or NULL if none
1194  *
1195  * @ingroup NavigationBar
1196  */
1197 EAPI Evas_Object *
1198 elm_navigationbar_content_top_get(Evas_Object *obj)
1199 {
1200         ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1201         Widget_Data *wd = elm_widget_data_get(obj);
1202         if (!wd) return NULL;
1203
1204         return elm_pager_content_top_get(wd->pager);
1205 }
1206
1207 /**
1208  * Return the content object at the bottom of the NavigationBar stack
1209  *
1210  * @param[in] obj The NavigationBar object
1211  * @return The bottom content object or NULL if none
1212  *
1213  * @ingroup NavigationBar
1214  */
1215 EAPI Evas_Object *
1216 elm_navigationbar_content_bottom_get(Evas_Object *obj)
1217 {
1218         ELM_CHECK_WIDTYPE(obj, widtype)NULL;
1219         Widget_Data *wd = elm_widget_data_get(obj);
1220         if (!wd) return NULL;
1221
1222         return elm_pager_content_bottom_get(wd->pager);
1223 }
1224
1225 /**
1226  * This hides the title area of navigationbar.
1227  *
1228  * @param[in] obj The NavigationBar object
1229  * @param[in] hidden if EINA_TRUE the title area is hidden.
1230  *
1231  * @ingroup NavigationBar
1232  */
1233 EAPI void
1234 elm_navigationbar_hidden_set(Evas_Object *obj, 
1235                                                                 Eina_Bool hidden)
1236 {
1237         ELM_CHECK_WIDTYPE(obj, widtype);
1238         Widget_Data *wd = elm_widget_data_get(obj);
1239         if (!wd) return;
1240
1241         if (hidden) edje_object_signal_emit(wd->base, "elm,state,item,moveup", "elm");
1242         else edje_object_signal_emit(wd->base, "elm,state,item,movedown", "elm");
1243         wd->hidden = hidden;
1244 }
1245
1246 /**
1247  * Set the button object of the pushed content.
1248  *
1249  * @param[in] obj The NavigationBar object
1250  * @param[in] content The object to push or pushed
1251  * @param[in] button The button
1252  * @param[in] button_type Indicates the position
1253  *
1254  * @ingroup NavigationBar
1255  */
1256  EAPI void
1257 elm_navigationbar_title_button_set(Evas_Object *obj, 
1258                                                                                 Evas_Object *content, 
1259                                                                                 Evas_Object *button, 
1260                                                                                 Elm_Navi_Button_Type button_type)
1261 {
1262         ELM_CHECK_WIDTYPE(obj, widtype);
1263         if(!content) return;
1264         switch(button_type)
1265         {
1266                 case ELM_NAVIGATIONBAR_FUNCTION_BUTTON1:
1267                         _elm_navigationbar_function_button1_set(obj, content, button);
1268                         break;
1269                 case ELM_NAVIGATIONBAR_FUNCTION_BUTTON2:
1270                         _elm_navigationbar_function_button2_set(obj, content, button);
1271                         break;
1272                 case ELM_NAVIGATIONBAR_FUNCTION_BUTTON3:
1273                         _elm_navigationbar_function_button3_set(obj, content, button);
1274                         break;
1275                 case ELM_NAVIGATIONBAR_BACK_BUTTON:
1276                         _elm_navigationbar_back_button_set(obj, content, button);
1277                         break;
1278                 default: 
1279                         break;
1280         }                       
1281         _sizing_eval(obj);
1282 }
1283
1284 /**
1285  * Return the button object of the pushed content
1286  *
1287  * @param[in] obj The NavigationBar object
1288  * @param[in] content The object to push or pushed
1289  * @param[in] button_type Indicates the position
1290  * @return The button object or NULL if none
1291  *
1292  * @ingroup NavigationBar
1293  */
1294 EAPI Evas_Object *
1295 elm_navigationbar_title_button_get(Evas_Object *obj,    
1296                                                                         Evas_Object *content,Elm_Navi_Button_Type button_type)
1297 {
1298         ELM_CHECK_WIDTYPE(obj, widtype) NULL;
1299         Evas_Object *button=NULL;
1300         if(!content || !obj) return NULL;       
1301         switch(button_type)
1302         {
1303                 case ELM_NAVIGATIONBAR_FUNCTION_BUTTON1:
1304                         button  = _elm_navigationbar_function_button1_get(obj, content);
1305                         break;
1306                 case ELM_NAVIGATIONBAR_FUNCTION_BUTTON2:
1307                         button = _elm_navigationbar_function_button2_get(obj, content);
1308                         break;
1309                 case ELM_NAVIGATIONBAR_FUNCTION_BUTTON3:
1310                         button  = _elm_navigationbar_function_button3_get(obj, content);
1311                         break;
1312                 case ELM_NAVIGATIONBAR_BACK_BUTTON:
1313                         button = _elm_navigationbar_back_button_get(obj, content);
1314                         break;
1315                 default: 
1316                         break;
1317         }       
1318         return button;
1319 }
1320
1321 /**
1322  * Set the sub title string for the pushed content.
1323  *
1324  * @param[in] obj The NavigationBar object
1325  * @param[in] content The object to push or pushed
1326  * @param[in] subtitle The subtitle string
1327  *
1328  * @ingroup NavigationBar
1329  */
1330 EAPI void
1331 elm_navigationbar_subtitle_label_set(Evas_Object *obj, 
1332                                                         Evas_Object *content, 
1333                                                         const char *subtitle)
1334 {
1335         ELM_CHECK_WIDTYPE(obj, widtype);
1336         Widget_Data *wd = elm_widget_data_get(obj);
1337         Eina_List *ll;
1338         Item *it;
1339
1340         if (!wd) return;
1341         
1342          EINA_LIST_FOREACH(wd->stack, ll, it)
1343         {
1344                 if (it->content == content) 
1345                 {
1346                    eina_stringshare_replace(&it->subtitle, subtitle);
1347                         edje_object_part_text_set(wd->base, "elm.text.sub", subtitle);
1348                         _item_sizing_eval(it);
1349                         break;
1350                 }
1351         }
1352 }
1353
1354 /**
1355  * Return the subtitle string of the pushed content.
1356  *
1357  * @param[in] obj The NavigationBar object
1358  * @param[in] content The object to push or pushed
1359  * @return The subtitle string or NULL if none
1360  *
1361  * @ingroup NavigationBar
1362  */
1363 EAPI const char *
1364 elm_navigationbar_subtitle_label_get(Evas_Object *obj, 
1365                                                         Evas_Object *content)
1366 {
1367         ELM_CHECK_WIDTYPE(obj, widtype)NULL;
1368         Widget_Data *wd = elm_widget_data_get(obj);
1369         Eina_List *ll;
1370         Item *it;
1371
1372         if (!wd) return NULL;
1373
1374          EINA_LIST_FOREACH(wd->stack, ll, it)
1375         {
1376                 if (it->content == content) 
1377                         return it->subtitle;
1378         }
1379         return NULL;
1380 }
1381
1382 /**
1383  * This disables content area animation on push/pop.
1384  *
1385  * @param[in] obj The NavigationBar object
1386  * @param[in] disable  if EINA_TRUE animation is disabled.
1387  *
1388  * @ingroup NavigationBar
1389  */
1390 EAPI void
1391 elm_navigationbar_animation_disable_set(Evas_Object *obj, 
1392                                                         Eina_Bool disable)
1393 {
1394         ELM_CHECK_WIDTYPE(obj, widtype);
1395         Widget_Data *wd = elm_widget_data_get(obj);
1396         elm_pager_animation_disable_set(wd->pager, disable);
1397 }
1398