* limitations under the License.
*
*/
-class page10: public ui_controller
+
+/** This page inherit ui_view.
+ * And implement on_portait(), on_landscape() method to create portarit, landscape content.
+ * This page will be created suitable content in on_portrait(), on_landscape() method.
+ */
+class page10: public ui_view
{
private:
appdata_s *ad;
-public:
- page10(appdata_s *ad)
- : ad(ad)
- {
- /* ui_view(controller, identity name).
- Later, you could get the identity name using view->get_name(); */
- ad->viewmgr->push_view(new ui_view(this, "page10"));
- }
-
- ~page10()
- {
- }
-
+protected:
void on_load()
{
- //Initialize contents.
- ui_view *view = dynamic_cast<ui_view *>(this->get_view());
-
//FIXME: Change below code to more convenient and clear way.
- if (view->get_degree() == 90 || view->get_degree() == 270)
+ if (this->get_degree() == 90 || this->get_degree() == 270)
this->on_landscape();
else
this->on_portrait();
void on_portrait()
{
- ui_view *view = dynamic_cast<ui_view *>(this->get_view());
- Evas_Object *content = create_content(view->get_base(), "ViewMgr Demo<br>Page 10<br>(Portrait + Landscape)",
- //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_page11(ad);
- },
- this->ad);
- view->set_content(content, "Title");
- view->set_indicator(UI_VIEW_INDICATOR_DEFAULT);
+ Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Page 10<br>(Portrait + Landscape)",
+ //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_page11(ad);
+ },
+ this->ad);
+ this->set_content(content, "Title");
+ this->set_indicator(UI_VIEW_INDICATOR_DEFAULT);
}
void on_landscape()
{
- ui_view *view = dynamic_cast<ui_view *>(this->get_view());
- Evas_Object *content = create_landscape_content(view->get_base(), "ViewMgr Demo<br>Page 10<br>(Portrait + Landscape)",
+ Evas_Object *content = create_landscape_content(this->get_base(), "ViewMgr Demo<br>Page 10<br>(Portrait + Landscape)",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
create_page11(ad);
},
this->ad);
- view->set_content(content, "Title");
- view->set_indicator(UI_VIEW_INDICATOR_OPTIMAL);
+ this->set_content(content, "Title");
+ this->set_indicator(UI_VIEW_INDICATOR_OPTIMAL);
}
+public:
+ page10(appdata_s *ad) : ui_view("page10"), ad(ad)
+ {
+ ad->viewmgr->push_view(this);
+ }
+
+ ~page10()
+ {
+ }
};
void create_page10(appdata_s *ad)
*
*/
-class page11: public ui_view
+/** This page inherit ui_controller
+ * And implement on_rotate() method to create portarit, landscape content.
+ * This page will be created suitable content in on_rotate() method.
+ */
+class page11: public ui_controller
{
private:
appdata_s *ad;
-protected:
+public:
+ page11(appdata_s *ad)
+ : ad(ad)
+ {
+ ad->viewmgr->push_view(new ui_view(this, "page11"));
+ }
+
+ ~page11()
+ {
+ }
+
void on_load()
{
- this->on_rotate(this->get_degree());
+ ui_view *view = dynamic_cast<ui_view *>(this->get_view());
+
+ this->on_rotate(view->get_degree());
}
void on_rotate(int degree)
{
+ ui_view *view = dynamic_cast<ui_view *>(this->get_view());
+
//Portrait
- if (this->get_degree() == 0 || this->get_degree() == 180)
+ if (view->get_degree() == 0 || view->get_degree() == 180)
{
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Page 11<br>(Rotate)",
+ Evas_Object *content = create_content(view->get_base(), "ViewMgr Demo<br>Page 11<br>(Rotate)",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
create_page12(ad);
},
this->ad);
- this->set_content(content, "Title");
- this->set_indicator(UI_VIEW_INDICATOR_DEFAULT);
+ view->set_content(content, "Title");
+ view->set_indicator(UI_VIEW_INDICATOR_DEFAULT);
}
//Landscape
else
{
- Evas_Object *content = create_landscape_content(this->get_base(), "ViewMgr Demo<br>Page 11<br>(Rotate)",
+ Evas_Object *content = create_landscape_content(view->get_base(), "ViewMgr Demo<br>Page 11<br>(Rotate)",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
create_page12(ad);
},
this->ad);
- this->set_content(content, "Title");
- this->set_indicator(UI_VIEW_INDICATOR_OPTIMAL);
+ view->set_content(content, "Title");
+ view->set_indicator(UI_VIEW_INDICATOR_OPTIMAL);
}
}
-public:
- page11(const char *name, appdata_s *ad)
- : ui_view(name), ad(ad)
- {
- ad->viewmgr->push_view(this);
- }
-
- ~page11()
- {
- }
};
void create_page11(appdata_s *ad)
{
- /* A example for view class extension instead of using controller class. */
- new page11("page11", ad);
+ new page11(ad);
}
*
*/
+
+/** This page inherit ui_controller
+ * And 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)
{
ui_view *view = static_cast<ui_view *>(data);
void create_page12(appdata_s *ad)
{
- /* A example for view class extension instead of using controller class. */
new page12(ad);
}
*
*/
+/** This page inherit ui_ui_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.
+ */
class page13: public ui_view
{
private:
* limitations under the License.
*
*/
-class page9: public ui_view
+
+/** This page inherit ui_controller to show view create in controller side.
+ * And this page create content in controller constructor time.
+ */
+class page9: public ui_controller
{
private:
appdata_s *ad;
public:
- page9(const char *name, appdata_s *ad)
- : ui_view(name), ad(ad)
+ page9(appdata_s *ad)
+ : ad(ad)
{
+ ui_view *view = new ui_view(this, "page9");
+
//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);
+ view->set_viewmgr(ad->viewmgr);
//Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Page 9<br>(Content Preloading)",
+ Evas_Object *content = create_content(view->get_base(), "ViewMgr Demo<br>Page 9<br>(Content Preloading)",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
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);
+ view->set_removable_content(false);
+ view->set_content(content, "Title");
+ ad->viewmgr->push_view(view);
}
-
~page9()
{
}
void create_page9(appdata_s *ad)
{
- /* A example for view class extension instead of using controller class. */
- new page9("page9", ad);
+ new page9(ad);
}