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