naviframe: Move focus from last content to first content by focus next
[platform/upstream/elementary.git] / src / lib / elc_naviframe.c
1 #ifdef HAVE_CONFIG_H
2 # include "elementary_config.h"
3 #endif
4
5 #define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
6 #define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
7 #define ELM_WIDGET_ITEM_PROTECTED
8
9 #include <Elementary.h>
10 #include "elm_priv.h"
11 #include "elm_widget_naviframe.h"
12 #include "elm_widget_container.h"
13
14 #define MY_CLASS ELM_NAVIFRAME_CLASS
15
16 #define MY_CLASS_NAME "Elm_Naviframe"
17 #define MY_CLASS_NAME_LEGACY "elm_naviframe"
18
19 static const char CONTENT_PART[] = "elm.swallow.content";
20 static const char PREV_BTN_PART[] = "elm.swallow.prev_btn";
21 static const char NEXT_BTN_PART[] = "elm.swallow.next_btn";
22 static const char ICON_PART[] = "elm.swallow.icon";
23 static const char TITLE_PART[] = "elm.text.title";
24 static const char SUBTITLE_PART[] = "elm.text.subtitle";
25 static const char TITLE_ACCESS_PART[] = "access.title";
26
27 static const char SIG_TRANSITION_FINISHED[] = "transition,finished";
28 static const char SIG_TITLE_TRANSITION_FINISHED[] = "title,transition,finished";
29 static const char SIG_TITLE_CLICKED[] = "title,clicked";
30 static const char SIG_ITEM_ACTIVATED[] = "item,activated";
31 //TIZEN_ONLY(20161213): apply screen_reader_changed callback
32 static const char SIG_ATSPI_SCREEN_READER_CHANGED[] = "atspi,screen,reader,changed";
33 //
34 static const Evas_Smart_Cb_Description _smart_callbacks[] = {
35    {SIG_TRANSITION_FINISHED, ""},
36    {SIG_TITLE_TRANSITION_FINISHED, ""},
37    {SIG_TITLE_CLICKED, ""},
38    {SIG_WIDGET_LANG_CHANGED, ""}, /**< handled by elm_widget */
39    {SIG_WIDGET_ACCESS_CHANGED, ""}, /**< handled by elm_widget */
40    {SIG_LAYOUT_FOCUSED, ""}, /**< handled by elm_layout */
41    {SIG_LAYOUT_UNFOCUSED, ""}, /**< handled by elm_layout */
42    {SIG_ITEM_ACTIVATED, ""},
43    //TIZEN_ONLY(20161213): apply screen_reader_changed callback
44    {SIG_ATSPI_SCREEN_READER_CHANGED, ""},
45    //
46    {NULL, NULL}
47 };
48
49 //TIZEN ONLY(20160829): Support tizen transition
50 static int initted = 0;
51 static Elm_Naviframe_Mod_Api *nf_mod = NULL;
52
53 static void
54 _nf_mod_init(void)
55 {
56    Elm_Module *mod;
57
58    initted++;
59    if (initted > 1) return;
60    if (!(mod = _elm_module_find_as("naviframe/api"))) return;
61
62    mod->api = malloc(sizeof(Elm_Naviframe_Mod_Api));
63    if (!mod->api) return;
64
65    ((Elm_Naviframe_Mod_Api *)(mod->api))->tizen_push_effect =
66       _elm_module_symbol_get(mod, "tizen_push_effect");
67    ((Elm_Naviframe_Mod_Api *)(mod->api))->tizen_pop_effect =
68       _elm_module_symbol_get(mod, "tizen_pop_effect");
69    ((Elm_Naviframe_Mod_Api *)(mod->api))->tizen_push_deferred_effect =
70       _elm_module_symbol_get(mod, "tizen_push_deferred_effect");
71    ((Elm_Naviframe_Mod_Api *)(mod->api))->tizen_pop_deferred_effect =
72       _elm_module_symbol_get(mod, "tizen_pop_deferred_effect");
73    ((Elm_Naviframe_Mod_Api *)(mod->api))->tizen_effect_enabled_get =
74       _elm_module_symbol_get(mod, "tizen_effect_enabled_get");
75    ((Elm_Naviframe_Mod_Api *)(mod->api))->tizen_effect_cancel =
76       _elm_module_symbol_get(mod, "tizen_effect_cancel");
77
78    nf_mod = mod->api;
79 }
80 //
81
82 //TIZEN ONLY(20161208): Support tizen transition
83 static Eina_Bool
84 _tizen_effect_enabled_get(Elm_Naviframe_Item_Data *it)
85 {
86    if (!it) return EINA_FALSE;
87    if (nf_mod &&
88        nf_mod->tizen_effect_enabled_get &&
89        nf_mod->tizen_effect_enabled_get(VIEW(it)))
90      {
91         return EINA_TRUE;
92      }
93
94    return EINA_FALSE;
95 }
96 //
97
98 static Eina_Bool _on_item_back_btn_clicked(void *data,
99       Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED);
100
101 static Eina_Bool _key_action_top_item_get(Evas_Object *obj, const char *params);
102 static Eina_Bool _key_action_item_pop(Evas_Object *obj, const char *params);
103
104 static char *_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED);
105
106 static const Elm_Action key_actions[] = {
107    {"top_item_get", _key_action_top_item_get},
108    {"item_pop", _key_action_item_pop},
109    {NULL, NULL}
110 };
111
112 static void
113 _resize_object_reset(Evas_Object *obj, Elm_Naviframe_Item_Data *it)
114 {
115    if (it)
116      {
117         elm_widget_resize_object_set(obj, VIEW(it), EINA_FALSE);
118         evas_object_raise(VIEW(it));
119      }
120 }
121
122 static void
123 _prev_page_focus_recover(Elm_Naviframe_Item_Data *it)
124 {
125    Evas_Object *newest;
126    unsigned int order = 0;
127
128    newest = elm_widget_newest_focus_order_get(VIEW(it), &order, EINA_TRUE);
129    if (newest)
130      elm_object_focus_set(newest, EINA_TRUE);
131    else
132      {
133         if (elm_object_focus_allow_get(VIEW(it)))
134           elm_object_focus_set(VIEW(it), EINA_TRUE);
135         else
136           elm_object_focus_set(WIDGET(it), EINA_TRUE);
137      }
138 }
139
140 EOLIAN static Eina_Bool
141 _elm_naviframe_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
142 {
143    Elm_Naviframe_Item_Data *it;
144
145    EINA_INLIST_FOREACH(sd->stack, it)
146      eo_do(EO_OBJ(it), elm_wdg_item_translate());
147
148    eo_do_super(obj, MY_CLASS, elm_obj_widget_translate());
149
150    return EINA_TRUE;
151 }
152
153 static void
154 _item_content_del_cb(void *data,
155                      Evas *e EINA_UNUSED,
156                      Evas_Object *obj EINA_UNUSED,
157                      void *event_info EINA_UNUSED)
158 {
159    Elm_Naviframe_Item_Data *it = data;
160
161    it->content = NULL;
162    elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
163 }
164
165 static void
166 _item_title_prev_btn_del_cb(void *data,
167                             Evas *e EINA_UNUSED,
168                             Evas_Object *obj EINA_UNUSED,
169                             void *event_info EINA_UNUSED)
170 {
171    Elm_Naviframe_Item_Data *it = data;
172
173    it->title_prev_btn = NULL;
174    if (it->auto_pushed_btn) it->auto_pushed_btn = NULL;
175    elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
176 }
177
178 static void
179 _item_title_next_btn_del_cb(void *data,
180                             Evas *e EINA_UNUSED,
181                             Evas_Object *obj EINA_UNUSED,
182                             void *event_info EINA_UNUSED)
183 {
184    Elm_Naviframe_Item_Data *it = data;
185
186    it->title_next_btn = NULL;
187    elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
188 }
189
190 static void
191 _item_title_icon_del_cb(void *data,
192                         Evas *e EINA_UNUSED,
193                         Evas_Object *obj EINA_UNUSED,
194                         void *event_info EINA_UNUSED)
195 {
196    Elm_Naviframe_Item_Data *it = data;
197
198    it->title_icon = NULL;
199    elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
200 }
201
202 static void
203 _title_content_del(void *data,
204                    Evas *e EINA_UNUSED,
205                    Evas_Object *obj EINA_UNUSED,
206                    void *event_info EINA_UNUSED)
207 {
208    char buf[1024];
209    Elm_Naviframe_Content_Item_Pair *pair = data;
210    Elm_Naviframe_Item_Data *it = pair->it;
211    snprintf(buf, sizeof(buf), "elm,state,%s,hide", pair->part);
212    elm_object_signal_emit(VIEW(it), buf, "elm");
213    it->content_list = eina_inlist_remove(it->content_list,
214                                          EINA_INLIST_GET(pair));
215    eina_stringshare_del(pair->part);
216    free(pair);
217 }
218
219 static void
220 _item_free(Elm_Naviframe_Item_Data *it)
221 {
222    Eina_Inlist *l;
223    Elm_Naviframe_Content_Item_Pair *content_pair;
224    Elm_Naviframe_Text_Item_Pair *text_pair;
225
226    ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
227
228    eina_stringshare_del(it->style);
229    eina_stringshare_del(it->title_label);
230    eina_stringshare_del(it->subtitle_label);
231
232    EINA_INLIST_FOREACH_SAFE(it->content_list, l, content_pair)
233      {
234         if (content_pair->content)
235           {
236              evas_object_event_callback_del(content_pair->content,
237                                             EVAS_CALLBACK_DEL,
238                                             _title_content_del);
239              evas_object_del(content_pair->content);
240           }
241         eina_stringshare_del(content_pair->part);
242         free(content_pair);
243      }
244    EINA_INLIST_FOREACH_SAFE(it->text_list, l, text_pair)
245      {
246         eina_stringshare_del(text_pair->part);
247         free(text_pair);
248      }
249
250    if (it->content)
251      {
252         if ((sd->preserve) && (!sd->on_deletion))
253           {
254              /* so that elm does not delete the contents with the item's
255               * view after the destructor */
256              elm_object_part_content_unset(VIEW(it), CONTENT_PART);
257              evas_object_event_callback_del
258                 (it->content, EVAS_CALLBACK_DEL, _item_content_del_cb);
259              evas_object_hide(it->content);
260           }
261      }
262 }
263
264 static void
265 _item_content_signals_emit(Elm_Naviframe_Item_Data *it)
266 {
267    Elm_Naviframe_Content_Item_Pair *content_pair;
268    char buf[1024];
269    //content
270    if (it->content)
271      elm_object_signal_emit(VIEW(it), "elm,state,content,show", "elm");
272    else
273      elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
274
275    //prev button
276    if (it->title_prev_btn)
277      elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,show", "elm");
278    else
279      elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
280
281    //next button
282    if (it->title_next_btn)
283      elm_object_signal_emit(VIEW(it), "elm,state,next_btn,show", "elm");
284    else
285      elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
286
287    if (it->title_icon)
288      elm_object_signal_emit(VIEW(it), "elm,state,icon,show", "elm");
289    else
290      elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
291
292    EINA_INLIST_FOREACH(it->content_list, content_pair)
293      {
294         if (content_pair->content)
295           snprintf(buf, sizeof(buf), "elm,state,%s,show", content_pair->part);
296         else
297           snprintf(buf, sizeof(buf), "elm,state,%s,hide", content_pair->part);
298         elm_object_signal_emit(VIEW(it), buf, "elm");
299      }
300 }
301
302 static void
303 _item_text_signals_emit(Elm_Naviframe_Item_Data *it)
304 {
305    Elm_Naviframe_Text_Item_Pair *text_pair;
306    char buf[1024];
307
308    if ((it->title_label) && (it->title_label[0]))
309      elm_object_signal_emit(VIEW(it), "elm,state,title_label,show", "elm");
310    else
311      elm_object_signal_emit(VIEW(it), "elm,state,title_label,hide", "elm");
312
313    if ((it->subtitle_label) && (it->subtitle_label[0]))
314      elm_object_signal_emit(VIEW(it), "elm,state,subtitle,show", "elm");
315    else
316      elm_object_signal_emit(VIEW(it), "elm,state,subtitle,hide", "elm");
317
318    EINA_INLIST_FOREACH(it->text_list, text_pair)
319      {
320         if (elm_object_part_text_get(VIEW(it), text_pair->part))
321           snprintf(buf, sizeof(buf), "elm,state,%s,show", text_pair->part);
322         else
323           snprintf(buf, sizeof(buf), "elm,state,%s,hide", text_pair->part);
324         elm_object_signal_emit(VIEW(it), buf, "elm");
325      }
326 }
327
328 static Evas_Object *
329 _access_object_get(Elm_Naviframe_Item_Data *it, const char* part)
330 {
331    Evas_Object *po, *ao;
332
333    po = (Evas_Object *)edje_object_part_object_get
334           (elm_layout_edje_get(VIEW(it)), part);
335    ao = evas_object_data_get(po, "_part_access_obj");
336
337    return ao;
338 }
339
340 static Eina_Bool
341 _access_info_has(Evas_Object *obj, int type)
342 {
343    Elm_Access_Info *ac;
344    Elm_Access_Item *ai;
345    Eina_List *l;
346
347    ac = _elm_access_info_get(obj);
348    if (!ac) return EINA_FALSE;
349
350    EINA_LIST_FOREACH(ac->items, l, ai)
351      {
352         if (ai->type == type)
353           {
354              if (ai->func || ai->data) return EINA_TRUE;
355           }
356      }
357
358    return EINA_FALSE;
359 }
360
361 static void
362 _item_signals_emit(Elm_Naviframe_Item_Data *it)
363 {
364    _item_text_signals_emit(it);
365    _item_content_signals_emit(it);
366 }
367
368 //TIZEN ONLY(20151012): expose title as at-spi object
369 static void
370 _atspi_expose_title(Elm_Naviframe_Item_Data *it, Eina_Bool is_atspi)
371 {
372    Evas_Object *part = NULL;
373    Evas_Object *access = NULL;
374    part = (Evas_Object*)edje_object_part_object_get(elm_layout_edje_get(VIEW(it)),
375                                                     TITLE_ACCESS_PART);
376    if (!part) return;
377    if (is_atspi)
378      {
379         access = elm_access_object_register(part, VIEW(it));
380         _elm_access_callback_set(_elm_access_info_get(access),
381                                  ELM_ACCESS_INFO, _access_info_cb, it);
382         elm_atspi_accessible_role_set(access, ELM_ATSPI_ROLE_HEADING);
383      }
384    else
385      elm_access_object_unregister(part);
386 }
387 //
388
389 /* FIXME: we need to handle the case when this function is called
390  * during a transition */
391 static void
392 _item_style_set(Elm_Naviframe_Item_Data *it,
393                 const char *item_style)
394 {
395    char buf[256];
396
397    ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
398
399    if (!item_style)
400      {
401         strcpy(buf, "item/basic");
402         eina_stringshare_replace(&it->style, "basic");
403      }
404    else
405      {
406         snprintf(buf, sizeof(buf), "item/%s", item_style);
407         eina_stringshare_replace(&it->style, item_style);
408      }
409
410    if (!elm_layout_theme_set(VIEW(it), "naviframe", buf,
411                              elm_widget_style_get(WIDGET(it))))
412      CRI("Failed to set layout!");
413
414    if (sd->freeze_events)
415      evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
416
417    //TIZEN ONLY(20151012): expose title as at-spi object
418    if (elm_atspi_bridge_utils_is_screen_reader_enabled())
419      _atspi_expose_title(it, EINA_TRUE);
420    //
421 }
422
423 static void
424 _on_item_title_transition_finished(void *data,
425                                    Evas_Object *obj EINA_UNUSED,
426                                    const char *emission EINA_UNUSED,
427                                    const char *source EINA_UNUSED)
428 {
429    Elm_Naviframe_Item_Data *it = data;
430
431    eo_do(WIDGET(it), eo_event_callback_call
432          (ELM_NAVIFRAME_EVENT_TITLE_TRANSITION_FINISHED, EO_OBJ(it)));
433 }
434
435 static void
436 _item_title_enabled_update(Elm_Naviframe_Item_Data *nit, Eina_Bool transition)
437 {
438    transition = !!transition;
439    if (transition)
440      {
441         if (nit->title_enabled)
442           elm_object_signal_emit(VIEW(nit), "elm,action,title,show", "elm");
443         else
444           elm_object_signal_emit(VIEW(nit), "elm,action,title,hide", "elm");
445      }
446    else
447      {
448         if (nit->title_enabled)
449           elm_object_signal_emit(VIEW(nit), "elm,state,title,show", "elm");
450         else
451           elm_object_signal_emit(VIEW(nit), "elm,state,title,hide", "elm");
452      }
453    edje_object_message_signal_process(elm_layout_edje_get(VIEW(nit)));
454 }
455
456 EOLIAN static Elm_Theme_Apply
457 _elm_naviframe_elm_widget_theme_apply(Eo *obj, Elm_Naviframe_Data *sd)
458 {
459    Elm_Naviframe_Item_Data *it;
460    const char *style = NULL, *sstyle = NULL;
461
462    eo_do(obj, style = elm_obj_widget_style_get());
463
464    EINA_INLIST_FOREACH(sd->stack, it)
465      {
466         eo_do(VIEW(it), sstyle = elm_obj_widget_style_get());
467         if ((style && sstyle) && strcmp(style, sstyle))
468           _item_style_set(it, it->style);
469         _item_signals_emit(it);
470         _item_title_enabled_update(it, EINA_FALSE);
471      }
472
473    elm_layout_sizing_eval(obj);
474    return ELM_THEME_APPLY_SUCCESS;
475 }
476
477 static char *
478 _access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
479 {
480    Elm_Naviframe_Item_Data *nit;
481    Evas_Object *layout;
482    Eina_Strbuf *buf;
483    const char *info;
484    char *ret;
485
486    nit = data;
487    if (!nit->title_enabled) return NULL;
488
489    layout = VIEW(nit);
490    info = elm_object_part_text_get(layout, TITLE_PART);
491    if (!info) return NULL;
492
493    buf = eina_strbuf_new();
494    eina_strbuf_append(buf, info);
495    //TIZEN ONLY(20160530): Read title after reading actual title
496    eina_strbuf_append_printf(buf, ", %s", N_("Title"));
497    //
498
499    info = elm_object_part_text_get(layout, SUBTITLE_PART);
500    if (!info) goto end;
501    //TIZEN ONLY(20160530): do not read subtitle even if text is empty
502    if (!strcmp(info, "")) goto end;
503    //
504
505    eina_strbuf_append_printf(buf, ", %s", info);
506    //TIZEN ONLY(20160530): Read subtitle after reading actual subtitle
507    eina_strbuf_append_printf(buf, ", %s", N_("Subtitle"));
508    //
509
510 end:
511    ret = eina_strbuf_string_steal(buf);
512    eina_strbuf_free(buf);
513    return ret;
514 }
515
516 static void
517 _access_obj_process(Elm_Naviframe_Item_Data *it, Eina_Bool is_access)
518 {
519    Evas_Object *ao, *eo;
520
521    if (is_access && (it->title_label || it->subtitle_label))
522      {
523         if (!_access_object_get(it, TITLE_ACCESS_PART))
524           {
525              eo = elm_layout_edje_get(VIEW(it));
526              ao =_elm_access_edje_object_part_object_register(WIDGET(it), eo,
527                                                             TITLE_ACCESS_PART);
528             _elm_access_text_set(_elm_access_info_get(ao),
529                                 ELM_ACCESS_TYPE, E_("Title"));
530             _elm_access_callback_set(_elm_access_info_get(ao),
531                                      ELM_ACCESS_INFO, _access_info_cb, it);
532             /* to access title access object, any idea? */
533             it->base->access_obj = ao;
534          }
535      }
536    else
537      {
538         /* to access title access object, any idea? */
539         ao = it->base->access_obj;
540         if (!ao) return;
541
542         if (it->title_label || it->subtitle_label)
543           _elm_access_edje_object_part_object_unregister
544              (WIDGET(it), elm_layout_edje_get(VIEW(it)), TITLE_ACCESS_PART);
545         evas_object_del(ao);
546      }
547 }
548
549 EOLIAN static void
550 _elm_naviframe_item_elm_widget_item_part_text_set(Eo *eo_it EINA_UNUSED,
551                                                   Elm_Naviframe_Item_Data *it,
552                                                   const char *part,
553                                                   const char *label)
554 {
555    Elm_Naviframe_Item_Data *nit = it;
556    Elm_Naviframe_Text_Item_Pair *pair = NULL;
557    char buf[1024];
558
559    if ((!part) || (!strcmp(part, "default")) ||
560        (!strcmp(part, TITLE_PART)))
561      {
562         eina_stringshare_replace(&nit->title_label, label);
563         if (label)
564           elm_object_signal_emit(VIEW(it), "elm,state,title_label,show", "elm");
565         else
566           elm_object_signal_emit(VIEW(it), "elm,state,title_label,hide", "elm");
567         elm_object_part_text_set(VIEW(it), TITLE_PART, label);
568      }
569    else if ((!strcmp(part, "subtitle")) || (!strcmp(part, SUBTITLE_PART)))
570      {
571         eina_stringshare_replace(&nit->subtitle_label, label);
572         if (label)
573           elm_object_signal_emit(VIEW(it), "elm,state,subtitle,show", "elm");
574         else
575           elm_object_signal_emit(VIEW(it), "elm,state,subtitle,hide", "elm");
576         elm_object_part_text_set(VIEW(it), SUBTITLE_PART, label);
577      }
578    else
579      {
580         EINA_INLIST_FOREACH(nit->text_list, pair)
581           if (!strcmp(part, pair->part)) break;
582
583         if (!pair)
584           {
585              pair = ELM_NEW(Elm_Naviframe_Text_Item_Pair);
586              if (!pair)
587                {
588                   ERR("Failed to allocate new text part of the item! : naviframe=%p",
589                   WIDGET(it));
590                   return;
591                }
592              eina_stringshare_replace(&pair->part, part);
593              nit->text_list = eina_inlist_append(nit->text_list,
594                                                  EINA_INLIST_GET(pair));
595           }
596         if (label)
597           snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
598         else
599           snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
600         elm_object_signal_emit(VIEW(it), buf, "elm");
601         elm_object_part_text_set(VIEW(it), part, label);
602      }
603
604    /* access */
605    if (_elm_config->access_mode)
606      _access_obj_process(nit, EINA_TRUE);
607
608    memset(buf, 0x0, sizeof(buf));
609    if (nit->title_label)
610      strncat(buf, nit->title_label, sizeof(buf) - 1);
611    if (nit->subtitle_label)
612      {
613         if (nit->title_label) strncat(buf, " ", 1);
614         strncat(buf, nit->subtitle_label, sizeof(buf) - strlen(buf) - 2);
615      }
616    char *plain_text = _elm_util_mkup_to_text(buf);
617    eo_do(VIEW(it), elm_interface_atspi_accessible_name_set(plain_text));
618    free(plain_text);
619
620    elm_layout_sizing_eval(WIDGET(nit));
621 }
622
623 EOLIAN static const char *
624 _elm_naviframe_item_elm_widget_item_part_text_get(Eo *nit EINA_UNUSED,
625                                              Elm_Naviframe_Item_Data *it,
626                                              const char *part)
627 {
628    char buf[1024];
629
630    if (!part || !strcmp(part, "default"))
631      snprintf(buf, sizeof(buf), TITLE_PART);
632    else if (!strcmp("subtitle", part))
633      snprintf(buf, sizeof(buf), SUBTITLE_PART);
634    else
635      snprintf(buf, sizeof(buf), "%s", part);
636
637    return elm_object_part_text_get(VIEW(it), buf);
638 }
639
640 EOLIAN static void
641 _elm_naviframe_item_eo_base_destructor(Eo *eo_item, Elm_Naviframe_Item_Data *it)
642 {
643    Eina_List *l;
644    Elm_Naviframe_Op *nfo;
645    Elm_Naviframe_Item_Data *nit = it, *prev_it = NULL;
646    Eina_Bool top;
647
648    ELM_NAVIFRAME_DATA_GET(WIDGET(nit), sd);
649
650    nit->delete_me = EINA_TRUE;
651
652    top = (eo_item == elm_naviframe_top_item_get(WIDGET(nit)));
653    if (evas_object_data_get(VIEW(nit), "out_of_list"))
654      goto end;
655
656    sd->stack = eina_inlist_remove(sd->stack, EINA_INLIST_GET(nit));
657
658    if (top && !sd->on_deletion) /* must raise another one */
659      {
660         if (sd->stack && sd->stack->last)
661           prev_it = EINA_INLIST_CONTAINER_GET(sd->stack->last,
662                                               Elm_Naviframe_Item_Data);
663         if (!prev_it)
664           {
665              elm_widget_tree_unfocusable_set(VIEW(nit), EINA_TRUE);
666              goto end;
667           }
668
669         elm_widget_tree_unfocusable_set(VIEW(prev_it), EINA_FALSE);
670         elm_widget_tree_unfocusable_set(VIEW(nit), EINA_TRUE);
671
672         if (sd->freeze_events)
673           evas_object_freeze_events_set(VIEW(prev_it), EINA_FALSE);
674         _resize_object_reset(WIDGET(prev_it), prev_it);
675         evas_object_show(VIEW(prev_it));
676
677         _prev_page_focus_recover(prev_it);
678
679         //TIZEN ONLY(20161208): Support tizen transition
680         //elm_object_signal_emit(VIEW(prev_it), "elm,state,visible", "elm");
681         if (_tizen_effect_enabled_get(nit))
682           nf_mod->tizen_effect_cancel(VIEW(nit));
683
684         if (_tizen_effect_enabled_get(prev_it))
685           nf_mod->tizen_effect_cancel(VIEW(prev_it));
686         else
687           elm_object_signal_emit(VIEW(prev_it), "elm,state,visible", "elm");
688         //
689
690         eo_do(WIDGET(prev_it), eo_event_callback_call(ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED, EO_OBJ(prev_it)));
691      }
692
693 end:
694    // This should not happen, but just in case and by security
695    // make sure there is no more reference to this item.
696    EINA_LIST_FOREACH(sd->ops, l, nfo)
697      {
698         /* If an item is newly pushed and then deleted by elm_object_item_del()
699          * before item push transition is not started, then the item push
700          * transitions for both new item and current item should be cancelled.
701          * Otherwise, the current item becomes invisible due to the item push
702          * transition. */
703         if ((nit->pushing) && (nfo->self == nit))
704           {
705              nfo->self = NULL;
706              nfo->related = NULL;
707           }
708         else
709           {
710              if (nfo->self == nit)
711                nfo->self = NULL;
712              if (nfo->related == nit)
713                nfo->related = NULL;
714           }
715      }
716
717    _item_free(nit);
718
719    eo_do_super(eo_item, ELM_NAVIFRAME_ITEM_CLASS, eo_destructor());
720 }
721
722 static void
723 _item_content_set(Elm_Naviframe_Item_Data *it,
724                   Evas_Object *content)
725 {
726    if (it->content == content) return;
727
728    evas_object_del(it->content);
729    it->content = content;
730
731    if (!content) return;
732
733    elm_object_part_content_set(VIEW(it), CONTENT_PART, content);
734    elm_object_signal_emit(VIEW(it), "elm,state,content,show", "elm");
735
736    evas_object_event_callback_add
737      (content, EVAS_CALLBACK_DEL, _item_content_del_cb, it);
738 }
739
740 static void
741 _item_title_prev_btn_set(Elm_Naviframe_Item_Data *it,
742                          Evas_Object *btn)
743 {
744    if (it->title_prev_btn == btn) return;
745    evas_object_del(it->title_prev_btn);
746    it->title_prev_btn = btn;
747    if (it->auto_pushed_btn && (it->auto_pushed_btn != btn))
748      it->auto_pushed_btn = NULL;
749    if (!btn) return;
750
751    elm_object_part_content_set(VIEW(it), PREV_BTN_PART, btn);
752    elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,show", "elm");
753    evas_object_event_callback_add
754      (btn, EVAS_CALLBACK_DEL, _item_title_prev_btn_del_cb, it);
755
756    //TIZEN ONLY(20161207): add reading text of back button
757    if (!elm_layout_text_get(btn, NULL))
758      {
759         if(_elm_config->atspi_mode)
760           eo_do(btn, elm_interface_atspi_accessible_name_set(N_("Navigate back")));
761      }
762    //
763
764    //FIXME: set back button callback here after elm 2.0
765 }
766
767 static void
768 _item_title_next_btn_set(Elm_Naviframe_Item_Data *it,
769                          Evas_Object *btn)
770 {
771    if (it->title_next_btn == btn) return;
772    evas_object_del(it->title_next_btn);
773    it->title_next_btn = btn;
774    if (!btn) return;
775
776    elm_object_part_content_set(VIEW(it), NEXT_BTN_PART, btn);
777    elm_object_signal_emit(VIEW(it), "elm,state,next_btn,show", "elm");
778
779    evas_object_event_callback_add
780      (btn, EVAS_CALLBACK_DEL, _item_title_next_btn_del_cb, it);
781 }
782
783 static void
784 _item_title_icon_set(Elm_Naviframe_Item_Data *it,
785                      Evas_Object *icon)
786 {
787    if (it->title_icon == icon) return;
788    evas_object_del(it->title_icon);
789    it->title_icon = icon;
790    if (!icon) return;
791
792    elm_object_part_content_set(VIEW(it), ICON_PART, icon);
793    elm_object_signal_emit(VIEW(it), "elm,state,icon,show", "elm");
794
795    evas_object_event_callback_add
796      (icon, EVAS_CALLBACK_DEL, _item_title_icon_del_cb, it);
797 }
798
799 static Evas_Object *
800 _item_content_unset(Elm_Naviframe_Item_Data *it)
801 {
802    Evas_Object *content = it->content;
803
804    if (!content) return NULL;
805
806    elm_object_part_content_unset(VIEW(it), CONTENT_PART);
807    elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
808
809    evas_object_event_callback_del
810      (content, EVAS_CALLBACK_DEL, _item_content_del_cb);
811
812    it->content = NULL;
813    return content;
814 }
815
816 static Evas_Object *
817 _item_title_prev_btn_unset(Elm_Naviframe_Item_Data *it)
818 {
819    Evas_Object *content = it->title_prev_btn;
820
821    if (!content) return NULL;
822
823    elm_object_part_content_unset(VIEW(it), PREV_BTN_PART);
824    elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
825
826    evas_object_event_callback_del
827      (content, EVAS_CALLBACK_DEL, _item_title_prev_btn_del_cb);
828    Eo* parent = eo_do_ret(content, parent, eo_parent_get());
829    eo_do(content, eo_event_callback_del(
830             EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_item_back_btn_clicked,
831             parent));
832    it->title_prev_btn = NULL;
833    if (it->auto_pushed_btn) it->auto_pushed_btn = NULL;
834    return content;
835 }
836
837 static Evas_Object *
838 _item_title_next_btn_unset(Elm_Naviframe_Item_Data *it)
839 {
840    Evas_Object *content = it->title_next_btn;
841
842    if (!content) return NULL;
843
844    elm_object_part_content_unset(VIEW(it), NEXT_BTN_PART);
845    elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
846
847    evas_object_event_callback_del
848      (content, EVAS_CALLBACK_DEL, _item_title_next_btn_del_cb);
849
850    it->title_next_btn = NULL;
851    return content;
852 }
853
854 static Evas_Object *
855 _item_title_icon_unset(Elm_Naviframe_Item_Data *it)
856 {
857    Evas_Object *content = it->title_icon;
858
859    if (!content) return NULL;
860
861    elm_object_part_content_unset(VIEW(it), ICON_PART);
862    elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
863
864    evas_object_event_callback_del
865      (content, EVAS_CALLBACK_DEL, _item_title_icon_del_cb);
866
867    it->title_icon = NULL;
868    return content;
869 }
870
871 /* since we have each item as layout, we can't reusing the layout's
872  * aliasing, so let's do it ourselves */
873 static void
874 _part_aliasing_eval(const char **part)
875 {
876    if (!*part || !strcmp(*part, "default"))
877      *part = CONTENT_PART;
878    else if (!strcmp(*part, "prev_btn"))
879      *part = PREV_BTN_PART;
880    else if (!strcmp(*part, "next_btn"))
881      *part = NEXT_BTN_PART;
882    else if (!strcmp(*part, "icon"))
883      *part = ICON_PART;
884 }
885
886 static void
887 _title_content_set(Elm_Naviframe_Item_Data *it,
888                    const char *part,
889                    Evas_Object *content)
890 {
891    Elm_Naviframe_Content_Item_Pair *pair = NULL;
892    char buf[1024];
893
894    EINA_INLIST_FOREACH(it->content_list, pair)
895      if (!strcmp(part, pair->part)) break;
896    if (pair)
897      {
898         if (pair->content == content) return;
899         if (pair->content)
900           evas_object_event_callback_del(pair->content,
901                                          EVAS_CALLBACK_DEL,
902                                          _title_content_del);
903         if (content) elm_object_part_content_set(VIEW(it), part, content);
904      }
905    else
906      {
907         if (!content) return;
908
909         //Remove the pair if new content was swallowed into other part.
910         EINA_INLIST_FOREACH(it->content_list, pair)
911           {
912              if (pair->content == content)
913                {
914                   eina_stringshare_del(pair->part);
915                   it->content_list = eina_inlist_remove(it->content_list,
916                                                         EINA_INLIST_GET(pair));
917                   evas_object_event_callback_del(pair->content,
918                                                  EVAS_CALLBACK_DEL,
919                                                  _title_content_del);
920                   free(pair);
921                   break;
922                }
923           }
924
925         //New pair
926         pair = ELM_NEW(Elm_Naviframe_Content_Item_Pair);
927         if (!pair)
928           {
929              ERR("Failed to allocate new content part of the item! : naviframe=%p",
930              WIDGET(it));
931              return;
932           }
933         pair->it = it;
934         eina_stringshare_replace(&pair->part, part);
935         it->content_list = eina_inlist_append(it->content_list,
936                                               EINA_INLIST_GET(pair));
937         elm_object_part_content_set(VIEW(it), part, content);
938         snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
939         elm_object_signal_emit(VIEW(it), buf, "elm");
940      }
941    pair->content = content;
942    evas_object_event_callback_add(content,
943                                   EVAS_CALLBACK_DEL,
944                                   _title_content_del,
945                                   pair);
946 }
947
948 EOLIAN static void
949 _elm_naviframe_item_elm_widget_item_part_content_set(Eo *eo_nit EINA_UNUSED,
950                                                      Elm_Naviframe_Item_Data *nit,
951                                                      const char *part,
952                                                      Evas_Object *content)
953 {
954    _part_aliasing_eval(&part);
955
956    //specified parts
957    if (!strcmp(part, CONTENT_PART))
958      _item_content_set(nit, content);
959    else if (!strcmp(part, PREV_BTN_PART))
960      _item_title_prev_btn_set(nit, content);
961    else if (!strcmp(part, NEXT_BTN_PART))
962      _item_title_next_btn_set(nit, content);
963    else if (!strcmp(part, ICON_PART))
964      _item_title_icon_set(nit, content);
965    else
966      _title_content_set(nit, part, content);
967
968    elm_layout_sizing_eval(WIDGET(nit));
969 }
970
971 EOLIAN static Evas_Object *
972 _elm_naviframe_item_elm_widget_item_part_content_get(Eo *eo_nit EINA_UNUSED,
973                                                      Elm_Naviframe_Item_Data *nit,
974                                                      const char *part)
975 {
976    _part_aliasing_eval(&part);
977
978    //specified parts
979    if (!strcmp(part, CONTENT_PART))
980      return nit->content;
981    else if (!strcmp(part, PREV_BTN_PART))
982      return nit->title_prev_btn;
983    else if (!strcmp(part, NEXT_BTN_PART))
984      return nit->title_next_btn;
985    else if (!strcmp(part, ICON_PART))
986      return nit->title_icon;
987
988    //common parts
989    return elm_object_part_content_get(VIEW(nit), part);
990 }
991
992 static Evas_Object *
993 _title_content_unset(Elm_Naviframe_Item_Data *it, const char *part)
994 {
995    Elm_Naviframe_Content_Item_Pair *pair = NULL;
996    char buf[1028];
997    Evas_Object *content = NULL;
998
999    EINA_INLIST_FOREACH(it->content_list, pair)
1000      {
1001         if (!strcmp(part, pair->part))
1002           {
1003              content = pair->content;
1004              eina_stringshare_del(pair->part);
1005              it->content_list = eina_inlist_remove(it->content_list,
1006                                                    EINA_INLIST_GET(pair));
1007              free(pair);
1008              break;
1009           }
1010      }
1011
1012    if (!content) return NULL;
1013
1014    elm_object_part_content_unset(VIEW(it), part);
1015    snprintf(buf, sizeof(buf), "elm,state,%s,hide", part);
1016    elm_object_signal_emit(VIEW(it), buf, "elm");
1017    evas_object_event_callback_del(content,
1018                                   EVAS_CALLBACK_DEL,
1019                                   _title_content_del);
1020    return content;
1021 }
1022
1023 EOLIAN static Evas_Object *
1024 _elm_naviframe_item_elm_widget_item_part_content_unset(Eo *eo_nit EINA_UNUSED,
1025                                                   Elm_Naviframe_Item_Data *nit,
1026                                                   const char *part)
1027 {
1028    Evas_Object *o = NULL;
1029
1030    _part_aliasing_eval(&part);
1031
1032    //specified parts
1033    if (!strcmp(part, CONTENT_PART))
1034      o = _item_content_unset(nit);
1035    else if (!strcmp(part, PREV_BTN_PART))
1036      o = _item_title_prev_btn_unset(nit);
1037    else if (!strcmp(part, NEXT_BTN_PART))
1038      o = _item_title_next_btn_unset(nit);
1039    else if (!strcmp(part, ICON_PART))
1040      o = _item_title_icon_unset(nit);
1041    else
1042      o = _title_content_unset(nit, part);
1043
1044    elm_layout_sizing_eval(WIDGET(nit));
1045
1046    return o;
1047 }
1048
1049 EOLIAN static void
1050 _elm_naviframe_item_elm_widget_item_signal_emit(Eo *eo_it EINA_UNUSED,
1051                                                 Elm_Naviframe_Item_Data *it,
1052                                                 const char *emission,
1053                                                 const char *source)
1054 {
1055    elm_object_signal_emit(VIEW(it), emission, source);
1056 }
1057
1058 EOLIAN static void
1059 _elm_naviframe_elm_layout_sizing_eval(Eo *obj, Elm_Naviframe_Data *sd)
1060 {
1061    Evas_Coord minw = -1, minh = -1;
1062    Elm_Naviframe_Item_Data *it, *top;
1063    Evas_Coord x, y, w, h;
1064
1065    if (sd->on_deletion) return;
1066    if (!sd->stack) return;
1067
1068    top = (EINA_INLIST_CONTAINER_GET(sd->stack->last, Elm_Naviframe_Item_Data));
1069    evas_object_geometry_get(obj, &x, &y, &w, &h);
1070    EINA_INLIST_FOREACH(sd->stack, it)
1071      {
1072         evas_object_move(VIEW(it), x, y);
1073         evas_object_resize(VIEW(it), w, h);
1074
1075         if (it == top)
1076           {
1077              edje_object_size_min_calc(elm_layout_edje_get(VIEW(it)),
1078                                        &it->minw, &it->minh);
1079              minw = it->minw;
1080              minh = it->minh;
1081           }
1082      }
1083
1084    evas_object_size_hint_min_set(obj, minw, minh);
1085    evas_object_size_hint_max_set(obj, -1, -1);
1086 }
1087
1088 static Eina_Bool
1089 _on_item_back_btn_clicked(void *data,
1090       Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
1091 {
1092    /* Since edje has the event queue, clicked event could be happened
1093       multiple times on some heavy environment. This callback del will
1094       prevent those scenario and guarantee only one clicked for it's own
1095       page. */
1096    eo_do(obj, eo_event_callback_del(
1097             EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED,  _on_item_back_btn_clicked,
1098             data));
1099    elm_naviframe_item_pop(data);
1100
1101    return EINA_TRUE;
1102 }
1103
1104 static Evas_Object *
1105 _back_btn_new(Evas_Object *obj, const char *title_label)
1106 {
1107    Evas_Object *btn, *ed;
1108    char buf[1024];
1109
1110    btn = elm_button_add(obj);
1111
1112    if (!btn) return NULL;
1113    eo_do(btn, eo_event_callback_add
1114          (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_item_back_btn_clicked, obj));
1115    snprintf
1116      (buf, sizeof(buf), "naviframe/back_btn/%s", elm_widget_style_get(obj));
1117    elm_object_style_set(btn, buf);
1118    if (title_label)
1119      elm_layout_text_set(btn, NULL, title_label);
1120    else
1121      elm_object_domain_translatable_text_set(btn, PACKAGE, N_("Back"));
1122
1123    /* HACK NOTE: this explicit check only exists to avoid an ERR()
1124     * message from elm_layout_content_set().
1125     *
1126     * The button was ALWAYS supposed to support an elm.swallow.content, but
1127     * default naviframe/back_btn/default theme did not provide such, then
1128     * old themes would emit such error message.
1129     *
1130     * Once we can break the theme API, remove this check and always
1131     * set an icon.
1132     */
1133    ed = elm_layout_edje_get(btn);
1134    if (edje_object_part_exists(ed, CONTENT_PART))
1135      {
1136         Evas_Object *ico = elm_icon_add(btn);
1137         elm_icon_standard_set(ico, "arrow_left");
1138         elm_layout_content_set(btn, CONTENT_PART, ico);
1139      }
1140
1141    if(_elm_config->atspi_mode)
1142      eo_do(btn, elm_interface_atspi_accessible_name_set(N_("Navigate back")));
1143
1144    return btn;
1145 }
1146
1147 EOLIAN static void
1148 _elm_naviframe_elm_layout_signal_emit(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *emission, const char *source)
1149 {
1150    Elm_Object_Item *eo_top_it;
1151
1152    eo_top_it = elm_naviframe_top_item_get(obj);
1153    if (!eo_top_it) return;
1154    ELM_NAVIFRAME_ITEM_DATA_GET(eo_top_it, top_it);
1155
1156    eo_do(VIEW(top_it), elm_obj_layout_signal_emit(emission, source));
1157 }
1158
1159 /* content/text smart functions proxying things to the top item, which
1160  * is the resize object of the layout */
1161 EOLIAN static Eina_Bool
1162 _elm_naviframe_elm_layout_text_set(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part, const char *label)
1163 {
1164    Elm_Object_Item *it;
1165    const char *text = NULL;
1166
1167    it = elm_naviframe_top_item_get(obj);
1168    if (!it) return EINA_FALSE;
1169
1170    elm_object_item_part_text_set(it, part, label);
1171    text = elm_object_item_part_text_get(it, part);
1172    if ((text) && !strcmp(text, label))
1173      return EINA_TRUE;
1174    return EINA_FALSE;
1175 }
1176
1177 EOLIAN static const char*
1178 _elm_naviframe_elm_layout_text_get(const Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part)
1179 {
1180    Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
1181    if (!it) return NULL;
1182
1183    return elm_object_item_part_text_get(it, part);
1184 }
1185
1186 /* we have to keep a "manual" set here because of the callbacks on the
1187  * children */
1188 EOLIAN static Eina_Bool
1189 _elm_naviframe_elm_container_content_set(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part, Evas_Object *content)
1190 {
1191    Elm_Object_Item *it;
1192
1193    it = elm_naviframe_top_item_get(obj);
1194    if (!it) return EINA_FALSE;
1195
1196    elm_object_item_part_content_set(it, part, content);
1197
1198    if (content == elm_object_item_part_content_get(it, part))
1199      return EINA_TRUE;
1200
1201    return EINA_FALSE;
1202 }
1203
1204 EOLIAN static Evas_Object*
1205 _elm_naviframe_elm_container_content_get(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part)
1206 {
1207    Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
1208
1209    if (!it) return NULL;
1210
1211    return elm_object_item_part_content_get(it, part);
1212 }
1213
1214 EOLIAN static Evas_Object*
1215 _elm_naviframe_elm_container_content_unset(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part)
1216 {
1217    Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
1218
1219    if (!it) return NULL;
1220
1221    return elm_object_item_part_content_unset(it, part);
1222 }
1223
1224 static void
1225 _on_item_title_clicked(void *data,
1226                        Evas_Object *obj EINA_UNUSED,
1227                        const char *emission EINA_UNUSED,
1228                        const char *source EINA_UNUSED)
1229 {
1230    Elm_Naviframe_Item_Data *it = data;
1231
1232    eo_do(WIDGET(it), eo_event_callback_call(ELM_NAVIFRAME_EVENT_TITLE_CLICKED,  EO_OBJ(it)));
1233 }
1234
1235 /* "elm,state,cur,pushed"
1236  */
1237 static void
1238 _on_item_push_finished(void *data,
1239                        Evas_Object *obj EINA_UNUSED,
1240                        const char *emission EINA_UNUSED,
1241                        const char *source EINA_UNUSED)
1242 {
1243    Elm_Naviframe_Item_Data *it = data;
1244
1245    if (!it) return;
1246
1247    ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
1248
1249    evas_object_hide(VIEW(it));
1250    //TIZEN_ONLY(20161122): add state_notify api
1251    if (_elm_atspi_enabled())
1252       eo_do(VIEW(it), elm_interface_atspi_accessible_state_notify(
1253             ATSPI_STATE(ELM_ATSPI_STATE_SHOWING) | ATSPI_STATE(ELM_ATSPI_STATE_VISIBLE), EINA_TRUE));
1254    //
1255
1256    //TIZEN ONLY(20161208): Support tizen transition
1257    //elm_object_signal_emit(VIEW(it), "elm,state,invisible", "elm");
1258    if (!_tizen_effect_enabled_get(it))
1259      elm_object_signal_emit(VIEW(it), "elm,state,invisible", "elm");
1260    //
1261
1262    if (sd->freeze_events)
1263      evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
1264 }
1265
1266 /* "elm,state,cur,popped"
1267  */
1268 static void
1269 _on_item_pop_finished(void *data,
1270                       Evas_Object *obj EINA_UNUSED,
1271                       const char *emission EINA_UNUSED,
1272                       const char *source EINA_UNUSED)
1273 {
1274    Elm_Naviframe_Item_Data *it = data;
1275    Elm_Naviframe_Item_Data *prev_it = NULL;
1276    Eo *widget = WIDGET(it);
1277
1278    ELM_NAVIFRAME_DATA_GET(widget, sd);
1279
1280    if (sd->stack && sd->stack->last)
1281      {
1282         prev_it = EINA_INLIST_CONTAINER_GET
1283            (sd->stack->last, Elm_Naviframe_Item_Data);
1284         /* TIZEN_ONLY(20161229): resize prev item before raise.
1285         _resize_object_reset(WIDGET(it), prev_it);
1286          */
1287         evas_object_raise(VIEW(prev_it));
1288         /*   END   */
1289      }
1290
1291    if (sd->preserve)
1292      elm_widget_tree_unfocusable_set(VIEW(it), EINA_FALSE);
1293    sd->popping = eina_list_remove(sd->popping, it);
1294
1295    eo_do(EO_OBJ(it), elm_wdg_item_del());
1296
1297    //TIZEN_ONLY(20161122): add state_notify api
1298    Eo *eo_top = elm_naviframe_top_item_get(widget);
1299    if (eo_top)
1300      {
1301         ELM_NAVIFRAME_ITEM_DATA_GET(eo_top, top);
1302         _elm_win_default_label_obj_append(VIEW(top));
1303
1304         if (_elm_atspi_enabled())
1305           {
1306              eo_do(VIEW(top), elm_interface_atspi_accessible_state_notify(
1307                    ATSPI_STATE(ELM_ATSPI_STATE_SHOWING) | ATSPI_STATE(ELM_ATSPI_STATE_VISIBLE), EINA_TRUE));
1308           }
1309      }
1310    //
1311 }
1312
1313 /* "elm,state,new,pushed",
1314  * "elm,state,prev,popped
1315  */
1316 static void
1317 _on_item_show_finished(void *data,
1318                        Evas_Object *obj EINA_UNUSED,
1319                        const char *emission EINA_UNUSED,
1320                        const char *source EINA_UNUSED)
1321 {
1322    Elm_Naviframe_Item_Data *it = data;
1323
1324    ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
1325
1326    //TIZEN ONLY(20161208): Support tizen transition
1327    //elm_object_signal_emit(VIEW(it), "elm,state,visible", "elm");
1328    if (!_tizen_effect_enabled_get(it))
1329      elm_object_signal_emit(VIEW(it), "elm,state,visible", "elm");
1330    //
1331
1332    /* TIZEN_ONLY(20170811): Set focus to new item view immediately when new item is pushed to show keypad fast. */
1333    //elm_widget_tree_unfocusable_set(VIEW(it), EINA_FALSE);
1334    if (!it->pushing)
1335      elm_widget_tree_unfocusable_set(VIEW(it), EINA_FALSE);
1336    /* END */
1337    _prev_page_focus_recover(it);
1338
1339    if (sd->freeze_events)
1340      evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
1341
1342    it->pushing = EINA_FALSE;
1343
1344    eo_do(WIDGET(it), eo_event_callback_call(ELM_NAVIFRAME_EVENT_TRANSITION_FINISHED, EO_OBJ(it)));
1345
1346    if (EO_OBJ(it) == elm_naviframe_top_item_get(WIDGET(it)))
1347      {
1348         eo_do(WIDGET(it), eo_event_callback_call(ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED, EO_OBJ(it)));
1349         //TIZEN_ONLY(20170919): Handle default label object
1350         _elm_win_default_label_obj_append(VIEW(it));
1351         //
1352      }
1353 }
1354
1355 static void
1356 _on_item_size_hints_changed(void *data,
1357                             Evas *e EINA_UNUSED,
1358                             Evas_Object *obj EINA_UNUSED,
1359                             void *event_info EINA_UNUSED)
1360 {
1361    elm_layout_sizing_eval(data);
1362 }
1363
1364 static void
1365 _item_dispmode_set(Elm_Naviframe_Item_Data *it, Evas_Display_Mode dispmode)
1366 {
1367    if (it->dispmode == dispmode) return;
1368    switch (dispmode)
1369      {
1370       case EVAS_DISPLAY_MODE_COMPRESS:
1371          elm_object_signal_emit(VIEW(it), "elm,state,display,compress", "elm");
1372          break;
1373       default:
1374          elm_object_signal_emit(VIEW(it), "elm,state,display,default", "elm");
1375          break;
1376      }
1377    it->dispmode = dispmode;
1378 }
1379
1380 static char *
1381 _access_prev_btn_info_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
1382 {
1383    return strdup(E_("Back"));
1384 }
1385
1386 EOLIAN static Eo *
1387 _elm_naviframe_item_eo_base_constructor(Eo *eo_item, Elm_Naviframe_Item_Data *it)
1388 {
1389    eo_item = eo_do_super_ret(eo_item, ELM_NAVIFRAME_ITEM_CLASS, eo_item, eo_constructor());
1390    it->base = eo_data_scope_get(eo_item, ELM_WIDGET_ITEM_CLASS);
1391
1392    return eo_item;
1393 }
1394
1395 static Elm_Object_Item *
1396 _item_new(Evas_Object *obj,
1397           const Elm_Object_Item *eo_prev_it,
1398           const char *title_label,
1399           Evas_Object *prev_btn,
1400           Evas_Object *next_btn,
1401           Evas_Object *content,
1402           const char *item_style)
1403 {
1404    Eo *eo_item;
1405
1406    ELM_NAVIFRAME_DATA_GET(obj, sd);
1407
1408    eo_item = eo_add(ELM_NAVIFRAME_ITEM_CLASS, obj);
1409
1410    if (!eo_item)
1411      {
1412         ERR("Failed to allocate new item! : naviframe=%p", obj);
1413         return NULL;
1414      }
1415
1416    ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
1417
1418    //item base layout
1419    VIEW(it) = elm_layout_add(obj);
1420    eo_do(VIEW(it), elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_PAGE_TAB));
1421    char *plain_text = _elm_util_mkup_to_text((char*)title_label);
1422    eo_do(VIEW(it), elm_interface_atspi_accessible_name_set(plain_text));
1423    free(plain_text);
1424
1425    evas_object_smart_member_add(VIEW(it), obj);
1426
1427    if (!elm_widget_sub_object_add(obj, VIEW(it)))
1428      ERR("could not add %p as sub object of %p", VIEW(it), obj);
1429
1430    evas_object_event_callback_add
1431      (VIEW(it), EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1432      _on_item_size_hints_changed, obj);
1433
1434    elm_object_signal_callback_add
1435      (VIEW(it), "elm,action,show,finished", "*", _on_item_show_finished, it);
1436    elm_object_signal_callback_add
1437      (VIEW(it), "elm,action,pushed,finished", "*", _on_item_push_finished, it);
1438    elm_object_signal_callback_add
1439      (VIEW(it), "elm,action,popped,finished", "*", _on_item_pop_finished, it);
1440    elm_object_signal_callback_add
1441      (VIEW(it), "elm,action,title,transition,finished", "*", _on_item_title_transition_finished, it);
1442    elm_object_signal_callback_add
1443      (VIEW(it), "elm,action,title,clicked", "*", _on_item_title_clicked, it);
1444
1445    _item_style_set(it, item_style);
1446
1447    if (title_label)
1448      eo_do(eo_item, elm_wdg_item_part_text_set(TITLE_PART, title_label));
1449
1450    //title buttons
1451    if ((!prev_btn) && sd->auto_pushed && eo_prev_it)
1452      {
1453         ELM_NAVIFRAME_ITEM_DATA_GET(eo_prev_it, prev_it);
1454         const char *prev_title = prev_it->title_label;
1455         prev_btn = _back_btn_new(obj, prev_title);
1456         it->auto_pushed_btn = prev_btn;
1457         /* TIZEN_ONLY(20161031): apply color_class parent-child relationship to all widgets */
1458         _elm_widget_color_class_parent_set(it->auto_pushed_btn, VIEW(it));
1459         /* END */
1460      }
1461
1462    if (prev_btn)
1463      {
1464         eo_do(eo_item, elm_wdg_item_part_content_set(PREV_BTN_PART, prev_btn));
1465         if (!elm_layout_text_get(prev_btn, NULL))
1466           {
1467              if (!_access_info_has(prev_btn, ELM_ACCESS_INFO))
1468                {
1469                   /* set access info */
1470                   _elm_access_callback_set
1471                      (_elm_access_info_get(prev_btn), ELM_ACCESS_INFO,
1472                       _access_prev_btn_info_cb, it);
1473                }
1474           }
1475         //TIZEN ONLY(20161207): add reading text of back button
1476         if(_elm_config->atspi_mode)
1477           eo_do(prev_btn, elm_interface_atspi_accessible_name_set(N_("Navigate back")));
1478         //
1479      }
1480
1481    if (next_btn)
1482      {
1483         eo_do(eo_item, elm_wdg_item_part_content_set(NEXT_BTN_PART, next_btn));
1484
1485         if (!elm_layout_text_get(next_btn, NULL))
1486           {
1487              if (!_access_info_has(next_btn, ELM_ACCESS_INFO))
1488                {
1489                   /* set access info */
1490                   _elm_access_text_set
1491                      (_elm_access_info_get(next_btn), ELM_ACCESS_INFO, E_("Next"));
1492                }
1493           }
1494      }
1495
1496    _item_content_set(it, content);
1497    _item_dispmode_set(it, sd->dispmode);
1498
1499    it->title_enabled = EINA_TRUE;
1500
1501    return EO_OBJ(it);
1502 }
1503
1504 static void
1505 _on_obj_size_hints_changed(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
1506                            Evas_Object *obj, void *event_info EINA_UNUSED)
1507 {
1508    Elm_Naviframe_Item_Data *it;
1509    Evas_Display_Mode dispmode;
1510
1511    ELM_NAVIFRAME_DATA_GET(obj, sd);
1512
1513    dispmode = evas_object_size_hint_display_mode_get(obj);
1514    if (sd->dispmode == dispmode) return;
1515
1516    sd->dispmode = dispmode;
1517
1518    EINA_INLIST_FOREACH(sd->stack, it)
1519      _item_dispmode_set(it, dispmode);
1520 }
1521
1522 EOLIAN static Eina_Bool
1523 _elm_naviframe_elm_widget_focus_next(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, Elm_Focus_Direction dir, Evas_Object **next, Elm_Object_Item **next_item)
1524 {
1525    Evas_Object *ao;
1526
1527    Eina_List *l = NULL;
1528    Elm_Object_Item *eo_top_it;
1529    void *(*list_data_get)(const Eina_List *list);
1530
1531    Eina_Bool int_ret = EINA_FALSE;
1532
1533    eo_top_it = elm_naviframe_top_item_get(obj);
1534    if (!eo_top_it) goto end;
1535
1536    list_data_get = eina_list_data_get;
1537
1538    ELM_NAVIFRAME_ITEM_DATA_GET(eo_top_it, top_it);
1539    l = eina_list_append(l, VIEW(top_it));
1540
1541    /* access */
1542    if (_elm_config->access_mode)
1543      {
1544         ao = _access_object_get(top_it, TITLE_ACCESS_PART);
1545         if (ao) l = eina_list_append(l, ao);
1546      }
1547
1548    int_ret = elm_widget_focus_list_next_get(obj, l, list_data_get, dir, next, next_item);
1549    eina_list_free(l);
1550
1551 end:
1552    if (!int_ret &&
1553        (!(*next) || (*next == elm_object_focused_object_get(obj))))
1554      {
1555         *next = obj;
1556         int_ret = !elm_widget_focus_get(obj);
1557      }
1558
1559    return int_ret;
1560 }
1561
1562 EOLIAN static Eina_Bool
1563 _elm_naviframe_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd EINA_UNUSED)
1564 {
1565    return EINA_TRUE;
1566 }
1567
1568 EOLIAN static Eina_Bool
1569 _elm_naviframe_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd EINA_UNUSED, const Evas_Object *base, double degree, Evas_Object **direction, Elm_Object_Item **direction_item, double *weight)
1570 {
1571    Eina_Bool int_ret;
1572
1573    Eina_List *l = NULL;
1574    Elm_Object_Item *eo_top_it;
1575    void *(*list_data_get)(const Eina_List *list);
1576
1577    eo_top_it = elm_naviframe_top_item_get(obj);
1578    if (!eo_top_it) return EINA_FALSE;
1579
1580    list_data_get = eina_list_data_get;
1581
1582    ELM_NAVIFRAME_ITEM_DATA_GET(eo_top_it, top_it);
1583    l = eina_list_append(l, VIEW(top_it));
1584
1585    int_ret = elm_widget_focus_list_direction_get
1586             (obj, base, l, list_data_get, degree, direction, direction_item, weight);
1587
1588    eina_list_free(l);
1589
1590    return int_ret;
1591 }
1592
1593 //TIZEN_ONLY(20161208): add API elm_object_part_access_object_get
1594 EOLIAN static Evas_Object*
1595 _elm_naviframe_elm_widget_part_access_object_get(const Eo *obj, Elm_Naviframe_Data *_pd EINA_UNUSED, const char *part)
1596 {
1597    Elm_Object_Item *eo_top_it = NULL;
1598    eo_do(obj, eo_top_it = elm_obj_naviframe_top_item_get());
1599    if (!eo_top_it) return NULL;
1600
1601    ELM_NAVIFRAME_ITEM_DATA_GET(eo_top_it, top_it);
1602    return _access_object_get(top_it, part);
1603 }
1604 //
1605
1606 EOLIAN static void
1607 _elm_naviframe_evas_object_smart_add(Eo *obj, Elm_Naviframe_Data *priv)
1608 {
1609    ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1610    //TIZEN ONLY(20160829): Support tizen transition
1611    _nf_mod_init();
1612
1613    eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
1614    elm_widget_sub_object_parent_add(obj);
1615
1616    priv->dummy_edje = wd->resize_obj;
1617    evas_object_smart_member_add(priv->dummy_edje, obj);
1618
1619    priv->auto_pushed = _elm_config->naviframe_prev_btn_auto_pushed;
1620    priv->freeze_events = EINA_TRUE;
1621
1622    evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1623                                   _on_obj_size_hints_changed, obj);
1624    elm_widget_can_focus_set(obj, EINA_TRUE);
1625 }
1626
1627 static void
1628 _send_signal(Elm_Naviframe_Item_Data *it, const char *sig)
1629 {
1630    if (!it) return ;
1631    elm_object_signal_emit(VIEW(it), sig, "elm");
1632    edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
1633 }
1634
1635 static Eina_Bool
1636 _deferred(void *data)
1637 {
1638    Elm_Naviframe_Data *nfd = data;
1639    Elm_Naviframe_Op *nfo;
1640
1641    EINA_LIST_FREE(nfd->ops, nfo)
1642      {
1643         const char *signals_cur[] = {
1644           "elm,state,cur,popped,deferred",
1645           "elm,state,cur,pushed,deferred"
1646         };
1647         const char *signals_prev = "elm,state,prev,popped,deferred";
1648         const char *signals_new = "elm,state,new,pushed,deferred";
1649         Elm_Naviframe_Item_Data *cur;
1650         Elm_Naviframe_Item_Data *other;
1651
1652         cur = nfo->push ? nfo->related : nfo->self;
1653         other = nfo->push ? nfo->self : nfo->related;
1654
1655         //TIZEN ONLY(20161208): Support tizen transition
1656         //_send_signal(cur, signals_cur[nfo->push]);
1657         //_send_signal(other, nfo->push ? signals_new : signals_prev);
1658         if (_tizen_effect_enabled_get(cur))
1659           {
1660              if (nfo->push)
1661                {
1662                   if (nf_mod->tizen_push_deferred_effect)
1663                     nf_mod->tizen_push_deferred_effect(WIDGET(cur), VIEW(cur),
1664                                                        EINA_TRUE);
1665                }
1666              else
1667                {
1668                   if (nf_mod->tizen_pop_deferred_effect)
1669                     nf_mod->tizen_pop_deferred_effect(WIDGET(cur), VIEW(cur),
1670                                                       EINA_TRUE);
1671                }
1672           }
1673         else
1674           _send_signal(cur, signals_cur[nfo->push]);
1675
1676         if (_tizen_effect_enabled_get(other))
1677           {
1678              if (nfo->push)
1679                {
1680                   if (nf_mod->tizen_push_deferred_effect)
1681                     nf_mod->tizen_push_deferred_effect(WIDGET(other),
1682                                                        VIEW(other), EINA_FALSE);
1683                }
1684              else
1685                {
1686                   if (nf_mod->tizen_pop_deferred_effect)
1687                     nf_mod->tizen_pop_deferred_effect(WIDGET(other),
1688                                                       VIEW(other), EINA_FALSE);
1689                }
1690           }
1691         else
1692           _send_signal(other, nfo->push ? signals_new : signals_prev);
1693         //
1694
1695         free(nfo);
1696      }
1697
1698    nfd->animator = NULL;
1699    return ECORE_CALLBACK_CANCEL;
1700 }
1701
1702 EOLIAN static void
1703 _elm_naviframe_evas_object_smart_del(Eo *obj, Elm_Naviframe_Data *sd)
1704 {
1705    Elm_Naviframe_Item_Data *it;
1706    Elm_Naviframe_Op *nfo;
1707
1708    sd->on_deletion = EINA_TRUE;
1709
1710    while (sd->stack)
1711      {
1712         it = EINA_INLIST_CONTAINER_GET(sd->stack, Elm_Naviframe_Item_Data);
1713         eo_do(EO_OBJ(it), elm_wdg_item_del());
1714      }
1715
1716    //All popping items which are not called yet by animator.
1717    if (sd->animator) ecore_animator_del(sd->animator);
1718    EINA_LIST_FREE(sd->ops, nfo)
1719      free(nfo);
1720    EINA_LIST_FREE(sd->popping, it)
1721      eo_do(EO_OBJ(it), elm_wdg_item_del());
1722
1723    evas_object_del(sd->dummy_edje);
1724
1725    eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
1726 }
1727
1728 //Show only the top item view
1729 EOLIAN static void
1730 _elm_naviframe_evas_object_smart_show(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED)
1731 {
1732    Elm_Object_Item *eo_top;
1733
1734    eo_top = elm_naviframe_top_item_get(obj);
1735    ELM_NAVIFRAME_ITEM_DATA_GET(eo_top, top);
1736
1737    if (top && !top->delete_me)
1738      evas_object_show(VIEW(top));
1739 }
1740
1741 static Eina_Bool
1742 _key_action_top_item_get(Evas_Object *obj, const char *params EINA_UNUSED)
1743 {
1744    Elm_Object_Item *eo_item = NULL;
1745    eo_do(obj, eo_item = elm_obj_naviframe_top_item_get());
1746    if (!eo_item) return EINA_FALSE;
1747
1748    //FIXME: Replace this below code to elm_naviframe_item_pop() at elm 2.0.
1749    ///Leave for compatibility.
1750    ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
1751    if (it->title_prev_btn)
1752      eo_do(it->title_prev_btn, eo_event_callback_call(EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, NULL));
1753
1754    return EINA_TRUE;
1755 }
1756
1757 static Eina_Bool
1758 _key_action_item_pop(Evas_Object *obj, const char *params EINA_UNUSED)
1759 {
1760    Elm_Object_Item *eo_item = NULL;
1761    eo_item = elm_naviframe_top_item_get(obj);
1762    if (!eo_item) return EINA_FALSE;
1763
1764    ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
1765
1766    if (it->pushing || it->popping) return EINA_FALSE;
1767
1768    elm_naviframe_item_pop(obj);
1769
1770    return EINA_TRUE;
1771 }
1772
1773 EOLIAN static Eina_Bool
1774 _elm_naviframe_elm_widget_event(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
1775 {
1776    (void)src;
1777    Evas_Event_Key_Down *ev = event_info;
1778
1779    if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
1780    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
1781    if (!_elm_config_key_binding_call(obj, ev, key_actions)) return EINA_FALSE;
1782
1783    ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1784    return EINA_TRUE;
1785 }
1786
1787 EOLIAN static void
1788 _elm_naviframe_elm_widget_access(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool is_access)
1789 {
1790    Elm_Naviframe_Item_Data *it;
1791
1792    EINA_INLIST_FOREACH(sd->stack, it)
1793      _access_obj_process(it, is_access);
1794 }
1795
1796 //TIZEN_ONLY(20160822): When atspi mode is dynamically switched on/off,
1797 //register/unregister access objects accordingly.
1798 // TIZEN_ONLY(20170516): connect to at-spi dbus based on org.a11y.Status.IsEnabled property
1799 EOLIAN static void
1800 _elm_naviframe_elm_widget_screen_reader(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool is_screen_reader)
1801 {
1802    Elm_Naviframe_Item_Data *it;
1803
1804    EINA_INLIST_FOREACH(sd->stack, it)
1805      _atspi_expose_title(it, is_screen_reader);
1806
1807    //TIZEN_ONLY(20161213): apply screen_reader_changed callback
1808    evas_object_smart_callback_call(obj, SIG_ATSPI_SCREEN_READER_CHANGED, &is_screen_reader);
1809    //
1810 }
1811 //
1812 //
1813
1814 static void
1815 _item_push_helper(Elm_Naviframe_Item_Data *item)
1816 {
1817    Elm_Object_Item *eo_top_item;
1818    Evas_Object *obj = WIDGET(item);
1819    ELM_NAVIFRAME_DATA_GET(obj, sd);
1820    eo_top_item = elm_naviframe_top_item_get(obj);
1821    evas_object_show(VIEW(item));
1822
1823    ELM_NAVIFRAME_ITEM_DATA_GET(eo_top_item, top_item);
1824    if (top_item) elm_widget_focused_object_clear(VIEW(top_item));
1825    _resize_object_reset(obj, item);
1826    if (top_item)
1827      {
1828         Elm_Naviframe_Op *nfo = calloc(1, sizeof (Elm_Naviframe_Op));
1829
1830         /* TIZEN_ONLY(20170811): Set focus to new item view immediately when new item is pushed to show keypad fast. */
1831         //elm_widget_tree_unfocusable_set(VIEW(item), EINA_TRUE);
1832         elm_widget_tree_unfocusable_set(VIEW(item), EINA_FALSE);
1833         /* END */
1834         elm_widget_tree_unfocusable_set(VIEW(top_item), EINA_TRUE);
1835
1836         if (sd->freeze_events)
1837           {
1838              evas_object_freeze_events_set(VIEW(item), EINA_TRUE);
1839              evas_object_freeze_events_set(VIEW(top_item), EINA_TRUE);
1840           }
1841
1842         //TIZEN ONLY(20161208): Support tizen transition
1843         //elm_object_signal_emit(VIEW(top_item), "elm,state,cur,pushed", "elm");
1844         //elm_object_signal_emit(VIEW(item), "elm,state,new,pushed", "elm");
1845         //edje_object_message_signal_process(elm_layout_edje_get(VIEW(top_item)));
1846         //edje_object_message_signal_process(elm_layout_edje_get(VIEW(item)));
1847         if (_tizen_effect_enabled_get(top_item))
1848           {
1849              if (nf_mod->tizen_push_effect)
1850                nf_mod->tizen_push_effect(obj, VIEW(top_item), EINA_TRUE);
1851           }
1852         else
1853           {
1854              elm_object_signal_emit(VIEW(top_item), "elm,state,cur,pushed", "elm");
1855              edje_object_message_signal_process(elm_layout_edje_get(VIEW(top_item)));
1856           }
1857
1858         if (_tizen_effect_enabled_get(item))
1859           {
1860              if (nf_mod->tizen_push_effect)
1861                nf_mod->tizen_push_effect(obj, VIEW(item), EINA_FALSE);
1862           }
1863         else
1864           {
1865              elm_object_signal_emit(VIEW(item), "elm,state,new,pushed", "elm");
1866              edje_object_message_signal_process(elm_layout_edje_get(VIEW(item)));
1867           }
1868         //
1869
1870         nfo->self = item;
1871         nfo->related = top_item;
1872         nfo->push = EINA_TRUE;
1873
1874         sd->ops = eina_list_append(sd->ops, nfo);
1875         if (!sd->animator) sd->animator = ecore_animator_add(_deferred, sd);
1876
1877         if (top_item) top_item->pushing = EINA_FALSE;
1878         item->pushing = EINA_TRUE;
1879      }
1880    else
1881      {
1882         if (elm_object_focus_allow_get(VIEW(item)))
1883           elm_object_focus_set(VIEW(item), EINA_TRUE);
1884         else
1885           elm_object_focus_set(WIDGET(item), EINA_TRUE);
1886      }
1887
1888    sd->stack = eina_inlist_append(sd->stack, EINA_INLIST_GET(item));
1889
1890    if (!top_item)
1891      //TIZEN ONLY(20161208): Support tizen transition
1892      //elm_object_signal_emit(VIEW(item), "elm,state,visible", "elm");
1893      {
1894         if (!_tizen_effect_enabled_get(item))
1895           elm_object_signal_emit(VIEW(item), "elm,state,visible", "elm");
1896      }
1897    //
1898
1899    elm_layout_sizing_eval(obj);
1900
1901    if (!top_item)
1902      {
1903         eo_do(obj, eo_event_callback_call(ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED, EO_OBJ(item)));
1904         //TIZEN_ONLY(20170919): Handle default label object
1905         _elm_win_default_label_obj_append(VIEW(item));
1906         //
1907      }
1908 }
1909
1910 EAPI Evas_Object *
1911 elm_naviframe_add(Evas_Object *parent)
1912 {
1913    EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
1914    Evas_Object *obj = eo_add(MY_CLASS, parent);
1915    return obj;
1916 }
1917
1918 EOLIAN static Eo *
1919 _elm_naviframe_eo_base_constructor(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED)
1920 {
1921    obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
1922    eo_do(obj,
1923          evas_obj_type_set(MY_CLASS_NAME_LEGACY),
1924          evas_obj_smart_callbacks_descriptions_set(_smart_callbacks),
1925          elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_PAGE_TAB_LIST));
1926
1927    return obj;
1928 }
1929
1930 EOLIAN static Elm_Object_Item*
1931 _elm_naviframe_item_push(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style)
1932 {
1933    Elm_Object_Item *top_item, *eo_item;
1934
1935    top_item = elm_naviframe_top_item_get(obj);
1936    eo_item = _item_new(obj, top_item,
1937                   title_label, prev_btn, next_btn, content, item_style);
1938    ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, item);
1939    if (!item) return NULL;
1940
1941    /* TIZEN_ONLY(20160523): give the new item's view to decorate it */
1942    evas_object_smart_callback_call(obj, "item,pushed,internal", VIEW(item));
1943    /* END */
1944
1945    _item_push_helper(item);
1946    return eo_item;
1947 }
1948
1949 EOLIAN static Elm_Object_Item*
1950 _elm_naviframe_item_insert_before(Eo *obj, Elm_Naviframe_Data *sd, Elm_Object_Item *eo_before, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style)
1951 {
1952    Elm_Object_Item *eo_it;
1953    Elm_Naviframe_Item_Data *prev_it = NULL;
1954
1955    EINA_SAFETY_ON_NULL_RETURN_VAL(eo_before, NULL);
1956    ELM_NAVIFRAME_ITEM_DATA_GET(eo_before, before);
1957
1958    ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(before, NULL);
1959
1960    eo_it = eo_before;
1961    ELM_NAVIFRAME_ITEM_DATA_GET(eo_it, it);
1962    if (EINA_INLIST_GET(it)->prev)
1963      prev_it = EINA_INLIST_CONTAINER_GET(EINA_INLIST_GET(it)->prev,
1964                                          Elm_Naviframe_Item_Data);
1965    eo_it = _item_new(obj, EO_OBJ(prev_it),
1966                   title_label, prev_btn, next_btn, content, item_style);
1967    if (!eo_it) return NULL;
1968
1969    it = eo_data_scope_get(eo_it, ELM_NAVIFRAME_ITEM_CLASS);
1970
1971    /* TIZEN_ONLY(20160523): give the new item's view to decorate it */
1972    evas_object_smart_callback_call(obj, "item,pushed,internal", VIEW(it));
1973    /* END */
1974
1975    sd->stack = eina_inlist_prepend_relative
1976        (sd->stack, EINA_INLIST_GET(it),
1977        EINA_INLIST_GET(before));
1978
1979    elm_widget_tree_unfocusable_set(VIEW(it), EINA_TRUE);
1980    evas_object_hide(VIEW(it));
1981    //TIZEN ONLY(20161208): Support tizen transition
1982    //elm_object_signal_emit(VIEW(it), "elm,state,invisible", "elm");
1983    if (!_tizen_effect_enabled_get(it))
1984      elm_object_signal_emit(VIEW(it), "elm,state,invisible", "elm");
1985    //
1986
1987    elm_layout_sizing_eval(obj);
1988
1989    return eo_it;
1990 }
1991
1992 EOLIAN static Elm_Object_Item*
1993 _elm_naviframe_item_insert_after(Eo *obj, Elm_Naviframe_Data *sd, Elm_Object_Item *eo_after, const char *title_label, Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style)
1994 {
1995    Elm_Object_Item *eo_item;
1996    Eina_Bool top_inserted = EINA_FALSE;
1997
1998    EINA_SAFETY_ON_NULL_RETURN_VAL(eo_after, NULL);
1999    ELM_NAVIFRAME_ITEM_DATA_GET(eo_after, after);
2000
2001    ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(after, NULL);
2002
2003    eo_item = _item_new(obj, eo_after,
2004                   title_label, prev_btn, next_btn, content, item_style);
2005    if (!eo_item) return NULL;
2006
2007    ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
2008
2009    /* TIZEN_ONLY(20160523): give the new item's view to decorate it */
2010    evas_object_smart_callback_call(obj, "item,pushed,internal", VIEW(it));
2011    /* END */
2012
2013    if (elm_naviframe_top_item_get(obj) == eo_after) top_inserted = EINA_TRUE;
2014
2015    sd->stack = eina_inlist_append_relative
2016        (sd->stack, EINA_INLIST_GET(it),
2017        EINA_INLIST_GET(after));
2018
2019
2020    if (top_inserted)
2021      {
2022         elm_widget_focused_object_clear(VIEW(after));
2023         elm_widget_tree_unfocusable_set(VIEW(after), EINA_TRUE);
2024         _resize_object_reset(obj, it);
2025         evas_object_show(VIEW(it));
2026         evas_object_hide(VIEW(after));
2027         if (elm_object_focus_allow_get(VIEW(it)))
2028           elm_object_focus_set(VIEW(it), EINA_TRUE);
2029         else
2030           elm_object_focus_set(WIDGET(it), EINA_TRUE);
2031         //TIZEN ONLY(20161208): Support tizen transition
2032         //elm_object_signal_emit(VIEW(it), "elm,state,visible", "elm");
2033         //elm_object_signal_emit(VIEW(after), "elm,state,invisible", "elm");
2034         if (!_tizen_effect_enabled_get(it))
2035           elm_object_signal_emit(VIEW(it), "elm,state,visible", "elm");
2036
2037         if (!_tizen_effect_enabled_get(after))
2038           elm_object_signal_emit(VIEW(after), "elm,state,invisible", "elm");
2039         //
2040      }
2041    else
2042    //TIZEN ONLY(20161208): Support tizen transition
2043      //elm_object_signal_emit(VIEW(it), "elm,state,invisible", "elm");
2044      {
2045         if (!_tizen_effect_enabled_get(it))
2046           elm_object_signal_emit(VIEW(it), "elm,state,invisible", "elm");
2047      }
2048    //
2049
2050    elm_layout_sizing_eval(obj);
2051
2052    if (top_inserted)
2053      eo_do(obj, eo_event_callback_call(ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED, eo_item));
2054
2055    return eo_item;
2056 }
2057
2058 EOLIAN static Evas_Object*
2059 _elm_naviframe_item_pop(Eo *obj, Elm_Naviframe_Data *sd)
2060 {
2061    Elm_Object_Item *eo_item;
2062    Elm_Naviframe_Item_Data *prev_it = NULL;
2063    Evas_Object *content = NULL;
2064
2065    if (sd->freeze_events && sd->popping) return NULL;
2066
2067    eo_item = elm_naviframe_top_item_get(obj);
2068    if (!eo_item) return NULL;
2069
2070    ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
2071
2072    if (it->pushing || it->popping) return NULL;
2073    it->popping = EINA_TRUE;
2074
2075    evas_object_ref(obj);
2076    if (it->pop_cb)
2077      {
2078         eo_ref(eo_item);
2079         if (!it->pop_cb(it->pop_data, eo_item))
2080           {
2081              eo_unref(eo_item);
2082              if (it->delete_me)
2083                eo_do(eo_item, elm_wdg_item_del());
2084              else
2085                {
2086                   /* To avoid multiple item pops, the auto pushed button deletes
2087                      its clicked callback once it is called.
2088                      Since the item is not popped or deleted here, the deleted
2089                      callback of the auto pushed button should be restored. */
2090                   if (it->auto_pushed_btn)
2091                     eo_do(it->auto_pushed_btn, eo_event_callback_add
2092                           (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED,
2093                            _on_item_back_btn_clicked, obj));
2094                   it->popping = EINA_FALSE;
2095                }
2096              evas_object_unref(obj);
2097              return NULL;
2098           }
2099         eo_unref(eo_item);
2100      }
2101    evas_object_unref(obj);
2102
2103    if (sd->preserve)
2104      content = it->content;
2105
2106    evas_object_data_set(VIEW(it), "out_of_list", (void *)1);
2107
2108    if (sd->stack->last->prev)
2109      prev_it = EINA_INLIST_CONTAINER_GET
2110          (sd->stack->last->prev, Elm_Naviframe_Item_Data);
2111
2112    sd->stack = eina_inlist_remove(sd->stack, EINA_INLIST_GET(it));
2113
2114    if (prev_it)
2115      {
2116         Elm_Naviframe_Op *nfo = calloc(1, sizeof (Elm_Naviframe_Op));
2117
2118         elm_widget_tree_unfocusable_set(VIEW(it), EINA_TRUE);
2119
2120         if (sd->freeze_events)
2121           {
2122              evas_object_freeze_events_set(VIEW(it), EINA_TRUE);
2123              evas_object_freeze_events_set(VIEW(prev_it), EINA_TRUE);
2124           }
2125
2126         // TIZEN_ONLY(20161229): resize prev item before raise.
2127         elm_widget_resize_object_set(obj, VIEW(prev_it), EINA_FALSE);
2128         //
2129
2130         //TIZEN ONLY(20161208): Support tizen transition
2131         /* these 2 signals MUST take place simultaneously */
2132         //elm_object_signal_emit(VIEW(it), "elm,state,cur,popped", "elm");
2133         //elm_object_signal_emit(VIEW(prev_it), "elm,state,prev,popped", "elm");
2134         //edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
2135         //edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
2136         if (_tizen_effect_enabled_get(it))
2137           {
2138              if (nf_mod->tizen_pop_effect)
2139                nf_mod->tizen_pop_effect(obj, VIEW(it), EINA_TRUE);
2140           }
2141         else
2142           {
2143              elm_object_signal_emit(VIEW(it), "elm,state,cur,popped", "elm");
2144              edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
2145           }
2146
2147         if (_tizen_effect_enabled_get(prev_it))
2148           {
2149              if (nf_mod->tizen_pop_effect)
2150                nf_mod->tizen_pop_effect(obj, VIEW(prev_it), EINA_FALSE);
2151           }
2152         else
2153           {
2154              elm_object_signal_emit(VIEW(prev_it), "elm,state,prev,popped", "elm");
2155              edje_object_message_signal_process(elm_layout_edje_get(VIEW(prev_it)));
2156           }
2157         //
2158
2159         //Show hidden previous view when pop transition begins.
2160         evas_object_show(VIEW(prev_it));
2161
2162         if (!nfo) goto on_error;
2163
2164         nfo->self = it;
2165         nfo->related = prev_it;
2166         nfo->push = EINA_FALSE;
2167
2168         sd->popping = eina_list_append(sd->popping, it);
2169         sd->ops = eina_list_append(sd->ops, nfo);
2170         if (!sd->animator) sd->animator = ecore_animator_add(_deferred, sd);
2171      }
2172    else
2173      eo_do(eo_item, elm_wdg_item_del());
2174
2175  on_error:
2176    return content;
2177 }
2178
2179 EOLIAN static void
2180 _elm_naviframe_item_pop_to(Eo *eo_it, Elm_Naviframe_Item_Data *it)
2181 {
2182    Eina_Inlist *l;
2183
2184    ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
2185
2186    if (eo_it == elm_naviframe_top_item_get(WIDGET(it))) return;
2187
2188    l = sd->stack->last->prev;
2189
2190    sd->on_deletion = EINA_TRUE;
2191
2192    while (l)
2193      {
2194         Elm_Naviframe_Item_Data *iit = EINA_INLIST_CONTAINER_GET
2195             (l, Elm_Naviframe_Item_Data);
2196
2197         if (iit == it) break;
2198
2199         l = l->prev;
2200
2201         eo_do(EO_OBJ(iit), elm_wdg_item_del());
2202      }
2203
2204    sd->on_deletion = EINA_FALSE;
2205
2206    elm_naviframe_item_pop(WIDGET(it));
2207 }
2208
2209 EOLIAN static void
2210 _elm_naviframe_item_promote(Eo *eo_it, Elm_Naviframe_Item_Data *it)
2211 {
2212    Elm_Object_Item *eo_prev_top;
2213    Elm_Naviframe_Item_Data *nit = it;
2214
2215    ELM_NAVIFRAME_DATA_GET(WIDGET(nit), sd);
2216
2217    eo_prev_top = elm_naviframe_top_item_get(WIDGET(nit));
2218    if (eo_it == eo_prev_top) return;
2219
2220    sd->stack = eina_inlist_remove(sd->stack, EINA_INLIST_GET(nit));
2221    _item_push_helper(nit);
2222 }
2223
2224 EOLIAN static void
2225 _elm_naviframe_item_simple_promote(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Evas_Object *content)
2226 {
2227    Elm_Naviframe_Item_Data *itr;
2228
2229    EINA_INLIST_FOREACH(sd->stack, itr)
2230      {
2231         if (elm_object_item_content_get(EO_OBJ(itr)) == content)
2232           {
2233              elm_naviframe_item_promote(EO_OBJ(itr));
2234              break;
2235           }
2236      }
2237 }
2238
2239 EOLIAN static void
2240 _elm_naviframe_content_preserve_on_pop_set(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool preserve)
2241 {
2242    sd->preserve = !!preserve;
2243 }
2244
2245 EOLIAN static Eina_Bool
2246 _elm_naviframe_content_preserve_on_pop_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
2247 {
2248    return sd->preserve;
2249 }
2250
2251 EOLIAN static Elm_Object_Item*
2252 _elm_naviframe_top_item_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
2253 {
2254    if (!sd->stack) return NULL;
2255    Elm_Naviframe_Item_Data *ret_it = EINA_INLIST_CONTAINER_GET
2256                                 (sd->stack->last, Elm_Naviframe_Item_Data);
2257    return EO_OBJ(ret_it);
2258 }
2259
2260 EOLIAN static Elm_Object_Item*
2261 _elm_naviframe_bottom_item_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
2262 {
2263    if (!sd->stack) return NULL;
2264    Elm_Naviframe_Item_Data *ret_it = EINA_INLIST_CONTAINER_GET
2265                                 (sd->stack, Elm_Naviframe_Item_Data);
2266    return EO_OBJ(ret_it);
2267 }
2268
2269 EOLIAN static void
2270 _elm_naviframe_item_style_set(Eo *eo_item EINA_UNUSED,
2271                               Elm_Naviframe_Item_Data *nit,
2272                               const char *item_style)
2273 {
2274    if (item_style && !strcmp(item_style, nit->style)) return;
2275
2276    if (!item_style)
2277      if (!strcmp("basic", nit->style)) return;
2278
2279    _item_style_set(nit, item_style);
2280    _item_signals_emit(nit);
2281    _item_title_enabled_update(nit, EINA_FALSE);
2282 }
2283
2284 EOLIAN static const char *
2285 _elm_naviframe_item_style_get(Eo *eo_item EINA_UNUSED,
2286                               Elm_Naviframe_Item_Data *nit)
2287 {
2288    return nit->style;
2289 }
2290
2291 EINA_DEPRECATED EAPI void
2292 elm_naviframe_item_title_visible_set(Elm_Object_Item *it,
2293                                      Eina_Bool visible)
2294 {
2295    elm_naviframe_item_title_enabled_set(it, visible, EINA_FALSE);
2296 }
2297
2298 EINA_DEPRECATED EAPI Eina_Bool
2299 elm_naviframe_item_title_visible_get(const Elm_Object_Item *it)
2300 {
2301    return elm_naviframe_item_title_enabled_get(it);
2302 }
2303
2304 EOLIAN static void
2305 _elm_naviframe_item_title_enabled_set(Eo *eo_item EINA_UNUSED,
2306                                       Elm_Naviframe_Item_Data *nit,
2307                                       Eina_Bool enabled,
2308                                       Eina_Bool transition)
2309 {
2310    enabled = !!enabled;
2311    if (nit->title_enabled == enabled) return;
2312
2313    nit->title_enabled = enabled;
2314
2315    transition = !!transition;
2316    _item_title_enabled_update(nit, transition);
2317 }
2318
2319 EOLIAN static Eina_Bool
2320 _elm_naviframe_item_title_enabled_get(const Eo *eo_item EINA_UNUSED, Elm_Naviframe_Item_Data *nit)
2321 {
2322    return nit->title_enabled;
2323 }
2324
2325 EOLIAN static void
2326 _elm_naviframe_item_pop_cb_set(Eo *eo_item EINA_UNUSED,
2327                                Elm_Naviframe_Item_Data *nit,
2328                                Elm_Naviframe_Item_Pop_Cb func,
2329                                void *data)
2330 {
2331    nit->pop_cb = func;
2332    nit->pop_data = data;
2333 }
2334
2335 EOLIAN static void
2336 _elm_naviframe_prev_btn_auto_pushed_set(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool auto_pushed)
2337 {
2338    sd->auto_pushed = !!auto_pushed;
2339 }
2340
2341 EOLIAN static Eina_Bool
2342 _elm_naviframe_prev_btn_auto_pushed_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
2343 {
2344    return sd->auto_pushed;
2345 }
2346
2347 EOLIAN static Eina_List*
2348 _elm_naviframe_items_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
2349 {
2350    Eina_List *ret = NULL;
2351    Elm_Naviframe_Item_Data *itr;
2352
2353    EINA_INLIST_FOREACH(sd->stack, itr)
2354      ret = eina_list_append(ret, EO_OBJ(itr));
2355
2356    return ret;
2357 }
2358
2359 EOLIAN static void
2360 _elm_naviframe_event_enabled_set(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool enabled)
2361 {
2362    enabled = !!enabled;
2363    if (sd->freeze_events == !enabled) return;
2364    sd->freeze_events = !enabled;
2365 }
2366
2367 EOLIAN static Eina_Bool
2368 _elm_naviframe_event_enabled_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
2369 {
2370    return !sd->freeze_events;
2371 }
2372
2373 EOLIAN static Eina_Bool
2374 _elm_naviframe_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd EINA_UNUSED)
2375 {
2376    return EINA_TRUE;
2377 }
2378
2379 static void
2380 _elm_naviframe_class_constructor(Eo_Class *klass)
2381 {
2382    evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
2383 }
2384
2385 EOLIAN const Elm_Atspi_Action *
2386 _elm_naviframe_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *pd EINA_UNUSED)
2387 {
2388    static Elm_Atspi_Action atspi_actions[] = {
2389           { "top_item_get", "top_item_get", NULL, _key_action_top_item_get },
2390           { "item_pop", "item_pop", NULL, _key_action_item_pop },
2391           { NULL, NULL, NULL, NULL }
2392    };
2393    return &atspi_actions[0];
2394 }
2395
2396 //TIZEN_ONLY(20161213) Using VIEW(item) for naviframe, naviframe item accessible information
2397 EOLIAN const char*
2398 _elm_naviframe_elm_interface_atspi_accessible_name_get(Eo *eo, Elm_Naviframe_Data *pd EINA_UNUSED)
2399 {
2400    const char *ret = NULL;
2401    Elm_Object_Item *eo_top_it = NULL;
2402
2403    eo_top_it = elm_naviframe_top_item_get(eo);
2404    if (eo_top_it)
2405      {
2406         eo_do(eo_top_it, ret = elm_interface_atspi_accessible_name_get());
2407      }
2408
2409    return ret;
2410 }
2411
2412 EOLIAN const char*
2413 _elm_naviframe_elm_interface_atspi_accessible_description_get(Eo *eo, Elm_Naviframe_Data *pd EINA_UNUSED)
2414 {
2415    const char *ret = NULL;
2416    Elm_Object_Item *eo_top_it = NULL;
2417
2418    eo_top_it = elm_naviframe_top_item_get(eo);
2419    if (eo_top_it)
2420      {
2421         eo_do(eo_top_it, ret = elm_interface_atspi_accessible_description_get());
2422      }
2423
2424    return ret;
2425 }
2426
2427 EOLIAN void
2428 _elm_naviframe_item_elm_interface_atspi_accessible_name_set(Eo *eo_item EINA_UNUSED, Elm_Naviframe_Item_Data* nit, const char *name)
2429 {
2430    eo_do(VIEW(nit), elm_interface_atspi_accessible_name_set(name));
2431 }
2432
2433 EOLIAN const char*
2434 _elm_naviframe_item_elm_interface_atspi_accessible_name_get(Eo *eo_item, Elm_Naviframe_Item_Data *nit)
2435 {
2436    const char *ret = NULL;
2437    eo_do_super(eo_item, ELM_NAVIFRAME_ITEM_CLASS, ret = elm_interface_atspi_accessible_name_get());
2438    if (ret) return ret;
2439
2440    eo_do(VIEW(nit), ret = elm_interface_atspi_accessible_name_get());
2441    return ret;
2442 }
2443
2444 EOLIAN void
2445 _elm_naviframe_item_elm_interface_atspi_accessible_description_set(Eo *eo_item EINA_UNUSED, Elm_Naviframe_Item_Data* nit, const char *description)
2446 {
2447    eo_do(VIEW(nit), elm_interface_atspi_accessible_description_set(description));
2448 }
2449
2450 EOLIAN const char*
2451 _elm_naviframe_item_elm_interface_atspi_accessible_description_get(Eo *eo_item, Elm_Naviframe_Item_Data *nit)
2452 {
2453    const char *ret = NULL;
2454    eo_do_super(eo_item, ELM_NAVIFRAME_ITEM_CLASS, ret = elm_interface_atspi_accessible_description_get());
2455    if (ret) return ret;
2456
2457    eo_do(VIEW(nit), ret = elm_interface_atspi_accessible_description_get());
2458    return ret;
2459 }
2460 //
2461
2462 #include "elm_naviframe_item.eo.c"
2463 #include "elm_naviframe.eo.c"