*
*/
#include "main.h"
+#include "page9.h"
+#include "page8.h"
#include "page7.h"
#include "page6.h"
#include "page5.h"
[](void *data, Evas_Object *obj, void *event_info) -> void
{
appdata_s *ad = static_cast<appdata_s *>(data);
- ad->viewmgr->deactivate();
+ create_page8(ad);
},
this->ad);
+ //Don't delete view's content when this view poped.
+ view->set_removable_content(false);
view->set_content(content, "Title with toolbar");
Evas_Object *toolbar = create_toolbar(view->get_base(), "navigationbar");
view->set_toolbar(toolbar);
--- /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.
+ *
+ */
+
+class page8: public ui_basic_view
+{
+private:
+ appdata_s *ad;
+
+protected:
+ virtual void load()
+ {
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Page 8<br>(View inheritance lazy load)",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ appdata_s *ad = static_cast<appdata_s *>(data);
+ ad->viewmgr->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ appdata_s *ad = static_cast<appdata_s *>(data);
+ create_page9(ad);
+ },
+ this->ad);
+
+ this->set_content(content, "Title");
+ }
+
+public:
+ page8(const char *name, appdata_s *ad)
+ : ui_basic_view(name), ad(ad)
+ {
+ ad->viewmgr->push_view(this);
+ }
+
+ ~page8()
+ {
+ }
+};
+
+void create_page8(appdata_s *ad)
+{
+ /* A example for view class extension instead of using controller class. */
+ new page8("page8", ad);
+}
--- /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.
+ *
+ */
+class page9: public ui_basic_view
+{
+private:
+ appdata_s *ad;
+
+public:
+ page9(const char *name, appdata_s *ad)
+ : ui_basic_view(name), ad(ad)
+ {
+ //FIXME: It will be deleted or change to other way :(
+ // We don't have any way to support it now.
+ this->set_viewmgr(ad->viewmgr);
+
+ //Create a main content.
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Page 9<br>(View inheritance)",
+ //Prev Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ appdata_s *ad = static_cast<appdata_s *>(data);
+ ad->viewmgr->pop_view();
+ },
+ //Next Button Callback
+ [](void *data, Evas_Object *obj, void *event_info) -> void
+ {
+ appdata_s *ad = static_cast<appdata_s *>(data);
+ ad->viewmgr->deactivate();
+ },
+ this->ad);
+
+ //Don't delete view's content when this view poped.
+ this->set_removable_content(false);
+ this->set_content(content, "Title");
+ ad->viewmgr->push_view(this);
+ }
+
+ ~page9()
+ {
+ }
+};
+
+void create_page9(appdata_s *ad)
+{
+ /* A example for view class extension instead of using controller class. */
+ new page9("page9", ad);
+}
public:
ui_basic_view(ui_controller *controller, const char *name = NULL);
+ ui_basic_view(const char *name = NULL);
virtual ~ui_basic_view();
Evas_Object *set_content(Evas_Object *content, const char *title = NULL);
public:
///Constructor.
ui_view(ui_controller *controller, const char *name = NULL);
+ ///Constructor.
+ ui_view(const char *name = NULL);
///Destructor.
virtual ~ui_view();
{
}
+ui_basic_view::ui_basic_view(const char *name)
+ : ui_basic_view(NULL, name)
+{
+}
+
ui_basic_view::~ui_basic_view()
{
destroy_layout();
{
}
+ui_view::ui_view(const char *name)
+ : ui_view(NULL, name)
+{
+}
+
ui_view::~ui_view()
{
}
indicator(UI_VIEW_INDICATOR_DEFAULT), event_block(false), removable_content(true)
{
this->state = UI_VIEW_STATE_UNLOAD;
- controller->set_view(this);
+
+ if (controller)
+ controller->set_view(this);
}
ui_iface_view::ui_iface_view(const char *name)