2 # include "elementary_config.h"
5 #define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
6 #define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
7 #define ELM_WIDGET_ITEM_PROTECTED
9 #include <Elementary.h>
11 #include "elm_widget_naviframe.h"
12 #include "elm_widget_container.h"
14 #define MY_CLASS ELM_NAVIFRAME_CLASS
16 #define MY_CLASS_NAME "Elm_Naviframe"
17 #define MY_CLASS_NAME_LEGACY "elm_naviframe"
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";
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";
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, ""},
49 //TIZEN ONLY(20160829): Support tizen transition
50 static int initted = 0;
51 static Elm_Naviframe_Mod_Api *nf_mod = NULL;
59 if (initted > 1) return;
60 if (!(mod = _elm_module_find_as("naviframe/api"))) return;
62 mod->api = malloc(sizeof(Elm_Naviframe_Mod_Api));
63 if (!mod->api) return;
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");
82 //TIZEN ONLY(20161208): Support tizen transition
84 _tizen_effect_enabled_get(Elm_Naviframe_Item_Data *it)
86 if (!it) return EINA_FALSE;
88 nf_mod->tizen_effect_enabled_get &&
89 nf_mod->tizen_effect_enabled_get(VIEW(it)))
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);
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);
104 static char *_access_info_cb(void *data, Evas_Object *obj EINA_UNUSED);
106 static const Elm_Action key_actions[] = {
107 {"top_item_get", _key_action_top_item_get},
108 {"item_pop", _key_action_item_pop},
113 _resize_object_reset(Evas_Object *obj, Elm_Naviframe_Item_Data *it)
117 elm_widget_resize_object_set(obj, VIEW(it), EINA_FALSE);
118 evas_object_raise(VIEW(it));
123 _prev_page_focus_recover(Elm_Naviframe_Item_Data *it)
126 unsigned int order = 0;
128 newest = elm_widget_newest_focus_order_get(VIEW(it), &order, EINA_TRUE);
130 elm_object_focus_set(newest, EINA_TRUE);
133 if (elm_object_focus_allow_get(VIEW(it)))
134 elm_object_focus_set(VIEW(it), EINA_TRUE);
136 elm_object_focus_set(WIDGET(it), EINA_TRUE);
140 EOLIAN static Eina_Bool
141 _elm_naviframe_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
143 Elm_Naviframe_Item_Data *it;
145 EINA_INLIST_FOREACH(sd->stack, it)
146 eo_do(EO_OBJ(it), elm_wdg_item_translate());
148 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate());
154 _item_content_del_cb(void *data,
156 Evas_Object *obj EINA_UNUSED,
157 void *event_info EINA_UNUSED)
159 Elm_Naviframe_Item_Data *it = data;
162 elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
166 _item_title_prev_btn_del_cb(void *data,
168 Evas_Object *obj EINA_UNUSED,
169 void *event_info EINA_UNUSED)
171 Elm_Naviframe_Item_Data *it = data;
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");
179 _item_title_next_btn_del_cb(void *data,
181 Evas_Object *obj EINA_UNUSED,
182 void *event_info EINA_UNUSED)
184 Elm_Naviframe_Item_Data *it = data;
186 it->title_next_btn = NULL;
187 elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
191 _item_title_icon_del_cb(void *data,
193 Evas_Object *obj EINA_UNUSED,
194 void *event_info EINA_UNUSED)
196 Elm_Naviframe_Item_Data *it = data;
198 it->title_icon = NULL;
199 elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
203 _title_content_del(void *data,
205 Evas_Object *obj EINA_UNUSED,
206 void *event_info EINA_UNUSED)
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);
220 _item_free(Elm_Naviframe_Item_Data *it)
223 Elm_Naviframe_Content_Item_Pair *content_pair;
224 Elm_Naviframe_Text_Item_Pair *text_pair;
226 ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
228 eina_stringshare_del(it->style);
229 eina_stringshare_del(it->title_label);
230 eina_stringshare_del(it->subtitle_label);
232 EINA_INLIST_FOREACH_SAFE(it->content_list, l, content_pair)
234 if (content_pair->content)
236 evas_object_event_callback_del(content_pair->content,
239 evas_object_del(content_pair->content);
241 eina_stringshare_del(content_pair->part);
244 EINA_INLIST_FOREACH_SAFE(it->text_list, l, text_pair)
246 eina_stringshare_del(text_pair->part);
252 if ((sd->preserve) && (!sd->on_deletion))
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);
265 _item_content_signals_emit(Elm_Naviframe_Item_Data *it)
267 Elm_Naviframe_Content_Item_Pair *content_pair;
271 elm_object_signal_emit(VIEW(it), "elm,state,content,show", "elm");
273 elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
276 if (it->title_prev_btn)
277 elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,show", "elm");
279 elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
282 if (it->title_next_btn)
283 elm_object_signal_emit(VIEW(it), "elm,state,next_btn,show", "elm");
285 elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
288 elm_object_signal_emit(VIEW(it), "elm,state,icon,show", "elm");
290 elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
292 EINA_INLIST_FOREACH(it->content_list, content_pair)
294 if (content_pair->content)
295 snprintf(buf, sizeof(buf), "elm,state,%s,show", content_pair->part);
297 snprintf(buf, sizeof(buf), "elm,state,%s,hide", content_pair->part);
298 elm_object_signal_emit(VIEW(it), buf, "elm");
303 _item_text_signals_emit(Elm_Naviframe_Item_Data *it)
305 Elm_Naviframe_Text_Item_Pair *text_pair;
308 if ((it->title_label) && (it->title_label[0]))
309 elm_object_signal_emit(VIEW(it), "elm,state,title_label,show", "elm");
311 elm_object_signal_emit(VIEW(it), "elm,state,title_label,hide", "elm");
313 if ((it->subtitle_label) && (it->subtitle_label[0]))
314 elm_object_signal_emit(VIEW(it), "elm,state,subtitle,show", "elm");
316 elm_object_signal_emit(VIEW(it), "elm,state,subtitle,hide", "elm");
318 EINA_INLIST_FOREACH(it->text_list, text_pair)
320 if (elm_object_part_text_get(VIEW(it), text_pair->part))
321 snprintf(buf, sizeof(buf), "elm,state,%s,show", text_pair->part);
323 snprintf(buf, sizeof(buf), "elm,state,%s,hide", text_pair->part);
324 elm_object_signal_emit(VIEW(it), buf, "elm");
329 _access_object_get(Elm_Naviframe_Item_Data *it, const char* part)
331 Evas_Object *po, *ao;
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");
341 _access_info_has(Evas_Object *obj, int type)
347 ac = _elm_access_info_get(obj);
348 if (!ac) return EINA_FALSE;
350 EINA_LIST_FOREACH(ac->items, l, ai)
352 if (ai->type == type)
354 if (ai->func || ai->data) return EINA_TRUE;
362 _item_signals_emit(Elm_Naviframe_Item_Data *it)
364 _item_text_signals_emit(it);
365 _item_content_signals_emit(it);
368 //TIZEN ONLY(20151012): expose title as at-spi object
370 _atspi_expose_title(Elm_Naviframe_Item_Data *it, Eina_Bool is_atspi)
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)),
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);
385 elm_access_object_unregister(part);
389 /* FIXME: we need to handle the case when this function is called
390 * during a transition */
392 _item_style_set(Elm_Naviframe_Item_Data *it,
393 const char *item_style)
397 ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
401 strcpy(buf, "item/basic");
402 eina_stringshare_replace(&it->style, "basic");
406 snprintf(buf, sizeof(buf), "item/%s", item_style);
407 eina_stringshare_replace(&it->style, item_style);
410 if (!elm_layout_theme_set(VIEW(it), "naviframe", buf,
411 elm_widget_style_get(WIDGET(it))))
413 /* Naviframe item theme name is combined with item style name and widget
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!");
422 if (sd->freeze_events)
423 evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
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);
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)
437 Elm_Naviframe_Item_Data *it = data;
439 eo_do(WIDGET(it), eo_event_callback_call
440 (ELM_NAVIFRAME_EVENT_TITLE_TRANSITION_FINISHED, EO_OBJ(it)));
444 _item_title_enabled_update(Elm_Naviframe_Item_Data *nit, Eina_Bool transition)
446 transition = !!transition;
449 if (nit->title_enabled)
450 elm_object_signal_emit(VIEW(nit), "elm,action,title,show", "elm");
452 elm_object_signal_emit(VIEW(nit), "elm,action,title,hide", "elm");
456 if (nit->title_enabled)
457 elm_object_signal_emit(VIEW(nit), "elm,state,title,show", "elm");
459 elm_object_signal_emit(VIEW(nit), "elm,state,title,hide", "elm");
461 edje_object_message_signal_process(elm_layout_edje_get(VIEW(nit)));
464 EOLIAN static Elm_Theme_Apply
465 _elm_naviframe_elm_widget_theme_apply(Eo *obj, Elm_Naviframe_Data *sd)
467 Elm_Naviframe_Item_Data *it;
468 const char *style = NULL, *sstyle = NULL;
470 eo_do(obj, style = elm_obj_widget_style_get());
472 EINA_INLIST_FOREACH(sd->stack, it)
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);
481 elm_layout_sizing_eval(obj);
482 return ELM_THEME_APPLY_SUCCESS;
486 _access_info_cb(void *data, Evas_Object *obj EINA_UNUSED)
488 Elm_Naviframe_Item_Data *nit;
495 if (!nit->title_enabled) return NULL;
498 info = elm_object_part_text_get(layout, TITLE_PART);
499 if (!info) return NULL;
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"));
507 info = elm_object_part_text_get(layout, SUBTITLE_PART);
509 //TIZEN ONLY(20160530): do not read subtitle even if text is empty
510 if (!strcmp(info, "")) goto end;
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"));
519 ret = eina_strbuf_string_steal(buf);
520 eina_strbuf_free(buf);
525 _access_obj_process(Elm_Naviframe_Item_Data *it, Eina_Bool is_access)
527 Evas_Object *ao, *eo;
529 if (is_access && (it->title_label || it->subtitle_label))
531 if (!_access_object_get(it, TITLE_ACCESS_PART))
533 eo = elm_layout_edje_get(VIEW(it));
534 ao =_elm_access_edje_object_part_object_register(WIDGET(it), eo,
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;
546 /* to access title access object, any idea? */
547 ao = it->base->access_obj;
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);
558 _elm_naviframe_item_elm_widget_item_part_text_set(Eo *eo_it EINA_UNUSED,
559 Elm_Naviframe_Item_Data *it,
563 Elm_Naviframe_Item_Data *nit = it;
564 Elm_Naviframe_Text_Item_Pair *pair = NULL;
567 if ((!part) || (!strcmp(part, "default")) ||
568 (!strcmp(part, TITLE_PART)))
570 eina_stringshare_replace(&nit->title_label, label);
572 elm_object_signal_emit(VIEW(it), "elm,state,title_label,show", "elm");
574 elm_object_signal_emit(VIEW(it), "elm,state,title_label,hide", "elm");
575 elm_object_part_text_set(VIEW(it), TITLE_PART, label);
577 else if ((!strcmp(part, "subtitle")) || (!strcmp(part, SUBTITLE_PART)))
579 eina_stringshare_replace(&nit->subtitle_label, label);
581 elm_object_signal_emit(VIEW(it), "elm,state,subtitle,show", "elm");
583 elm_object_signal_emit(VIEW(it), "elm,state,subtitle,hide", "elm");
584 elm_object_part_text_set(VIEW(it), SUBTITLE_PART, label);
588 EINA_INLIST_FOREACH(nit->text_list, pair)
589 if (!strcmp(part, pair->part)) break;
593 pair = ELM_NEW(Elm_Naviframe_Text_Item_Pair);
596 ERR("Failed to allocate new text part of the item! : naviframe=%p",
600 eina_stringshare_replace(&pair->part, part);
601 nit->text_list = eina_inlist_append(nit->text_list,
602 EINA_INLIST_GET(pair));
605 snprintf(buf, sizeof(buf), "elm,state,%s,show", part);
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);
613 if (_elm_config->access_mode)
614 _access_obj_process(nit, EINA_TRUE);
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)
621 if (nit->title_label) strncat(buf, " ", 1);
622 strncat(buf, nit->subtitle_label, sizeof(buf) - strlen(buf) - 2);
624 char *plain_text = _elm_util_mkup_to_text(buf);
625 eo_do(VIEW(it), elm_interface_atspi_accessible_name_set(plain_text));
628 elm_layout_sizing_eval(WIDGET(nit));
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,
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);
643 snprintf(buf, sizeof(buf), "%s", part);
645 return elm_object_part_text_get(VIEW(it), buf);
649 _elm_naviframe_item_eo_base_destructor(Eo *eo_item, Elm_Naviframe_Item_Data *it)
652 Elm_Naviframe_Op *nfo;
653 Elm_Naviframe_Item_Data *nit = it, *prev_it = NULL;
656 ELM_NAVIFRAME_DATA_GET(WIDGET(nit), sd);
658 nit->delete_me = EINA_TRUE;
660 top = (eo_item == elm_naviframe_top_item_get(WIDGET(nit)));
661 if (evas_object_data_get(VIEW(nit), "out_of_list"))
664 sd->stack = eina_inlist_remove(sd->stack, EINA_INLIST_GET(nit));
666 if (top && !sd->on_deletion) /* must raise another one */
668 if (sd->stack && sd->stack->last)
669 prev_it = EINA_INLIST_CONTAINER_GET(sd->stack->last,
670 Elm_Naviframe_Item_Data);
673 elm_widget_tree_unfocusable_set(VIEW(nit), EINA_TRUE);
677 elm_widget_tree_unfocusable_set(VIEW(prev_it), EINA_FALSE);
678 elm_widget_tree_unfocusable_set(VIEW(nit), EINA_TRUE);
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));
685 _prev_page_focus_recover(prev_it);
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));
692 if (_tizen_effect_enabled_get(prev_it))
693 nf_mod->tizen_effect_cancel(VIEW(prev_it));
695 elm_object_signal_emit(VIEW(prev_it), "elm,state,visible", "elm");
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));
704 eo_do(WIDGET(prev_it), eo_event_callback_call(ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED, EO_OBJ(prev_it)));
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)
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
717 if ((nit->pushing) && (nfo->self == nit))
724 if (nfo->self == nit)
726 if (nfo->related == nit)
733 eo_do_super(eo_item, ELM_NAVIFRAME_ITEM_CLASS, eo_destructor());
737 _item_content_set(Elm_Naviframe_Item_Data *it,
738 Evas_Object *content)
740 if (it->content == content) return;
742 evas_object_del(it->content);
743 it->content = content;
745 if (!content) return;
747 elm_object_part_content_set(VIEW(it), CONTENT_PART, content);
748 elm_object_signal_emit(VIEW(it), "elm,state,content,show", "elm");
750 evas_object_event_callback_add
751 (content, EVAS_CALLBACK_DEL, _item_content_del_cb, it);
755 _item_title_prev_btn_set(Elm_Naviframe_Item_Data *it,
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;
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);
770 //TIZEN ONLY(20161207): add reading text of back button
771 if (!elm_layout_text_get(btn, NULL))
773 if(_elm_config->atspi_mode)
774 eo_do(btn, elm_interface_atspi_accessible_name_set(N_("Navigate back")));
778 //FIXME: set back button callback here after elm 2.0
782 _item_title_next_btn_set(Elm_Naviframe_Item_Data *it,
785 if (it->title_next_btn == btn) return;
786 evas_object_del(it->title_next_btn);
787 it->title_next_btn = btn;
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");
793 evas_object_event_callback_add
794 (btn, EVAS_CALLBACK_DEL, _item_title_next_btn_del_cb, it);
798 _item_title_icon_set(Elm_Naviframe_Item_Data *it,
801 if (it->title_icon == icon) return;
802 evas_object_del(it->title_icon);
803 it->title_icon = icon;
806 elm_object_part_content_set(VIEW(it), ICON_PART, icon);
807 elm_object_signal_emit(VIEW(it), "elm,state,icon,show", "elm");
809 evas_object_event_callback_add
810 (icon, EVAS_CALLBACK_DEL, _item_title_icon_del_cb, it);
814 _item_content_unset(Elm_Naviframe_Item_Data *it)
816 Evas_Object *content = it->content;
818 if (!content) return NULL;
820 elm_object_part_content_unset(VIEW(it), CONTENT_PART);
821 elm_object_signal_emit(VIEW(it), "elm,state,content,hide", "elm");
823 evas_object_event_callback_del
824 (content, EVAS_CALLBACK_DEL, _item_content_del_cb);
831 _item_title_prev_btn_unset(Elm_Naviframe_Item_Data *it)
833 Evas_Object *content = it->title_prev_btn;
835 if (!content) return NULL;
837 elm_object_part_content_unset(VIEW(it), PREV_BTN_PART);
838 elm_object_signal_emit(VIEW(it), "elm,state,prev_btn,hide", "elm");
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,
846 it->title_prev_btn = NULL;
847 if (it->auto_pushed_btn) it->auto_pushed_btn = NULL;
852 _item_title_next_btn_unset(Elm_Naviframe_Item_Data *it)
854 Evas_Object *content = it->title_next_btn;
856 if (!content) return NULL;
858 elm_object_part_content_unset(VIEW(it), NEXT_BTN_PART);
859 elm_object_signal_emit(VIEW(it), "elm,state,next_btn,hide", "elm");
861 evas_object_event_callback_del
862 (content, EVAS_CALLBACK_DEL, _item_title_next_btn_del_cb);
864 it->title_next_btn = NULL;
869 _item_title_icon_unset(Elm_Naviframe_Item_Data *it)
871 Evas_Object *content = it->title_icon;
873 if (!content) return NULL;
875 elm_object_part_content_unset(VIEW(it), ICON_PART);
876 elm_object_signal_emit(VIEW(it), "elm,state,icon,hide", "elm");
878 evas_object_event_callback_del
879 (content, EVAS_CALLBACK_DEL, _item_title_icon_del_cb);
881 it->title_icon = NULL;
885 /* since we have each item as layout, we can't reusing the layout's
886 * aliasing, so let's do it ourselves */
888 _part_aliasing_eval(const char **part)
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"))
901 _title_content_set(Elm_Naviframe_Item_Data *it,
903 Evas_Object *content)
905 Elm_Naviframe_Content_Item_Pair *pair = NULL;
908 EINA_INLIST_FOREACH(it->content_list, pair)
909 if (!strcmp(part, pair->part)) break;
912 if (pair->content == content) return;
914 evas_object_event_callback_del(pair->content,
917 if (content) elm_object_part_content_set(VIEW(it), part, content);
921 if (!content) return;
923 //Remove the pair if new content was swallowed into other part.
924 EINA_INLIST_FOREACH(it->content_list, pair)
926 if (pair->content == content)
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,
940 pair = ELM_NEW(Elm_Naviframe_Content_Item_Pair);
943 ERR("Failed to allocate new content part of the item! : naviframe=%p",
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");
955 pair->content = content;
956 evas_object_event_callback_add(content,
963 _elm_naviframe_item_elm_widget_item_part_content_set(Eo *eo_nit EINA_UNUSED,
964 Elm_Naviframe_Item_Data *nit,
966 Evas_Object *content)
968 _part_aliasing_eval(&part);
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);
980 _title_content_set(nit, part, content);
982 elm_layout_sizing_eval(WIDGET(nit));
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,
990 _part_aliasing_eval(&part);
993 if (!strcmp(part, CONTENT_PART))
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;
1003 return elm_object_part_content_get(VIEW(nit), part);
1006 static Evas_Object *
1007 _title_content_unset(Elm_Naviframe_Item_Data *it, const char *part)
1009 Elm_Naviframe_Content_Item_Pair *pair = NULL;
1011 Evas_Object *content = NULL;
1013 EINA_INLIST_FOREACH(it->content_list, pair)
1015 if (!strcmp(part, pair->part))
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));
1026 if (!content) return NULL;
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,
1033 _title_content_del);
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,
1042 Evas_Object *o = NULL;
1044 _part_aliasing_eval(&part);
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);
1056 o = _title_content_unset(nit, part);
1058 elm_layout_sizing_eval(WIDGET(nit));
1064 _elm_naviframe_item_elm_widget_item_signal_emit(Eo *eo_it EINA_UNUSED,
1065 Elm_Naviframe_Item_Data *it,
1066 const char *emission,
1069 elm_object_signal_emit(VIEW(it), emission, source);
1073 _elm_naviframe_elm_layout_sizing_eval(Eo *obj, Elm_Naviframe_Data *sd)
1075 Evas_Coord minw = -1, minh = -1;
1076 Elm_Naviframe_Item_Data *it, *top;
1077 Evas_Coord x, y, w, h;
1079 if (sd->on_deletion) return;
1080 if (!sd->stack) return;
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)
1086 evas_object_move(VIEW(it), x, y);
1087 evas_object_resize(VIEW(it), w, h);
1091 edje_object_size_min_calc(elm_layout_edje_get(VIEW(it)),
1092 &it->minw, &it->minh);
1098 evas_object_size_hint_min_set(obj, minw, minh);
1099 evas_object_size_hint_max_set(obj, -1, -1);
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)
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
1110 eo_do(obj, eo_event_callback_del(
1111 EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_item_back_btn_clicked,
1113 elm_naviframe_item_pop(data);
1118 static Evas_Object *
1119 _back_btn_new(Evas_Object *obj, const char *title_label)
1121 Evas_Object *btn, *ed;
1124 btn = elm_button_add(obj);
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));
1130 (buf, sizeof(buf), "naviframe/back_btn/%s", elm_widget_style_get(obj));
1131 elm_object_style_set(btn, buf);
1133 elm_layout_text_set(btn, NULL, title_label);
1135 elm_object_domain_translatable_text_set(btn, PACKAGE, N_("Back"));
1137 /* HACK NOTE: this explicit check only exists to avoid an ERR()
1138 * message from elm_layout_content_set().
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.
1144 * Once we can break the theme API, remove this check and always
1147 ed = elm_layout_edje_get(btn);
1148 if (edje_object_part_exists(ed, CONTENT_PART))
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);
1155 if(_elm_config->atspi_mode)
1156 eo_do(btn, elm_interface_atspi_accessible_name_set(N_("Navigate back")));
1162 _elm_naviframe_elm_layout_signal_emit(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *emission, const char *source)
1164 Elm_Object_Item *eo_top_it;
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);
1170 eo_do(VIEW(top_it), elm_obj_layout_signal_emit(emission, source));
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)
1178 Elm_Object_Item *it;
1179 const char *text = NULL;
1181 it = elm_naviframe_top_item_get(obj);
1182 if (!it) return EINA_FALSE;
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))
1191 EOLIAN static const char*
1192 _elm_naviframe_elm_layout_text_get(const Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part)
1194 Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
1195 if (!it) return NULL;
1197 return elm_object_item_part_text_get(it, part);
1200 /* we have to keep a "manual" set here because of the callbacks on the
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)
1205 Elm_Object_Item *it;
1207 it = elm_naviframe_top_item_get(obj);
1208 if (!it) return EINA_FALSE;
1210 elm_object_item_part_content_set(it, part, content);
1212 if (content == elm_object_item_part_content_get(it, part))
1218 EOLIAN static Evas_Object*
1219 _elm_naviframe_elm_container_content_get(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part)
1221 Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
1223 if (!it) return NULL;
1225 return elm_object_item_part_content_get(it, part);
1228 EOLIAN static Evas_Object*
1229 _elm_naviframe_elm_container_content_unset(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part)
1231 Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
1233 if (!it) return NULL;
1235 return elm_object_item_part_content_unset(it, part);
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)
1244 Elm_Naviframe_Item_Data *it = data;
1246 eo_do(WIDGET(it), eo_event_callback_call(ELM_NAVIFRAME_EVENT_TITLE_CLICKED, EO_OBJ(it)));
1249 /* "elm,state,cur,pushed"
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)
1257 Elm_Naviframe_Item_Data *it = data;
1261 ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
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));
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");
1276 if (sd->freeze_events)
1277 evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
1280 /* "elm,state,cur,popped"
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)
1288 Elm_Naviframe_Item_Data *it = data;
1289 Elm_Naviframe_Item_Data *prev_it = NULL;
1290 Eo *widget = WIDGET(it);
1292 ELM_NAVIFRAME_DATA_GET(widget, sd);
1294 if (sd->stack && sd->stack->last)
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);
1301 evas_object_raise(VIEW(prev_it));
1306 elm_widget_tree_unfocusable_set(VIEW(it), EINA_FALSE);
1307 sd->popping = eina_list_remove(sd->popping, it);
1309 eo_do(EO_OBJ(it), elm_wdg_item_del());
1312 /* "elm,state,new,pushed",
1313 * "elm,state,prev,popped
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)
1321 Elm_Naviframe_Item_Data *it = data;
1323 ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
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");
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);
1334 elm_widget_tree_unfocusable_set(VIEW(it), EINA_FALSE);
1336 _prev_page_focus_recover(it);
1338 if (sd->freeze_events)
1339 evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
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)))
1345 _elm_win_default_label_obj_append(VIEW(it));
1347 if (_elm_atspi_enabled())
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));
1355 eo_do(WIDGET(it), eo_event_callback_call(ELM_NAVIFRAME_EVENT_TRANSITION_FINISHED, EO_OBJ(it)));
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)));
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)
1367 elm_layout_sizing_eval(data);
1371 _item_dispmode_set(Elm_Naviframe_Item_Data *it, Evas_Display_Mode dispmode)
1373 if (it->dispmode == dispmode) return;
1376 case EVAS_DISPLAY_MODE_COMPRESS:
1377 elm_object_signal_emit(VIEW(it), "elm,state,display,compress", "elm");
1380 elm_object_signal_emit(VIEW(it), "elm,state,display,default", "elm");
1383 it->dispmode = dispmode;
1387 _access_prev_btn_info_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
1389 return strdup(E_("Back"));
1393 _elm_naviframe_item_eo_base_constructor(Eo *eo_item, Elm_Naviframe_Item_Data *it)
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);
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)
1412 ELM_NAVIFRAME_DATA_GET(obj, sd);
1414 eo_item = eo_add(ELM_NAVIFRAME_ITEM_CLASS, obj);
1418 ERR("Failed to allocate new item! : naviframe=%p", obj);
1422 ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
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));
1431 evas_object_smart_member_add(VIEW(it), obj);
1433 if (!elm_widget_sub_object_add(obj, VIEW(it)))
1434 ERR("could not add %p as sub object of %p", VIEW(it), obj);
1436 evas_object_event_callback_add
1437 (VIEW(it), EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1438 _on_item_size_hints_changed, obj);
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);
1451 _item_style_set(it, item_style);
1454 eo_do(eo_item, elm_wdg_item_part_text_set(TITLE_PART, title_label));
1457 if ((!prev_btn) && sd->auto_pushed && eo_prev_it)
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));
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))
1473 if (!_access_info_has(prev_btn, ELM_ACCESS_INFO))
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);
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")));
1489 eo_do(eo_item, elm_wdg_item_part_content_set(NEXT_BTN_PART, next_btn));
1491 if (!elm_layout_text_get(next_btn, NULL))
1493 if (!_access_info_has(next_btn, ELM_ACCESS_INFO))
1495 /* set access info */
1496 _elm_access_text_set
1497 (_elm_access_info_get(next_btn), ELM_ACCESS_INFO, E_("Next"));
1502 _item_content_set(it, content);
1503 _item_dispmode_set(it, sd->dispmode);
1505 it->title_enabled = EINA_TRUE;
1511 _on_obj_size_hints_changed(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
1512 Evas_Object *obj, void *event_info EINA_UNUSED)
1514 Elm_Naviframe_Item_Data *it;
1515 Evas_Display_Mode dispmode;
1517 ELM_NAVIFRAME_DATA_GET(obj, sd);
1519 dispmode = evas_object_size_hint_display_mode_get(obj);
1520 if (sd->dispmode == dispmode) return;
1522 sd->dispmode = dispmode;
1524 EINA_INLIST_FOREACH(sd->stack, it)
1525 _item_dispmode_set(it, dispmode);
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)
1533 Eina_List *l = NULL;
1534 Elm_Object_Item *eo_top_it;
1535 void *(*list_data_get)(const Eina_List *list);
1537 Eina_Bool int_ret = EINA_FALSE;
1539 eo_top_it = elm_naviframe_top_item_get(obj);
1540 if (!eo_top_it) goto end;
1542 list_data_get = eina_list_data_get;
1544 ELM_NAVIFRAME_ITEM_DATA_GET(eo_top_it, top_it);
1545 l = eina_list_append(l, VIEW(top_it));
1548 if (_elm_config->access_mode)
1550 ao = _access_object_get(top_it, TITLE_ACCESS_PART);
1551 if (ao) l = eina_list_append(l, ao);
1554 int_ret = elm_widget_focus_list_next_get(obj, l, list_data_get, dir, next, next_item);
1559 (!(*next) || (*next == elm_object_focused_object_get(obj))))
1562 int_ret = !elm_widget_focus_get(obj);
1568 EOLIAN static Eina_Bool
1569 _elm_naviframe_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd EINA_UNUSED)
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)
1579 Eina_List *l = NULL;
1580 Elm_Object_Item *eo_top_it;
1581 void *(*list_data_get)(const Eina_List *list);
1583 eo_top_it = elm_naviframe_top_item_get(obj);
1584 if (!eo_top_it) return EINA_FALSE;
1586 list_data_get = eina_list_data_get;
1588 ELM_NAVIFRAME_ITEM_DATA_GET(eo_top_it, top_it);
1589 l = eina_list_append(l, VIEW(top_it));
1591 int_ret = elm_widget_focus_list_direction_get
1592 (obj, base, l, list_data_get, degree, direction, direction_item, weight);
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)
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;
1607 ELM_NAVIFRAME_ITEM_DATA_GET(eo_top_it, top_it);
1608 return _access_object_get(top_it, part);
1613 _elm_naviframe_evas_object_smart_add(Eo *obj, Elm_Naviframe_Data *priv)
1615 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1616 //TIZEN ONLY(20160829): Support tizen transition
1619 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
1620 elm_widget_sub_object_parent_add(obj);
1622 priv->dummy_edje = wd->resize_obj;
1623 evas_object_smart_member_add(priv->dummy_edje, obj);
1625 priv->auto_pushed = _elm_config->naviframe_prev_btn_auto_pushed;
1626 priv->freeze_events = EINA_TRUE;
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);
1634 _send_signal(Elm_Naviframe_Item_Data *it, const char *sig)
1637 elm_object_signal_emit(VIEW(it), sig, "elm");
1638 edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
1642 _deferred(void *data)
1644 Elm_Naviframe_Data *nfd = data;
1645 Elm_Naviframe_Op *nfo;
1647 EINA_LIST_FREE(nfd->ops, nfo)
1649 const char *signals_cur[] = {
1650 "elm,state,cur,popped,deferred",
1651 "elm,state,cur,pushed,deferred"
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;
1658 cur = nfo->push ? nfo->related : nfo->self;
1659 other = nfo->push ? nfo->self : nfo->related;
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))
1668 if (nf_mod->tizen_push_deferred_effect)
1669 nf_mod->tizen_push_deferred_effect(WIDGET(cur), VIEW(cur),
1674 if (nf_mod->tizen_pop_deferred_effect)
1675 nf_mod->tizen_pop_deferred_effect(WIDGET(cur), VIEW(cur),
1680 _send_signal(cur, signals_cur[nfo->push]);
1682 if (_tizen_effect_enabled_get(other))
1686 if (nf_mod->tizen_push_deferred_effect)
1687 nf_mod->tizen_push_deferred_effect(WIDGET(other),
1688 VIEW(other), EINA_FALSE);
1692 if (nf_mod->tizen_pop_deferred_effect)
1693 nf_mod->tizen_pop_deferred_effect(WIDGET(other),
1694 VIEW(other), EINA_FALSE);
1698 _send_signal(other, nfo->push ? signals_new : signals_prev);
1704 nfd->animator = NULL;
1705 return ECORE_CALLBACK_CANCEL;
1709 _elm_naviframe_evas_object_smart_del(Eo *obj, Elm_Naviframe_Data *sd)
1711 Elm_Naviframe_Item_Data *it;
1712 Elm_Naviframe_Op *nfo;
1714 sd->on_deletion = EINA_TRUE;
1718 it = EINA_INLIST_CONTAINER_GET(sd->stack, Elm_Naviframe_Item_Data);
1719 eo_do(EO_OBJ(it), elm_wdg_item_del());
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)
1726 EINA_LIST_FREE(sd->popping, it)
1727 eo_do(EO_OBJ(it), elm_wdg_item_del());
1729 evas_object_del(sd->dummy_edje);
1731 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
1734 //Show only the top item view
1736 _elm_naviframe_evas_object_smart_show(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED)
1738 Elm_Object_Item *eo_top;
1740 eo_top = elm_naviframe_top_item_get(obj);
1741 ELM_NAVIFRAME_ITEM_DATA_GET(eo_top, top);
1743 if (top && !top->delete_me)
1744 evas_object_show(VIEW(top));
1748 _key_action_top_item_get(Evas_Object *obj, const char *params EINA_UNUSED)
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;
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));
1764 _key_action_item_pop(Evas_Object *obj, const char *params EINA_UNUSED)
1766 Elm_Object_Item *eo_item = NULL;
1767 eo_item = elm_naviframe_top_item_get(obj);
1768 if (!eo_item) return EINA_FALSE;
1770 ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
1772 if (it->pushing || it->popping) return EINA_FALSE;
1774 elm_naviframe_item_pop(obj);
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)
1783 Evas_Event_Key_Down *ev = event_info;
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;
1789 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
1794 _elm_naviframe_elm_widget_access(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool is_access)
1796 Elm_Naviframe_Item_Data *it;
1798 EINA_INLIST_FOREACH(sd->stack, it)
1799 _access_obj_process(it, is_access);
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
1806 _elm_naviframe_elm_widget_screen_reader(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool is_screen_reader)
1808 Elm_Naviframe_Item_Data *it;
1810 EINA_INLIST_FOREACH(sd->stack, it)
1811 _atspi_expose_title(it, is_screen_reader);
1813 //TIZEN_ONLY(20161213): apply screen_reader_changed callback
1814 evas_object_smart_callback_call(obj, SIG_ATSPI_SCREEN_READER_CHANGED, &is_screen_reader);
1821 _item_push_helper(Elm_Naviframe_Item_Data *item)
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));
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);
1834 Elm_Naviframe_Op *nfo = calloc(1, sizeof (Elm_Naviframe_Op));
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);
1840 elm_widget_tree_unfocusable_set(VIEW(top_item), EINA_TRUE);
1842 if (sd->freeze_events)
1844 evas_object_freeze_events_set(VIEW(item), EINA_TRUE);
1845 evas_object_freeze_events_set(VIEW(top_item), EINA_TRUE);
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))
1855 if (nf_mod->tizen_push_effect)
1856 nf_mod->tizen_push_effect(obj, VIEW(top_item), EINA_TRUE);
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)));
1864 if (_tizen_effect_enabled_get(item))
1866 if (nf_mod->tizen_push_effect)
1867 nf_mod->tizen_push_effect(obj, VIEW(item), EINA_FALSE);
1871 elm_object_signal_emit(VIEW(item), "elm,state,new,pushed", "elm");
1872 edje_object_message_signal_process(elm_layout_edje_get(VIEW(item)));
1877 nfo->related = top_item;
1878 nfo->push = EINA_TRUE;
1880 sd->ops = eina_list_append(sd->ops, nfo);
1881 if (!sd->animator) sd->animator = ecore_animator_add(_deferred, sd);
1883 if (top_item) top_item->pushing = EINA_FALSE;
1884 item->pushing = EINA_TRUE;
1888 if (elm_object_focus_allow_get(VIEW(item)))
1889 elm_object_focus_set(VIEW(item), EINA_TRUE);
1891 elm_object_focus_set(WIDGET(item), EINA_TRUE);
1894 sd->stack = eina_inlist_append(sd->stack, EINA_INLIST_GET(item));
1897 //TIZEN ONLY(20161208): Support tizen transition
1898 //elm_object_signal_emit(VIEW(item), "elm,state,visible", "elm");
1900 if (!_tizen_effect_enabled_get(item))
1901 elm_object_signal_emit(VIEW(item), "elm,state,visible", "elm");
1905 elm_layout_sizing_eval(obj);
1909 //TIZEN_ONLY(20170919): Handle default label object
1910 _elm_win_default_label_obj_append(VIEW(item));
1912 eo_do(obj, eo_event_callback_call(ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED, EO_OBJ(item)));
1917 elm_naviframe_add(Evas_Object *parent)
1919 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
1920 Evas_Object *obj = eo_add(MY_CLASS, parent);
1925 _elm_naviframe_eo_base_constructor(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED)
1927 obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
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));
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)
1939 Elm_Object_Item *top_item, *eo_item;
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;
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));
1951 _item_push_helper(item);
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)
1958 Elm_Object_Item *eo_it;
1959 Elm_Naviframe_Item_Data *prev_it = NULL;
1961 EINA_SAFETY_ON_NULL_RETURN_VAL(eo_before, NULL);
1962 ELM_NAVIFRAME_ITEM_DATA_GET(eo_before, before);
1964 ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(before, NULL);
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;
1975 it = eo_data_scope_get(eo_it, ELM_NAVIFRAME_ITEM_CLASS);
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));
1981 sd->stack = eina_inlist_prepend_relative
1982 (sd->stack, EINA_INLIST_GET(it),
1983 EINA_INLIST_GET(before));
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");
1993 elm_layout_sizing_eval(obj);
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)
2001 Elm_Object_Item *eo_item;
2002 Eina_Bool top_inserted = EINA_FALSE;
2004 EINA_SAFETY_ON_NULL_RETURN_VAL(eo_after, NULL);
2005 ELM_NAVIFRAME_ITEM_DATA_GET(eo_after, after);
2007 ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(after, NULL);
2009 eo_item = _item_new(obj, eo_after,
2010 title_label, prev_btn, next_btn, content, item_style);
2011 if (!eo_item) return NULL;
2013 ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
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));
2019 if (elm_naviframe_top_item_get(obj) == eo_after) top_inserted = EINA_TRUE;
2021 sd->stack = eina_inlist_append_relative
2022 (sd->stack, EINA_INLIST_GET(it),
2023 EINA_INLIST_GET(after));
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));
2038 if (elm_object_focus_allow_get(VIEW(it)))
2039 elm_object_focus_set(VIEW(it), EINA_TRUE);
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");
2048 if (!_tizen_effect_enabled_get(after))
2049 elm_object_signal_emit(VIEW(after), "elm,state,invisible", "elm");
2053 //TIZEN ONLY(20161208): Support tizen transition
2054 //elm_object_signal_emit(VIEW(it), "elm,state,invisible", "elm");
2056 if (!_tizen_effect_enabled_get(it))
2057 elm_object_signal_emit(VIEW(it), "elm,state,invisible", "elm");
2061 elm_layout_sizing_eval(obj);
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));
2071 eo_do(obj, eo_event_callback_call(ELM_NAVIFRAME_EVENT_ITEM_ACTIVATED, eo_item));
2077 EOLIAN static Evas_Object*
2078 _elm_naviframe_item_pop(Eo *obj, Elm_Naviframe_Data *sd)
2080 Elm_Object_Item *eo_item;
2081 Elm_Naviframe_Item_Data *prev_it = NULL;
2082 Evas_Object *content = NULL;
2084 if (sd->freeze_events && sd->popping) return NULL;
2086 eo_item = elm_naviframe_top_item_get(obj);
2087 if (!eo_item) return NULL;
2089 ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
2091 if (it->pushing || it->popping) return NULL;
2092 it->popping = EINA_TRUE;
2094 evas_object_ref(obj);
2098 if (!it->pop_cb(it->pop_data, eo_item))
2102 eo_do(eo_item, elm_wdg_item_del());
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;
2115 evas_object_unref(obj);
2120 evas_object_unref(obj);
2123 content = it->content;
2125 evas_object_data_set(VIEW(it), "out_of_list", (void *)1);
2127 if (sd->stack->last->prev)
2128 prev_it = EINA_INLIST_CONTAINER_GET
2129 (sd->stack->last->prev, Elm_Naviframe_Item_Data);
2131 sd->stack = eina_inlist_remove(sd->stack, EINA_INLIST_GET(it));
2135 Elm_Naviframe_Op *nfo = calloc(1, sizeof (Elm_Naviframe_Op));
2137 elm_widget_tree_unfocusable_set(VIEW(it), EINA_TRUE);
2139 if (sd->freeze_events)
2141 evas_object_freeze_events_set(VIEW(it), EINA_TRUE);
2142 evas_object_freeze_events_set(VIEW(prev_it), EINA_TRUE);
2145 // TIZEN_ONLY(20161229): resize prev item before raise.
2146 elm_widget_resize_object_set(obj, VIEW(prev_it), EINA_FALSE);
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))
2157 if (nf_mod->tizen_pop_effect)
2158 nf_mod->tizen_pop_effect(obj, VIEW(it), EINA_TRUE);
2162 elm_object_signal_emit(VIEW(it), "elm,state,cur,popped", "elm");
2163 edje_object_message_signal_process(elm_layout_edje_get(VIEW(it)));
2166 if (_tizen_effect_enabled_get(prev_it))
2168 if (nf_mod->tizen_pop_effect)
2169 nf_mod->tizen_pop_effect(obj, VIEW(prev_it), EINA_FALSE);
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)));
2178 //Show hidden previous view when pop transition begins.
2179 evas_object_show(VIEW(prev_it));
2181 if (!nfo) goto on_error;
2184 nfo->related = prev_it;
2185 nfo->push = EINA_FALSE;
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);
2192 eo_do(eo_item, elm_wdg_item_del());
2199 _elm_naviframe_item_pop_to(Eo *eo_it, Elm_Naviframe_Item_Data *it)
2203 ELM_NAVIFRAME_DATA_GET(WIDGET(it), sd);
2205 if (eo_it == elm_naviframe_top_item_get(WIDGET(it))) return;
2207 l = sd->stack->last->prev;
2209 sd->on_deletion = EINA_TRUE;
2213 Elm_Naviframe_Item_Data *iit = EINA_INLIST_CONTAINER_GET
2214 (l, Elm_Naviframe_Item_Data);
2216 if (iit == it) break;
2220 eo_do(EO_OBJ(iit), elm_wdg_item_del());
2223 sd->on_deletion = EINA_FALSE;
2225 elm_naviframe_item_pop(WIDGET(it));
2229 _elm_naviframe_item_promote(Eo *eo_it, Elm_Naviframe_Item_Data *it)
2231 Elm_Object_Item *eo_prev_top;
2232 Elm_Naviframe_Item_Data *nit = it;
2234 ELM_NAVIFRAME_DATA_GET(WIDGET(nit), sd);
2236 eo_prev_top = elm_naviframe_top_item_get(WIDGET(nit));
2237 if (eo_it == eo_prev_top) return;
2239 sd->stack = eina_inlist_remove(sd->stack, EINA_INLIST_GET(nit));
2240 _item_push_helper(nit);
2244 _elm_naviframe_item_simple_promote(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Evas_Object *content)
2246 Elm_Naviframe_Item_Data *itr;
2248 EINA_INLIST_FOREACH(sd->stack, itr)
2250 if (elm_object_item_content_get(EO_OBJ(itr)) == content)
2252 elm_naviframe_item_promote(EO_OBJ(itr));
2259 _elm_naviframe_content_preserve_on_pop_set(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool preserve)
2261 sd->preserve = !!preserve;
2264 EOLIAN static Eina_Bool
2265 _elm_naviframe_content_preserve_on_pop_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
2267 return sd->preserve;
2270 EOLIAN static Elm_Object_Item*
2271 _elm_naviframe_top_item_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
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);
2279 EOLIAN static Elm_Object_Item*
2280 _elm_naviframe_bottom_item_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
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);
2289 _elm_naviframe_item_style_set(Eo *eo_item EINA_UNUSED,
2290 Elm_Naviframe_Item_Data *nit,
2291 const char *item_style)
2293 if (item_style && !strcmp(item_style, nit->style)) return;
2296 if (!strcmp("basic", nit->style)) return;
2298 _item_style_set(nit, item_style);
2299 _item_signals_emit(nit);
2300 _item_title_enabled_update(nit, EINA_FALSE);
2303 EOLIAN static const char *
2304 _elm_naviframe_item_style_get(Eo *eo_item EINA_UNUSED,
2305 Elm_Naviframe_Item_Data *nit)
2310 EINA_DEPRECATED EAPI void
2311 elm_naviframe_item_title_visible_set(Elm_Object_Item *it,
2314 elm_naviframe_item_title_enabled_set(it, visible, EINA_FALSE);
2317 EINA_DEPRECATED EAPI Eina_Bool
2318 elm_naviframe_item_title_visible_get(const Elm_Object_Item *it)
2320 return elm_naviframe_item_title_enabled_get(it);
2324 _elm_naviframe_item_title_enabled_set(Eo *eo_item EINA_UNUSED,
2325 Elm_Naviframe_Item_Data *nit,
2327 Eina_Bool transition)
2329 enabled = !!enabled;
2330 if (nit->title_enabled == enabled) return;
2332 nit->title_enabled = enabled;
2334 transition = !!transition;
2335 _item_title_enabled_update(nit, transition);
2338 EOLIAN static Eina_Bool
2339 _elm_naviframe_item_title_enabled_get(const Eo *eo_item EINA_UNUSED, Elm_Naviframe_Item_Data *nit)
2341 return nit->title_enabled;
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,
2351 nit->pop_data = data;
2355 _elm_naviframe_prev_btn_auto_pushed_set(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool auto_pushed)
2357 sd->auto_pushed = !!auto_pushed;
2360 EOLIAN static Eina_Bool
2361 _elm_naviframe_prev_btn_auto_pushed_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
2363 return sd->auto_pushed;
2366 EOLIAN static Eina_List*
2367 _elm_naviframe_items_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
2369 Eina_List *ret = NULL;
2370 Elm_Naviframe_Item_Data *itr;
2372 EINA_INLIST_FOREACH(sd->stack, itr)
2373 ret = eina_list_append(ret, EO_OBJ(itr));
2379 _elm_naviframe_event_enabled_set(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd, Eina_Bool enabled)
2381 enabled = !!enabled;
2382 if (sd->freeze_events == !enabled) return;
2383 sd->freeze_events = !enabled;
2386 EOLIAN static Eina_Bool
2387 _elm_naviframe_event_enabled_get(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd)
2389 return !sd->freeze_events;
2392 EOLIAN static Eina_Bool
2393 _elm_naviframe_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd EINA_UNUSED)
2399 _elm_naviframe_class_constructor(Eo_Class *klass)
2401 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
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)
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 }
2412 return &atspi_actions[0];
2415 //TIZEN_ONLY(20161213) Using VIEW(item) for naviframe, naviframe item accessible information
2417 _elm_naviframe_elm_interface_atspi_accessible_name_get(Eo *eo, Elm_Naviframe_Data *pd EINA_UNUSED)
2419 const char *ret = NULL;
2420 Elm_Object_Item *eo_top_it = NULL;
2422 eo_top_it = elm_naviframe_top_item_get(eo);
2425 eo_do(eo_top_it, ret = elm_interface_atspi_accessible_name_get());
2432 _elm_naviframe_elm_interface_atspi_accessible_description_get(Eo *eo, Elm_Naviframe_Data *pd EINA_UNUSED)
2434 const char *ret = NULL;
2435 Elm_Object_Item *eo_top_it = NULL;
2437 eo_top_it = elm_naviframe_top_item_get(eo);
2440 eo_do(eo_top_it, ret = elm_interface_atspi_accessible_description_get());
2447 _elm_naviframe_item_elm_interface_atspi_accessible_name_set(Eo *eo_item EINA_UNUSED, Elm_Naviframe_Item_Data* nit, const char *name)
2449 eo_do(VIEW(nit), elm_interface_atspi_accessible_name_set(name));
2453 _elm_naviframe_item_elm_interface_atspi_accessible_name_get(Eo *eo_item, Elm_Naviframe_Item_Data *nit)
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;
2459 eo_do(VIEW(nit), ret = elm_interface_atspi_accessible_name_get());
2464 _elm_naviframe_item_elm_interface_atspi_accessible_description_set(Eo *eo_item EINA_UNUSED, Elm_Naviframe_Item_Data* nit, const char *description)
2466 eo_do(VIEW(nit), elm_interface_atspi_accessible_description_set(description));
2470 _elm_naviframe_item_elm_interface_atspi_accessible_description_get(Eo *eo_item, Elm_Naviframe_Item_Data *nit)
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;
2476 eo_do(VIEW(nit), ret = elm_interface_atspi_accessible_description_get());
2481 _elm_naviframe_item_elm_interface_atspi_accessible_translation_domain_set(Eo *eo_item EINA_UNUSED, Elm_Naviframe_Item_Data* nit, const char *domain)
2483 eo_do(VIEW(nit), elm_interface_atspi_accessible_translation_domain_set(domain));
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)
2489 const char *ret = NULL;
2490 eo_do(VIEW(nit), ret = elm_interface_atspi_accessible_translation_domain_get());
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)
2497 eo_do(VIEW(nit), elm_interface_atspi_accessible_name_cb_set(name_cb, data));
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)
2503 eo_do(VIEW(nit), elm_interface_atspi_accessible_description_cb_set(description_cb, data));
2507 #include "elm_naviframe_item.eo.c"
2508 #include "elm_naviframe.eo.c"