%{_includedir}/ui-viewmgr/interface/*.h
%{_includedir}/ui-viewmgr/efl/*.h
%{_includedir}/ui-viewmgr/efl/mobile/*.h
+%{_includedir}/ui-viewmgr/efl/mobile/c/*.h
%{_libdir}/*.so
%{_libdir}/pkgconfig/ui-viewmgr.pc
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(lib)
-ADD_SUBDIRECTORY(examples/efl)
+ADD_SUBDIRECTORY(examples/efl/cpp)
+++ /dev/null
-SET(SRCS
- contents.cpp
- main.cpp
- )
-
-ADD_EXECUTABLE(${BINNAME} ${SRCS})
-
-ADD_DEFINITIONS("-DBINDIR=\"${BINDIR}\"")
-
-PKG_CHECK_MODULES(BIN_PKGS REQUIRED elementary dlog capi-appfw-application capi-system-system-settings appcore-efl capi-appfw-app-manager)
-
-FOREACH(flag ${BIN_PKGS_CFLAGS})
- SET(PKG_CFLAGS "${PKG_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET_TARGET_PROPERTIES(${BINNAME} PROPERTIES COMPILE_FLAGS "${PKG_CFLAGS}" LINK_FLAGS -pie)
-TARGET_LINK_LIBRARIES(${BINNAME} ${BIN_PKGS_LDFLAGS} ${LIBNAME})
-
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PKG_CFLAGS}")
-
-INSTALL(TARGETS ${BINNAME} DESTINATION ${BINDIR}/bin)
--- /dev/null
+SET(SRCS
+ main.cpp
+ )
+
+ADD_EXECUTABLE(${BINNAME} ${SRCS})
+
+ADD_DEFINITIONS("-DBINDIR=\"${BINDIR}\"")
+
+PKG_CHECK_MODULES(BIN_PKGS REQUIRED elementary dlog capi-appfw-application capi-system-system-settings appcore-efl capi-appfw-app-manager)
+
+FOREACH(flag ${BIN_PKGS_CFLAGS})
+ SET(PKG_CFLAGS "${PKG_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET_TARGET_PROPERTIES(${BINNAME} PROPERTIES COMPILE_FLAGS "${PKG_CFLAGS}" LINK_FLAGS -pie)
+TARGET_LINK_LIBRARIES(${BINNAME} ${BIN_PKGS_LDFLAGS} ${LIBNAME})
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PKG_CFLAGS}")
+
+INSTALL(TARGETS ${BINNAME} DESTINATION ${BINDIR}/bin)
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "main.h"
+
+Evas_Object*
+create_landscape_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb)
+{
+ char buf[PATH_MAX];
+ Elm_Grid *grid;
+ Elm_Box *box;
+ Elm_Layout *layout;
+ Elm_Scroller *scroller;
+ Elm_Button *btn;
+ Elm_Image *image;
+
+ /* Scroller */
+ scroller = elm_scroller_add(parent);
+ elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
+ elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
+
+ /* Grid */
+ grid = elm_grid_add(scroller);
+ evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(grid);
+
+ /* NoContent Layout */
+ layout = elm_layout_add(grid);
+ elm_layout_theme_set(layout, "layout", "nocontents", "default");
+ elm_object_part_text_set(layout, "elm.text", text);
+ evas_object_show(layout);
+ elm_grid_pack(grid, layout, 0, 0, 50, 100);
+
+ /* Image */
+ image = elm_image_add(grid);
+ snprintf(buf, sizeof(buf), "%s/data/images/tizen.png", BINDIR);
+ elm_image_file_set(image, buf, NULL);
+ evas_object_show(image);
+ elm_grid_pack(grid, image, 50, 0, 50, 85);
+
+ /* Box */
+ box = elm_box_add(grid);
+ elm_box_horizontal_set(box, EINA_TRUE);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_padding_set(box, ELM_SCALE_SIZE(50), 0);
+ evas_object_show(box);
+ elm_grid_pack(grid, box, 0, 0, 100, 100);
+
+ /* Previous Page Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Prev");
+ evas_object_smart_callback_add(btn, "clicked", prev_btn_clicked_cb, NULL);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Next Page Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Next");
+ evas_object_smart_callback_add(btn, "clicked", next_btn_clicked_cb, NULL);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ elm_object_content_set(scroller, grid);
+
+ return scroller;
+}
+
+Evas_Object*
+create_title_handle_content(Evas_Object *parent, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb,
+ Evas_Smart_Cb title_show_btn_clicked_cb, Evas_Smart_Cb title_hide_btn_clicked_cb,
+ Evas_Smart_Cb title_show_anim_btn_clicked_cb, Evas_Smart_Cb title_hide_anim_btn_clicked_cb, ui_view *view)
+{
+ Elm_Grid *grid;
+ Elm_Box *box;
+ Elm_Layout *layout;
+ Elm_Button *btn;
+
+ /* Grid */
+ grid = elm_grid_add(parent);
+ evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(grid);
+
+ /* NoContent Layout */
+ layout = elm_layout_add(grid);
+ elm_layout_theme_set(layout, "layout", "nocontents", "default");
+ elm_object_part_text_set(layout, "elm.text", NULL);
+ evas_object_show(layout);
+ elm_grid_pack(grid, layout, 0, 0, 100, 100);
+
+ /* Box */
+ box = elm_box_add(grid);
+ //elm_box_horizontal_set(box, EINA_TRUE);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ //elm_box_padding_set(box, ELM_SCALE_SIZE(50), 0);
+ evas_object_show(box);
+ elm_grid_pack(grid, box, 25, 15, 50, 50);
+
+ /* Title Show Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Title Show");
+ evas_object_smart_callback_add(btn, "clicked", title_show_btn_clicked_cb, view);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Title Hide Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Title Hide");
+ evas_object_smart_callback_add(btn, "clicked", title_hide_btn_clicked_cb, view);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Title Show Anim Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Title Show Anim");
+ evas_object_smart_callback_add(btn, "clicked", title_show_anim_btn_clicked_cb, view);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Title Hide Anim Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Title Hide Anim");
+ evas_object_smart_callback_add(btn, "clicked", title_hide_anim_btn_clicked_cb, view);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Box */
+ box = elm_box_add(grid);
+ elm_box_horizontal_set(box, EINA_TRUE);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 1.0);
+ elm_box_padding_set(box, ELM_SCALE_SIZE(50), 0);
+ evas_object_show(box);
+ elm_grid_pack(grid, box, 0, 0, 100, 100);
+
+ /* Previous Page Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Prev");
+ evas_object_smart_callback_add(btn, "clicked", prev_btn_clicked_cb, NULL);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Next Page Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Next");
+ evas_object_smart_callback_add(btn, "clicked", next_btn_clicked_cb, NULL);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ return grid;
+}
+
+Evas_Object*
+create_scrolling_content(Evas_Object *parent)
+{
+ char buf[PATH_MAX];
+ Elm_Image *image;
+
+ /* Image */
+ image = elm_image_add(parent);
+ snprintf(buf, sizeof(buf), "%s/data/images/bg.png", BINDIR);
+ elm_image_file_set(image, buf, NULL);
+ elm_image_resizable_set(image, EINA_FALSE, EINA_FALSE);
+ evas_object_show(image);
+
+ return image;
+}
+
+Evas_Object*
+create_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb)
+{
+ Elm_Grid *grid;
+ Elm_Box *box;
+ Elm_Layout *layout;
+ Elm_Scroller *scroller;
+ Elm_Button *btn;
+
+ /* Scroller */
+ scroller = elm_scroller_add(parent);
+ elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
+ elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
+
+ /* Grid */
+ grid = elm_grid_add(scroller);
+ evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(grid);
+
+ /* NoContent Layout */
+ layout = elm_layout_add(grid);
+ elm_layout_theme_set(layout, "layout", "nocontents", "default");
+ elm_object_part_text_set(layout, "elm.text", text);
+ evas_object_show(layout);
+ elm_grid_pack(grid, layout, 0, 0, 100, 100);
+
+ /* Box */
+ box = elm_box_add(grid);
+ elm_box_horizontal_set(box, EINA_TRUE);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_padding_set(box, ELM_SCALE_SIZE(50), 0);
+ evas_object_show(box);
+ elm_grid_pack(grid, box, 0, 0, 100, 100);
+
+ /* Previous Page Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Prev");
+ evas_object_smart_callback_add(btn, "clicked", prev_btn_clicked_cb, NULL);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Next Page Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Next");
+ evas_object_smart_callback_add(btn, "clicked", next_btn_clicked_cb, NULL);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ elm_object_content_set(scroller, grid);
+
+ return scroller;
+}
+
+Elm_Toolbar*
+create_toolbar(Evas_Object *parent, const char *style)
+{
+ Elm_Toolbar *toolbar;
+
+ toolbar = elm_toolbar_add(parent);
+
+ //FIXME: :( UI_View can set this style instead.
+ elm_object_style_set(toolbar, style);
+
+ //FIXME: If not call below API, toolbar items create with min size.
+ // It looks toolbar bug.
+ elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
+
+ elm_toolbar_item_append(toolbar, NULL, "Tab1", NULL, NULL);
+ elm_toolbar_item_append(toolbar, NULL, "Tab2", NULL, NULL);
+ elm_toolbar_item_append(toolbar, NULL, "Tab3", NULL, NULL);
+ elm_toolbar_item_append(toolbar, NULL, "Tab4", NULL, NULL);
+
+ return toolbar;
+}
+
+//=================================================================================
+//================================== View 16 ======================================
+//=================================================================================
+
+static void
+view16_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view16_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_DEACTIVATE();
+}
+
+static void
+view16_title_show_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ ui_view *view = data;
+ ui_standard_view_title_visible_set(view, true, false);
+}
+
+static void
+view16_title_hide_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ ui_view *view = data;
+ ui_standard_view_title_visible_set(view, false, false);
+}
+
+static void
+view16_title_show_anim_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ ui_view *view = data;
+ ui_standard_view_title_visible_set(view, true, true);
+}
+
+static void
+view16_title_hide_anim_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ ui_view *view = data;
+ ui_standard_view_title_visible_set(view, false, true);
+}
+
+static void
+view16_load_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_title_handle_content(this->get_base(),
+ view16_prev_btn_clicked_cb, view16_next_btn_clicked_cb,
+ view16_title_show_btn_clicked_cb, view16_title_hide_btn_clicked_cb,
+ view16_title_show_anim_btn_clicked_cb, view16_title_hide_anim_btn_clicked_cb, view);
+
+ ui_standard_view_content_set(view, content, "Page16", NULL, NULL);
+}
+
+static void
+create_page16()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+
+ lifecycle_callback.load = view16_load_cb;
+
+ ui_view *view = ui_standard_view_create("page16");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//=================================================================================
+//================================== View 15 ======================================
+//=================================================================================
+
+static void
+view15_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page16();
+}
+
+static void
+view15_load_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_scrolling_content(base_layout);
+
+ ui_standard_view_content_set(view, content, "Page 15 Scroller In Viewmgr", NULL, NULL);
+
+ //Title Right button
+ Elm_Button *right_btn = elm_button_add(this->get_base());
+ elm_object_text_set(right_btn, "Next");
+ evas_object_smart_callback_add(right_btn, "clicked", view15_btn_clicked_cb, NULL);
+
+ ui_standard_view_title_right_btn_set(view, right_btn);
+}
+
+static void
+create_page15()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+
+ lifecycle_callback.load = view15_load_cb;
+
+ ui_view *view = ui_standard_view_create("page15");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//=================================================================================
+//================================== View 14 ======================================
+//=================================================================================
+
+static void
+view14_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view14_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page15();
+}
+
+static void
+view14_load_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>None Transition",
+ view14_prev_btn_clicked_cb, view14_next_btn_clicked_cb);
+
+ ui_standard_view_content_set(view, content, "Page14", NULL, NULL);
+}
+
+static void
+create_page14()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+
+ lifecycle_callback.load = view14_load_cb;
+
+ ui_view *view = ui_standard_view_create("page14");
+ ui_view_transition_style_set(view, "none");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//=================================================================================
+//================================== View 13 ======================================
+//=================================================================================
+
+static void
+view13_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view13_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page14();
+}
+
+static void
+view13_load_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Fade Transition",
+ view13_prev_btn_clicked_cb, view13_next_btn_clicked_cb);
+
+ ui_standard_view_content_set(view, content, "Page13", NULL, NULL);
+}
+
+static void
+create_page13()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+
+ lifecycle_callback.load = view13_load_cb;
+
+ ui_view *view = ui_standard_view_create("page13");
+ ui_view_transition_style_set(view, "fade");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//=================================================================================
+//================================== View 12 ======================================
+//=================================================================================
+
+static void
+view12_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view12_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page13();
+}
+
+static void
+popup_block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ elm_poopup_dismiss(obj);
+}
+
+static void
+popup_timeout_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ elm_poopup_dismiss(obj);
+}
+static void
+popup_dismissed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ //FIXME: remove dismissed callback because this callback is called twice.
+ //It seems this is an efl or popup error, not this ui_popup nor example.
+ evas_object_smart_callback_del(obj, "dismissed", popup_dismissed_cb);
+ ui_popup *popup = data;
+
+ //Is It right?
+ ui_popup_del(popup);
+}
+
+static void
+view12_btn_clicked(void *data, Evas_Object *obj, void *event_info)
+{
+ ui_view *view = data;
+
+ //Create popup.
+ //FIXME: is overlay a proper name?
+ ui_popup *popup = ui_popup_create(view);
+
+ Elm_Popup *obj = elm_popup_add(ui_view_base_get(view));
+ elm_object_text_set(obj, "This popup has only text which is set via desc set function, (This popup gets hidden when user clicks outside) here timeout of 3 sec is set.");
+ elm_popup_timeout_set(obj, 3.0);
+ evas_object_smart_callback_add(obj, "dismissed", popup_dismissed_cb, popup);
+ evas_object_smart_callback_add(obj, "block,clicked", popup_block_clicked_cb. NULL);
+ evas_object_smart_callback_add(obj, "timeout", popup_timeout_cb, NULL);
+
+ ui_popup_content_set(popup, obj);
+ ui_popup_activate(popup);
+}
+
+static void
+view12_load_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Popup",
+ view12_prev_btn_clicked_cb, view12_next_btn_clicked_cb);
+
+ ui_standard_view_content_set(view, content, "Page12", NULL, NULL);
+
+ //Title Right button
+ Elm_Button *right_btn = elm_button_add(base_layout);
+ elm_object_text_set(right_btn, "popup");
+ evas_object_smart_callback_add(right_btn, "clicked", view12_btn_clicked, view);
+
+ ui_standard_view_title_right_btn_set(view, right_btn);
+}
+
+static void
+create_page12()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+ lifecycle_callback.load = view12_load_cb;
+
+ ui_view *view = ui_standard_view_create("page12");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//=================================================================================
+//================================== View 11 ======================================
+//=================================================================================
+
+
+static void
+view11_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+ ol ui_popup_content_set(ui_popup *popup, Elm_Popup *popup);
+ bool ui_popup_activate(ui_popup *popup);
+
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view11_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page12();
+}
+
+static void
+view11_load_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Menu Popup",
+ view11_prev_btn_clicked_cb, view11_next_btn_clicked_cb);
+
+ ui_standard_view_content_set(view, content, "Page11", NULL, NULL);
+}
+
+static void ctxpopup_item_select_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ Elm_Object_Item *it = event_info;
+ elm_ctxpopup_dismiss(obj);
+ LOGE("Item (%s) is selected", elm_object_item_text_get(it));
+}
+
+static void
+view11_menu_cb(ui_menu *menu, void *data)
+{
+ Elm_Ctxpopup *ctxpopup = elm_ctxpopup_add(menu->get_base());
+ elm_ctxpopup_item_append(ctxpopup, "Phone calls", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Favorites", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Search", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Dialer", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Add contact", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Phone calls", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Favorites", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Search", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Dialer", NULL, ctxpopup_item_select_cb, this);
+
+ ui_menu_content_set(menu, ctxpopup);
+}
+
+static void
+create_page11()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+
+ lifecycle_callback.load = view11_load_cb;
+ event_callback.menu = view11_menu_cb;
+
+ ui_view *view = ui_standard_view_create("page11");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ int ret = ui_view_event_callbacks_set(view, &event_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//=================================================================================
+//================================== View 10 ======================================
+//=================================================================================
+
+static void
+view10_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view10_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page11();
+}
+
+static void
+view10_rotate_cb(ui_view *view, int degree, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ if (degree == 0 || degree == 180)
+ {
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Rotation",
+ view10_prev_btn_clicked_cb, view10_next_btn_clicked_cb);
+
+ ui_standard_view_content_set(view, content, "Page10", NULL, NULL);
+ ui_view_indicator_set(view, UI_VIEW_INDICATOR_DEFAULT);
+ }
+ else
+ {
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Rotation",
+ view10_prev_btn_clicked_cb, view10_next_btn_clicked_cb);
+
+ ui_standard_view_content_set(view, content, "Page10", NULL. NULL);
+ ui_view_indicator_set(view, UI_VIEW_INDICATOR_OPTIMAL);
+ }
+}
+
+static void
+view10_load_cb(ui_view *view, void *data)
+{
+ view10_rotate_cb(view, data);
+}
+
+static void
+create_page10()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+ ui_view_event_callback_s event_callback = {0, };
+
+ lifecycle_callback.load = view10_load_cb;
+ event_callback.rotate = view10_rotate_cb;
+
+ ui_view *view = ui_standard_view_create("page10");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ int ret = ui_view_event_callbacks_set(view, &event_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//================================================================================
+//================================== View 9 ======================================
+//================================================================================
+
+static void
+view9_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view9_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page10();
+}
+
+static void
+view9_portrait_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Portrait/Landscape",
+ view9_prev_btn_clicked_cb, view9_next_btn_clicked_cb);
+
+ ui_standard_view_content_set(view, content, "Page9", NULL, NULL);
+ ui_view_indicator_set(view, UI_VIEW_INDICATOR_DEFAULT);
+}
+
+static void
+view9_landscape_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Portrait/Landscape",
+ view9_prev_btn_clicked_cb, view9_next_btn_clicked_cb);
+
+ ui_standard_view_content_set(view, content, "Page9", NULL, NULL);
+ ui_view_indicator_set(view, UI_VIEW_INDICATOR_OPTIMAL);
+}
+
+static void
+view9_load_cb(ui_view *view, void *data)
+{
+ if (ui_view_degree_get(view) == 90 || ui_view_degree_get(view) == 270)
+ view9_landscape_cb(view, data);
+ else
+ view9_portrait_cb(view, data);
+}
+
+static void
+create_page9()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+ ui_view_event_callback_s event_callback = {0, };
+
+ lifecycle_callback.load = view9_load_cb;
+
+ event_callback.portrait = view9_portrait_cb;
+ event_callback.landscape = view9_landscape_cb;
+
+ ui_view *view = ui_standard_view_create("page9");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ int ret = ui_view_event_callbacks_set(view, &event_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//================================================================================
+//================================== View 8 ======================================
+//================================================================================
+
+static void
+view8_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view8_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page9();
+}
+
+static void
+create_page8()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+ ui_view *view = ui_standard_view_create("page7");
+
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Content Preload",
+ view8_prev_btn_clicked_cb, view8_next_btn_clicked_cb);
+
+ ui_view_removable_content(view, false);
+ ui_standard_view_content_set(view, content, "Page7", NULL, NULL);
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//================================================================================
+//================================== View 7 ======================================
+//================================================================================
+
+static void
+view7_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view7_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page8();
+}
+
+static void
+view7_load_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Navigationbarr",
+ view7_prev_btn_clicked_cb, view7_next_btn_clicked_cb);
+
+ ui_standard_view_content_set(view, content, "Page7", NULL, NULL);
+ Elm_Toolbar *toolbar = create_toolbar(base_layout, "navigarionbar");
+ ui_standard_view_toolbar_set(view, toolbar);
+}
+
+static void
+create_page7()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+
+ lifecycle_callback.load = view7_load_cb;
+
+ ui_view *view = ui_standard_view_create("page7");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//================================================================================
+//================================== View 6 ======================================
+//================================================================================
+
+static void
+view6_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view6_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page7();
+}
+
+static void
+view6_load_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Toolbar",
+ view6_prev_btn_clicked_cb, view6_next_btn_clicked_cb);
+
+ ui_standard_view_content_set(view, content, "Page6", NULL, NULL);
+ Elm_Toolbar *toolbar = create_toolbar(base_layout, "toolbar_with_title");
+ ui_standard_view_toolbar_set(view, toolbar);
+}
+
+static void
+create_page6()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+ lifecycle_callback.load = view6_load_cb;
+
+ ui_view *view = ui_standard_view_create("page6");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//================================================================================
+//================================== View 5 ======================================
+//================================================================================
+
+static void
+view5_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view5_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page6();
+}
+
+static void
+view5_load_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Full View",
+ view5_prev_btn_clicked_cb, view5_next_btn_clicked_cb);
+
+ ui_view_content_set(view, content);
+ ui_view_indicator_set(view, UI_VIEW_INDICATOR_HIDE);
+}
+
+static void
+create_page5()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+
+ lifecycle_callback.load = view5_load_cb;
+
+ ui_view *view = ui_view_create("page5");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//================================================================================
+//================================== View 4 ======================================
+//================================================================================
+
+static void
+view4_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view4_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page5();
+}
+
+static void
+view4_load_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Title Badge",
+ view4_prev_btn_clicked_cb, view4_next_btn_clicked_cb);
+
+ ui_standard_view_content_set(view, content, "Page4 We put a long title here intentionally", NULL, NULL);
+ ui_standard_view_title_badge_set(view, "999+");
+}
+
+static void
+create_page4()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+ lifecycle_callback.load = view4_load_cb;
+
+ ui_view *view = ui_standard_view_create("page4");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//================================================================================
+//================================== View 3 ======================================
+//================================================================================
+
+static void
+view3_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view3_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page4();
+}
+
+static void
+view3_load_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Subtitle",
+ view3_prev_btn_clicked_cb, view3_next_btn_clicked_cb);
+
+ ui_standard_view_content_set(view, content, "Page3", "Subtitle", NULL, NULL);
+}
+
+static void
+create_page3()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+
+ lifecycle_callback.load = view3_load_cb;
+
+ ui_view *view = ui_standard_view_create("page3");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//================================================================================
+//================================== View 2 ======================================
+//================================================================================
+
+static void
+view2_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_VIEW_POP();
+}
+
+static void
+view2_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page3();
+}
+
+static void
+view2_load_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Title Buttons",
+ view2_prev_btn_clicked_cb, view2_next_btn_clicked_cb);
+
+ //Title left button
+ Elm_Button *left_title_btn = elm_button_add(this->get_base());
+ elm_object_text_set(left_title_btn, "Cancel");
+
+ //Title right button
+ Elm_Button *right_title_btn = elm_button_add(this->get_base());
+ elm_object_text_set(right_title_btn, "Done");
+
+ ui_standard_view_content_set(view, content, "Page2", NULL, left_title_btn, right_title_btn);
+}
+
+static void
+create_page2()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+
+ lifecycle_callback.load = view2_load_cb;
+
+ ui_view *view = ui_standard_view_create("page2");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+//================================================================================
+//================================== View 1 ======================================
+//================================================================================
+
+static void
+view1_prev_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ UI_VIEWMGR_DEACTIVATE();
+}
+
+static void
+view1_next_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ create_page2();
+}
+
+static void
+view1_load_cb(ui_view *view, void *data)
+{
+ Evas_Object *base_layout = ui_view_base_get(view);
+
+ Evas_Object *content = create_content(base_layout, "ViewMgr Demo<br>Page 1",
+ view1_prev_btn_clicked_cb, view1_next_btn_clicked_cb);
+
+ ui_standard_view_content_set(view, content, "Page1", NULL, NULL, NULL);
+}
+
+static void
+create_page1()
+{
+ ui_view_lifecycle_callback_s lifecycle_callback = {0, };
+
+ lifecycle_callback.load = view1_load_cb;
+
+ ui_view *view = ui_standard_view_create("page1");
+
+ int ret = ui_view_lifecycle_callbacks_set(view, &lifecycle_callback, NULL);
+ if (ret != 0)
+ {
+ //TODO
+ }
+
+ UI_VIEWMGR_VIEW_PUSH(view);
+}
+
+static bool
+app_create(void *data)
+{
+ create_page1();
+
+ return true;
+}
+
+int
+main(int argc, char *argv[])
+{
+ appdata_s ad = {0,};
+ int ret;
+
+ ui_app_lifecycle_callback_s event_callback = {0,};
+
+ event_callback.create = app_create;
+ event_callback.terminate = app_terminate;
+ event_callback.pause = app_pause;
+ event_callback.resume = app_resume;
+ event_callback.app_control = app_control;
+
+ ret = ui_app_init(PACKAGE, LOCALE_DIR);
+ if (ret != 0)
+ {
+ //TODO
+ return ret;
+ }
+
+ app_event_handler_h handlers[5] = {NULL, };
+
+ ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, &ad);
+ ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad);
+ ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);
+ ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad);
+ ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad)
+
+
+ return ui_app_run(argc, argv, &event_callback, &ad);
+}
--- /dev/null
+//This is to check CAPIs.
+#include "main.h"
+
+static bool
+app_create(void *data)
+{
+ ui_app_init(NULL, NULL);
+ ui_app_run(0, NULL, NULL, NULL);
+ ui_menu_content_set(NULL, NULL);
+ ui_popup_content_set(NULL, NULL);
+ ui_popup_activate(NULL);
+ ui_popup_del(NULL);
+ ui_standard_view_create(NULL);
+ ui_view_lifecycle_callbacks_set(NULL, NULL, NULL);
+ ui_view_base_get(NULL);
+ ui_view_content_set(NULL, NULL);
+ ui_standard_view_content_set(NULL, NULL, NULL, NULL, NULL, NULL);
+ ui_standard_view_title_badge_set(NULL, NULL);
+ ui_view_indicator_set(NULL, UI_VIEW_INDICATOR_DEFAULT);
+ ui_standard_view_toolbar_set(NULL, NULL);
+ ui_view_removable_content(NULL, false);
+ ui_view_event_callbacks_set(NULL, NULL, NULL);
+ ui_standard_view_title_right_btn_set(NULL, NULL);
+ ui_standard_view_title_visible_set(NULL, false, false);
+ UI_VIEWMGR_VIEW_DEACTIVATE();
+ UI_VIEWMGR_VIEW_PUSH(NULL);
+ UI_VIEWMGR_VIEW_POP();
+
+ return true;
+}
+
+int
+main(int argc, char *argv[])
+{
+ appdata_s ad = {0,};
+ int ret = 0;
+
+ ui_app_lifecycle_callback_s event_callback = {0,};
+
+ ret = ui_app_init(PACKAGE, LOCALE_DIR);
+
+ event_callback.create = app_create;
+
+ ret = ui_app_main(argc, argv, &event_callback, &ad);
+ if (ret != APP_ERROR_NONE) {
+ dlog_print(DLOG_ERROR, LOG_TAG, "ui_app_main() is failed. err = %d", ret);
+ }
+
+ return ret;
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include <app.h>
+#include <system_settings.h>
+#include <Elementary.h>
+#include <dlog.h>
+#include <ui_viewmanager.h>
+
+//uncomment if you want debug
+#ifndef TIZEN_ENGINEER_MODE
+#define TIZEN_ENGINEER_MODE
+#endif
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "UI_VIEWMGR"
+
+#if !defined(PACKAGE)
+#define PACKAGE "ui-viewmgr"
+#endif
+
+typedef struct appdata {
+ Evas_Object *win;
+ Evas_Object *conform;
+ Evas_Object *layout;
+ Evas_Object *nf;
+ Evas_Object *tabbar;
+} appdata_s;
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#include "main.h"
-
-Elm_Toolbar*
-create_toolbar(Evas_Object *parent, const char *style)
-{
- Elm_Toolbar *toolbar;
-
- toolbar = elm_toolbar_add(parent);
-
- //FIXME: :( UI_View can set this style instead.
- elm_object_style_set(toolbar, style);
-
- //FIXME: If not call below API, toolbar items create with min size.
- // It looks toolbar bug.
- elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
-
- elm_toolbar_item_append(toolbar, NULL, "Tab1", NULL, NULL);
- elm_toolbar_item_append(toolbar, NULL, "Tab2", NULL, NULL);
- elm_toolbar_item_append(toolbar, NULL, "Tab3", NULL, NULL);
- elm_toolbar_item_append(toolbar, NULL, "Tab4", NULL, NULL);
-
- return toolbar;
-}
-
-Evas_Object*
-create_scrolling_content(Evas_Object *parent)
-{
- char buf[PATH_MAX];
- Elm_Image *image;
-
- /* Image */
- image = elm_image_add(parent);
- snprintf(buf, sizeof(buf), "%s/data/images/bg.png", BINDIR);
- elm_image_file_set(image, buf, NULL);
- elm_image_resizable_set(image, EINA_FALSE, EINA_FALSE);
- evas_object_show(image);
-
- return image;
-}
-
-Evas_Object*
-create_landscape_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb)
-{
- char buf[PATH_MAX];
- Elm_Grid *grid;
- Elm_Box *box;
- Elm_Layout *layout;
- Elm_Scroller *scroller;
- Elm_Button *btn;
- Elm_Image *image;
-
- /* Scroller */
- scroller = elm_scroller_add(parent);
- elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
- elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
-
- /* Grid */
- grid = elm_grid_add(scroller);
- evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(grid);
-
- /* NoContent Layout */
- layout = elm_layout_add(grid);
- elm_layout_theme_set(layout, "layout", "nocontents", "default");
- elm_object_part_text_set(layout, "elm.text", text);
- evas_object_show(layout);
- elm_grid_pack(grid, layout, 0, 0, 50, 100);
-
- /* Image */
- image = elm_image_add(grid);
- snprintf(buf, sizeof(buf), "%s/data/images/tizen.png", BINDIR);
- elm_image_file_set(image, buf, NULL);
- evas_object_show(image);
- elm_grid_pack(grid, image, 50, 0, 50, 85);
-
- /* Box */
- box = elm_box_add(grid);
- elm_box_horizontal_set(box, EINA_TRUE);
- evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_box_padding_set(box, ELM_SCALE_SIZE(50), 0);
- evas_object_show(box);
- elm_grid_pack(grid, box, 0, 0, 100, 100);
-
- /* Previous Page Button */
- btn = elm_button_add(grid);
- evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
- elm_object_text_set(btn, "Prev");
- evas_object_smart_callback_add(btn, "clicked", prev_btn_clicked_cb, NULL);
- evas_object_show(btn);
- elm_box_pack_end(box, btn);
-
- /* Next Page Button */
- btn = elm_button_add(grid);
- evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
- elm_object_text_set(btn, "Next");
- evas_object_smart_callback_add(btn, "clicked", next_btn_clicked_cb, NULL);
- evas_object_show(btn);
- elm_box_pack_end(box, btn);
-
- elm_object_content_set(scroller, grid);
-
- return scroller;
-}
-
-Evas_Object*
-create_title_handle_content(Evas_Object *parent, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb,
- Evas_Smart_Cb title_show_btn_clicked_cb, Evas_Smart_Cb title_hide_btn_clicked_cb,
- Evas_Smart_Cb title_show_anim_btn_clicked_cb, Evas_Smart_Cb title_hide_anim_btn_clicked_cb, ui_view *view)
-{
- Elm_Grid *grid;
- Elm_Box *box;
- Elm_Layout *layout;
- Elm_Button *btn;
-
- /* Grid */
- grid = elm_grid_add(parent);
- evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(grid);
-
- /* NoContent Layout */
- layout = elm_layout_add(grid);
- elm_layout_theme_set(layout, "layout", "nocontents", "default");
- elm_object_part_text_set(layout, "elm.text", NULL);
- evas_object_show(layout);
- elm_grid_pack(grid, layout, 0, 0, 100, 100);
-
- /* Box */
- box = elm_box_add(grid);
- //elm_box_horizontal_set(box, EINA_TRUE);
- evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
- //elm_box_padding_set(box, ELM_SCALE_SIZE(50), 0);
- evas_object_show(box);
- elm_grid_pack(grid, box, 25, 15, 50, 50);
-
- /* Title Show Button */
- btn = elm_button_add(grid);
- evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
- elm_object_text_set(btn, "Title Show");
- evas_object_smart_callback_add(btn, "clicked", title_show_btn_clicked_cb, view);
- evas_object_show(btn);
- elm_box_pack_end(box, btn);
-
- /* Title Hide Button */
- btn = elm_button_add(grid);
- evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
- elm_object_text_set(btn, "Title Hide");
- evas_object_smart_callback_add(btn, "clicked", title_hide_btn_clicked_cb, view);
- evas_object_show(btn);
- elm_box_pack_end(box, btn);
-
- /* Title Show Anim Button */
- btn = elm_button_add(grid);
- evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
- elm_object_text_set(btn, "Title Show Anim");
- evas_object_smart_callback_add(btn, "clicked", title_show_anim_btn_clicked_cb, view);
- evas_object_show(btn);
- elm_box_pack_end(box, btn);
-
- /* Title Hide Anim Button */
- btn = elm_button_add(grid);
- evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
- elm_object_text_set(btn, "Title Hide Anim");
- evas_object_smart_callback_add(btn, "clicked", title_hide_anim_btn_clicked_cb, view);
- evas_object_show(btn);
- elm_box_pack_end(box, btn);
-
- /* Box */
- box = elm_box_add(grid);
- elm_box_horizontal_set(box, EINA_TRUE);
- evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 1.0);
- elm_box_padding_set(box, ELM_SCALE_SIZE(50), 0);
- evas_object_show(box);
- elm_grid_pack(grid, box, 0, 0, 100, 100);
-
- /* Previous Page Button */
- btn = elm_button_add(grid);
- evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
- elm_object_text_set(btn, "Prev");
- evas_object_smart_callback_add(btn, "clicked", prev_btn_clicked_cb, NULL);
- evas_object_show(btn);
- elm_box_pack_end(box, btn);
-
- /* Next Page Button */
- btn = elm_button_add(grid);
- evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
- elm_object_text_set(btn, "Next");
- evas_object_smart_callback_add(btn, "clicked", next_btn_clicked_cb, NULL);
- evas_object_show(btn);
- elm_box_pack_end(box, btn);
-
- return grid;
-}
-
-Evas_Object*
-create_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb)
-{
- Elm_Grid *grid;
- Elm_Box *box;
- Elm_Layout *layout;
- Elm_Scroller *scroller;
- Elm_Button *btn;
-
- /* Scroller */
- scroller = elm_scroller_add(parent);
- elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
- elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
-
- /* Grid */
- grid = elm_grid_add(scroller);
- evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(grid);
-
- /* NoContent Layout */
- layout = elm_layout_add(grid);
- elm_layout_theme_set(layout, "layout", "nocontents", "default");
- elm_object_part_text_set(layout, "elm.text", text);
- evas_object_show(layout);
- elm_grid_pack(grid, layout, 0, 0, 100, 100);
-
- /* Box */
- box = elm_box_add(grid);
- elm_box_horizontal_set(box, EINA_TRUE);
- evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
- elm_box_padding_set(box, ELM_SCALE_SIZE(50), 0);
- evas_object_show(box);
- elm_grid_pack(grid, box, 0, 0, 100, 100);
-
- /* Previous Page Button */
- btn = elm_button_add(grid);
- evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
- elm_object_text_set(btn, "Prev");
- evas_object_smart_callback_add(btn, "clicked", prev_btn_clicked_cb, NULL);
- evas_object_show(btn);
- elm_box_pack_end(box, btn);
-
- /* Next Page Button */
- btn = elm_button_add(grid);
- evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
- elm_object_text_set(btn, "Next");
- evas_object_smart_callback_add(btn, "clicked", next_btn_clicked_cb, NULL);
- evas_object_show(btn);
- elm_box_pack_end(box, btn);
-
- elm_object_content_set(scroller, grid);
-
- return scroller;
-}
--- /dev/null
+SET(SRCS
+ contents.cpp
+ main.cpp
+ )
+
+ADD_EXECUTABLE(${BINNAME} ${SRCS})
+
+ADD_DEFINITIONS("-DBINDIR=\"${BINDIR}\"")
+
+PKG_CHECK_MODULES(BIN_PKGS REQUIRED elementary dlog capi-appfw-application capi-system-system-settings appcore-efl capi-appfw-app-manager)
+
+FOREACH(flag ${BIN_PKGS_CFLAGS})
+ SET(PKG_CFLAGS "${PKG_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET_TARGET_PROPERTIES(${BINNAME} PROPERTIES COMPILE_FLAGS "${PKG_CFLAGS}" LINK_FLAGS -pie)
+TARGET_LINK_LIBRARIES(${BINNAME} ${BIN_PKGS_LDFLAGS} ${LIBNAME})
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PKG_CFLAGS}")
+
+INSTALL(TARGETS ${BINNAME} DESTINATION ${BINDIR}/bin)
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "main.h"
+
+Elm_Toolbar*
+create_toolbar(Evas_Object *parent, const char *style)
+{
+ Elm_Toolbar *toolbar;
+
+ toolbar = elm_toolbar_add(parent);
+
+ //FIXME: :( UI_View can set this style instead.
+ elm_object_style_set(toolbar, style);
+
+ //FIXME: If not call below API, toolbar items create with min size.
+ // It looks toolbar bug.
+ elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
+
+ elm_toolbar_item_append(toolbar, NULL, "Tab1", NULL, NULL);
+ elm_toolbar_item_append(toolbar, NULL, "Tab2", NULL, NULL);
+ elm_toolbar_item_append(toolbar, NULL, "Tab3", NULL, NULL);
+ elm_toolbar_item_append(toolbar, NULL, "Tab4", NULL, NULL);
+
+ return toolbar;
+}
+
+Evas_Object*
+create_scrolling_content(Evas_Object *parent)
+{
+ char buf[PATH_MAX];
+ Elm_Image *image;
+
+ /* Image */
+ image = elm_image_add(parent);
+ snprintf(buf, sizeof(buf), "%s/data/images/bg.png", BINDIR);
+ elm_image_file_set(image, buf, NULL);
+ elm_image_resizable_set(image, EINA_FALSE, EINA_FALSE);
+ evas_object_show(image);
+
+ return image;
+}
+
+Evas_Object*
+create_landscape_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb)
+{
+ char buf[PATH_MAX];
+ Elm_Grid *grid;
+ Elm_Box *box;
+ Elm_Layout *layout;
+ Elm_Scroller *scroller;
+ Elm_Button *btn;
+ Elm_Image *image;
+
+ /* Scroller */
+ scroller = elm_scroller_add(parent);
+ elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
+ elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
+
+ /* Grid */
+ grid = elm_grid_add(scroller);
+ evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(grid);
+
+ /* NoContent Layout */
+ layout = elm_layout_add(grid);
+ elm_layout_theme_set(layout, "layout", "nocontents", "default");
+ elm_object_part_text_set(layout, "elm.text", text);
+ evas_object_show(layout);
+ elm_grid_pack(grid, layout, 0, 0, 50, 100);
+
+ /* Image */
+ image = elm_image_add(grid);
+ snprintf(buf, sizeof(buf), "%s/data/images/tizen.png", BINDIR);
+ elm_image_file_set(image, buf, NULL);
+ evas_object_show(image);
+ elm_grid_pack(grid, image, 50, 0, 50, 85);
+
+ /* Box */
+ box = elm_box_add(grid);
+ elm_box_horizontal_set(box, EINA_TRUE);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_padding_set(box, ELM_SCALE_SIZE(50), 0);
+ evas_object_show(box);
+ elm_grid_pack(grid, box, 0, 0, 100, 100);
+
+ /* Previous Page Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Prev");
+ evas_object_smart_callback_add(btn, "clicked", prev_btn_clicked_cb, NULL);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Next Page Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Next");
+ evas_object_smart_callback_add(btn, "clicked", next_btn_clicked_cb, NULL);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ elm_object_content_set(scroller, grid);
+
+ return scroller;
+}
+
+Evas_Object*
+create_title_handle_content(Evas_Object *parent, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb,
+ Evas_Smart_Cb title_show_btn_clicked_cb, Evas_Smart_Cb title_hide_btn_clicked_cb,
+ Evas_Smart_Cb title_show_anim_btn_clicked_cb, Evas_Smart_Cb title_hide_anim_btn_clicked_cb, ui_view *view)
+{
+ Elm_Grid *grid;
+ Elm_Box *box;
+ Elm_Layout *layout;
+ Elm_Button *btn;
+
+ /* Grid */
+ grid = elm_grid_add(parent);
+ evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(grid);
+
+ /* NoContent Layout */
+ layout = elm_layout_add(grid);
+ elm_layout_theme_set(layout, "layout", "nocontents", "default");
+ elm_object_part_text_set(layout, "elm.text", NULL);
+ evas_object_show(layout);
+ elm_grid_pack(grid, layout, 0, 0, 100, 100);
+
+ /* Box */
+ box = elm_box_add(grid);
+ //elm_box_horizontal_set(box, EINA_TRUE);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ //elm_box_padding_set(box, ELM_SCALE_SIZE(50), 0);
+ evas_object_show(box);
+ elm_grid_pack(grid, box, 25, 15, 50, 50);
+
+ /* Title Show Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Title Show");
+ evas_object_smart_callback_add(btn, "clicked", title_show_btn_clicked_cb, view);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Title Hide Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Title Hide");
+ evas_object_smart_callback_add(btn, "clicked", title_hide_btn_clicked_cb, view);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Title Show Anim Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Title Show Anim");
+ evas_object_smart_callback_add(btn, "clicked", title_show_anim_btn_clicked_cb, view);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Title Hide Anim Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Title Hide Anim");
+ evas_object_smart_callback_add(btn, "clicked", title_hide_anim_btn_clicked_cb, view);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Box */
+ box = elm_box_add(grid);
+ elm_box_horizontal_set(box, EINA_TRUE);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 1.0);
+ elm_box_padding_set(box, ELM_SCALE_SIZE(50), 0);
+ evas_object_show(box);
+ elm_grid_pack(grid, box, 0, 0, 100, 100);
+
+ /* Previous Page Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Prev");
+ evas_object_smart_callback_add(btn, "clicked", prev_btn_clicked_cb, NULL);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Next Page Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Next");
+ evas_object_smart_callback_add(btn, "clicked", next_btn_clicked_cb, NULL);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ return grid;
+}
+
+Evas_Object*
+create_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb)
+{
+ Elm_Grid *grid;
+ Elm_Box *box;
+ Elm_Layout *layout;
+ Elm_Scroller *scroller;
+ Elm_Button *btn;
+
+ /* Scroller */
+ scroller = elm_scroller_add(parent);
+ elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
+ elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
+
+ /* Grid */
+ grid = elm_grid_add(scroller);
+ evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(grid);
+
+ /* NoContent Layout */
+ layout = elm_layout_add(grid);
+ elm_layout_theme_set(layout, "layout", "nocontents", "default");
+ elm_object_part_text_set(layout, "elm.text", text);
+ evas_object_show(layout);
+ elm_grid_pack(grid, layout, 0, 0, 100, 100);
+
+ /* Box */
+ box = elm_box_add(grid);
+ elm_box_horizontal_set(box, EINA_TRUE);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_box_padding_set(box, ELM_SCALE_SIZE(50), 0);
+ evas_object_show(box);
+ elm_grid_pack(grid, box, 0, 0, 100, 100);
+
+ /* Previous Page Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Prev");
+ evas_object_smart_callback_add(btn, "clicked", prev_btn_clicked_cb, NULL);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ /* Next Page Button */
+ btn = elm_button_add(grid);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 1.0);
+ elm_object_text_set(btn, "Next");
+ evas_object_smart_callback_add(btn, "clicked", next_btn_clicked_cb, NULL);
+ evas_object_show(btn);
+ elm_box_pack_end(box, btn);
+
+ elm_object_content_set(scroller, grid);
+
+ return scroller;
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "main.h"
+#include "page16.h"
+#include "page15.h"
+#include "page14.h"
+#include "page13.h"
+#include "page12.h"
+#include "page11.h"
+#include "page10.h"
+#include "page9.h"
+#include "page8.h"
+#include "page7.h"
+#include "page6.h"
+#include "page5.h"
+#include "page4.h"
+#include "page3.h"
+#include "page2.h"
+#include "page1.h"
+
+class sample_app: public ui_app
+{
+public:
+ sample_app()
+ : ui_app(PACKAGE, LOCALE_DIR)
+ {
+ }
+ ~sample_app()
+ {
+ }
+
+protected:
+ bool on_create()
+ {
+ if (!ui_app::on_create())
+ {
+ return false;
+ }
+
+ //Push first view in viewmgr.
+ UI_VIEWMGR->push_view(new page1());
+
+ return true;
+ }
+};
+
+int main(int argc, char *argv[])
+{
+ sample_app app;
+ return app.run(argc, argv);
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include <dlog.h>
+#include <ui_viewmanager.h>
+
+//uncomment if you want debug
+#ifndef TIZEN_ENGINEER_MODE
+#define TIZEN_ENGINEER_MODE
+#endif
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "UI_VIEWMGR"
+
+#if !defined(PACKAGE)
+#define PACKAGE "ui-viewmgr"
+#endif
+
+Evas_Object *create_landscape_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb);
+Evas_Object *create_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb);
+Evas_Object *create_scrolling_content(Evas_Object *parent);
+Evas_Object* create_title_handle_content(Evas_Object *parent, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb,
+ Evas_Smart_Cb title_show_btn_clicked_cb, Evas_Smart_Cb title_hide_btn_clicked_cb,
+ Evas_Smart_Cb title_show_anim_btn_clicked_cb, Evas_Smart_Cb title_hide_anim_btn_clicked_cb, ui_view *view);
+Elm_Toolbar *create_toolbar(Evas_Object *parent, const char *style);
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This example create a simple view which is inheritance ui_standard_view.
+ * Then push in viewmgr.
+ */
+class page1: public ui_standard_view
+{
+protected:
+ //on_load() will be called when this page1 is requested to be shown.
+ void on_load()
+ {
+ ui_standard_view::on_load();
+
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Basic View",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->deactivate();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page2());
+ });
+ this->set_content(content, "Page1");
+ }
+
+public:
+ page1() : ui_standard_view("page1") {}
+ ~page1() {}
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This page implements on_rotate() method to create portrait, landscape content.
+ * This page will be created suitable content in on_rotate() method.
+ */
+class page10: public ui_standard_view
+{
+protected:
+ void on_load()
+ {
+ ui_standard_view::on_load();
+ this->on_rotate(this->get_degree());
+ }
+
+ void on_rotate(int degree)
+ {
+ ui_standard_view::on_rotate(degree);
+
+ //Portrait
+ if (this->get_degree() == 0 || this->get_degree() == 180)
+ {
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Rotation",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page11());
+ });
+
+ this->set_content(content, "Page 10");
+ this->set_indicator(UI_VIEW_INDICATOR_DEFAULT);
+ }
+ //Landscape
+ else
+ {
+ Evas_Object *content = create_landscape_content(this->get_base(), "ViewMgr Demo<br>Rotation",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page11());
+ });
+
+ this->set_content(content, "Page 10");
+ this->set_indicator(UI_VIEW_INDICATOR_OPTIMAL);
+ }
+ }
+public:
+ page10() : ui_standard_view("page10") {}
+ ~page10() {}
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+/** This page implement on_menu() method to create ctxpopup when menu HW key clicked.
+ * This page will be created menu(ctxpopup)items in on_menu() method.
+ */
+static void ctxpopup_item_select_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ Elm_Object_Item *it = static_cast<Elm_Object_Item *>(event_info);
+ elm_ctxpopup_dismiss(obj);
+ LOGE("Item (%s) is selected", elm_object_item_text_get(it));
+}
+
+class page11: public ui_standard_view
+{
+protected:
+ void on_load()
+ {
+ ui_standard_view::on_load();
+
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Menu Popup",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page12());
+ });
+
+ this->set_content(content, "Page11");
+ }
+
+ void on_menu(ui_menu *menu)
+ {
+ ui_standard_view::on_menu(menu);
+
+ Elm_Ctxpopup *ctxpopup = elm_ctxpopup_add(menu->get_base());
+ elm_ctxpopup_item_append(ctxpopup, "Phone calls", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Favorites", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Search", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Dialer", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Add contact", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Phone calls", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Favorites", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Search", NULL, ctxpopup_item_select_cb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Dialer", NULL, ctxpopup_item_select_cb, this);
+
+ menu->set_content(ctxpopup);
+ }
+
+public:
+ page11() {}
+ ~page11() {}
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This page inherit ui_ui_standard_view
+ * And make a button on right top side of title area to activate popup.
+ * The created popup has view and it will be managed by viewmgr.
+ */
+
+static void popup_dismissed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ //FIXME: remove dismissed callback because this callback is called twice.
+ //It seems this is an efl or popup error, not this ui_popup nor example.
+ evas_object_smart_callback_del(obj, "dismissed", popup_dismissed_cb);
+ ui_popup *popup = static_cast<ui_popup *>(data);
+ delete (popup);
+}
+
+class page12: public ui_standard_view
+{
+protected:
+ void on_load()
+ {
+ ui_standard_view::on_load();
+
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Popup",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page13());
+ });
+
+ this->set_content(content, "Page12");
+
+ //Title Right button
+ Elm_Button *right_btn = elm_button_add(this->get_base());
+ elm_object_text_set(right_btn, "popup");
+ evas_object_smart_callback_add(right_btn, "clicked",
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ page12 *view = static_cast<page12 *>(data);
+ view->create_popup();
+ },
+ this);
+
+ this->set_title_right_btn(right_btn);
+ }
+
+public:
+ page12() : ui_standard_view("page12") {}
+ ~page12() {}
+
+ void create_popup()
+ {
+ //FIXME: is overlay a proper name?
+ ui_popup *popup = new ui_popup(this);
+
+ Elm_Popup *obj = elm_popup_add(popup->get_base());
+ elm_object_text_set(obj, "This popup has only text which is set via desc set function, (This popup gets hidden when user clicks outside) here timeout of 3 sec is set.");
+ elm_popup_timeout_set(obj, 3.0);
+ evas_object_smart_callback_add(obj, "dismissed", popup_dismissed_cb, popup);
+ evas_object_smart_callback_add(obj, "block,clicked",
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ elm_popup_dismiss(obj);
+ },
+ NULL);
+ evas_object_smart_callback_add(obj, "timeout",
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ elm_popup_dismiss(obj);
+ },
+ NULL);
+
+ popup->set_content(obj);
+ popup->activate();
+ }
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This page inherit ui_ui_standard_view
+ * And make a view transition style as fade.
+ * The fade effect will be shown when view appear or disappear.
+ * The default of transition style of view was slide in/out.
+ */
+class page13: public ui_standard_view
+{
+protected:
+ void on_load()
+ {
+ ui_standard_view::on_load();
+
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Fade Transition",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page14());
+ });
+
+ this->set_content(content, "Page13");
+ }
+
+public:
+ page13() : ui_standard_view("page13")
+ {
+ this->set_transition_style("fade");
+ }
+ ~page13() {}
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This page inherit ui_ui_standard_view
+ * And make a view transition style as none.
+ * There will be no effect when view appear or disappear.
+ * The default of transition style of view was slide in/out.
+ */
+class page14: public ui_standard_view
+{
+protected:
+ void on_load()
+ {
+ ui_standard_view::on_load();
+
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>None Transition",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page15());
+ });
+
+ this->set_content(content, "Page14");
+ }
+
+public:
+ page14() : ui_standard_view("page14")
+ {
+ this->set_transition_style("none");
+ }
+ ~page14(){}
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This page inherit ui_ui_standard_view
+ * This create a content that has same size of screen.
+ * When this view has rotated viewmgr's internal scroller will be enabled automatically.
+ */
+class page15: public ui_standard_view
+{
+protected:
+ void on_load()
+ {
+ ui_standard_view::on_load();
+
+ //Create a main content.
+ Evas_Object *content = create_scrolling_content(this->get_base());
+
+ this->set_content(content, "Page15 Scroller In Viewmgr");
+
+ //Title Right button
+ Elm_Button *right_btn = elm_button_add(this->get_base());
+ elm_object_text_set(right_btn, "Next");
+ evas_object_smart_callback_add(right_btn, "clicked",
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page16());
+ },
+ this);
+
+ this->set_title_right_btn(right_btn);
+ }
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This page inherit ui_ui_standard_view
+ * This view create a lot of buttons to show how to handle title area visible state with animation or no effect.
+ */
+class page16: public ui_standard_view
+{
+protected:
+ void on_load()
+ {
+ ui_standard_view::on_load();
+
+ //Create a main content.
+ Evas_Object *content = create_title_handle_content(this->get_base(),
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->deactivate();
+ },
+ //Title Show Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ ui_standard_view *view = static_cast<ui_standard_view *>(data);
+ view->set_title_visible(true, false);
+ },
+ //Title Hide Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ ui_standard_view *view = static_cast<ui_standard_view *>(data);
+ view->set_title_visible(false, false);
+ },
+ //Title Show Anim Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ ui_standard_view *view = static_cast<ui_standard_view *>(data);
+ view->set_title_visible(true, true);
+ },
+ //Title Hide Anim Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ ui_standard_view *view = static_cast<ui_standard_view *>(data);
+ view->set_title_visible(false, true);
+ }, this);
+
+ this->set_content(content, "Page16");
+ }
+
+public:
+ page16() : ui_standard_view("page16") {}
+ ~page16() {}
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This example create a simple view which is inheritance ui_standard_view.
+ * And add two buttons in view title area. then push in viewmgr.
+ */
+class page2: public ui_standard_view
+{
+protected:
+ void on_load()
+ {
+ ui_standard_view::on_load();
+
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Title Buttons",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page3());
+ });
+
+ //Title left button
+ Elm_Button *left_title_btn = elm_button_add(this->get_base());
+ elm_object_text_set(left_title_btn, "Cancel");
+
+ //Title right button
+ Elm_Button *right_title_btn = elm_button_add(this->get_base());
+ elm_object_text_set(right_title_btn, "Done");
+
+ //Arguments: content, title, subtitle, title left button, title right button
+ this->set_content(content, "Page2", NULL, left_title_btn, right_title_btn);
+ }
+
+public:
+ page2() : ui_standard_view("page2") {}
+ ~page2() {}
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This example create a simple view which is inheritance ui_standard_view.
+ * And set text in view subtitle. then push in viewmgr.
+ */
+class page3: public ui_standard_view
+{
+protected:
+ void on_load()
+ {
+ ui_standard_view::on_load();
+
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Subtitle",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page4());
+ });
+
+ //Arguments: content, title, subtitle, title left button, title right button
+ this->set_content(content, "Page3", "Subtitle", NULL, NULL);
+ }
+
+public:
+ page3() : ui_standard_view("page3") {}
+ ~page3() {}
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This example create a simple view which is inheritance ui_standard_view.
+ * And set long text to title, set badge text in view title area.
+ * Then push in viewmgr.
+ */
+class page4: public ui_standard_view
+{
+protected:
+ void on_load()
+ {
+ ui_standard_view::on_load();
+
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Title Badge",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page5());
+ });
+
+ //Arguments: content, title
+ this->set_content(content, "Page4. We put a long title here intentionally");
+ this->set_title_badge("999+");
+ }
+
+public:
+ page4() : ui_standard_view("page4") {}
+ ~page4() {}
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This page inherit ui_view to show how to create full view.
+ * And set indicator state as hide.
+ */
+class page5: public ui_view
+{
+protected:
+ void on_load()
+ {
+ ui_view::on_load();
+
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Full View",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page6());
+ });
+
+ this->set_content(content);
+ this->set_indicator(UI_VIEW_INDICATOR_HIDE);
+ }
+
+public:
+ page5() : ui_view("page5") {}
+ ~page5() {}
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This page inherit ui_standard_view to show title with toolbar(toolbar_with_title) example.
+ */
+class page6: public ui_standard_view
+{
+protected:
+ void on_load()
+ {
+ ui_standard_view::on_load();
+
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Toolbar",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page7());
+ });
+
+ //Arguments: content, title
+ this->set_content(content, "Page6");
+ Elm_Toolbar *toolbar = create_toolbar(this->get_base(), "toolbar_with_title");
+ this->set_toolbar(toolbar);
+ }
+
+public:
+ page6() : ui_standard_view("page6") {}
+ ~page6() {}
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This page inherit ui_standard_view to show title with toolbar(navigationbar) example.
+ */
+class page7: public ui_standard_view
+{
+protected:
+ void on_load()
+ {
+ ui_standard_view::on_load();
+
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Navigationbar",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page8());
+ });
+
+ //Arguments: content, title
+ this->set_content(content, "Page7");
+ Elm_Toolbar *toolbar = create_toolbar(this->get_base(), "navigationbar");
+ this->set_toolbar(toolbar);
+ }
+public:
+ page7() : ui_standard_view("page7") {}
+ ~page7() {}
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This page shows how to create a view content in advance.
+ */
+class page8: public ui_standard_view
+{
+public:
+ page8() : ui_standard_view("page8")
+ {
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Content Preloading",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page9());
+ });
+
+ //Don't delete view's content when this view poped.
+ this->set_removable_content(false);
+ this->set_content(content, "Page 8");
+ }
+ ~page8() {}
+};
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/** This page inherit ui_standard_view.
+ * And implement on_portait(), on_landscape() method to create portrait, landscape content.
+ * This page will be created suitable content in on_portrait(), on_landscape() method.
+ */
+class page9: public ui_standard_view
+{
+protected:
+ void on_load()
+ {
+ ui_standard_view::on_load();
+
+ //FIXME: Change below code to more convenient and clear way.
+ if (this->get_degree() == 90 || this->get_degree() == 270)
+ this->on_landscape();
+ else
+ this->on_portrait();
+ }
+
+ void on_portrait()
+ {
+ ui_standard_view::on_portrait();
+
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Portrait/Landscape",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page10());
+ });
+
+ this->set_content(content, "Page 9");
+ this->set_indicator(UI_VIEW_INDICATOR_DEFAULT);
+ }
+
+ void on_landscape()
+ {
+ ui_standard_view::on_landscape();
+
+ Evas_Object *content = create_landscape_content(this->get_base(), "ViewMgr Demo<br>Portrait/Landscape",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ UI_VIEWMGR->push_view(new page10());
+ });
+
+ this->set_content(content, "Page 9");
+ this->set_indicator(UI_VIEW_INDICATOR_OPTIMAL);
+ }
+
+public:
+ page9() : ui_standard_view("page9") {}
+ ~page9() {}
+};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#include "main.h"
-#include "page16.h"
-#include "page15.h"
-#include "page14.h"
-#include "page13.h"
-#include "page12.h"
-#include "page11.h"
-#include "page10.h"
-#include "page9.h"
-#include "page8.h"
-#include "page7.h"
-#include "page6.h"
-#include "page5.h"
-#include "page4.h"
-#include "page3.h"
-#include "page2.h"
-#include "page1.h"
-
-class sample_app: public ui_app
-{
-public:
- sample_app()
- : ui_app(PACKAGE, LOCALE_DIR)
- {
- }
- ~sample_app()
- {
- }
-
-protected:
- bool on_create()
- {
- if (!ui_app::on_create())
- {
- return false;
- }
-
- //Push first view in viewmgr.
- UI_VIEWMGR->push_view(new page1());
-
- return true;
- }
-};
-
-int main(int argc, char *argv[])
-{
- sample_app app;
- return app.run(argc, argv);
-}
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#include <dlog.h>
-#include <ui_viewmanager.h>
-
-//uncomment if you want debug
-#ifndef TIZEN_ENGINEER_MODE
-#define TIZEN_ENGINEER_MODE
-#endif
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "UI_VIEWMGR"
-
-#if !defined(PACKAGE)
-#define PACKAGE "ui-viewmgr"
-#endif
-
-Evas_Object *create_landscape_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb);
-Evas_Object *create_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb);
-Evas_Object *create_scrolling_content(Evas_Object *parent);
-Evas_Object* create_title_handle_content(Evas_Object *parent, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb,
- Evas_Smart_Cb title_show_btn_clicked_cb, Evas_Smart_Cb title_hide_btn_clicked_cb,
- Evas_Smart_Cb title_show_anim_btn_clicked_cb, Evas_Smart_Cb title_hide_anim_btn_clicked_cb, ui_view *view);
-Elm_Toolbar *create_toolbar(Evas_Object *parent, const char *style);
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This example create a simple view which is inheritance ui_standard_view.
- * Then push in viewmgr.
- */
-class page1: public ui_standard_view
-{
-protected:
- //on_load() will be called when this page1 is requested to be shown.
- void on_load()
- {
- ui_standard_view::on_load();
-
- //Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Basic View",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->deactivate();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page2());
- });
- this->set_content(content, "Page1");
- }
-
- //on_unload() will be called when this page1 is requested to be hidden.
- void on_unload()
- {
- ui_standard_view::on_unload();
- }
-
- //on_destroy() will be called when this page1 is requested to be destroyed.
- void on_destroy()
- {
- ui_standard_view::on_destroy();
- }
-
- //on_deactivate() will be called when this page1 is requested to be deactivated.
- void on_deactivate()
- {
- ui_standard_view::on_deactivate();
- }
-
- //on_activate() will be called when this page1 is requested to be activated.
- void on_activate()
- {
- ui_standard_view::on_activate();
- }
-
-public:
- page1() : ui_standard_view("page1") {}
- ~page1() {}
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This page implements on_rotate() method to create portrait, landscape content.
- * This page will be created suitable content in on_rotate() method.
- */
-class page10: public ui_standard_view
-{
-protected:
- void on_load()
- {
- ui_standard_view::on_load();
- this->on_rotate(this->get_degree());
- }
-
- void on_rotate(int degree)
- {
- ui_standard_view::on_rotate(degree);
-
- //Portrait
- if (this->get_degree() == 0 || this->get_degree() == 180)
- {
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Rotation",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page11());
- });
-
- this->set_content(content, "Page 10");
- this->set_indicator(UI_VIEW_INDICATOR_DEFAULT);
- }
- //Landscape
- else
- {
- Evas_Object *content = create_landscape_content(this->get_base(), "ViewMgr Demo<br>Rotation",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page11());
- });
-
- this->set_content(content, "Page 10");
- this->set_indicator(UI_VIEW_INDICATOR_OPTIMAL);
- }
- }
-public:
- page10() : ui_standard_view("page10") {}
- ~page10() {}
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-/** This page implement on_menu() method to create ctxpopup when menu HW key clicked.
- * This page will be created menu(ctxpopup)items in on_menu() method.
- */
-static void ctxpopup_item_select_cb(void *data, Evas_Object *obj, void *event_info)
-{
- Elm_Object_Item *it = static_cast<Elm_Object_Item *>(event_info);
- elm_ctxpopup_dismiss(obj);
- LOGE("Item (%s) is selected", elm_object_item_text_get(it));
-}
-
-class page11: public ui_standard_view
-{
-protected:
- void on_load()
- {
- ui_standard_view::on_load();
-
- //Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Menu Popup",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page12());
- });
-
- this->set_content(content, "Page11");
- }
-
- void on_menu(ui_menu *menu)
- {
- ui_standard_view::on_menu(menu);
-
- Elm_Ctxpopup *ctxpopup = elm_ctxpopup_add(menu->get_base());
- elm_ctxpopup_item_append(ctxpopup, "Phone calls", NULL, ctxpopup_item_select_cb, this);
- elm_ctxpopup_item_append(ctxpopup, "Favorites", NULL, ctxpopup_item_select_cb, this);
- elm_ctxpopup_item_append(ctxpopup, "Search", NULL, ctxpopup_item_select_cb, this);
- elm_ctxpopup_item_append(ctxpopup, "Dialer", NULL, ctxpopup_item_select_cb, this);
- elm_ctxpopup_item_append(ctxpopup, "Add contact", NULL, ctxpopup_item_select_cb, this);
- elm_ctxpopup_item_append(ctxpopup, "Phone calls", NULL, ctxpopup_item_select_cb, this);
- elm_ctxpopup_item_append(ctxpopup, "Favorites", NULL, ctxpopup_item_select_cb, this);
- elm_ctxpopup_item_append(ctxpopup, "Search", NULL, ctxpopup_item_select_cb, this);
- elm_ctxpopup_item_append(ctxpopup, "Dialer", NULL, ctxpopup_item_select_cb, this);
-
- menu->set_content(ctxpopup);
- }
-
-public:
- page11() {}
- ~page11() {}
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This page inherit ui_ui_standard_view
- * And make a button on right top side of title area to activate popup.
- * The created popup has view and it will be managed by viewmgr.
- */
-
-static void popup_dismissed_cb(void *data, Evas_Object *obj, void *event_info)
-{
- //FIXME: remove dismissed callback because this callback is called twice.
- //It seems this is an efl or popup error, not this ui_popup nor example.
- evas_object_smart_callback_del(obj, "dismissed", popup_dismissed_cb);
- ui_popup *popup = static_cast<ui_popup *>(data);
- delete (popup);
-}
-
-class page12: public ui_standard_view
-{
-protected:
- void on_load()
- {
- ui_standard_view::on_load();
-
- //Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Popup",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page13());
- });
-
- this->set_content(content, "Page12");
-
- //Title Right button
- Elm_Button *right_btn = elm_button_add(this->get_base());
- elm_object_text_set(right_btn, "popup");
- evas_object_smart_callback_add(right_btn, "clicked",
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- page12 *view = static_cast<page12 *>(data);
- view->create_popup();
- },
- this);
-
- this->set_title_right_btn(right_btn);
- }
-
-public:
- page12() : ui_standard_view("page12") {}
- ~page12() {}
-
- void create_popup()
- {
- //FIXME: is overlay a proper name?
- ui_popup *popup = new ui_popup(this);
-
- Elm_Popup *obj = elm_popup_add(popup->get_base());
- elm_object_text_set(obj, "This popup has only text which is set via desc set function, (This popup gets hidden when user clicks outside) here timeout of 3 sec is set.");
- elm_popup_timeout_set(obj, 3.0);
- evas_object_smart_callback_add(obj, "dismissed", popup_dismissed_cb, popup);
- evas_object_smart_callback_add(obj, "block,clicked",
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- elm_popup_dismiss(obj);
- },
- NULL);
- evas_object_smart_callback_add(obj, "timeout",
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- elm_popup_dismiss(obj);
- },
- NULL);
-
- popup->set_content(obj);
- popup->activate();
- }
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This page inherit ui_ui_standard_view
- * And make a view transition style as fade.
- * The fade effect will be shown when view appear or disappear.
- * The default of transition style of view was slide in/out.
- */
-class page13: public ui_standard_view
-{
-protected:
- void on_load()
- {
- ui_standard_view::on_load();
-
- //Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Fade Transition",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page14());
- });
-
- this->set_content(content, "Page13");
- }
-
-public:
- page13() : ui_standard_view("page13")
- {
- this->set_transition_style("fade");
- }
- ~page13() {}
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This page inherit ui_ui_standard_view
- * And make a view transition style as none.
- * There will be no effect when view appear or disappear.
- * The default of transition style of view was slide in/out.
- */
-class page14: public ui_standard_view
-{
-protected:
- void on_load()
- {
- ui_standard_view::on_load();
-
- //Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>None Transition",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page15());
- });
-
- this->set_content(content, "Page14");
- }
-
-public:
- page14() : ui_standard_view("page14")
- {
- this->set_transition_style("none");
- }
- ~page14(){}
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This page inherit ui_ui_standard_view
- * This create a content that has same size of screen.
- * When this view has rotated viewmgr's internal scroller will be enabled automatically.
- */
-class page15: public ui_standard_view
-{
-protected:
- void on_load()
- {
- ui_standard_view::on_load();
-
- //Create a main content.
- Evas_Object *content = create_scrolling_content(this->get_base());
-
- this->set_content(content, "Page15 Scroller In Viewmgr");
-
- //Title Right button
- Elm_Button *right_btn = elm_button_add(this->get_base());
- elm_object_text_set(right_btn, "Next");
- evas_object_smart_callback_add(right_btn, "clicked",
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page16());
- },
- this);
-
- this->set_title_right_btn(right_btn);
- }
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This page inherit ui_ui_standard_view
- * This view create a lot of buttons to show how to handle title area visible state with animation or no effect.
- */
-class page16: public ui_standard_view
-{
-protected:
- void on_load()
- {
- ui_standard_view::on_load();
-
- //Create a main content.
- Evas_Object *content = create_title_handle_content(this->get_base(),
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->deactivate();
- },
- //Title Show Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- ui_standard_view *view = static_cast<ui_standard_view *>(data);
- view->set_title_visible(true, false);
- },
- //Title Hide Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- ui_standard_view *view = static_cast<ui_standard_view *>(data);
- view->set_title_visible(false, false);
- },
- //Title Show Anim Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- ui_standard_view *view = static_cast<ui_standard_view *>(data);
- view->set_title_visible(true, true);
- },
- //Title Hide Anim Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- ui_standard_view *view = static_cast<ui_standard_view *>(data);
- view->set_title_visible(false, true);
- }, this);
-
- this->set_content(content, "Page16");
- }
-
-public:
- page16() : ui_standard_view("page16") {}
- ~page16() {}
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This example create a simple view which is inheritance ui_standard_view.
- * And add two buttons in view title area. then push in viewmgr.
- */
-class page2: public ui_standard_view
-{
-private:
- Evas_Object *content;
- Elm_Button *left_title_btn;
- Elm_Button *right_title_btn;
-
-protected:
- void on_load()
- {
- ui_standard_view::on_load();
-
- //Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Title Buttons",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page3());
- });
-
- //Title left button
- Elm_Button *left_title_btn = elm_button_add(this->get_base());
- elm_object_text_set(left_title_btn, "Cancel");
-
- //Title right button
- Elm_Button *right_title_btn = elm_button_add(this->get_base());
- elm_object_text_set(right_title_btn, "Done");
-
- //Arguments: content, title, subtitle, title left button, title right button
- this->set_content(content, "Page2", NULL, left_title_btn, right_title_btn);
-
- this->content = content;
- this->left_title_btn = left_title_btn;
- this->right_title_btn = right_title_btn;
- }
- void on_unload()
- {
- ui_standard_view::on_unload();
-
- evas_object_del(this->content);
- evas_object_del(this->left_title_btn);
- evas_object_del(this->right_title_btn);
- }
-
-public:
- page2() : ui_standard_view("page2")
- {
- }
- ~page2() {}
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This example create a simple view which is inheritance ui_standard_view.
- * And set text in view subtitle. then push in viewmgr.
- */
-class page3: public ui_standard_view
-{
-protected:
- void on_load()
- {
- ui_standard_view::on_load();
-
- //Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Subtitle",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page4());
- });
-
- //Arguments: content, title, subtitle, title left button, title right button
- this->set_content(content, "Page3", "Subtitle", NULL, NULL);
- }
-
-public:
- page3() : ui_standard_view("page3") {}
- ~page3() {}
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This example create a simple view which is inheritance ui_standard_view.
- * And set long text to title, set badge text in view title area.
- * Then push in viewmgr.
- */
-class page4: public ui_standard_view
-{
-protected:
- void on_load()
- {
- ui_standard_view::on_load();
-
- //Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Title Badge",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page5());
- });
-
- //Arguments: content, title
- this->set_content(content, "Page4. We put a long title here intentionally");
- this->set_title_badge("999+");
- }
-
-public:
- page4() : ui_standard_view("page4") {}
- ~page4() {}
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This page inherit ui_view to show how to create full view.
- * And set indicator state as hide.
- */
-class page5: public ui_view
-{
-protected:
- void on_load()
- {
- ui_view::on_load();
-
- //Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Full View",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page6());
- });
-
- this->set_content(content);
- this->set_indicator(UI_VIEW_INDICATOR_HIDE);
- }
-
-public:
- page5() : ui_view("page5") {}
- ~page5() {}
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This page inherit ui_standard_view to show title with toolbar(toolbar_with_title) example.
- */
-class page6: public ui_standard_view
-{
-protected:
- void on_load()
- {
- ui_standard_view::on_load();
-
- //Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Toolbar",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page7());
- });
-
- //Arguments: content, title
- this->set_content(content, "Page6");
- Elm_Toolbar *toolbar = create_toolbar(this->get_base(), "toolbar_with_title");
- this->set_toolbar(toolbar);
- }
-
-public:
- page6() : ui_standard_view("page6") {}
- ~page6() {}
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This page inherit ui_standard_view to show title with toolbar(navigationbar) example.
- */
-class page7: public ui_standard_view
-{
-protected:
- void on_load()
- {
- ui_standard_view::on_load();
-
- //Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Navigationbar",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page8());
- });
-
- //Arguments: content, title
- this->set_content(content, "Page7");
- Elm_Toolbar *toolbar = create_toolbar(this->get_base(), "navigationbar");
- this->set_toolbar(toolbar);
- }
-public:
- page7() : ui_standard_view("page7") {}
- ~page7() {}
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This page shows how to create a view content in advance.
- */
-class page8: public ui_standard_view
-{
-public:
- page8() : ui_standard_view("page8")
- {
- //Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Content Preloading",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page9());
- });
-
- //Don't delete view's content when this view poped.
- this->set_removable_content(false);
- this->set_content(content, "Page 8");
- }
- ~page8() {}
-};
+++ /dev/null
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/** This page inherit ui_standard_view.
- * And implement on_portait(), on_landscape() method to create portrait, landscape content.
- * This page will be created suitable content in on_portrait(), on_landscape() method.
- */
-class page9: public ui_standard_view
-{
-protected:
- void on_load()
- {
- ui_standard_view::on_load();
-
- //FIXME: Change below code to more convenient and clear way.
- if (this->get_degree() == 90 || this->get_degree() == 270)
- this->on_landscape();
- else
- this->on_portrait();
- }
-
- void on_portrait()
- {
- ui_standard_view::on_portrait();
-
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Portrait/Landscape",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page10());
- });
-
- this->set_content(content, "Page 9");
- this->set_indicator(UI_VIEW_INDICATOR_DEFAULT);
- }
-
- void on_landscape()
- {
- ui_standard_view::on_landscape();
-
- Evas_Object *content = create_landscape_content(this->get_base(), "ViewMgr Demo<br>Portrait/Landscape",
- //Prev Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->pop_view();
- },
- //Next Button Callback
- [](void *data, Evas_Object *obj, void *event_info) -> void
- {
- UI_VIEWMGR->push_view(new page10());
- });
-
- this->set_content(content, "Page 9");
- this->set_indicator(UI_VIEW_INDICATOR_OPTIMAL);
- }
-
-public:
- page9() : ui_standard_view("page9") {}
- ~page9() {}
-};
FILES_MATCHING
PATTERN "interface/*.h"
PATTERN "efl/*.h"
+ PATTERN "efl/mobile/c/*.h"
PATTERN "efl/mobile/*.h"
PATTERN "*.h"
)
--- /dev/null
+#ifndef _UI_APP_C_H_
+#define _UI_APP_C_H_
+
+namespace efl_viewmanager
+{
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ int ui_app_init(const char *pkg, const char *locale_dir);
+ int ui_app_run(int argc, char **argv, ui_app_lifecycle_callback_s *event_callback, void *data);
+#ifdef __cplusplus
+}
+#endif
+
+}
+#endif /* _UI_APP_C_H_ */
--- /dev/null
+#ifndef _UI_MENU_C_H_
+#define _UI_MENU_C_H_
+
+namespace efl_viewmananger
+{
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ bool ui_menu_content_set(ui_menu *menu, Elm_Ctxpopup *ctxpopup);
+#ifdef __cplusplus
+}
+#endif
+}
+
+#endif /* _UI_MENU_C_H_ */
--- /dev/null
+#ifndef _UI_POPUP_C_H_
+#define _UI_POPUP_C_H_
+
+namespace efl_viewmananger
+{
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ bool ui_popup_content_set(ui_popup *popup, Elm_Popup *elm_popup);
+ bool ui_popup_activate(ui_popup *popup);
+ void ui_popup_del(ui_popup *popup);
+#ifdef __cplusplus
+}
+#endif
+
+}
+#endif /* _UI_POPUP_C_H_ */
--- /dev/null
+#ifndef _UI_VIEW_C_H_
+#define _UI_VIEW_C_H_
+
+namespace efl_viewmananger
+{
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ typedef bool (*ui_view_lifecycle_load_cb) (ui_view *view, void *data);
+ typedef bool (*ui_view_lifecycle_unload_cb) (ui_view *view, void *data);
+ typedef bool (*ui_view_lifecycle_pause_cb) (ui_view *view, void *data);
+ typedef bool (*ui_view_lifecycle_resume_cb) (ui_view *view, void *data);
+ typedef bool (*ui_view_lifecycle_activate_cb) (ui_view *view, void *data);
+ typedef bool (*ui_view_lifecycle_deactivate_cb) (ui_view *view, void *data);
+ typedef bool (*ui_view_lifecycle_destroy_cb) (ui_view *view, void *data);
+
+ typedef bool (*ui_view_event_rotate_cb) (ui_view *view, int degree, void *data);
+ typedef bool (*ui_view_event_portrait_cb) (ui_view *view, void *data);
+ typedef bool (*ui_view_event_landscape_cb) (ui_view *view, void *data);
+ typedef bool (*ui_view_event_back_cb) (ui_view *view, void *data);
+ typedef bool (*ui_view_event_menu_cb) (ui_menu *menu, void *data);
+
+ typedef struct
+ {
+ ui_view_lifecycle_load_cb load;
+ ui_view_lifecycle_unload_cb unload;
+ ui_view_lifecycle_pause_cb pause;
+ ui_view_lifecycle_resume_cb resume;
+ ui_view_lifecycle_activate_cb activate;
+ ui_view_lifecycle_deactivate_cb deactivate;
+ ui_view_lifecycle_destroy_cb destroy;
+ } ui_view_lifecycle_callback_s;
+
+ typedef struct
+ {
+ ui_view_event_rotate_cb rotate;
+ ui_view_event_portrait_cb portrait;
+ ui_view_event_landscape_cb landscape;
+ ui_view_event_back_cb back;
+ ui_view_event_menu_cb menu;
+ } ui_view_event_callback_s;
+
+ ui_view* ui_standard_view_create(const char *name);
+ bool ui_view_lifecycle_callbacks_set(ui_view *view,
+ ui_view_lifecycle_callback_s *lifecycle_callback, void *data);
+ Evas_Object* ui_view_base_get(ui_view *view);
+ bool ui_view_content_set(ui_view *view, Evas_Object *content);
+ bool ui_standard_view_content_set(ui_view *view, Evas_Object *content,
+ const char *title, const char *subtitle,
+ Evas_Object *title_left_btn, Evas_Object *title_right_btn);
+ bool ui_standard_view_title_badge_set(ui_view *view, const char *badge_text);
+ bool ui_view_indicator_set(ui_view *view, ui_view_indicator indicator);
+ bool ui_standard_view_toolbar_set(ui_view *view, Elm_Toolbar *toolbar);
+ void ui_view_removable_content(ui_view *view, bool remove);
+ bool ui_view_event_callbacks_set(ui_view *view,
+ ui_view_event_callback_s *event_callback, void *data);
+ bool ui_standard_view_title_right_btn_set(ui_view *view, Evas_Object *title_right_btn);
+ bool ui_standard_view_title_visible_set(ui_view *view, bool visible, bool anim);
+
+#ifdef __cplusplus
+}
+#endif
+
+}
+#endif /* _UI_VIEW_C_H_ */
--- /dev/null
+#ifndef _UI_VIEWMGR_C_H_
+#define _UI_VIEWMGR_C_H_
+
+using namespace efl_viewmananger;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ //TODO
+ #define UI_VIEWMGR_VIEW_DEACTIVATE() (ui_app::get_instance()->get_viewmgr())->deactivate()
+ #define UI_VIEWMGR_VIEW_PUSH(x) (ui_app::get_instance()->get_viewmgr())->push_view(x)
+ #define UI_VIEWMGR_VIEW_POP() (ui_app::get_instance()->get_viewmgr())->pop_view()
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _UI_VIEWMGR_C_H_ */
#ifndef _UI_MOBILE_VIEWMANAGER_H_
#define _UI_MOBILE_VIEWMANAGER_H_
+#include <app.h>
#include "../ui_base_viewmanager.h"
#include "ui_view.h"
#include "ui_standard_view.h"
#include "ui_menu.h"
#include "ui_popup.h"
#include "ui_app.h"
+#include "c/ui_app_c.h"
+#include "c/ui_menu_c.h"
+#include "c/ui_popup_c.h"
+#include "c/ui_viewmgr_c.h"
+#include "c/ui_view_c.h"
#define UI_VIEWMGR (ui_app::get_instance()->get_viewmgr())
efl/mobile/ui_standard_view.cpp
efl/mobile/ui_key_listener.cpp
efl/mobile/ui_viewmgr.cpp
+ efl/mobile/c/ui_app_c.cpp
+ efl/mobile/c/ui_menu_c.cpp
+ efl/mobile/c/ui_popup_c.cpp
+ efl/mobile/c/ui_view_c.cpp
)
ADD_LIBRARY(${LIBNAME} SHARED ${SRCS})
--- /dev/null
+#include "../../../../include/efl/mobile/ui_mobile_viewmanager.h"
+#include "../../../../include/efl/mobile/c/ui_app_c.h"
+
+using namespace efl_viewmanager;
+
+extern "C" {
+ int ui_app_init(const char *pkg, const char *locale_dir)
+ {
+ //TODO
+ return 1;
+ }
+
+ int ui_app_run(int argc, char **argv, ui_app_lifecycle_callback_s *event_callback, void *data)
+ {
+ //TODO
+ return 1;
+ }
+}
--- /dev/null
+#include "../../../../include/efl/mobile/ui_mobile_viewmanager.h"
+#include "../../../../include/efl/mobile/c/ui_menu_c.h"
+
+using namespace efl_viewmanager;
+
+extern "C" {
+ bool ui_menu_content_set(ui_menu *menu, Elm_Ctxpopup *ctxpopup)
+ {
+ //TODO
+ return 1;
+ }
+}
+
--- /dev/null
+#include "../../../../include/efl/mobile/ui_mobile_viewmanager.h"
+#include "../../../../include/efl/mobile/c/ui_popup_c.h"
+
+using namespace efl_viewmanager;
+
+extern "C" {
+ bool ui_popup_content_set(ui_popup *popup, Elm_Popup *elm_popup)
+ {
+ //TODO
+ return 1;
+ }
+
+ bool ui_popup_activate(ui_popup *popup)
+ {
+ //TODO
+ return 1;
+ }
+
+ void ui_popup_del(ui_popup *popup)
+ {
+ //TODO
+ }
+}
--- /dev/null
+#include "../../../../include/efl/mobile/ui_mobile_viewmanager.h"
+#include "../../../../include/efl/mobile/c/ui_view_c.h"
+
+using namespace efl_viewmanager;
+
+extern "C" {
+ ui_view* ui_standard_view_create(const char *name)
+ {
+ //TODO
+ return NULL;
+ }
+
+ bool ui_view_lifecycle_callbacks_set(ui_view *view,
+ ui_view_lifecycle_callback_s *lifecycle_callback, void *data)
+ {
+ //TODO
+ return 1;
+ }
+ Evas_Object* ui_view_base_get(ui_view *view)
+ {
+ //TODO
+ return NULL;
+ }
+
+ bool ui_view_content_set(ui_view *view, Evas_Object *content)
+ {
+ //TODO
+ return 1;
+ }
+
+ bool ui_standard_view_content_set(ui_view *view, Evas_Object *content,
+ const char *title, const char *subtitle,
+ Evas_Object *title_left_btn, Evas_Object *title_right_btn)
+ {
+ //TODO
+ return 1;
+ }
+
+ bool ui_standard_view_title_badge_set(ui_view *view, const char *badge_text)
+ {
+ //TODO
+ return 1;
+ }
+
+ bool ui_view_indicator_set(ui_view *view, ui_view_indicator indicator)
+ {
+ //TODO
+ return 1;
+ }
+
+ bool ui_standard_view_toolbar_set(ui_view *view, Elm_Toolbar *toolbar)
+ {
+ //TODO
+ return 1;
+ }
+
+ void ui_view_removable_content(ui_view *view, bool remove)
+ {
+ //TODO
+ }
+
+ bool ui_view_event_callbacks_set(ui_view *view,
+ ui_view_event_callback_s *event_callback, void *data)
+ {
+ //TODO
+ return 1;
+ }
+
+ bool ui_standard_view_title_right_btn_set(ui_view *view, Evas_Object *title_right_btn)
+ {
+ //TODO
+ return 1;
+ }
+
+ bool ui_standard_view_title_visible_set(ui_view *view, bool visible, bool anim)
+ {
+ //TODO
+ return 1;
+ }
+}