#include "main.h"
Elm_Toolbar*
-create_toolbar(Evas_Object *parent, const char *style)
+createToolbar(Evas_Object *parent, const char *style)
{
Elm_Toolbar *toolbar;
}
Evas_Object*
-create_scrolling_content(Evas_Object *parent)
+createScrollingContent(Evas_Object *parent)
{
char buf[PATH_MAX];
Elm_Image *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)
+createLandscapeContent(Evas_Object *parent, const char *text, Evas_Smart_Cb _prevBtnClickedCb, Evas_Smart_Cb _nextBtnClickedCb)
{
char buf[PATH_MAX];
Elm_Grid *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_smart_callback_add(btn, "clicked", _prevBtnClickedCb, NULL);
evas_object_show(btn);
elm_box_pack_end(box, btn);
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_smart_callback_add(btn, "clicked", _nextBtnClickedCb, NULL);
evas_object_show(btn);
elm_box_pack_end(box, btn);
}
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, UiView *view)
+createTitleHandleContent(Evas_Object *parent, Evas_Smart_Cb _prevBtnClickedCb, Evas_Smart_Cb _nextBtnClickedCb,
+ Evas_Smart_Cb _titleShowBtnClickedCb, Evas_Smart_Cb _titleHideBtnClickedCb,
+ Evas_Smart_Cb _titleShowAnimBtnClickedCb, Evas_Smart_Cb _titleHideAnimBtnClickedCb, UiView *view)
{
Elm_Grid *grid;
Elm_Box *box;
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_smart_callback_add(btn, "clicked", _titleShowBtnClickedCb, view);
evas_object_show(btn);
elm_box_pack_end(box, btn);
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_smart_callback_add(btn, "clicked", _titleHideBtnClickedCb, view);
evas_object_show(btn);
elm_box_pack_end(box, btn);
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_smart_callback_add(btn, "clicked", _titleShowAnimBtnClickedCb, view);
evas_object_show(btn);
elm_box_pack_end(box, btn);
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_smart_callback_add(btn, "clicked", _titleHideAnimBtnClickedCb, view);
evas_object_show(btn);
elm_box_pack_end(box, btn);
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_smart_callback_add(btn, "clicked", _prevBtnClickedCb, NULL);
evas_object_show(btn);
elm_box_pack_end(box, btn);
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_smart_callback_add(btn, "clicked", _nextBtnClickedCb, NULL);
evas_object_show(btn);
elm_box_pack_end(box, btn);
}
Evas_Object*
-create_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb)
+createContent(Evas_Object *parent, const char *text, Evas_Smart_Cb _prevBtnClickedCb, Evas_Smart_Cb _nextBtnClickedCb)
{
Elm_Grid *grid;
Elm_Box *box;
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_smart_callback_add(btn, "clicked", _prevBtnClickedCb, NULL);
evas_object_show(btn);
elm_box_pack_end(box, btn);
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_smart_callback_add(btn, "clicked", _nextBtnClickedCb, NULL);
evas_object_show(btn);
elm_box_pack_end(box, btn);
}
protected:
- bool on_create()
+ bool onCreate()
{
- if (!UiApp::on_create())
+ if (!UiApp::onCreate())
{
return false;
}
//Push first view in viewmgr.
- UI_VIEWMGR->push_view(new page1());
+ UI_VIEWMGR->pushView(new page1());
return true;
}
#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, UiView *view);
-Elm_Toolbar *create_toolbar(Evas_Object *parent, const char *style);
+Evas_Object *createLandscapeContent(Evas_Object *parent, const char *text, Evas_Smart_Cb _prevBtnClickedCb, Evas_Smart_Cb _nextBtnClickedCb);
+Evas_Object *createContent(Evas_Object *parent, const char *text, Evas_Smart_Cb _prevBtnClickedCb, Evas_Smart_Cb _nexBtnClickedCb);
+Evas_Object *createScrollingContent(Evas_Object *parent);
+Evas_Object* createTitleHandleContent(Evas_Object *parent, Evas_Smart_Cb _prevBtnClickedCb, Evas_Smart_Cb _nextBtnClickedCb,
+ Evas_Smart_Cb _titleShowBtnClickedCb, Evas_Smart_Cb _titleHideBtnClickedCb,
+ Evas_Smart_Cb _titleShowAnimBtnClickedCb, Evas_Smart_Cb _titleHideAnimBtnClickedCb, UiView *view);
+Elm_Toolbar *createToolbar(Evas_Object *parent, const char *style);
{
protected:
//on_load() will be called when this page1 is requested to be shown.
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
+ UiStandardView::onLoad();
//Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr++ Demo<br>Basic View",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr++ Demo<br>Basic View",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page2());
+ UI_VIEWMGR->pushView(new page2());
});
- this->set_content(content, "Page1");
+ this->setContent(content, "Page1");
}
public:
class page10: public UiStandardView
{
protected:
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
- this->on_rotate(this->get_degree());
+ UiStandardView::onLoad();
+ this->onRotate(this->getDegree());
}
- void on_rotate(int degree)
+ void onRotate(int degree)
{
- UiStandardView::on_rotate(degree);
+ UiStandardView::onRotate(degree);
- if (this->get_degree() == 0 || this->get_degree() == 180)
+ if (this->getDegree() == 0 || this->getDegree() == 180)
{
//Portrait
- Evas_Object *content = create_content(this->get_base(), "ViewMgr++ Demo<br>Rotation",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr++ Demo<br>Rotation",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page11());
+ UI_VIEWMGR->pushView(new page11());
});
- this->set_content(content, "Page 10");
- this->set_indicator(UI_VIEW_INDICATOR_DEFAULT);
+ this->setContent(content, "Page 10");
+ this->setIndicator(UI_VIEW_INDICATOR_DEFAULT);
} else {
//Landscape
- Evas_Object *content = create_landscape_content(this->get_base(), "ViewMgr++ Demo<br>Rotation",
+ Evas_Object *content = createLandscapeContent(this->getBase(), "ViewMgr++ Demo<br>Rotation",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page11());
+ UI_VIEWMGR->pushView(new page11());
});
- this->set_content(content, "Page 10");
- this->set_indicator(UI_VIEW_INDICATOR_OPTIMAL);
+ this->setContent(content, "Page 10");
+ this->setIndicator(UI_VIEW_INDICATOR_OPTIMAL);
}
}
public:
/** 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)
+static void _ctxpopupItemSelectCb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Object_Item *it = static_cast<Elm_Object_Item *>(event_info);
LOGE("Item (%s) is selected", elm_object_item_text_get(it));
class page11: public UiStandardView
{
protected:
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
+ UiStandardView::onLoad();
//Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr++ Demo<br>Menu Popup",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr++ Demo<br>Menu Popup",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page12());
+ UI_VIEWMGR->pushView(new page12());
});
- this->set_content(content, "Page11");
+ this->setContent(content, "Page11");
}
- void on_menu(UiMenu *menu)
+ void onMenu(UiMenu *menu)
{
- UiStandardView::on_menu(menu);
+ UiStandardView::onMenu(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);
+ Elm_Ctxpopup *ctxpopup = elm_ctxpopup_add(menu->getBase());
+ elm_ctxpopup_item_append(ctxpopup, "Phone calls", NULL, _ctxpopupItemSelectCb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Favorites", NULL, _ctxpopupItemSelectCb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Search", NULL, _ctxpopupItemSelectCb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Dialer", NULL, _ctxpopupItemSelectCb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Add contact", NULL, _ctxpopupItemSelectCb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Phone calls", NULL, _ctxpopupItemSelectCb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Favorites", NULL, _ctxpopupItemSelectCb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Search", NULL, _ctxpopupItemSelectCb, this);
+ elm_ctxpopup_item_append(ctxpopup, "Dialer", NULL, _ctxpopupItemSelectCb, this);
- menu->set_content(ctxpopup);
+ menu->setContent(ctxpopup);
}
public:
* 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)
+static void _popupDismissedCb(void *data, Evas_Object *obj, void *event_info)
{
- evas_object_smart_callback_del(obj, "dismissed", popup_dismissed_cb);
+ evas_object_smart_callback_del(obj, "dismissed", _popupDismissedCb);
UiPopup *popup = static_cast<UiPopup *>(data);
delete (popup);
}
class page12: public UiStandardView
{
protected:
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
+ UiStandardView::onLoad();
//Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr++ Demo<br>Popup",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr++ Demo<br>Popup",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page13());
+ UI_VIEWMGR->pushView(new page13());
});
- this->set_content(content, "Page12");
+ this->setContent(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",
+ Elm_Button *rightBtn = elm_button_add(this->getBase());
+ elm_object_text_set(rightBtn, "popup");
+ evas_object_smart_callback_add(rightBtn, "clicked",
[](void *data, Evas_Object *obj, void *event_info) -> void
{
page12 *view = static_cast<page12 *>(data);
- view->create_popup();
+ view->createPopup();
},
this);
- this->set_title_right_btn(right_btn);
+ this->setTitleRightBtn(rightBtn);
}
public:
+
page12() : UiStandardView("page12") {}
~page12() {}
- void create_popup()
+ void createPopup()
{
UiPopup *popup = new UiPopup(this);
if (!popup) return;
- Elm_Popup *obj = elm_popup_add(popup->get_base());
+ Elm_Popup *obj = elm_popup_add(popup->getBase());
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, "dismissed", _popupDismissedCb, popup);
evas_object_smart_callback_add(obj, "block,clicked",
[](void *data, Evas_Object *obj, void *event_info) -> void
{
},
NULL);
- popup->set_content(obj);
+ popup->setContent(obj);
popup->activate();
}
};
class page13: public UiStandardView
{
protected:
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
+ UiStandardView::onLoad();
//Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr++ Demo<br>Fade Transition",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr++ Demo<br>Fade Transition",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page14());
+ UI_VIEWMGR->pushView(new page14());
});
- this->set_content(content, "Page13");
+ this->setContent(content, "Page13");
}
public:
page13() : UiStandardView("page13")
{
- this->set_transition_style("fade");
+ this->setTransitionStyle("fade");
}
~page13() {}
};
class page14: public UiStandardView
{
protected:
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
+ UiStandardView::onLoad();
//Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr++ Demo<br>None Transition",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr++ Demo<br>None Transition",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page15());
+ UI_VIEWMGR->pushView(new page15());
});
- this->set_content(content, "Page14");
+ this->setContent(content, "Page14");
}
public:
page14() : UiStandardView("page14")
{
- this->set_transition_style("none");
+ this->setTransitionStyle("none");
}
~page14(){}
};
class page15: public UiStandardView
{
protected:
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
+ UiStandardView::onLoad();
//Create a main content.
- Evas_Object *content = create_scrolling_content(this->get_base());
+ Evas_Object *content = createScrollingContent(this->getBase());
- this->set_content(content, "Page15 Scroller In Viewmgr");
+ this->setContent(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",
+ Elm_Button *rightBtn = elm_button_add(this->getBase());
+ elm_object_text_set(rightBtn, "Next");
+ evas_object_smart_callback_add(rightBtn, "clicked",
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page16());
+ UI_VIEWMGR->pushView(new page16());
},
this);
- this->set_title_right_btn(right_btn);
+ this->setTitleRightBtn(rightBtn);
}
};
class page16: public UiStandardView
{
protected:
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
+ UiStandardView::onLoad();
//Create a main content.
- Evas_Object *content = create_title_handle_content(this->get_base(),
+ Evas_Object *content = createTitleHandleContent(this->getBase(),
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
[](void *data, Evas_Object *obj, void *event_info) -> void
{
UiStandardView *view = static_cast<UiStandardView *>(data);
- view->set_title_visible(true, false);
+ view->setTitleVisible(true, false);
},
//Title Hide Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
UiStandardView *view = static_cast<UiStandardView *>(data);
- view->set_title_visible(false, false);
+ view->setTitleVisible(false, false);
},
//Title Show Anim Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
UiStandardView *view = static_cast<UiStandardView *>(data);
- view->set_title_visible(true, true);
+ view->setTitleVisible(true, true);
},
//Title Hide Anim Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
UiStandardView *view = static_cast<UiStandardView *>(data);
- view->set_title_visible(false, true);
+ view->setTitleVisible(false, true);
}, this);
- this->set_content(content, "Page16");
+ this->setContent(content, "Page16");
}
public:
class page2: public UiStandardView
{
protected:
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
+ UiStandardView::onLoad();
//Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr++ Demo<br>Title Buttons",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr++ Demo<br>Title Buttons",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page3());
+ UI_VIEWMGR->pushView(new page3());
});
//Title left button
- Elm_Button *left_title_btn = elm_button_add(this->get_base());
- elm_object_text_set(left_title_btn, "Cancel");
+ Elm_Button *leftTitleBtn = elm_button_add(this->getBase());
+ elm_object_text_set(leftTitleBtn, "Cancel");
//Title right button
- Elm_Button *right_title_btn = elm_button_add(this->get_base());
- elm_object_text_set(right_title_btn, "Done");
+ Elm_Button *rightTitleBtn = elm_button_add(this->getBase());
+ elm_object_text_set(rightTitleBtn, "Done");
//Arguments: content, title, subtitle, title left button, title right button
- this->set_content(content, "Page2", NULL, left_title_btn, right_title_btn);
+ this->setContent(content, "Page2", NULL, leftTitleBtn, rightTitleBtn);
}
public:
class page3: public UiStandardView
{
protected:
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
+ UiStandardView::onLoad();
//Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr++ Demo<br>Subtitle",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr++ Demo<br>Subtitle",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page4());
+ UI_VIEWMGR->pushView(new page4());
});
//Arguments: content, title, subtitle, title left button, title right button
- this->set_content(content, "Page3", "Subtitle", NULL, NULL);
+ this->setContent(content, "Page3", "Subtitle", NULL, NULL);
}
public:
class page4: public UiStandardView
{
protected:
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
+ UiStandardView::onLoad();
//Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr++ Demo<br>Title Badge",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr++ Demo<br>Title Badge",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page5());
+ UI_VIEWMGR->pushView(new page5());
});
//Arguments: content, title
- this->set_content(content, "Page4. We put a long title here intentionally");
- this->set_title_badge("999+");
+ this->setContent(content, "Page4. We put a long title here intentionally");
+ this->setTitleBadge("999+");
}
public:
class page5: public UiView
{
protected:
- void on_load()
+ void onLoad()
{
- UiView::on_load();
+ UiView::onLoad();
//Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr++ Demo<br>Full View",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr++ Demo<br>Full View",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page6());
+ UI_VIEWMGR->pushView(new page6());
});
- this->set_content(content);
- this->set_indicator(UI_VIEW_INDICATOR_HIDE);
+ this->setContent(content);
+ this->setIndicator(UI_VIEW_INDICATOR_HIDE);
}
public:
class page6: public UiStandardView
{
protected:
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
+ UiStandardView::onLoad();
//Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr++ Demo<br>Toolbar",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr++ Demo<br>Toolbar",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page7());
+ UI_VIEWMGR->pushView(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);
+ this->setContent(content, "Page6");
+ Elm_Toolbar *toolbar = createToolbar(this->getBase(), "toolbar_with_title");
+ this->setToolbar(toolbar);
}
public:
class page7: public UiStandardView
{
protected:
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
+ UiStandardView::onLoad();
//Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr++ Demo<br>Navigationbar",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr++ Demo<br>Navigationbar",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page8());
+ UI_VIEWMGR->pushView(new page8());
});
//Arguments: content, title
- this->set_content(content, "Page7");
- Elm_Toolbar *toolbar = create_toolbar(this->get_base(), "navigationbar");
- this->set_toolbar(toolbar);
+ this->setContent(content, "Page7");
+ Elm_Toolbar *toolbar = createToolbar(this->getBase(), "navigationbar");
+ this->setToolbar(toolbar);
}
public:
page7() : UiStandardView("page7") {}
page8() : UiStandardView("page8")
{
//Create a main content.
- Evas_Object *content = create_content(this->get_base(), "ViewMgr++ Demo<br>Content Preloading",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr++ Demo<br>Content Preloading",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page9());
+ UI_VIEWMGR->pushView(new page9());
});
- this->set_content(content, "Page 8");
+ this->setContent(content, "Page 8");
//Don't delete view's content when this view popped.
//This is a show case for saving this content for reuse later.
- this->set_removable_content(false);
+ this->setRemovableContent(false);
}
~page8() {}
};
class page9: public UiStandardView
{
protected:
- void on_load()
+ void onLoad()
{
- UiStandardView::on_load();
+ UiStandardView::onLoad();
//FIXME: Change below code to more convenient and clear way.
- if (this->get_degree() == 90 || this->get_degree() == 270)
- this->on_landscape();
+ if (this->getDegree() == 90 || this->getDegree() == 270)
+ this->onLandscape();
else
- this->on_portrait();
+ this->onPortrait();
}
- void on_portrait()
+ void onPortrait()
{
- UiStandardView::on_portrait();
+ UiStandardView::onPortrait();
- Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo<br>Portrait/Landscape",
+ Evas_Object *content = createContent(this->getBase(), "ViewMgr Demo<br>Portrait/Landscape",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page10());
+ UI_VIEWMGR->pushView(new page10());
});
- this->set_content(content, "Page 9");
- this->set_indicator(UI_VIEW_INDICATOR_DEFAULT);
+ this->setContent(content, "Page 9");
+ this->setIndicator(UI_VIEW_INDICATOR_DEFAULT);
}
- void on_landscape()
+ void onLandscape()
{
- UiStandardView::on_landscape();
+ UiStandardView::onLandscape();
- Evas_Object *content = create_landscape_content(this->get_base(), "ViewMgr Demo<br>Portrait/Landscape",
+ Evas_Object *content = createLandscapeContent(this->getBase(), "ViewMgr Demo<br>Portrait/Landscape",
//Prev Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->pop_view();
+ UI_VIEWMGR->popView();
},
//Next Button Callback
[](void *data, Evas_Object *obj, void *event_info) -> void
{
- UI_VIEWMGR->push_view(new page10());
+ UI_VIEWMGR->pushView(new page10());
});
- this->set_content(content, "Page 9");
- this->set_indicator(UI_VIEW_INDICATOR_OPTIMAL);
+ this->setContent(content, "Page 9");
+ this->setIndicator(UI_VIEW_INDICATOR_OPTIMAL);
}
public:
*
* @note This is checking H/W key is menu or not.
*/
- virtual void extend_event_proc(UiBaseView *view, Evas_Event_Key_Down *ev) {}
+ virtual void extendEventProc(UiBaseView *view, Evas_Event_Key_Down *ev) {}
/**
* @brief Return the viewmgr instance.
*
* @return UiBaseViewmgr instance.
*/
- UiBaseViewmgr *get_viewmgr();
+ UiBaseViewmgr *getViewmgr();
/**
* @brief Return the key grabber(evas_object_rectangle).
*
* @return key grabber object.
*/
- Evas_Object *get_keygrab_obj();
+ Evas_Object *getKeygrabObj();
private:
_UI_DECLARE_PRIVATE_IMPL(UiBaseKeyListener);
*
* @return A previous content. If it wasn't, return @c NULL.
*/
- virtual bool set_content(Evas_Object *content);
+ virtual bool setContent(Evas_Object *content);
/**
* @brief This is for unsetting a content of the view.
*
* @return A previous content. If it wasn't, return @c NULL.
*/
- virtual Evas_Object *unset_content();
+ virtual Evas_Object *unsetContent();
/**
* @brief Get a base object of ui_view.
*
* @return The base object of ui_view.
*/
- virtual Evas_Object *get_base();
+ virtual Evas_Object *getBase();
/**
* @brief Set the indicator mode.
*
* @param indicator The mode to set, one of #UiViewIndicator.
*/
- virtual void set_indicator(UiViewIndicator indicator);
+ virtual void setIndicator(UiViewIndicator indicator);
/**
* @brief Get current view's degree.
*
* @return Current rotation degree, -1 if it fails to get degree information.
*/
- virtual int get_degree();
+ virtual int getDegree();
protected:
/**
*
* @return The base layout object of viewmgr.
*/
- Evas_Object *get_parent();
+ Evas_Object *getParent();
/**
* @brief Toggle event block.
*
* @param block @c true, when blocking is enabled, otherwise @c false.
*/
- virtual void set_event_block(bool block);
+ virtual void setEventBlock(bool block);
/**
* @brief View rotate changed.
*
* @param degree The current degree of view.
*
- * @see on_portrait()
- * @see on_landscpae()
+ * @see onPortrait()
+ * @see onLandscpae()
*/
- virtual void on_rotate(int degree);
+ virtual void onRotate(int degree);
/**
* @brief View portrait state.
*
* @note This state will be called when view rotation changed to portrait.
*
- * @see on_landscpae()
- * @see on_rotate()
+ * @see onLandscpae()
+ * @see onRotate()
*/
- virtual void on_portrait();
+ virtual void onPortrait();
/**
* @brief View landscape state.
*
* @note This state will be called when view rotation changed to landscape.
*
- * @see on_portrait()
- * @see on_rotate()
+ * @see onPortrait()
+ * @see onRotate()
*/
- virtual void on_landscape();
+ virtual void onLandscape();
private:
_UI_DECLARE_PRIVATE_IMPL(UiBaseView);
#include "UiBaseViewmgr.h"
#include "UiBaseView.h"
-#define UI_BASE_VIEWMGR dynamic_cast<UiBaseViewmgr *>(UiIfaceViewmgr::get_instance())
+#define UI_BASE_VIEWMGR dynamic_cast<UiBaseViewmgr *>(UiIfaceViewmgr::getInstance())
using namespace efl_viewmanager;
* @return @p view, @c NULL when it fails to push a @p view.
*
* @see activated()
- * @see insert_view_before()
- * @see insert_view_after()
- * @see pop_view()
+ * @see insertViewBefore()
+ * @see insertViewAfter()
+ * @see popView()
*/
- virtual UiBaseView *push_view(UiBaseView *view);
+ virtual UiBaseView *pushView(UiBaseView *view);
/**
* @brief Pop the top(last) view from this viewmgr view list.
* @return @c true on success or @c false otherwise.
*
* @see deactivate()
- * @see push_view()
+ * @see pushView()
*/
- virtual bool pop_view();
+ virtual bool popView();
/**
* @brief Insert a view in this viewmgr view list. Specifically, insert a given @p view right before of the given view, @before.
*
* @return @c true on success or @c false otherwise.
*/
- virtual bool insert_view_before(UiBaseView *view, UiBaseView *before);
+ virtual bool insertViewBefore(UiBaseView *view, UiBaseView *before);
/**
* @brief Insert a view in this viewmgr view list. Specifically, insert a given @p view right after of the given view, @after.
*
* @return @c true on success or @c false otherwise.
*/
- virtual bool insert_view_after(UiBaseView *view, UiBaseView *after);
+ virtual bool insertViewAfter(UiBaseView *view, UiBaseView *after);
/**
* @brief Get a window object of viewmgr.
*
* @return The window object of viewmgr.
*/
- Elm_Win *get_window();
+ Elm_Win *getWindow();
/**
* @brief Get a conformant object of viewmgr.
*
* @return The conformant object of viewmgr.
*/
- Elm_Conformant *get_conformant();
+ Elm_Conformant *getConformant();
/**
* @brief Return a last(top) view.
*
* @return The view which is last view of the viewmgr view list.
*/
- UiBaseView *get_last_view();
+ UiBaseView *getLastView();
/**
* @brief Return a view which is matched with the index @p idx.
* @note You could use the index as the page numbers of the views.
* @warning the index number of views are variable since the view list is variable.
*
- * @see get_view_index()
- * @see get_view_count()
+ * @see getViewIndex()
+ * @see getViewCount()
*/
- UiBaseView *get_view(unsigned int idx);
+ UiBaseView *getView(unsigned int idx);
/**
* @brief Return a view which is matched with the @p name.
* @return The view which name is matched with @p name.
* If there were no views name matched, @c NULL will be returned.
*
- * @see UiIfaceView::set_name()
+ * @see UiIfaceView::setName()
*/
- UiBaseView *get_view(const char *name);
+ UiBaseView *getView(const char *name);
/**
* @brief Get a base object of this viewmgr.
*
* @return The base object of this viewmgr.
*/
- Evas_Object *get_base();
+ Evas_Object *getBase();
protected:
/**
*
* @return @c false if current indicator is same with new one, @c true otherwise.
*/
- bool set_indicator(UiViewIndicator indicator);
+ bool setIndicator(UiViewIndicator indicator);
/**
* @brief This is a constructor for initializing viewmgr.
* @param pkg The name of package.
* @param key_listener The instance of UiBaseKeyListener.
*/
- UiBaseViewmgr(const char *pkg, UiBaseKeyListener *key_listener);
+ UiBaseViewmgr(const char *pkg, UiBaseKeyListener *keyListener);
/**
* @brief This is a constructor for initializing viewmgr.
*
* @return UiViewmgr instance.
*/
- UiViewmgr *get_viewmgr();
+ UiViewmgr *getViewmgr();
/**
* @brief Return UiApp instance.
*
* @return The instance of UiApp.
*/
- static UiApp *get_instance();
+ static UiApp *getInstance();
private:
_UI_DISABLE_COPY_AND_ASSIGN(UiApp);
*
* @note This is checking H/W key is menu or not.
*/
- virtual void extend_event_proc(UiBaseView *view, Evas_Event_Key_Down *ev);
+ virtual void extendEventProc(UiBaseView *view, Evas_Event_Key_Down *ev);
};
}
*
* @return @c true if it succeeds, @c false otherwise.
*/
- virtual bool set_content(Elm_Ctxpopup* ctxpopup);
+ virtual bool setContent(Elm_Ctxpopup* ctxpopup);
/**
* @brief This is for unsetting a content of the menu.
*
* @return A previous content. If it wasn't, return value will be @c NULL.
*/
- virtual Elm_Ctxpopup *unset_content();
+ virtual Elm_Ctxpopup *unsetContent();
/**
* @brief Return the active status of menu.
* @see activate()
* @see deactivate()
*/
- virtual bool is_activated();
+ virtual bool isActivated();
/**
* @brief Get a base object of a UiMenu.
* @note Normally, A base object can be used for a parent of UiMenu content.
* @return base object of UiMenu.
*/
- virtual Evas_Object *get_base();
+ virtual Evas_Object *getBase();
/**
* @brief Get a current menu's degree.
*
* @return Current rotation degree, -1 if it fails to get degree information.
*/
- virtual int get_degree();
+ virtual int getDegree();
protected:
/**
*
* @return viewmgr's window object.
*/
- Elm_Win *get_window();
+ Elm_Win *getWindow();
private:
_UI_DECLARE_PRIVATE_IMPL(UiMenu);
#include "UiPopup.h"
#include "UiApp.h"
-#define UI_VIEWMGR (UiApp::get_instance()->get_viewmgr())
+#define UI_VIEWMGR (UiApp::getInstance()->getViewmgr())
#endif /* UI_MOBILE_VIEWMANAGER_H */
*
* @return @c true if it succeeds, @c false otherwise.
*/
- virtual bool set_content(Elm_Popup* popup);
+ virtual bool setContent(Elm_Popup* popup);
/**
* @brief This is for unsetting a content of the popup.
*
* @return A previous content. If it wasn't, return value will be @c NULL.
*/
- virtual Elm_Popup *unset_content();
+ virtual Elm_Popup *unsetContent();
/**
* @brief Return the active status of popup.
* @see activate()
* @see deactivate()
*/
- virtual bool is_activated();
+ virtual bool isActivated();
/**
* @brief Get a base object of an UiPopup.
*
* @return base object of UiPopup.
*/
- virtual Evas_Object *get_base();
+ virtual Evas_Object *getBase();
/**
* @brief Get current popup's degree.
*
* @return Current rotation degree, -1 if it fails to get degree information.
*/
- virtual int get_degree();
+ virtual int getDegree();
protected:
/**
*
* @return viewmgr's window object.
*/
- virtual Elm_Win *get_window();
+ virtual Elm_Win *getWindow();
private:
_UI_DECLARE_PRIVATE_IMPL(UiPopup);
*
* @return @c true if it succeeds, @c false otherwise.
*/
- bool set_content(Evas_Object *content, const char *title = NULL);
+ bool setContent(Evas_Object *content, const char *title = NULL);
/**
* @brief Replace or set a content of the view.
*
* @return @c true if it succeeds, @c false otherwise.
*/
- bool set_content(Evas_Object *content, const char *title, const char *subtitle, Elm_Button *title_left_btn, Elm_Button *title_right_btn);
+ bool setContent(Evas_Object *content, const char *title, const char *subtitle, Elm_Button *titleLeftBtn, Elm_Button *titleRightBtn);
/**
* @brief Set a title badge text.
*
* @return @c true if it succeeds, @c false otherwise.
*/
- bool set_title_badge(const char *text);
+ bool setTitleBadge(const char *text);
/**
* @brief Set a subtitle text.
*
* @return @c true if it succeeds, @c false otherwise.
*/
- bool set_subtitle(const char *text);
+ bool setSubtitle(const char *text);
/**
* @brief Set a title_left_btn.
*
* @return @c true if it succeeds, @c false otherwise.
*/
- bool set_title_left_btn(Elm_Button *title_left_btn);
+ bool setTitleLeftBtn(Elm_Button *titleLeftBtn);
/**
* @brief Set a title_right_btn.
*
* @return @c true if it succeeds, @c false otherwise.
*/
- bool set_title_right_btn(Elm_Button *title_right_btn);
+ bool setTitleRightBtn(Elm_Button *titleRightBtn);
/**
* @brief Set a title text.
*
* @return @c true if it succeeds, @c false otherwise.
*/
- bool set_title(const char *text);
+ bool setTitle(const char *text);
/**
* @brief Set a toolbar below title.
*
* @return @c true if it succeeds, @c false otherwise.
*/
- bool set_toolbar(Elm_Toolbar *toolbar);
+ bool setToolbar(Elm_Toolbar *toolbar);
/**
* @brief Control the title visible state.
*
* @return @c true if it succeeds, @c false otherwise.
*/
- bool set_title_visible(bool visible, bool anim);
+ bool setTitleVisible(bool visible, bool anim);
/**
* @brief Unset a content of the view.
*
* @return A previous content. If it wasn't, return @c NULL.
*/
- Evas_Object *unset_content();
+ Evas_Object *unsetContent();
/**
* @brief Unset a title left button of title area.
*
* @return A previous content. If it wasn't, return @c NULL.
*/
- Elm_Button *unset_title_left_btn();
+ Elm_Button *unsetTitleLeftBtn();
/**
* @brief Unset a title right button of title area.
*
* @return A previous content. If it wasn't, return @c NULL.
*/
- Elm_Button *unset_title_right_btn();
+ Elm_Button *unsetTitleRightBtn();
/**
* @brief Unset a toolbar.
*
* @return A previous content. If it wasn't, return @c NULL.
*/
- Elm_Toolbar *unset_toolbar();
+ Elm_Toolbar *unsetToolbar();
/**
* @brief Return a title left button of the view.
*
* @return title left button of the view.
*/
- Elm_Button *get_title_left_btn();
+ Elm_Button *getTitleLeftBtn();
/**
* @brief Return a title right button of the view.
*
* @return title right button of the view.
*/
- Elm_Button *get_title_right_btn();
+ Elm_Button *getTitleRightBtn();
/**
* @brief Return a toolbar of the view.
*
* @return toolbar of the view.
*/
- Elm_Toolbar *get_toolbar();
+ Elm_Toolbar *getToolbar();
/**
* @brief Get a base layout of viewmgr.
*
* @return viewmgr's base layout object.
*/
- virtual Evas_Object *get_base();
+ virtual Evas_Object *getBase();
protected:
/**
* @note this state will be triggered by UiIfaceViewmgr.
*
*/
- virtual void on_load();
+ virtual void onLoad();
/** @brief view unload state.
*
* @note this state will be triggered by UiIfaceViewmgr.
*
*/
- virtual void on_unload();
+ virtual void onUnload();
/** @brief toggle event block.
*
*
* @param block @c true, blocking enable, otherwise @c false.
*/
- virtual void set_event_block(bool block);
+ virtual void setEventBlock(bool block);
private:
_UI_DECLARE_PRIVATE_IMPL(UiStandardView);
*
* @return The menu object that connected with this view.
*/
- const UiMenu *get_menu();
+ const UiMenu *getMenu();
protected:
/**
*
* @return The menu instance of this view. NULL If the menu already activated.
*/
- virtual UiMenu *on_menu_pre();
+ virtual UiMenu *onMenuPre();
/**
* @brief Activate menu.
*
* @note It calls activate() for posting menu. If there is a menu instance.
*/
- virtual void on_menu_post();
+ virtual void onMenuPost();
/**
* @brief The H/W menu key event occurs on view.
*
* @param menu menu instance, This is made by key listener when menu key occured.
*/
- virtual void on_menu(UiMenu *menu);
+ virtual void onMenu(UiMenu *menu);
/**
* @brief The H/W back key event occurs on view.
* @note User can override this function to define application specific action when H/W back key
* event occurs. otherwise current view will be popped.
*/
- virtual void on_back();
+ virtual void onBack();
/**
* @brief View rotate changed.
*
* @param degree Current view's degree.
*
- * @see on_portrait()
- * @see on_landscpae()
+ * @see onPortrait()
+ * @see onLandscpae()
*/
- virtual void on_rotate(int degree);
+ virtual void onRotate(int degree);
/**
* @brief View portrait state.
*
* @note This state will be called when view rotation changed to portrait.
*
- * @see on_landscpae()
- * @see on_rotate()
+ * @see onLandscpae()
+ * @see onRotate()
*/
- virtual void on_portrait();
+ virtual void onPortrait();
/**
* @brief View landscape state.
*
* @note This state will be called when view rotation changed to landscape.
*
- * @see on_portrait()
- * @see on_rotate()
+ * @see onPortrait()
+ * @see onRotate()
*/
- virtual void on_landscape();
+ virtual void onLandscape();
/** @brief View deactivate state.
*
* @note this state will be triggered by UiIfaceViewmgr.
*
*/
- virtual void on_deactivate();
+ virtual void onDeactivate();
private:
/**
*
* @param popup UiPopup instance
*/
- void connect_popup(UiPopup *popup);
+ void _connectPopup(UiPopup *popup);
/**
* @brief pop given popup instance in the internal popup stack.
*
* @param popup UiPopup instance
*/
- void disconnect_popup(UiPopup *popup);
+ void _disconnectPopup(UiPopup *popup);
_UI_DECLARE_PRIVATE_IMPL(UiView);
_UI_DISABLE_COPY_AND_ASSIGN(UiView);
*
* @return UiIfaceViewmgr instance.
*/
- UiIfaceViewmgr *get_viewmgr();
+ UiIfaceViewmgr *getViewmgr();
/**
* @brief Return UiIfaceApp instance.
*
* @return The instance of UiIfaceApp.
*/
- static UiIfaceApp *get_instance();
+ static UiIfaceApp *getInstance();
/**
* @brief Application life-cycle start and add application event callback functions add.
* @return If this function returns true, the application main loop starts.
* If this function returns false, the application terminates.
*/
- virtual bool on_create();
+ virtual bool onCreate();
/**
* @brief Calling before the main event loop finish.
*
* @note Release all resources here.
*/
- virtual void on_terminate();
+ virtual void onTerminate();
/**
* @brief Calling when application becomes invisible.
*/
- virtual void on_pause();
+ virtual void onPause();
/**
* @brief Calling when application becomes visible.
*/
- virtual void on_resume();
+ virtual void onResume();
/**
* @brief Calling when gets a launch request event.
*
* @param app_control_h The instance of app_control_h.
*/
- virtual void on_control(app_control_h app_control);
+ virtual void onControl(app_control_h app_control);
/**
* @brief Calling when device low battery.
*
* @param app_event_info_h The instance of app_event_info_h.
*/
- virtual void on_low_battery(app_event_info_h event_info);
+ virtual void onLowBattery(app_event_info_h event_info);
/**
* @brief Calling when device low memory.
*
* @param app_event_info_h The instance of app_event_info_h.
*/
- virtual void on_low_memory(app_event_info_h event_info);
+ virtual void onLowMemory(app_event_info_h event_info);
/**
* @brief Calling when device region changed.
*
* @param app_event_info_h The instance of app_event_info_h.
*/
- virtual void on_region_changed(app_event_info_h event_info);
+ virtual void onRegionChanged(app_event_info_h event_info);
/**
* @brief Calling when device orient changed.
*
* @param app_event_info_h The instance of app_event_info_h.
*/
- virtual void on_orient_changed(app_event_info_h event_info);
+ virtual void onOrientChanged(app_event_info_h event_info);
/**
* @brief Calling when language changed.
*
* @param app_event_info_h The instance of app_event_info_h.
*/
- virtual void on_lang_changed(app_event_info_h event_info);
+ virtual void onLangChanged(app_event_info_h event_info);
private:
_UI_DECLARE_PRIVATE_IMPL(UiIfaceApp);
*
* @return @c true if it succeeds, @c false otherwise.
*/
- virtual bool set_content(T content);
+ virtual bool setContent(T content);
/**
* @brief This is for unsetting a content of the view.
*
* @return A previous content. If it wasn't, return @c NULL.
*/
- virtual T unset_content();
+ virtual T unsetContent();
/**
* @brief The H/W back key event occurs on view.
* @note User can override this function to define application specific action when H/W back key
* event occurs. otherwise current view will be popped.
*/
- virtual void on_back();
+ virtual void onBack();
/**
* @brief Overlay activate.
* @see activate()
* @see deactivate()
*/
- virtual bool is_activated();
+ virtual bool isActivated();
/**
* @brief Return a view which is matched with the overlay.
*
* @return The view which is matched with overlay.
*/
- UiIfaceView *get_view();
+ UiIfaceView *getView();
/**
* @brief Return a content instance of this overlay.
*
* @return content of overlay.
*/
- virtual T get_content();
+ virtual T getContent();
protected:
/**
* @see on_landscpae()
* @see on_rotate()
*/
- virtual void on_portrait() {}
+ virtual void onPortrait() {}
/**
* @brief View landscape state.
* @see on_portrait()
* @see on_rotate()
*/
- virtual void on_landscape() {}
+ virtual void onLandscape() {}
/**
* @brief View rotate changed.
* @see on_portrait()
* @see on_landscpae()
*/
- virtual void on_rotate(int degree) {}
+ virtual void onRotate(int degree) {}
public:
/**
*
* @return Current rotation degree, -1 if it fails to get degree information.
*/
- virtual int get_degree() { return 0; }
+ virtual int getDegree() { return 0; }
};
}
* @warning When you override this member function, you should implement the logic to check the given style name is available or not.
* If your framework doesn't support any styles then just allow a @c NULL argument and return true. Otherwise return false.
*/
- bool set_transition_style(const char *style);
+ bool setTransitionStyle(const char *style);
/**
* @brief Set content removable.
*
* @warning You should not remove a view content manually on unload status if removable content is set.
*/
- void set_removable_content(bool removable);
+ void setRemovableContent(bool removable);
/**
* @brief Set the indicator mode of the view.
*
* @param indicator The mode to set, one of #UiViewIndicator.
*/
- void set_indicator(UiViewIndicator indicator);
+ void setIndicator(UiViewIndicator indicator);
/**
* @brief Return a style name of this view.
*
* @return style name of view.
*/
- const char *get_transition_style();
+ const char *getTransitionStyle();
/**
* @brief Return a name of this view.
*
* @return name of view.
*/
- const char *get_name();
+ const char *getName();
/**
* @brief Return a content instance of this view.
*
* @return content of view. If no contents set yet, @c NULL.
*/
- T get_content();
+ T getContent();
/**
* @brief Replace or set a content of the view.
*
* @return @c true if it succeeds, @c false otherwise.
*/
- virtual bool set_content(T content);
+ virtual bool setContent(T content);
/**
* @brief Unset the view content.
*
* @return A previous content. If it wasn't, return @c NULL.
*/
- virtual T unset_content();
+ virtual T unsetContent();
/**
* @brief Return a state of this view.
*
* @return current state of view.
*/
- UiViewState get_state();
+ UiViewState getState();
/**
* @brief Return a state of removable content.
*
* @return true if the view's content is removable, otherwise false.
*/
- bool get_removable_content();
+ bool getRemovableContent();
/**
* @brief Return the indicator mode of this view.
*
* @return indicator state of view.
*/
- UiViewIndicator get_indicator();
+ UiViewIndicator getIndicator();
/**
* @brief The H/W back key event occurs on view.
* @note User can override this function to define application specific action when H/W back key
* event occurs. otherwise current view will be popped.
*/
- virtual void on_back();
+ virtual void onBack();
protected:
/**
*
* @param block @c true, when blocking is enabled, otherwise @c false.
*
- * @see get_event_block()
+ * @see getEventBlock()
*/
- virtual void set_event_block(bool block);
+ virtual void setEventBlock(bool block);
/**
* @brief Return the state of event block.
*
* @return true if the event block enabled, otherwise false.
*
- * @see set_event_block()
+ * @see setEventBlock()
*/
- bool get_event_block();
+ bool getEventBlock();
/**
* @brief View load state.
*
* @note A view of this state is moving onto the screen. Get ready for this view. Generally, you could prepare this view's content here and set them to
- * this view. In the most cases, this on_load() will be triggered with this step. load -> deactivated -> activated. Tihs on_load() will be triggered
+ * this view. In the most cases, this onLoad() will be triggered with this step. load -> deactivated -> activated. Tihs onLoad() will be triggered
* only when view has not any content yet.
*/
- virtual void on_load();
+ virtual void onLoad();
/**
* @brief View unload state.
*
* @note Remove resources (contents) with regards to this view for saving memory. Otherwise, you could keep those resources (contents) for later access.
- * Removing resources might be better in point of performance view. It's up to your scenario. on_unload() will be triggered just right before
- * the view is going to be deleted by popping or by somehow. Also, on_unload() will be triggered when this view is pushed behind other views.
+ * Removing resources might be better in point of performance view. It's up to your scenario. onUnload() will be triggered just right before
+ * the view is going to be deleted by popping or by somehow. Also, onUnload() will be triggered when this view is pushed behind other views.
*/
- virtual void on_unload();
+ virtual void onUnload();
/**
* @brief View activate state.
*
* @note Generally, a view will be activated when show-transition is finished. From whatever its state, when the view comes on the screen,
- * on_activate() will be triggered. In the most cases, on_activate() will be triggered with this step. load -> deactivate -> activate
+ * onActivate() will be triggered. In the most cases, onActivate() will be triggered with this step. load -> deactivate -> activate
*/
- virtual void on_activate();
+ virtual void onActivate();
/**
* @brief View deactivate state.
*
* @note Get ready for unload. Hide transition may be triggered at this point. If the system blocks application running in some cases such as phone call,
* system notification, application switching ..., Deactivate state will be triggered. Also, when a view is going to be popped or destroyed,
- * on_deactivate() will be triggered. Lastly, when a new view is pushed, so if it becomes invisible state by other views, on_deactivate() will be
+ * onDeactivate() will be triggered. Lastly, when a new view is pushed, so if it becomes invisible state by other views, onDeactivate() will be
* triggered also.
*/
- virtual void on_deactivate();
+ virtual void onDeactivate();
/**
* @brief View pause state.
* interactive with users. However, still it would be visible in some way (ie, half transparency). For this, this Pause will be triggered.
* If the view is already deactivated or under the unload state, the pause won't be called.
*/
- virtual void on_pause();
+ virtual void onPause();
/**
* @brief View resume state.
*
- * @note When a view is returns to the activate state from pause state, this on_resume() will be triggered. For instance, a Popup is dismissed.
+ * @note When a view is returns to the activate state from pause state, this onResume() will be triggered. For instance, a Popup is dismissed.
*/
- virtual void on_resume();
+ virtual void onResume();
/**
* @brief View destroy state.
* the view because this view instance will be totally freed at the end of destroy. Be aware that you must not request any view functions on this
* state.
*/
- virtual void on_destroy();
+ virtual void onDestroy();
/**
* @brief Low Memory Event
* platform Low Memory Killer kills your application to get more free memory. This event function must also release any cached data in the main
* memory to secure more free memory.
*/
- virtual void on_low_memory();
+ virtual void onLowMemory();
/**
* @brief Low Battery Event
* @note This event function is responsible for saving data in the main memory to a persistent memory or storage to avoid data loss in case the power goes
* off completely. This event function must also stop heavy CPU consumption or power consumption activities to save the remaining power.
*/
- virtual void on_low_battery();
+ virtual void onLowBattery();
/**
* @brief Region Changed Event
*
* @note This event function is responsible for refreshing the display into the new time zone.
*/
- virtual void on_region_changed(const char *region);
+ virtual void onRegionChanged(const char *region);
/**
* @brief Language Changed Event
*
* @note This event function is responsible for refreshing the display into the new language.
*/
- virtual void on_language_changed(const char *language);
+ virtual void onLanguageChanged(const char *language);
private:
/**
*
* @return @c true if it succeeds, @c false otherwise.
*
- * @see get_viewmgr()
+ * @see _getViewmgr()
*/
- bool set_viewmgr(UiIfaceViewmgr *viewmgr);
+ bool _setViewmgr(UiIfaceViewmgr *viewmgr);
/**
* @brief Return the viewmgr instance.
*
* @return UiIfaceViewmgr instance.
*
- * @see set_viewmgr()
+ * @see _setViewmgr()
*/
- UiIfaceViewmgr *get_viewmgr();
+ UiIfaceViewmgr *_getViewmgr();
_UI_DECLARE_PRIVATE_IMPL(UiIfaceView);
_UI_DISABLE_COPY_AND_ASSIGN(UiIfaceView);
friend class A
#define _UI_DECLARE_PRIVATE_IMPL(A) \
- class A##Impl *impl; \
+ class A##Impl *_impl; \
friend class A##Impl
#define _UI_DISABLE_COPY_AND_ASSIGN(A) \
* @see activate()
* @see deactivate()
*/
- bool is_activated();
+ bool isActivated();
/**
* @brief Return the number of views which this viewmgr has.
*
* @return the count of views
*/
- unsigned int get_view_count();
+ unsigned int getViewCount();
/**
* @brief Return a view index(page) number of the given view.
*
* @warning The index number of views are variable since the view list is variable.
*/
- int get_view_index(const UiIfaceView *view);
+ int getViewIndex(const UiIfaceView *view);
/**
* @brief Return whether soft key is required or not.
*
* @return @c true if soft key is required, @c false otherwise.
*/
- static bool need_soft_key();
+ static bool needSoftKey();
/**
* @brief Return viewmgr instance.
*
* @return viewmgr instance.
*/
- static UiIfaceViewmgr* get_instance();
+ static UiIfaceViewmgr* getInstance();
protected:
/**
*
* @warning This function must be called when push transition is finished.
*/
- bool push_view_finished(UiIfaceView *view);
+ bool pushViewFinished(UiIfaceView *view);
/**
* @brief This function is designed for finishing process for pop transition.
*
* @warning This function must be called when push transition is finished.
*/
- bool pop_view_finished(UiIfaceView *view);
+ bool popViewFinished(UiIfaceView *view);
/**
* @brief Push a new view into this viewmgr. This function is used for when application switches a current view to a new one.
* @return @p view, @c NULL when it fails to push a @p view.
*
* @see activated()
- * @see insert_view_before()
- * @see insert_view_after()
- * @see pop_view()
- * @see UiIfaceView::set_transition_style()
+ * @see insertViewBefore()
+ * @see insertViewAfter()
+ * @see popView()
+ * @see UiIfaceView::setTransitionStyle()
*/
- virtual UiIfaceView *push_view(UiIfaceView *view);
+ virtual UiIfaceView *pushView(UiIfaceView *view);
/**
* @brief Pop the top(last) view from this viewmgr view list.
* @return @c true on success or @c false otherwise.
*
* @see deactivate()
- * @see push_view()
+ * @see pushView()
*/
- virtual bool pop_view();
+ virtual bool popView();
/**
* @brief Insert a view in this viewmgr view list. Specifically, insert a given @p view right before of the given view, @before.
*
* @return @c true on success or @c false otherwise.
*/
- bool insert_view_before(UiIfaceView *view, UiIfaceView *before);
+ bool insertViewBefore(UiIfaceView *view, UiIfaceView *before);
/**
* @brief Insert a view in this viewmgr view list. Specifically, insert a given @p view right after of the given view, @after.
*
* @return @c true on success or @c false otherwise.
*/
- bool insert_view_after(UiIfaceView *view, UiIfaceView *after);
+ bool insertViewAfter(UiIfaceView *view, UiIfaceView *after);
/**
* @brief Remove the given view from this viewmgr view list.
*
* @return @c true on success or @c false otherwise.
*
- * @see insert_view_before()
- * @see insert_view_after()
- * @see push_view()
+ * @see insertViewBefore()
+ * @see insertViewAfter()
+ * @see pushView()
*/
- bool remove_view(UiIfaceView *view);
+ bool removeView(UiIfaceView *view);
/**
* @brief Return a view which is matched with the index @p idx.
* @note You could use the index as the page numbers of the views.
* @warning the index number of views are variable since the view list is variable.
*
- * @see get_view_index()
- * @see get_view_count()
+ * @see getViewIndex()
+ * @see getViewCount()
*/
- UiIfaceView* get_view(unsigned int idx);
+ UiIfaceView* getView(unsigned int idx);
/**
* @brief Return a view which is matched with the @p name.
* @return The view which name is matched with @p name.
* If there were no views name matched, @c NULL will be returned.
*
- * @see UiIfaceView::get_name().
+ * @see UiIfaceView::getName().
*/
- UiIfaceView *get_view(const char *name);
+ UiIfaceView *getView(const char *name);
/**
* @brief Return a last(top) view.
*
* @return The view which is last view of the viewmgr view list.
*/
- UiIfaceView *get_last_view();
+ UiIfaceView *getLastView();
///Constructor.
UiIfaceViewmgr();
class UiBaseKeyListenerImpl
{
protected:
- UiBaseKeyListener *key_listener;
+ UiBaseKeyListener *keyListener;
UiBaseViewmgr *viewmgr;
- Evas_Object *key_grabber;
+ Evas_Object *keyGrabber;
public:
UiBaseKeyListenerImpl(UiBaseKeyListener *key_listener, UiBaseViewmgr *viewmgr);
bool init();
bool term();
- void event_proc(Evas_Event_Key_Down *ev);
- UiBaseViewmgr *get_viewmgr() { return this->viewmgr; }
- Evas_Object *get_keygrab_obj() { return this->key_grabber; }
+ void eventProc(Evas_Event_Key_Down *ev);
+ UiBaseViewmgr *getViewmgr() { return this->viewmgr; }
+ Evas_Object *getKeygrabObj() { return this->keyGrabber; }
};
}
static const char *KEY_BACK = "XF86Back";
static const char *KEY_BACK2 = "XF86Stop";
-static void key_grab_rect_key_up_cb(UiBaseKeyListenerImpl *key_listener, Evas_Event_Key_Down *ev)
+static void _keyGrabRectKeyUpCb(UiBaseKeyListenerImpl *keyListener, Evas_Event_Key_Down *ev)
{
- key_listener->event_proc(ev);
+ keyListener->eventProc(ev);
}
-UiBaseKeyListenerImpl::UiBaseKeyListenerImpl(UiBaseKeyListener *key_listener, UiBaseViewmgr *viewmgr)
- : key_listener(key_listener), viewmgr(viewmgr), key_grabber(NULL)
+UiBaseKeyListenerImpl::UiBaseKeyListenerImpl(UiBaseKeyListener *keyListener, UiBaseViewmgr *viewmgr)
+ : keyListener(keyListener), viewmgr(viewmgr), keyGrabber(NULL)
{
}
-void UiBaseKeyListenerImpl::event_proc(Evas_Event_Key_Down *ev)
+void UiBaseKeyListenerImpl::eventProc(Evas_Event_Key_Down *ev)
{
//Only if view manager is activated
- UiBaseViewmgr *viewmgr = this->key_listener->get_viewmgr();
- if (!viewmgr->is_activated()) return;
+ UiBaseViewmgr *viewmgr = this->keyListener->getViewmgr();
+ if (!viewmgr->isActivated()) return;
//Get Top View
- UiBaseView *view = viewmgr->get_last_view();
+ UiBaseView *view = viewmgr->getLastView();
if (!view) return;
- this->key_listener->extend_event_proc(view, ev);
+ this->keyListener->extendEventProc(view, ev);
if (strcmp(ev->keyname, KEY_BACK) && strcmp(ev->keyname, KEY_BACK2)) return;
- view->on_back();
+ view->onBack();
}
bool UiBaseKeyListenerImpl::term()
{
- evas_object_del(this->key_grabber);
+ evas_object_del(this->keyGrabber);
return true;
}
return false;
}
- Evas *e = evas_object_evas_get(this->viewmgr->get_window());
+ Evas *e = evas_object_evas_get(this->viewmgr->getWindow());
if (!e)
{
LOGE("Failed to get Evas from window");
return false;
}
- Evas_Object *key_grab_rect = evas_object_rectangle_add(e);
- if (!key_grab_rect)
+ Evas_Object *keyGrabRect = evas_object_rectangle_add(e);
+ if (!keyGrabRect)
{
LOGE("Failed to create a key grabber rectangle");
return false;
}
- evas_object_event_callback_add(key_grab_rect, EVAS_CALLBACK_KEY_UP, [](void *data, Evas *e, Evas_Object *obj, void *event_info) -> void
+ evas_object_event_callback_add(keyGrabRect, EVAS_CALLBACK_KEY_UP, [](void *data, Evas *e, Evas_Object *obj, void *event_info) -> void
{
Evas_Event_Key_Down *ev = static_cast<Evas_Event_Key_Down *>(event_info);
- UiBaseKeyListenerImpl *key_listener = static_cast<UiBaseKeyListenerImpl *>(data);
- key_grab_rect_key_up_cb(key_listener, ev);
+ UiBaseKeyListenerImpl *keyListener = static_cast<UiBaseKeyListenerImpl *>(data);
+ _keyGrabRectKeyUpCb(keyListener, ev);
}, this);
- if (!evas_object_key_grab(key_grab_rect, KEY_BACK, 0, 0, EINA_FALSE))
+ if (!evas_object_key_grab(keyGrabRect, KEY_BACK, 0, 0, EINA_FALSE))
{
LOGE("Failed to grab BACK KEY(%s)\n", KEY_BACK);
- evas_object_del(key_grab_rect);
+ evas_object_del(keyGrabRect);
return false;
}
- if (!evas_object_key_grab(key_grab_rect, KEY_BACK2, 0, 0, EINA_FALSE))
+ if (!evas_object_key_grab(keyGrabRect, KEY_BACK2, 0, 0, EINA_FALSE))
{
LOGE("Failed to grab BACK KEY(%s)\n", KEY_BACK2);
- evas_object_del(key_grab_rect);
+ evas_object_del(keyGrabRect);
return false;
}
- this->key_grabber = key_grab_rect;
+ this->keyGrabber = keyGrabRect;
return true;
}
UiBaseKeyListener::UiBaseKeyListener(UiBaseViewmgr *viewmgr)
{
- this->impl = new UiBaseKeyListenerImpl(this, viewmgr);
+ this->_impl = new UiBaseKeyListenerImpl(this, viewmgr);
}
UiBaseKeyListener::~UiBaseKeyListener()
{
- delete(this->impl);
+ delete(this->_impl);
}
bool UiBaseKeyListener::term()
{
- return this->impl->term();
+ return this->_impl->term();
}
bool UiBaseKeyListener::init()
{
- return this->impl->init();
+ return this->_impl->init();
}
-Evas_Object *UiBaseKeyListener::get_keygrab_obj()
+Evas_Object *UiBaseKeyListener::getKeygrabObj()
{
- return this->impl->get_keygrab_obj();
+ return this->_impl->getKeygrabObj();
}
-UiBaseViewmgr *UiBaseKeyListener::get_viewmgr()
+UiBaseViewmgr *UiBaseKeyListener::getViewmgr()
{
- return this->impl->get_viewmgr();
+ return this->_impl->getViewmgr();
}
/* External class Implementation */
/***********************************************************************************************/
-static void content_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+static void _contentDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
UiBaseView *view = static_cast<UiBaseView *>(data);
- view->unset_content();
+ view->unsetContent();
}
UiBaseView::UiBaseView(const char *name)
{
}
-bool UiBaseView::set_content(Evas_Object *content)
+bool UiBaseView::setContent(Evas_Object *content)
{
- Evas_Object *pcontent = this->unset_content();
+ Evas_Object *pcontent = this->unsetContent();
if (pcontent)
{
evas_object_del(pcontent);
}
if (content)
{
- evas_object_event_callback_add(content, EVAS_CALLBACK_DEL, content_del_cb, this);
- UiIfaceView::set_content(content);
+ evas_object_event_callback_add(content, EVAS_CALLBACK_DEL, _contentDelCb, this);
+ UiIfaceView::setContent(content);
}
return true;
}
-Evas_Object *UiBaseView::unset_content()
+Evas_Object *UiBaseView::unsetContent()
{
- Evas_Object *obj = UiIfaceView::unset_content();
+ Evas_Object *obj = UiIfaceView::unsetContent();
if (obj)
{
- evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, content_del_cb);
+ evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, _contentDelCb);
evas_object_hide(obj);
}
return obj;
}
-Evas_Object *UiBaseView::get_base()
+Evas_Object *UiBaseView::getBase()
{
UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
if (!viewmgr)
{
return NULL;
}
- return viewmgr->get_base();
+ return viewmgr->getBase();
}
-Evas_Object *UiBaseView ::get_parent()
+Evas_Object *UiBaseView ::getParent()
{
UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
if (!viewmgr)
LOGE("Failed to get a viewmgr");
return NULL;
}
- return viewmgr->get_base();
+ return viewmgr->getBase();
}
-void UiBaseView::set_indicator(UiViewIndicator indicator)
+void UiBaseView::setIndicator(UiViewIndicator indicator)
{
- if (this->get_indicator() == indicator) return;
+ if (this->getIndicator() == indicator) return;
- UiIfaceView::set_indicator(indicator);
+ UiIfaceView::setIndicator(indicator);
UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
if (!viewmgr)
return;
}
- if (!viewmgr->is_activated()) return;
+ if (!viewmgr->isActivated()) return;
- if (viewmgr->get_last_view() != this) return;
+ if (viewmgr->getLastView() != this) return;
- viewmgr->set_indicator(indicator);
+ viewmgr->setIndicator(indicator);
}
-void UiBaseView::on_rotate(int degree)
+void UiBaseView::onRotate(int degree)
{
}
-void UiBaseView::on_portrait()
+void UiBaseView::onPortrait()
{
}
-void UiBaseView::on_landscape()
+void UiBaseView::onLandscape()
{
}
-void UiBaseView::set_event_block(bool block)
+void UiBaseView::setEventBlock(bool block)
{
- UiIfaceView::set_event_block(block);
- evas_object_freeze_events_set(this->get_content(), block);
+ UiIfaceView::setEventBlock(block);
+ evas_object_freeze_events_set(this->getContent(), block);
}
-int UiBaseView::get_degree()
+int UiBaseView::getDegree()
{
UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
if (!viewmgr)
LOGE("Failed to get a viewmgr");
return -1;
}
- return elm_win_rotation_get(viewmgr->get_window());
+ return elm_win_rotation_get(viewmgr->getWindow());
}
friend class UiBaseViewmgr;
private:
- UiBaseViewmgr *viewmgr;
- Elm_Win *win; //This is acting like a base object of viewmgr.
- Elm_Conformant *conform; //Conformant for viewmgr.
- Elm_Scroller *scroller; //Scroller for viewmgr.
- Elm_Layout *layout; //Viewmgr's base layout.
- UiBaseKeyListener *key_listener; //HW Key Handler such as "BACK" key...
- UiViewIndicator indicator; //Mode of indicator.
- string transition_style; //Current transition effect style name
- map<string, Elm_Layout *> effect_map; //Map for effect layouts.
-
- Elm_Layout *set_transition_layout(string transition_style);
-
- bool create_conformant(Elm_Win *win);
- bool create_scroller(Elm_Conformant *conform);
- bool create_base_layout(Elm_Scroller *scroller, const char *style);
- bool set_indicator(UiViewIndicator indicator);
- void activate_top_view();
- bool init();
- bool term();
+ UiBaseViewmgr *_viewmgr;
+ Elm_Win *_win; //This is acting like a base object of viewmgr.
+ Elm_Conformant *_conform; //Conformant for viewmgr.
+ Elm_Scroller *_scroller; //Scroller for viewmgr.
+ Elm_Layout *_layout; //Viewmgr's base layout.
+ UiBaseKeyListener *_keyListener; //HW Key Handler such as "BACK" key...
+ UiViewIndicator _indicator; //Mode of indicator.
+ string _transitionStyle; //Current transition effect style name
+ map<string, Elm_Layout *> _effectMap; //Map for effect layouts.
+
+ Elm_Layout *_setTransitionLayout(string transitionStyle);
+
+ bool _createConformant(Elm_Win *win);
+ bool _createScroller(Elm_Conformant *conform);
+ bool _createBaseLayout(Elm_Scroller *scroller, const char *style);
+ bool _setIndicator(UiViewIndicator indicator);
+ void _activateTopView();
+ bool _init();
+ bool _term();
public:
- UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, const char *pkg, UiBaseKeyListener *key_listener);
+ UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, const char *pkg, UiBaseKeyListener *keyListener);
~UiBaseViewmgrImpl();
bool activate();
bool deactivate();
- UiBaseView *push_view(UiBaseView *view);
- bool pop_view();
- bool insert_view_before(UiBaseView *view, UiBaseView *before);
- bool insert_view_after(UiBaseView *view, UiBaseView *after);
+ UiBaseView *pushView(UiBaseView *view);
+ bool popView();
+ bool insertViewBefore(UiBaseView *view, UiBaseView *before);
+ bool insertViewAfter(UiBaseView *view, UiBaseView *after);
- Evas_Object *get_base()
+ Evas_Object *getBase()
{
- return this->layout;
+ return this->_layout;
}
- Elm_Win *get_window()
+ Elm_Win *getWindow()
{
- return this->win;
+ return this->_win;
}
- Elm_Conformant *get_conformant()
+ Elm_Conformant *getConformant()
{
- return this->conform;
+ return this->_conform;
}
};
}
-bool UiBaseViewmgrImpl::create_base_layout(Elm_Scroller *scroller, const char *style)
+bool UiBaseViewmgrImpl::_createBaseLayout(Elm_Scroller *scroller, const char *style)
{
- char edj_path[PATH_MAX];
- char group_name[128];
+ char edjPath[PATH_MAX];
+ char groupName[128];
Elm_Layout *layout = elm_layout_add(scroller);
if (!layout) return false;
- snprintf(group_name, sizeof(group_name), "transition/%s", style);
- snprintf(edj_path, sizeof(edj_path), "%s/ui-viewmgr.edj", EDJ_PATH);
- elm_layout_file_set(layout, edj_path, group_name);
+ snprintf(groupName, sizeof(groupName), "transition/%s", style);
+ snprintf(edjPath, sizeof(edjPath), "%s/ui-viewmgr.edj", EDJ_PATH);
+ elm_layout_file_set(layout, edjPath, groupName);
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_content_set(scroller, layout);
[](void *data, Evas_Object *obj, const char *emission, const char *source) -> void
{
UiBaseViewmgr *viewmgr = static_cast<UiBaseViewmgr *>(data);
- UiBaseView *pview = viewmgr->get_view(viewmgr->get_view_count() - 2);
- UiBaseView *view = viewmgr->get_last_view();
- if (pview) viewmgr->push_view_finished(pview);
- if (view) viewmgr->push_view_finished(view);
+ UiBaseView *pview = viewmgr->getView(viewmgr->getViewCount() - 2);
+ UiBaseView *view = viewmgr->getLastView();
+ if (pview) viewmgr->pushViewFinished(pview);
+ if (view) viewmgr->pushViewFinished(view);
},
- this->viewmgr);
+ this->_viewmgr);
//Pop Finished Event
elm_layout_signal_callback_add(layout, "pop,finished", "viewmgr",
[](void *data, Evas_Object *obj, const char *emission, const char *source) -> void
{
UiBaseViewmgr *viewmgr = static_cast<UiBaseViewmgr *>(data);
- UiBaseView *pview = viewmgr->get_view(viewmgr->get_view_count() - 2);
- UiBaseView *view = viewmgr->get_last_view();
- if (pview) viewmgr->pop_view_finished(pview);
- if (view) viewmgr->pop_view_finished(view);
+ UiBaseView *pview = viewmgr->getView(viewmgr->getViewCount() - 2);
+ UiBaseView *view = viewmgr->getLastView();
+ if (pview) viewmgr->popViewFinished(pview);
+ if (view) viewmgr->popViewFinished(view);
},
- this->viewmgr);
+ this->_viewmgr);
- this->layout = layout;
+ this->_layout = layout;
return true;
}
-Elm_Layout *UiBaseViewmgrImpl::set_transition_layout(string transition_style)
+Elm_Layout *UiBaseViewmgrImpl::_setTransitionLayout(string transitionStyle)
{
- Elm_Layout *effect_layout = NULL;
+ Elm_Layout *effectLayout = NULL;
Elm_Layout *pcontent;
- pcontent = elm_object_part_content_unset(this->get_base(), "pcontent");
+ pcontent = elm_object_part_content_unset(this->getBase(), "pcontent");
if (pcontent) evas_object_hide(pcontent);
- elm_object_part_content_unset(this->get_base(), "content");
+ elm_object_part_content_unset(this->getBase(), "content");
- if (transition_style.compare(this->transition_style) == 0) return this->layout;
+ if (transitionStyle.compare(this->_transitionStyle) == 0) return this->_layout;
- if (effect_map.size()) effect_layout = effect_map.find(transition_style)->second;
+ if (_effectMap.size()) effectLayout = _effectMap.find(transitionStyle)->second;
//Scroller content change to current effect layout and change to hide prev layout.
- Elm_Layout *playout = elm_object_part_content_unset(this->scroller, NULL);
+ Elm_Layout *playout = elm_object_part_content_unset(this->_scroller, NULL);
evas_object_hide(playout);
- if (!effect_layout)
+ if (!effectLayout)
{
//Create and add effect_layouts in map here.
//FIXME: If we have to support many effects, this logic should be changed.
- effect_map.insert(pair<string, Elm_Layout *>("default", this->layout));
- this->create_base_layout(this->scroller, transition_style.c_str());
- effect_map.insert(pair<string, Elm_Layout *>(transition_style, this->layout));
+ _effectMap.insert(pair<string, Elm_Layout *>("default", this->_layout));
+ this->_createBaseLayout(this->_scroller, transitionStyle.c_str());
+ _effectMap.insert(pair<string, Elm_Layout *>(transitionStyle, this->_layout));
} else {
- elm_object_content_set(this->scroller, effect_layout);
+ elm_object_content_set(this->_scroller, effectLayout);
- this->layout = effect_layout;
+ this->_layout = effectLayout;
}
- this->transition_style = transition_style;
+ this->_transitionStyle = transitionStyle;
- return this->layout;
+ return this->_layout;
}
-void UiBaseViewmgrImpl::activate_top_view()
+void UiBaseViewmgrImpl::_activateTopView()
{
- Evas_Object *pcontent = elm_object_part_content_unset(this->get_base(), "content");
+ Evas_Object *pcontent = elm_object_part_content_unset(this->getBase(), "content");
if (pcontent) evas_object_hide(pcontent);
- UiBaseView *view = this->viewmgr->get_last_view();
+ UiBaseView *view = this->_viewmgr->getLastView();
//In case of UiBaseView, it doesn't have any base form. It uses viewmgr base instead.
Evas_Object *content;
- if (view->get_base() == this->get_base())
+ if (view->getBase() == this->getBase())
{
- content = view->get_content();
+ content = view->getContent();
} else {
- content = view->get_base();
+ content = view->getBase();
}
- elm_object_part_content_set(this->get_base(), "content", content);
+ elm_object_part_content_set(this->getBase(), "content", content);
- this->set_indicator(view->get_indicator());
+ this->_setIndicator(view->getIndicator());
}
//FIXME: How to deal with indicator in other UI framework? Dali? Volt?
//Is it possible make this interface common?
-bool UiBaseViewmgrImpl::set_indicator(UiViewIndicator indicator)
+bool UiBaseViewmgrImpl::_setIndicator(UiViewIndicator indicator)
{
- if (this->indicator == indicator) return false;
- this->indicator = indicator;
+ if (this->_indicator == indicator) return false;
+ this->_indicator = indicator;
- Elm_Win *window = this->get_window();
- Elm_Conformant *conform = this->get_conformant();
+ Elm_Win *window = this->getWindow();
+ Elm_Conformant *conform = this->getConformant();
switch (indicator)
{
return true;
}
-bool UiBaseViewmgrImpl::create_conformant(Elm_Win *win)
+bool UiBaseViewmgrImpl::_createConformant(Elm_Win *win)
{
Elm_Conformant *conform = elm_conformant_add(win);
if (!conform) return false;
elm_win_conformant_set(win, EINA_TRUE);
evas_object_show(conform);
- this->conform = conform;
+ this->_conform = conform;
return true;
}
-bool UiBaseViewmgrImpl::create_scroller(Elm_Conformant *conform)
+bool UiBaseViewmgrImpl::_createScroller(Elm_Conformant *conform)
{
Elm_Scroller *scroller = elm_scroller_add(conform);
if (!scroller) return false;
elm_object_content_set(conform, scroller);
- this->scroller = scroller;
+ this->_scroller = scroller;
return true;
}
-UiBaseViewmgrImpl::UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, const char *pkg, UiBaseKeyListener *key_listener)
- : viewmgr(viewmgr), key_listener(key_listener), transition_style("default")
+UiBaseViewmgrImpl::UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, const char *pkg, UiBaseKeyListener *keyListener)
+ : _viewmgr(viewmgr), _keyListener(keyListener), _transitionStyle("default")
{
if (!pkg)
{
}
//Window
- this->win = elm_win_util_standard_add(pkg, pkg);
+ this->_win = elm_win_util_standard_add(pkg, pkg);
- if (!this->win)
+ if (!this->_win)
{
LOGE("Failed to create a window (%s)", pkg);
return;
//FIXME: Make a method? to set available rotation degree.
//Set window rotation
- if (elm_win_wm_rotation_supported_get(this->win))
+ if (elm_win_wm_rotation_supported_get(this->_win))
{
int rots[4] =
{ 0, 90, 180, 270 };
- elm_win_wm_rotation_available_rotations_set(this->win, (const int *) (&rots), 4);
+ elm_win_wm_rotation_available_rotations_set(this->_win, (const int *) (&rots), 4);
}
- evas_object_smart_callback_add(this->win, "wm,rotation,changed",
+ evas_object_smart_callback_add(this->_win, "wm,rotation,changed",
[](void *data, Evas_Object *obj, void *event_info) -> void
{
int rot = elm_win_rotation_get(obj);
UiBaseViewmgr *viewmgr = static_cast<UiBaseViewmgr *>(data);
- UiBaseView *view = viewmgr->get_last_view();
- view->on_rotate(rot);
+ UiBaseView *view = viewmgr->getLastView();
+ view->onRotate(rot);
//FIXME: Change this configurable?
- if (rot == 0 || rot == 180) view->on_portrait();
- else view->on_landscape();
+ if (rot == 0 || rot == 180) view->onPortrait();
+ else view->onLandscape();
}
- , this->viewmgr);
+ , this->_viewmgr);
//Window is requested to delete.
- evas_object_smart_callback_add(this->win, "delete,request",
+ evas_object_smart_callback_add(this->_win, "delete,request",
[](void *data, Evas_Object *obj, void *event_info) -> void
{
UiBaseViewmgr *viewmgr = static_cast<UiBaseViewmgr*>(data);
delete(viewmgr);
},
- this->viewmgr);
+ this->_viewmgr);
//FIXME: Make conformant configurable?
- if (!this->create_conformant(this->win))
+ if (!this->_createConformant(this->_win))
{
LOGE("Failed to create a conformant (%s)", pkg);
return;
}
- if (!this->create_scroller(this->conform))
+ if (!this->_createScroller(this->_conform))
{
LOGE("Failed to create a scroller (%s)", pkg);
return;
}
- if (!this->create_base_layout(this->scroller, "default"))
+ if (!this->_createBaseLayout(this->_scroller, "default"))
{
LOGE("Failed to create a base layout (%s)", pkg);
return;
}
//Set Indicator properties
- elm_win_indicator_mode_set(this->win, ELM_WIN_INDICATOR_SHOW);
- elm_win_indicator_opacity_set(this->win, ELM_WIN_INDICATOR_OPAQUE);
+ elm_win_indicator_mode_set(this->_win, ELM_WIN_INDICATOR_SHOW);
+ elm_win_indicator_opacity_set(this->_win, ELM_WIN_INDICATOR_OPAQUE);
- elm_win_autodel_set(this->win, EINA_TRUE);
+ elm_win_autodel_set(this->_win, EINA_TRUE);
}
UiBaseViewmgrImpl::~UiBaseViewmgrImpl()
{
- delete(this->key_listener);
+ delete(this->_keyListener);
}
-bool UiBaseViewmgrImpl::init()
+bool UiBaseViewmgrImpl::_init()
{
- return this->key_listener->init();
+ return this->_keyListener->init();
}
-bool UiBaseViewmgrImpl::term()
+bool UiBaseViewmgrImpl::_term()
{
- return this->key_listener->term();
+ return this->_keyListener->term();
}
bool UiBaseViewmgrImpl::activate()
{
- this->activate_top_view();
- evas_object_show(this->win);
+ this->_activateTopView();
+ evas_object_show(this->_win);
return true;
}
//FIXME: based on the profile, we should app to go behind or terminate.
if (true)
{
- evas_object_lower(this->win);
+ evas_object_lower(this->_win);
} else {
- delete(this->viewmgr);
+ delete(this->_viewmgr);
}
return true;
}
-bool UiBaseViewmgrImpl::pop_view()
+bool UiBaseViewmgrImpl::popView()
{
- UiBaseView *pview = this->viewmgr->get_view(this->viewmgr->get_view_count() - 2);
- UiBaseView *view = this->viewmgr->get_last_view();
+ UiBaseView *pview = this->_viewmgr->getView(this->_viewmgr->getViewCount() - 2);
+ UiBaseView *view = this->_viewmgr->getLastView();
//In case, if view doesn't have any transition effects.
- if (!strcmp(view->get_transition_style(), "none"))
+ if (!strcmp(view->getTransitionStyle(), "none"))
{
- this->viewmgr->pop_view_finished(pview);
- this->viewmgr->pop_view_finished(view);
- this->activate_top_view();
+ this->_viewmgr->popViewFinished(pview);
+ this->_viewmgr->popViewFinished(view);
+ this->_activateTopView();
return true;
}
//Choose an effect layout.
- Elm_Layout *effect = this->set_transition_layout(view->get_transition_style());
+ Elm_Layout *effect = this->_setTransitionLayout(view->getTransitionStyle());
if (!effect) {
- LOGE("invalid effect transition style?! = %s", view->get_transition_style());
- this->viewmgr->pop_view_finished(pview);
- this->viewmgr->pop_view_finished(view);
- this->activate_top_view();
+ LOGE("invalid effect transition style?! = %s", view->getTransitionStyle());
+ this->_viewmgr->popViewFinished(pview);
+ this->_viewmgr->popViewFinished(view);
+ this->_activateTopView();
return true;
}
//Trigger Effects.
- Evas_Object *prv = this->get_base() == pview->get_base() ? pview->get_content() : pview->get_base();
+ Evas_Object *prv = this->getBase() == pview->getBase() ? pview->getContent() : pview->getBase();
elm_layout_content_set(effect, "content", prv);
- Evas_Object *cur = this->get_base() == view->get_base() ? view->get_content() : view->get_base();
+ Evas_Object *cur = this->getBase() == view->getBase() ? view->getContent() : view->getBase();
elm_layout_content_set(effect, "pcontent", cur);
elm_layout_signal_emit(effect, "view,pop", "viewmgr");
- this->set_indicator(pview->get_indicator());
+ this->_setIndicator(pview->getIndicator());
return true;
}
-UiBaseView * UiBaseViewmgrImpl::push_view(UiBaseView *view)
+UiBaseView * UiBaseViewmgrImpl::pushView(UiBaseView *view)
{
- if (!this->viewmgr->is_activated()) return view;
+ if (!this->_viewmgr->isActivated()) return view;
//In case, if viewmgr has one view, we skip effect.
- if (this->viewmgr->get_view_count() == 1) {
- this->activate_top_view();
- this->viewmgr->push_view_finished(view);
+ if (this->_viewmgr->getViewCount() == 1) {
+ this->_activateTopView();
+ this->_viewmgr->pushViewFinished(view);
return view;
}
- UiBaseView *pview = this->viewmgr->get_view(this->viewmgr->get_view_count() - 2);
+ UiBaseView *pview = this->_viewmgr->getView(this->_viewmgr->getViewCount() - 2);
//In case, if view doesn't have transition effect
- if (!strcmp(view->get_transition_style(), "none")) {
- this->activate_top_view();
- this->viewmgr->push_view_finished(pview);
- this->viewmgr->push_view_finished(view);
+ if (!strcmp(view->getTransitionStyle(), "none")) {
+ this->_activateTopView();
+ this->_viewmgr->pushViewFinished(pview);
+ this->_viewmgr->pushViewFinished(view);
return view;
}
//Choose an effect layout.
- Elm_Layout *effect = this->set_transition_layout(view->get_transition_style());
+ Elm_Layout *effect = this->_setTransitionLayout(view->getTransitionStyle());
if (!effect) {
- LOGE("invalid effect transition style?! = %s", view->get_transition_style());
- this->activate_top_view();
- this->viewmgr->push_view_finished(pview);
- this->viewmgr->push_view_finished(view);
+ LOGE("invalid effect transition style?! = %s", view->getTransitionStyle());
+ this->_activateTopView();
+ this->_viewmgr->pushViewFinished(pview);
+ this->_viewmgr->pushViewFinished(view);
return view;
}
//Trigger Effects.
- Evas_Object *prv = this->get_base() == pview->get_base() ? pview->get_content() : pview->get_base();
+ Evas_Object *prv = this->getBase() == pview->getBase() ? pview->getContent() : pview->getBase();
elm_layout_content_set(effect, "pcontent", prv);
- Evas_Object *cur = this->get_base() == view->get_base() ? view->get_content() : view->get_base();
+ Evas_Object *cur = this->getBase() == view->getBase() ? view->getContent() : view->getBase();
elm_layout_content_set(effect, "content", cur);
elm_layout_signal_emit(effect, "view,push", "viewmgr");
- this->set_indicator(view->get_indicator());
+ this->_setIndicator(view->getIndicator());
return view;
}
UiBaseViewmgr::UiBaseViewmgr(const char *pkg, UiBaseKeyListener *key_listener)
: UiIfaceViewmgr()
{
- this->impl = new UiBaseViewmgrImpl(this, pkg, key_listener);
- this->impl->init();
+ this->_impl = new UiBaseViewmgrImpl(this, pkg, key_listener);
+ this->_impl->_init();
}
UiBaseViewmgr::UiBaseViewmgr(const char *pkg)
UiBaseViewmgr::~UiBaseViewmgr()
{
- this->impl->term();
- delete(this->impl);
+ this->_impl->_term();
+ delete(this->_impl);
ui_app_exit();
}
bool UiBaseViewmgr::activate()
{
if (!UiIfaceViewmgr::activate()) return false;
- this->impl->activate();
+ this->_impl->activate();
return true;
}
bool UiBaseViewmgr::deactivate()
{
if (!UiIfaceViewmgr::deactivate()) return false;
- this->impl->deactivate();
+ this->_impl->deactivate();
return true;
}
-bool UiBaseViewmgr::pop_view()
+bool UiBaseViewmgr::popView()
{
- if (this->get_view_count() == 1)
+ if (this->getViewCount() == 1)
{
this->deactivate();
return true;
}
- if(!UiIfaceViewmgr::pop_view())
+ if(!UiIfaceViewmgr::popView())
{
return false;
}
- return this->impl->pop_view();
+ return this->_impl->popView();
}
-UiBaseView * UiBaseViewmgr::push_view(UiBaseView *view)
+UiBaseView * UiBaseViewmgr::pushView(UiBaseView *view)
{
- UiIfaceViewmgr::push_view(view);
+ UiIfaceViewmgr::pushView(view);
- return this->impl->push_view(view);
+ return this->_impl->pushView(view);
}
-bool UiBaseViewmgr::insert_view_before(UiBaseView *view, UiBaseView *before)
+bool UiBaseViewmgr::insertViewBefore(UiBaseView *view, UiBaseView *before)
{
- return UiIfaceViewmgr::insert_view_before(view, before);
+ return UiIfaceViewmgr::insertViewBefore(view, before);
}
-bool UiBaseViewmgr::insert_view_after(UiBaseView *view, UiBaseView *after)
+bool UiBaseViewmgr::insertViewAfter(UiBaseView *view, UiBaseView *after)
{
- return UiIfaceViewmgr::insert_view_after(view, after);
+ return UiIfaceViewmgr::insertViewAfter(view, after);
}
-UiBaseView *UiBaseViewmgr::get_view(unsigned int idx)
+UiBaseView *UiBaseViewmgr::getView(unsigned int idx)
{
- return dynamic_cast<UiBaseView *>(UiIfaceViewmgr::get_view(idx));
+ return dynamic_cast<UiBaseView *>(UiIfaceViewmgr::getView(idx));
}
-UiBaseView *UiBaseViewmgr::get_view(const char *name)
+UiBaseView *UiBaseViewmgr::getView(const char *name)
{
- return dynamic_cast<UiBaseView *>(UiIfaceViewmgr::get_view(name));
+ return dynamic_cast<UiBaseView *>(UiIfaceViewmgr::getView(name));
}
-UiBaseView *UiBaseViewmgr::get_last_view()
+UiBaseView *UiBaseViewmgr::getLastView()
{
- return dynamic_cast<UiBaseView *>(UiIfaceViewmgr::get_last_view());
+ return dynamic_cast<UiBaseView *>(UiIfaceViewmgr::getLastView());
}
-Evas_Object *UiBaseViewmgr::get_base()
+Evas_Object *UiBaseViewmgr::getBase()
{
- return this->impl->get_base();
+ return this->_impl->getBase();
}
-Elm_Win *UiBaseViewmgr::get_window()
+Elm_Win *UiBaseViewmgr::getWindow()
{
- return this->impl->get_window();
+ return this->_impl->getWindow();
}
-Elm_Conformant *UiBaseViewmgr::get_conformant()
+Elm_Conformant *UiBaseViewmgr::getConformant()
{
- return this->impl->get_conformant();
+ return this->_impl->getConformant();
}
-bool UiBaseViewmgr::set_indicator(UiViewIndicator indicator)
+bool UiBaseViewmgr::setIndicator(UiViewIndicator indicator)
{
- return this->impl->set_indicator(indicator);
+ return this->_impl->_setIndicator(indicator);
}
{
}
-UiViewmgr *UiApp::get_viewmgr()
+UiViewmgr *UiApp::getViewmgr()
{
- return dynamic_cast<UiViewmgr*>(UiIfaceApp::get_viewmgr());
+ return dynamic_cast<UiViewmgr*>(UiIfaceApp::getViewmgr());
}
-UiApp *UiApp::get_instance()
+UiApp *UiApp::getInstance()
{
- return dynamic_cast<UiApp*>(UiIfaceApp::get_instance());
+ return dynamic_cast<UiApp*>(UiIfaceApp::getInstance());
}
{
}
-void UiKeyListener::extend_event_proc(UiBaseView *view, Evas_Event_Key_Down *ev)
+void UiKeyListener::extendEventProc(UiBaseView *view, Evas_Event_Key_Down *ev)
{
if (strcmp(ev->keyname, KEY_MENU) && strcmp(ev->keyname, KEY_MENU2)) return;
UiView *v = dynamic_cast<UiView *>(view);
- UiMenu *menu = v->on_menu_pre();
+ UiMenu *menu = v->onMenuPre();
if (!menu) return;
- v->on_menu(menu);
- v->on_menu_post();
+ v->onMenu(menu);
+ v->onMenuPost();
}
bool UiKeyListener::init()
{
if (!UiBaseKeyListener::init()) return false;
- if (!evas_object_key_grab(this->get_keygrab_obj(), KEY_MENU, 0, 0, EINA_FALSE))
+ if (!evas_object_key_grab(this->getKeygrabObj(), KEY_MENU, 0, 0, EINA_FALSE))
{
LOGE("Failed to grab MENU KEY(%s)\n", KEY_MENU);
return false;
}
- if (!evas_object_key_grab(this->get_keygrab_obj(), KEY_MENU2, 0, 0, EINA_FALSE))
+ if (!evas_object_key_grab(this->getKeygrabObj(), KEY_MENU2, 0, 0, EINA_FALSE))
{
LOGE("Failed to grab MENU KEY(%s)\n", KEY_MENU2);
return false;
*/
#include "../../../include/efl/mobile/UiMobileViewManager.h"
-static void ctxpopup_dismissed_cb(void *data, Evas_Object *obj, void *event_info)
+static void _ctxpopupDismissedCb(void *data, Evas_Object *obj, void *event_info)
{
evas_object_hide(obj);
}
-static void ctxpopup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+static void _ctxpopupDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
UiMenu *menu = static_cast<UiMenu *>(data);
- menu->unset_content();
+ menu->unsetContent();
}
-static bool update_menu(UiMenu *menu)
+static bool _updateMenu(UiMenu *menu)
{
- Elm_Win *win = menu->get_base();
+ Elm_Win *win = menu->getBase();
if (!win) return false;
- Elm_Ctxpopup *ctxpopup = menu->get_content();
+ Elm_Ctxpopup *ctxpopup = menu->getContent();
if (!ctxpopup) return false;
/* We convince the top widget is a window */
return true;
}
-static void win_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+static void _winResizeCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
UiMenu *menu = static_cast<UiMenu *>(data);
- if (!menu->is_activated()) return;
- update_menu(menu);
+ if (!menu->isActivated()) return;
+ _updateMenu(menu);
}
UiMenu::UiMenu(UiView *view)
: UiBaseOverlay(view)
{
- Elm_Win *win = this->get_window();
- evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, win_resize_cb, this);
+ Elm_Win *win = this->getWindow();
+ evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _winResizeCb, this);
}
UiMenu::~UiMenu()
{
- Elm_Win *win = this->get_window();
- if (win) evas_object_event_callback_del(win, EVAS_CALLBACK_RESIZE, win_resize_cb);
- Elm_Ctxpopup *ctxpopup = this->unset_content();
+ Elm_Win *win = this->getWindow();
+ if (win) evas_object_event_callback_del(win, EVAS_CALLBACK_RESIZE, _winResizeCb);
+ Elm_Ctxpopup *ctxpopup = this->unsetContent();
evas_object_del(ctxpopup);
}
-Elm_Win *UiMenu::get_window()
+Elm_Win *UiMenu::getWindow()
{
UiViewmgr *viewmgr = UI_VIEWMGR;
if (!viewmgr)
return NULL;
}
- return viewmgr->get_window();
+ return viewmgr->getWindow();
}
bool UiMenu::deactivate()
{
- Elm_Ctxpopup *ctxpopup = this->get_content();
+ Elm_Ctxpopup *ctxpopup = this->getContent();
if (!ctxpopup)
{
LOGE("Content is not set! = UiMenu(%p)", this);
}
elm_ctxpopup_dismiss(ctxpopup);
- dynamic_cast<UiView *>(this->get_view())->on_resume();
+ dynamic_cast<UiView *>(this->getView())->onResume();
return true;
}
bool UiMenu::activate()
{
- bool ret = update_menu(this);
- if (ret) dynamic_cast<UiView *>(this->get_view())->on_pause();
+ bool ret = _updateMenu(this);
+ if (ret) dynamic_cast<UiView *>(this->getView())->onPause();
return ret;
}
-bool UiMenu::set_content(Elm_Ctxpopup *ctxpopup)
+bool UiMenu::setContent(Elm_Ctxpopup *ctxpopup)
{
- Elm_Ctxpopup *prev = this->unset_content();
+ Elm_Ctxpopup *prev = this->unsetContent();
evas_object_del(prev);
if (!ctxpopup) return true;
elm_object_style_set(ctxpopup, "more/default");
elm_ctxpopup_auto_hide_disabled_set(ctxpopup, EINA_TRUE);
- evas_object_smart_callback_add(ctxpopup, "dismissed", ctxpopup_dismissed_cb, NULL);
- evas_object_event_callback_add(ctxpopup, EVAS_CALLBACK_DEL, ctxpopup_del_cb, this);
+ evas_object_smart_callback_add(ctxpopup, "dismissed", _ctxpopupDismissedCb, NULL);
+ evas_object_event_callback_add(ctxpopup, EVAS_CALLBACK_DEL, _ctxpopupDelCb, this);
- UiBaseOverlay::set_content(ctxpopup);
+ UiBaseOverlay::setContent(ctxpopup);
return true;
}
-bool UiMenu::is_activated()
+bool UiMenu::isActivated()
{
- Elm_Ctxpopup *ctxpopup = this->get_content();
+ Elm_Ctxpopup *ctxpopup = this->getContent();
if (!ctxpopup) return false;
return evas_object_visible_get(ctxpopup);
}
-Elm_Ctxpopup *UiMenu::unset_content()
+Elm_Ctxpopup *UiMenu::unsetContent()
{
- Elm_Ctxpopup *ctxpopup = UiBaseOverlay::unset_content();
+ Elm_Ctxpopup *ctxpopup = UiBaseOverlay::unsetContent();
if (!ctxpopup) return NULL;
- evas_object_smart_callback_del(ctxpopup, "dismissed", ctxpopup_dismissed_cb);
- evas_object_event_callback_del(ctxpopup, EVAS_CALLBACK_DEL, ctxpopup_del_cb);
+ evas_object_smart_callback_del(ctxpopup, "dismissed", _ctxpopupDismissedCb);
+ evas_object_event_callback_del(ctxpopup, EVAS_CALLBACK_DEL, _ctxpopupDelCb);
return ctxpopup;
}
-Evas_Object *UiMenu::get_base()
+Evas_Object *UiMenu::getBase()
{
- return this->get_window();
+ return this->getWindow();
}
-int UiMenu::get_degree()
+int UiMenu::getDegree()
{
- return this->get_view()->get_degree();
+ return this->getView()->getDegree();
}
*/
#include "../../../include/efl/mobile/UiMobileViewManager.h"
-static bool update_popup(UiPopup *popup)
+static bool _updatePopup(UiPopup *popup)
{
- Elm_Win *win = popup->get_base();
+ Elm_Win *win = popup->getBase();
if (!win) return false;
- Elm_Popup *_popup = popup->get_content();
+ Elm_Popup *_popup = popup->getContent();
if (!_popup) return false;
evas_object_show(_popup);
return true;
}
-static void popup_dismissed_cb(void *data, Evas_Object *obj, void *event_info)
+static void _popupDismissedCb(void *data, Evas_Object *obj, void *event_info)
{
evas_object_hide(obj);
}
-static void popup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+static void _popupDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
UiPopup *popup = static_cast<UiPopup *>(data);
- popup->unset_content();
+ popup->unsetContent();
}
UiPopup::UiPopup(UiView *view)
: UiBaseOverlay(view)
{
- view->connect_popup(this);
+ view->_connectPopup(this);
}
UiPopup::~UiPopup()
{
- dynamic_cast<UiView *>(this->get_view())->disconnect_popup(this);
- Elm_Popup *popup = this->unset_content();
+ dynamic_cast<UiView *>(this->getView())->_disconnectPopup(this);
+ Elm_Popup *popup = this->unsetContent();
evas_object_del(popup);
}
-Elm_Win *UiPopup::get_window()
+Elm_Win *UiPopup::getWindow()
{
UiViewmgr *viewmgr = UI_VIEWMGR;
if (!viewmgr)
LOGE("Viewmgr is null?? menu(%p)", this);
return NULL;
}
- return viewmgr->get_window();
+ return viewmgr->getWindow();
}
bool UiPopup::deactivate()
{
- Elm_Popup *popup = this->get_content();
+ Elm_Popup *popup = this->getContent();
if (!popup)
{
LOGE("Content is not set! = UiPopup(%p)", this);
}
elm_popup_dismiss(popup);
- dynamic_cast<UiView*>(this->get_view())->on_resume();
+ dynamic_cast<UiView*>(this->getView())->onResume();
return true;
}
bool UiPopup::activate()
{
- bool ret = update_popup(this);
- if (ret) dynamic_cast<UiView*>(this->get_view())->on_pause();
+ bool ret = _updatePopup(this);
+ if (ret) dynamic_cast<UiView*>(this->getView())->onPause();
return ret;
}
-bool UiPopup::set_content(Elm_Popup *popup)
+bool UiPopup::setContent(Elm_Popup *popup)
{
- Elm_Popup *prev = this->unset_content();
+ Elm_Popup *prev = this->unsetContent();
evas_object_del(prev);
if (!popup) return true;
}
elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
- evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, popup_del_cb, this);
- evas_object_smart_callback_add(popup, "dismissed", popup_dismissed_cb, this);
+ evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, _popupDelCb, this);
+ evas_object_smart_callback_add(popup, "dismissed", _popupDismissedCb, this);
- UiBaseOverlay::set_content(popup);
+ UiBaseOverlay::setContent(popup);
return true;
}
-bool UiPopup::is_activated()
+bool UiPopup::isActivated()
{
- Elm_Popup *popup = this->get_content();
+ Elm_Popup *popup = this->getContent();
if (!popup) return false;
return evas_object_visible_get(popup);
}
-Elm_Popup *UiPopup::unset_content()
+Elm_Popup *UiPopup::unsetContent()
{
- Elm_Popup *popup = UiBaseOverlay::unset_content();
+ Elm_Popup *popup = UiBaseOverlay::unsetContent();
if (!popup) return NULL;
- evas_object_event_callback_del(popup, EVAS_CALLBACK_DEL, popup_del_cb);
- evas_object_smart_callback_del(popup, "dismissed", popup_dismissed_cb);
+ evas_object_event_callback_del(popup, EVAS_CALLBACK_DEL, _popupDelCb);
+ evas_object_smart_callback_del(popup, "dismissed", _popupDismissedCb);
return popup;
}
-Evas_Object *UiPopup::get_base()
+Evas_Object *UiPopup::getBase()
{
- return this->get_window();
+ return this->getWindow();
}
-int UiPopup::get_degree()
+int UiPopup::getDegree()
{
- return this->get_view()->get_degree();
+ return this->getView()->getDegree();
}
friend class UiStandardView;
private:
- UiStandardView *view;
- Elm_Layout *layout; //Base layout for view
- Elm_Toolbar *toolbar; //Toolbar
- Elm_Button *title_left_btn; //Title left button
- Elm_Button *title_right_btn; //Title right button
+ UiStandardView *_view;
+ Elm_Layout *_layout; //Base layout for view
+ Elm_Toolbar *_toolbar; //Toolbar
+ Elm_Button *_titleLeftBtn; //Title left button
+ Elm_Button *_titleRightBtn; //Title right button
- bool create_layout();
- bool destroy_layout();
+ bool _createLayout();
+ bool _destroyLayout();
public:
UiStandardViewImpl(UiStandardView *view);
~UiStandardViewImpl();
- bool set_content(Evas_Object *content, const char *title = NULL);
- bool set_content(Evas_Object *content, const char *title, const char *subtitle, Elm_Button *title_left_btn, Elm_Button *title_right_btn);
- bool set_title_badge(const char *text);
- bool set_subtitle(const char *text);
- bool set_title_left_btn(Elm_Button *title_left_btn);
- bool set_title_right_btn(Elm_Button *title_right_btn);
- bool set_title(const char *text);
- bool set_toolbar(Elm_Toolbar *toolbar);
- bool set_title_visible(bool visible, bool anim);
- void unset_content();
- Elm_Button *unset_title_left_btn();
- Elm_Button *unset_title_right_btn();
- Elm_Toolbar *unset_toolbar();
- Evas_Object *get_base();
-
- Elm_Button *get_title_left_btn()
+ bool setContent(Evas_Object *content, const char *title = NULL);
+ bool setContent(Evas_Object *content, const char *title, const char *subtitle, Elm_Button *titleLeftBtn, Elm_Button *titleRightBtn);
+ bool setTitleBadge(const char *text);
+ bool setSubtitle(const char *text);
+ bool setTitleLeftBtn(Elm_Button *titleLeftBtn);
+ bool setTitleRightBtn(Elm_Button *titleRightBtn);
+ bool setTitle(const char *text);
+ bool setToolbar(Elm_Toolbar *toolbar);
+ bool setTitleVisible(bool visible, bool anim);
+ void unsetContent();
+ Elm_Button *unsetTitleLeftBtn();
+ Elm_Button *unsetTitleRightBtn();
+ Elm_Toolbar *unsetToolbar();
+ Evas_Object *getBase();
+
+ Elm_Button *getTitleLeftBtn()
{
- return this->title_left_btn;
+ return this->_titleLeftBtn;
}
- Elm_Button *get_title_right_btn()
+ Elm_Button *getTitleRightBtn()
{
- return this->title_right_btn;
+ return this->_titleRightBtn;
}
- Elm_Toolbar *get_toolbar()
+ Elm_Toolbar *getToolbar()
{
- return this->toolbar;
+ return this->_toolbar;
}
};
#define DEFAULT_GROUP "tizen_view/default"
#define LAYOUT_VALIDATE() if (!layout) \
- { \
- LOGE("Layout is invalid! UiStandardView(%p)", this); \
- return false; \
- }
+ { \
+ LOGE("Layout is invalid! UiStandardView(%p)", this); \
+ return false; \
+ }
-static void title_left_btn_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+static void _titleLeftBtnDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
UiStandardView *view = static_cast<UiStandardView *>(data);
- view->unset_title_left_btn();
+ view->unsetTitleLeftBtn();
}
-static void title_right_btn_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+static void _titleRightBtnDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
UiStandardView *view = static_cast<UiStandardView *>(data);
- view->unset_title_right_btn();
+ view->unsetTitleRightBtn();
}
-static void toolbar_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+static void _toolbarDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
UiStandardView *view = static_cast<UiStandardView *>(data);
- view->unset_toolbar();
+ view->unsetToolbar();
}
-bool UiStandardViewImpl::destroy_layout()
+bool UiStandardViewImpl::_destroyLayout()
{
- if (!this->layout) return false;
- evas_object_del(this->layout);
- this->layout = NULL;
+ if (!this->_layout) return false;
+ evas_object_del(this->_layout);
+ this->_layout = NULL;
return true;
}
-bool UiStandardViewImpl::create_layout()
+bool UiStandardViewImpl::_createLayout()
{
- if (this->layout) return false;
+ if (this->_layout) return false;
- Elm_Layout *layout = elm_layout_add(this->view->get_parent());
+ Elm_Layout *layout = elm_layout_add(this->_view->getParent());
LAYOUT_VALIDATE();
char buf[PATH_MAX];
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
- if (this->view->get_content())
+ if (this->_view->getContent())
{
- elm_object_part_content_set(layout, "elm.swallow.content", this->view->get_content());
+ elm_object_part_content_set(layout, "elm.swallow.content", this->_view->getContent());
}
//Set software back key, if it's needed
UiViewmgr *viewmgr = UI_VIEWMGR;
- if (viewmgr && viewmgr->need_soft_key())
+ if (viewmgr && viewmgr->needSoftKey())
{
- Elm_Button *prev_btn = elm_button_add(layout);
+ Elm_Button *prevBtn = elm_button_add(layout);
- if (!prev_btn)
+ if (!prevBtn)
{
LOGE("Failed to create a button = UiStandardView(%p)", this);
} else {
- evas_object_smart_callback_add(prev_btn, "clicked", [](void *data, Evas_Object *obj, void *event_info) -> void
+ evas_object_smart_callback_add(prevBtn, "clicked", [](void *data, Evas_Object *obj, void *event_info) -> void
{
UiViewmgr *viewmgr = static_cast<UiViewmgr *>(data);
- viewmgr->pop_view();
+ viewmgr->popView();
}, viewmgr);
- elm_object_style_set(prev_btn, "tizen_view/prev_btn");
- elm_object_part_content_set(layout, "elm.swallow.prev_btn", prev_btn);
+ elm_object_style_set(prevBtn, "tizen_view/prev_btn");
+ elm_object_part_content_set(layout, "elm.swallow.prev_btn", prevBtn);
elm_object_signal_emit(layout, "elm,state,prev_btn,show", "viewmgr");
}
}
- this->layout = layout;
+ this->_layout = layout;
return true;
}
UiStandardViewImpl::UiStandardViewImpl(UiStandardView *view)
- : view(view), layout(NULL), toolbar(NULL), title_left_btn(NULL), title_right_btn(NULL)
+ : _view(view), _layout(NULL), _toolbar(NULL), _titleLeftBtn(NULL), _titleRightBtn(NULL)
{
}
UiStandardViewImpl::~UiStandardViewImpl()
{
- destroy_layout();
+ _destroyLayout();
}
-bool UiStandardViewImpl::set_content(Evas_Object *content, const char *title)
+bool UiStandardViewImpl::setContent(Evas_Object *content, const char *title)
{
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
elm_object_part_content_set(layout, "elm.swallow.content", content);
elm_object_signal_emit(layout, "elm.state,elm.swallow.content,hide", "viewmgr");
}
- this->set_title(title);
+ this->setTitle(title);
return true;
}
-bool UiStandardViewImpl::set_subtitle(const char *text)
+bool UiStandardViewImpl::setSubtitle(const char *text)
{
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
elm_object_part_text_set(layout, "elm.text.subtitle", text);
return true;
}
-bool UiStandardViewImpl::set_title_left_btn(Elm_Button *title_left_btn)
+bool UiStandardViewImpl::setTitleLeftBtn(Elm_Button *titleLeftBtn)
{
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
//FIXME: inside of the unset_title_left_btn, it will send a title_left_btn,hide signal.
//But right after it needs to send a show signal again if new title_left_btn is valid.
//We don't need to send a hide signal in this case.
- Elm_Button *pbtn = this->unset_title_left_btn();
+ Elm_Button *pbtn = this->unsetTitleLeftBtn();
evas_object_del(pbtn);
- this->title_left_btn = title_left_btn;
- if (!title_left_btn) return true;
+ this->_titleLeftBtn = titleLeftBtn;
+ if (!titleLeftBtn) return true;
- elm_object_style_set(title_left_btn, "tizen_view/title_left");
- elm_object_part_content_set(layout, "title_left_btn", title_left_btn);
+ elm_object_style_set(titleLeftBtn, "tizen_view/title_left");
+ elm_object_part_content_set(layout, "title_left_btn", titleLeftBtn);
elm_object_signal_emit(layout, "elm,state,title_left_btn,show", "viewmgr");
- evas_object_event_callback_add(title_left_btn, EVAS_CALLBACK_DEL, title_left_btn_del_cb, this->view);
+ evas_object_event_callback_add(titleLeftBtn, EVAS_CALLBACK_DEL, _titleLeftBtnDelCb, this->_view);
return true;
}
-bool UiStandardViewImpl::set_title_right_btn(Elm_Button *title_right_btn)
+bool UiStandardViewImpl::setTitleRightBtn(Elm_Button *titleRightBtn)
{
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
//FIXME: inside of the unset_title_right_btn, it will send a title_right_btn,hide signal.
//But right after it needs to send a show signal again if new title_right_btn is valid.
//We don't need to send a hide signal in this case.
- Elm_Button *pbtn = this->unset_title_right_btn();
+ Elm_Button *pbtn = this->unsetTitleRightBtn();
evas_object_del(pbtn);
- this->title_right_btn = title_right_btn;
- if (!title_right_btn) return true;
+ this->_titleRightBtn = titleRightBtn;
+ if (!titleRightBtn) return true;
- elm_object_style_set(title_right_btn, "tizen_view/title_right");
- elm_object_part_content_set(layout, "title_right_btn", title_right_btn);
+ elm_object_style_set(titleRightBtn, "tizen_view/title_right");
+ elm_object_part_content_set(layout, "title_right_btn", titleRightBtn);
elm_object_signal_emit(layout, "elm,state,title_right_btn,show", "viewmgr");
- evas_object_event_callback_add(title_right_btn, EVAS_CALLBACK_DEL, title_right_btn_del_cb, this->view);
+ evas_object_event_callback_add(titleRightBtn, EVAS_CALLBACK_DEL, _titleRightBtnDelCb, this->_view);
return true;
}
-bool UiStandardViewImpl::set_title_badge(const char *text)
+bool UiStandardViewImpl::setTitleBadge(const char *text)
{
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
elm_object_part_text_set(layout, "title_badge", text);
return true;
}
-bool UiStandardViewImpl::set_title(const char *text)
+bool UiStandardViewImpl::setTitle(const char *text)
{
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
elm_object_part_text_set(layout, "elm.text.title", text);
return true;
}
-bool UiStandardViewImpl::set_toolbar(Elm_Toolbar *toolbar)
+bool UiStandardViewImpl::setToolbar(Elm_Toolbar *toolbar)
{
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
//FIXME: inside of the unset_toolbar, it will send a toolbar,hide signal.
//But right after it needs to send a show signal again if new toolbar is valid.
//We don't need to send a hide signal in this case.
- Elm_Toolbar *ptoolbar = this->unset_toolbar();
+ Elm_Toolbar *ptoolbar = this->unsetToolbar();
evas_object_del(ptoolbar);
- this->toolbar = toolbar;
+ this->_toolbar = toolbar;
if (!toolbar) return true;
//FIXME: eeeek. check style?? :(
elm_object_part_content_set(layout, "toolbar", toolbar);
elm_object_signal_emit(layout, "elm,state,toolbar,show", "viewmgr");
- evas_object_event_callback_add(toolbar, EVAS_CALLBACK_DEL, toolbar_del_cb, this->view);
+ evas_object_event_callback_add(toolbar, EVAS_CALLBACK_DEL, _toolbarDelCb, this->_view);
return true;
}
-void UiStandardViewImpl::unset_content()
+void UiStandardViewImpl::unsetContent()
{
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
if (!layout)
{
LOGE("Layout is invalid! UiStandardView(%p)", this);
elm_object_signal_emit(layout, "elm.state,elm.swallow.content,hide", "viewmgr");
}
-Elm_Button *UiStandardViewImpl::unset_title_left_btn()
+Elm_Button *UiStandardViewImpl::unsetTitleLeftBtn()
{
- Elm_Button *btn = this->title_left_btn;
+ Elm_Button *btn = this->_titleLeftBtn;
if (!btn) return NULL;
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
if (!layout)
{
LOGE("Layout is invalid! UiStandardView(%p)", this);
elm_object_part_content_unset(layout, "title_left_btn");
elm_object_signal_emit(layout, "elm,state,title_left_btn,hide", "viewmgr");
- evas_object_event_callback_del(btn, EVAS_CALLBACK_DEL, title_left_btn_del_cb);
+ evas_object_event_callback_del(btn, EVAS_CALLBACK_DEL, _titleLeftBtnDelCb);
evas_object_hide(btn);
- this->title_left_btn = NULL;
+ this->_titleLeftBtn = NULL;
return btn;
}
-Elm_Button *UiStandardViewImpl::unset_title_right_btn()
+Elm_Button *UiStandardViewImpl::unsetTitleRightBtn()
{
- Elm_Button *btn = this->title_right_btn;
+ Elm_Button *btn = this->_titleRightBtn;
if (!btn) return NULL;
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
if (!layout)
{
LOGE("Layout is invalid! UiStandardView(%p)", this);
elm_object_part_content_unset(layout, "title_right_btn");
elm_object_signal_emit(layout, "elm,state,title_right_btn,hide", "viewmgr");
- evas_object_event_callback_del(btn, EVAS_CALLBACK_DEL, title_right_btn_del_cb);
+ evas_object_event_callback_del(btn, EVAS_CALLBACK_DEL, _titleRightBtnDelCb);
evas_object_hide(btn);
- this->title_right_btn = NULL;
+ this->_titleRightBtn = NULL;
return btn;
}
-Elm_Toolbar *UiStandardViewImpl::unset_toolbar()
+Elm_Toolbar *UiStandardViewImpl::unsetToolbar()
{
- Elm_Toolbar *toolbar = this->toolbar;
+ Elm_Toolbar *toolbar = this->_toolbar;
if (!toolbar) return NULL;
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
if (!layout)
{
LOGE("Layout is invalid! UiStandardView(%p)", this);
elm_object_part_content_unset(layout, "toolbar");
elm_object_signal_emit(layout, "elm,state,toolbar,hide", "viewmgr");
- evas_object_event_callback_del(toolbar, EVAS_CALLBACK_DEL, toolbar_del_cb);
+ evas_object_event_callback_del(toolbar, EVAS_CALLBACK_DEL, _toolbarDelCb);
evas_object_hide(toolbar);
- this->toolbar = NULL;
+ this->_toolbar = NULL;
return toolbar;
}
-Evas_Object *UiStandardViewImpl::get_base()
+Evas_Object *UiStandardViewImpl::getBase()
{
- if (!this->layout)
+ if (!this->_layout)
{
- this->create_layout();
+ this->_createLayout();
}
- return this->layout;
+ return this->_layout;
}
-bool UiStandardViewImpl::set_title_visible(bool visible, bool anim)
+bool UiStandardViewImpl::setTitleVisible(bool visible, bool anim)
{
//FIXME: save visible, anim value. they can be used in layout created time.
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
if (!layout)
{
LOGE("Layout is invalid! UiStandardView(%p)", this);
UiStandardView::UiStandardView(const char *name)
: UiView(name)
{
- this->impl = new UiStandardViewImpl(this);
+ this->_impl = new UiStandardViewImpl(this);
}
UiStandardView::~UiStandardView()
{
- delete(this->impl);
+ delete(this->_impl);
}
-void UiStandardView::on_load()
+void UiStandardView::onLoad()
{
- UiView::on_load();
+ UiView::onLoad();
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
evas_object_show(layout);
}
-void UiStandardView::on_unload()
+void UiStandardView::onUnload()
{
- UiView::on_unload();
+ UiView::onUnload();
- Elm_Layout *layout = this->get_base();
+ Elm_Layout *layout = this->getBase();
evas_object_hide(layout);
}
-bool UiStandardView::set_content(Evas_Object *content, const char *title)
+bool UiStandardView::setContent(Evas_Object *content, const char *title)
{
- UiView::set_content(content);
- return this->impl->set_content(content, title);
+ UiView::setContent(content);
+ return this->_impl->setContent(content, title);
}
-bool UiStandardView::set_subtitle(const char *text)
+bool UiStandardView::setSubtitle(const char *text)
{
- return this->impl->set_subtitle(text);
+ return this->_impl->setSubtitle(text);
}
-bool UiStandardView::set_title_left_btn(Elm_Button *title_left_btn)
+bool UiStandardView::setTitleLeftBtn(Elm_Button *titleLeftBtn)
{
- return this->impl->set_title_left_btn(title_left_btn);
+ return this->_impl->setTitleLeftBtn(titleLeftBtn);
}
-bool UiStandardView::set_title_right_btn(Elm_Button *title_right_btn)
+bool UiStandardView::setTitleRightBtn(Elm_Button *titleRightBtn)
{
- return this->impl->set_title_right_btn(title_right_btn);
+ return this->_impl->setTitleRightBtn(titleRightBtn);
}
-bool UiStandardView::set_title_badge(const char *text)
+bool UiStandardView::setTitleBadge(const char *text)
{
- return this->impl->set_title_badge(text);
+ return this->_impl->setTitleBadge(text);
}
-bool UiStandardView::set_title(const char *text)
+bool UiStandardView::setTitle(const char *text)
{
- return this->impl->set_title(text);
+ return this->_impl->setTitle(text);
}
-bool UiStandardView::set_content(Evas_Object *content, const char *title, const char *subtitle, Elm_Button *title_left_btn, Elm_Button *title_right_btn)
+bool UiStandardView::setContent(Evas_Object *content, const char *title, const char *subtitle, Elm_Button *titleLeftBtn, Elm_Button *titleRightBtn)
{
- if (!this->set_content(content, title)) return false;
- if (!this->set_subtitle(subtitle)) return false;
- if (!this->set_title_left_btn(title_left_btn)) return false;
- if (!this->set_title_right_btn(title_right_btn)) return false;
+ if (!this->setContent(content, title)) return false;
+ if (!this->setSubtitle(subtitle)) return false;
+ if (!this->setTitleLeftBtn(titleLeftBtn)) return false;
+ if (!this->setTitleRightBtn(titleRightBtn)) return false;
return true;
}
-bool UiStandardView::set_toolbar(Elm_Toolbar *toolbar)
+bool UiStandardView::setToolbar(Elm_Toolbar *toolbar)
{
- return this->impl->set_toolbar(toolbar);
+ return this->_impl->setToolbar(toolbar);
}
-void UiStandardView::set_event_block(bool block)
+void UiStandardView::setEventBlock(bool block)
{
- UiView::set_event_block(block);
- evas_object_freeze_events_set(this->get_base(), block);
+ UiView::setEventBlock(block);
+ evas_object_freeze_events_set(this->getBase(), block);
}
-Evas_Object *UiStandardView::unset_content()
+Evas_Object *UiStandardView::unsetContent()
{
- Evas_Object *pcontent = UiView::unset_content();
+ Evas_Object *pcontent = UiView::unsetContent();
if (!pcontent) return NULL;
- this->impl->unset_content();
+ this->_impl->unsetContent();
return pcontent;
}
-Elm_Button *UiStandardView::unset_title_left_btn()
+Elm_Button *UiStandardView::unsetTitleLeftBtn()
{
- return this->impl->unset_title_left_btn();
+ return this->_impl->unsetTitleLeftBtn();
}
-Elm_Button *UiStandardView::unset_title_right_btn()
+Elm_Button *UiStandardView::unsetTitleRightBtn()
{
- return this->impl->unset_title_right_btn();
+ return this->_impl->unsetTitleRightBtn();
}
-Elm_Toolbar *UiStandardView::unset_toolbar()
+Elm_Toolbar *UiStandardView::unsetToolbar()
{
- return this->impl->unset_toolbar();
+ return this->_impl->unsetToolbar();
}
-Evas_Object *UiStandardView::get_base()
+Evas_Object *UiStandardView::getBase()
{
- return this->impl->get_base();
+ return this->_impl->getBase();
}
-bool UiStandardView::set_title_visible(bool visible, bool anim)
+bool UiStandardView::setTitleVisible(bool visible, bool anim)
{
- return this->impl->set_title_visible(visible, anim);
+ return this->_impl->setTitleVisible(visible, anim);
}
-Elm_Button *UiStandardView::get_title_left_btn()
+Elm_Button *UiStandardView::getTitleLeftBtn()
{
- return this->impl->get_title_left_btn();
+ return this->_impl->getTitleLeftBtn();
}
-Elm_Button *UiStandardView::get_title_right_btn()
+Elm_Button *UiStandardView::getTitleRightBtn()
{
- return this->impl->get_title_right_btn();
+ return this->_impl->getTitleRightBtn();
}
-Elm_Toolbar *UiStandardView::get_toolbar()
+Elm_Toolbar *UiStandardView::getToolbar()
{
- return this->impl->get_toolbar();
+ return this->_impl->getToolbar();
}
friend class UiView;
private:
- UiView *view;
- UiMenu *menu;
- list<UiPopup *> popup_list;
+ UiView *_view;
+ UiMenu *_menu;
+ list<UiPopup *> _popupList;
- void connect_popup(UiPopup *popup);
- void disconnect_popup(UiPopup *popup);
- bool deactivate_popup(bool top_one);
+ void _connectPopup(UiPopup *popup);
+ void _disconnectPopup(UiPopup *popup);
+ bool _deactivatePopup(bool topOne);
protected:
- UiMenu *on_menu_pre();
- void on_menu_post();
- void on_rotate(int degree);
- void on_portrait();
- void on_landscape();
- bool on_back();
+ UiMenu *onMenuPre();
+ void onMenuPost();
+ void onRotate(int degree);
+ void onPortrait();
+ void onLandscape();
+ bool onBack();
public:
UiViewImpl(UiView *view);
~UiViewImpl();
- const UiMenu *get_menu()
+ const UiMenu *getMenu()
{
- return this->menu;
+ return this->_menu;
}
};
}
-typedef list<UiPopup*>::reverse_iterator popup_ritr;
+typedef list<UiPopup*>::reverse_iterator popupRitr;
-void UiViewImpl::connect_popup(UiPopup *popup)
+void UiViewImpl::_connectPopup(UiPopup *popup)
{
- this->popup_list.push_back(popup);
+ this->_popupList.push_back(popup);
}
-void UiViewImpl::disconnect_popup(UiPopup *popup)
+void UiViewImpl::_disconnectPopup(UiPopup *popup)
{
- this->popup_list.remove(popup);
+ this->_popupList.remove(popup);
}
-bool UiViewImpl::deactivate_popup(bool top_one)
+bool UiViewImpl::_deactivatePopup(bool topOne)
{
- for (popup_ritr it = this->popup_list.rbegin(); it != this->popup_list.rend(); it++)
+ for (popupRitr it = this->_popupList.rbegin(); it != this->_popupList.rend(); it++)
{
UiPopup *popup = *it;
- if (!popup->is_activated()) continue;
- popup->on_back();
+ if (!popup->isActivated()) continue;
+ popup->onBack();
//deactivate only one top one? or all popups?
- if (top_one) return true;
+ if (topOne) return true;
}
return false;
}
-bool UiViewImpl::on_back()
+bool UiViewImpl::onBack()
{
//If any popup is activated, deactivate the popup first.
- if (this->deactivate_popup(true))
+ if (this->_deactivatePopup(true))
{
return false;
}
- if (this->menu)
+ if (this->_menu)
{
- if (this->menu->is_activated())
+ if (this->_menu->isActivated())
{
- this->menu->on_back();
+ this->_menu->onBack();
return false;
}
}
}
UiViewImpl::UiViewImpl(UiView *view)
- : view(view), menu(NULL)
+ : _view(view), _menu(NULL)
{
}
UiViewImpl::~UiViewImpl()
{
- if (menu) delete (this->menu);
+ if (_menu) delete (this->_menu);
}
-UiMenu *UiViewImpl::on_menu_pre()
+UiMenu *UiViewImpl::onMenuPre()
{
- if (!this->menu)
+ if (!this->_menu)
{
- this->menu = new UiMenu(this->view);
+ this->_menu = new UiMenu(this->_view);
}
- if (this->menu->is_activated())
+ if (this->_menu->isActivated())
{
- this->menu->deactivate();
+ this->_menu->deactivate();
return NULL;
}
- return this->menu;
+ return this->_menu;
}
-void UiViewImpl::on_menu_post()
+void UiViewImpl::onMenuPost()
{
- if (!this->menu) return;
- this->menu->activate();
+ if (!this->_menu) return;
+ this->_menu->activate();
}
-void UiViewImpl::on_rotate(int degree)
+void UiViewImpl::onRotate(int degree)
{
- if (!this->menu) return;
- if (!this->menu->is_activated()) return;
- this->menu->on_rotate(degree);
+ if (!this->_menu) return;
+ if (!this->_menu->isActivated()) return;
+ this->_menu->onRotate(degree);
}
-void UiViewImpl::on_portrait()
+void UiViewImpl::onPortrait()
{
- if (!this->menu) return;
- if (!this->menu->is_activated()) return;
- this->menu->on_portrait();
+ if (!this->_menu) return;
+ if (!this->_menu->isActivated()) return;
+ this->_menu->onPortrait();
}
-void UiViewImpl::on_landscape()
+void UiViewImpl::onLandscape()
{
- if (!this->menu) return;
- if (!this->menu->is_activated()) return;
- this->menu->on_landscape();
+ if (!this->_menu) return;
+ if (!this->_menu->isActivated()) return;
+ this->_menu->onLandscape();
}
/***********************************************************************************************/
/* External class Implementation */
/***********************************************************************************************/
-void UiView::connect_popup(UiPopup *popup)
+void UiView::_connectPopup(UiPopup *popup)
{
- this->impl->connect_popup(popup);
+ this->_impl->_connectPopup(popup);
}
-void UiView::disconnect_popup(UiPopup *popup)
+void UiView::_disconnectPopup(UiPopup *popup)
{
- this->impl->disconnect_popup(popup);
+ this->_impl->_disconnectPopup(popup);
}
-void UiView::on_deactivate()
+void UiView::onDeactivate()
{
- this->impl->deactivate_popup(false);
- UiBaseView::on_deactivate();
+ this->_impl->_deactivatePopup(false);
+ UiBaseView::onDeactivate();
}
-void UiView::on_back()
+void UiView::onBack()
{
- if (!this->impl->on_back()) return;
- UiBaseView::on_back();
+ if (!this->_impl->onBack()) return;
+ UiBaseView::onBack();
}
UiView::UiView(const char *name)
: UiBaseView(name)
{
- this->impl = new UiViewImpl(this);
+ this->_impl = new UiViewImpl(this);
}
UiView::~UiView()
{
- delete(this->impl);
+ delete(this->_impl);
}
-UiMenu *UiView::on_menu_pre()
+UiMenu *UiView::onMenuPre()
{
- return this->impl->on_menu_pre();
+ return this->_impl->onMenuPre();
}
-void UiView::on_menu(UiMenu *menu)
+void UiView::onMenu(UiMenu *menu)
{
}
-void UiView::on_menu_post()
+void UiView::onMenuPost()
{
- this->impl->on_menu_post();
+ this->_impl->onMenuPost();
}
-void UiView::on_rotate(int degree)
+void UiView::onRotate(int degree)
{
//FIXME: see how to handle on_menu()
- UiBaseView::on_rotate(degree);
- this->impl->on_rotate(degree);
+ UiBaseView::onRotate(degree);
+ this->_impl->onRotate(degree);
}
-void UiView::on_portrait()
+void UiView::onPortrait()
{
//FIXME: see how to handle on_menu()
- UiBaseView::on_portrait();
- this->impl->on_portrait();
+ UiBaseView::onPortrait();
+ this->_impl->onPortrait();
}
-void UiView::on_landscape()
+void UiView::onLandscape()
{
//FIXME: see how to handle on_menu()
- UiBaseView::on_landscape();
- this->impl->on_landscape();
+ UiBaseView::onLandscape();
+ this->_impl->onLandscape();
}
-const UiMenu *UiView::get_menu()
+const UiMenu *UiView::getMenu()
{
- return this->impl->get_menu();
+ return this->_impl->getMenu();
}
ui_app_lifecycle_callback_s capi_lifecycle_callback;
void *data;
- bool on_create()
+ bool onCreate()
{
- if (!UiApp::on_create()) return false;
+ if (!UiApp::onCreate()) return false;
if (!this->capi_lifecycle_callback.create) return false;
return this->capi_lifecycle_callback.create(this->data);
}
- void on_terminate()
+ void onTerminate()
{
- UiApp::on_terminate();
+ UiApp::onTerminate();
if (!this->capi_lifecycle_callback.terminate) return;
this->capi_lifecycle_callback.terminate(this->data);
}
- void on_pause()
+ void onPause()
{
- UiApp::on_pause();
+ UiApp::onPause();
if (!this->capi_lifecycle_callback.pause) return;
this->capi_lifecycle_callback.pause(this->data);
}
- void on_resume()
+ void onResume()
{
- UiApp::on_resume();
+ UiApp::onResume();
if (!this->capi_lifecycle_callback.resume) return;
this->capi_lifecycle_callback.resume(this->data);
}
- void on_control(app_control_h app_control)
+ void onControl(app_control_h app_control)
{
- UiApp::on_control(app_control);
+ UiApp::onControl(app_control);
if (!this->capi_lifecycle_callback.app_control) return;
this->capi_lifecycle_callback.app_control(app_control, this->data);
EAPI bool ui_menu_content_set(ui_menu *menu, Elm_Ctxpopup *ctxpopup)
{
if (!validate_menu(menu)) return false;
- return menu->set_content(ctxpopup);
+ return menu->setContent(ctxpopup);
}
EAPI Elm_Ctxpopup *ui_menu_content_get(ui_menu *menu)
{
if (!validate_menu(menu)) return NULL;
- return menu->get_content();
+ return menu->getContent();
}
EAPI Elm_Ctxpopup *ui_menu_content_unset(ui_menu *menu)
{
if (!validate_menu(menu)) return NULL;
- return menu->unset_content();
+ return menu->unsetContent();
}
EAPI bool ui_menu_activate(ui_menu *menu)
EAPI bool ui_menu_activated_get(ui_menu *menu)
{
if (!validate_menu(menu)) return false;
- return menu->is_activated();
+ return menu->isActivated();
}
EAPI Evas_Object *ui_menu_base_get(ui_menu *menu)
{
if (!validate_menu(menu)) return NULL;
- return menu->get_base();
+ return menu->getBase();
}
EAPI int ui_menu_degree_get(ui_menu *menu)
{
if (!validate_menu(menu)) return -1;
- return menu->get_degree();
+ return menu->getDegree();
}
EAPI ui_view *ui_menu_view_get(ui_menu *menu)
{
if (!validate_menu(menu)) return NULL;
- return dynamic_cast<ui_view *>(menu->get_view());
+ return dynamic_cast<ui_view *>(menu->getView());
}
EAPI bool ui_popup_content_set(ui_popup *popup, Elm_Popup *content)
{
if (!validate_popup(popup)) return false;
- return popup->set_content(content);
+ return popup->setContent(content);
}
EAPI Elm_Popup *ui_popup_content_get(ui_popup *popup)
{
if (!validate_popup(popup)) return NULL;
- return popup->get_content();
+ return popup->getContent();
}
EAPI Elm_Popup *ui_popup_content_unset(ui_popup *popup)
{
if (!validate_popup(popup)) return NULL;
- return popup->unset_content();
+ return popup->unsetContent();
}
EAPI bool ui_popup_activate(ui_popup *popup)
EAPI bool ui_popup_activate_get(ui_popup *popup)
{
if (!validate_popup(popup)) return false;
- return popup->is_activated();
+ return popup->isActivated();
}
EAPI Evas_Object *ui_popup_base_get(ui_popup *popup)
{
if (!validate_popup(popup)) return NULL;
- return popup->get_base();
+ return popup->getBase();
}
EAPI int ui_popup_degree_get(ui_popup *popup)
{
if (!validate_popup(popup)) return -1;
- return popup->get_degree();
+ return popup->getDegree();
}
EAPI ui_view *ui_popup_view_get(ui_popup *popup)
{
if (!validate_popup(popup)) return NULL;
- return dynamic_cast<ui_view *>(popup->get_view());
+ return dynamic_cast<ui_view *>(popup->getView());
}
class ui_standard_view_capi: public ui_standard_view, public ui_common_view_capi
{
public:
- void on_load()
+ void onLoad()
{
if (this->lifecycle_callback.load)
{
if (!this->lifecycle_callback.load(this, this->lifecycle_data)) return;
}
- ui_standard_view::on_load();
+ ui_standard_view::onLoad();
}
- void on_unload()
+ void onUnload()
{
if (this->lifecycle_callback.unload)
{
if (!this->lifecycle_callback.unload(this, this->lifecycle_data)) return;
}
- ui_standard_view::on_unload();
+ ui_standard_view::onUnload();
}
- void on_pause()
+ void onPause()
{
if (this->lifecycle_callback.pause)
{
if (!this->lifecycle_callback.pause(this, this->lifecycle_data)) return;
}
- ui_standard_view::on_pause();
+ ui_standard_view::onPause();
}
- void on_resume()
+ void onResume()
{
if (this->lifecycle_callback.resume)
{
if (!this->lifecycle_callback.resume(this, this->lifecycle_data)) return;
}
- ui_standard_view::on_resume();
+ ui_standard_view::onResume();
}
- void on_activate()
+ void onActivate()
{
if (this->lifecycle_callback.activate)
{
if (!this->lifecycle_callback.activate(this, this->lifecycle_data)) return;
}
- ui_standard_view::on_activate();
+ ui_standard_view::onActivate();
}
- void on_deactivate()
+ void onDeactivate()
{
if (this->lifecycle_callback.deactivate)
{
if (!this->lifecycle_callback.deactivate(this, this->lifecycle_data)) return;
}
- ui_standard_view::on_deactivate();
+ ui_standard_view::onDeactivate();
}
- void on_destroy()
+ void onDestroy()
{
if (this->lifecycle_callback.destroy)
{
if (!this->lifecycle_callback.destroy(this, this->lifecycle_data)) return;
}
- ui_standard_view::on_destroy();
+ ui_standard_view::onDestroy();
}
- void on_portrait()
+ void onPortrait()
{
if (this->event_callback.portrait)
{
if (!this->event_callback.portrait(this, this->event_data)) return;
}
- ui_standard_view::on_portrait();
+ ui_standard_view::onPortrait();
}
- void on_landscape()
+ void onLandscape()
{
if (this->event_callback.landscape)
{
if (!this->event_callback.landscape(this, this->event_data)) return;
}
- ui_standard_view::on_landscape();
+ ui_standard_view::onLandscape();
}
- void on_rotate(int degree)
+ void onRotate(int degree)
{
if (this->event_callback.rotate)
{
if (!this->event_callback.rotate(this, degree, this->event_data)) return;
}
- ui_standard_view::on_rotate(degree);
+ ui_standard_view::onRotate(degree);
}
- void on_back()
+ void onBack()
{
if (this->event_callback.back)
{
if (!this->event_callback.back(this, this->event_data)) return;
}
- ui_standard_view::on_back();
+ ui_standard_view::onBack();
}
- void on_menu(ui_menu *menu)
+ void onMenu(ui_menu *menu)
{
if (this->event_callback.menu)
{
if (!this->event_callback.menu(menu, this->event_data)) return;
}
- ui_standard_view::on_menu(menu);
+ ui_standard_view::onMenu(menu);
}
ui_standard_view_capi(const char *name)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return false;
- return capi_view->set_content(content, title, subtitle, title_left_btn, title_right_btn);
+ return capi_view->setContent(content, title, subtitle, title_left_btn, title_right_btn);
}
EAPI bool ui_standard_view_title_set(ui_standard_view *view, const char *text)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return false;
- return capi_view->set_title(text);
+ return capi_view->setTitle(text);
}
EAPI bool ui_standard_view_sub_title_set(ui_standard_view *view, const char *text)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return false;
- return capi_view->set_subtitle(text);
+ return capi_view->setSubtitle(text);
}
EAPI bool ui_standard_view_title_badge_set(ui_standard_view *view, const char *badge_text)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return false;
- return capi_view->set_title_badge(badge_text);
+ return capi_view->setTitleBadge(badge_text);
}
EAPI bool ui_standard_view_title_right_btn_set(ui_standard_view *view, Evas_Object *title_right_btn)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return false;
- return capi_view->set_title_right_btn(title_right_btn);
+ return capi_view->setTitleRightBtn(title_right_btn);
}
EAPI Elm_Button *ui_standard_view_title_right_btn_get(ui_standard_view *view)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return NULL;
- return capi_view->get_title_right_btn();
+ return capi_view->getTitleRightBtn();
}
EAPI Elm_Button *ui_standard_view_title_right_btn_unset(ui_standard_view *view)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return NULL;
- return capi_view->unset_title_right_btn();
+ return capi_view->unsetTitleRightBtn();
}
EAPI bool ui_standard_view_title_left_btn_set(ui_standard_view *view, Evas_Object *title_left_btn)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return false;
- return capi_view->set_title_left_btn(title_left_btn);
+ return capi_view->setTitleLeftBtn(title_left_btn);
}
EAPI Elm_Button *ui_standard_view_title_left_btn_get(ui_standard_view *view)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return NULL;
- return capi_view->get_title_left_btn();
+ return capi_view->getTitleLeftBtn();
}
EAPI Elm_Button *ui_standard_view_title_left_btn_unset(ui_standard_view *view)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return NULL;
- return capi_view->unset_title_right_btn();
+ return capi_view->unsetTitleRightBtn();
}
EAPI bool ui_standard_view_toolbar_set(ui_standard_view *view, Elm_Toolbar *toolbar)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return false;
- return capi_view->set_toolbar(toolbar);
+ return capi_view->setToolbar(toolbar);
}
EAPI Elm_Toolbar *ui_standard_view_toolbar_get(ui_standard_view *view)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return NULL;
- return capi_view->get_toolbar();
+ return capi_view->getToolbar();
}
EAPI Elm_Toolbar *ui_standard_view_toolbar_unset(ui_standard_view *view)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return NULL;
- return capi_view->unset_toolbar();
+ return capi_view->unsetToolbar();
}
EAPI bool ui_standard_view_title_visible_set(ui_standard_view *view, bool visible, bool anim)
{
ui_standard_view_capi *capi_view;
if (!(capi_view = validate_view(view))) return false;
- return capi_view->set_title_visible(visible, anim);
+ return capi_view->setTitleVisible(visible, anim);
}
class ui_view_capi: public ui_view, public ui_common_view_capi
{
public:
- void on_load()
+ void onLoad()
{
if (this->lifecycle_callback.load)
{
if (!this->lifecycle_callback.load(this, this->lifecycle_data)) return;
}
- ui_view::on_load();
+ ui_view::onLoad();
}
- void on_unload()
+ void onUnload()
{
if (this->lifecycle_callback.unload)
{
if (!this->lifecycle_callback.unload(this, this->lifecycle_data)) return;
}
- ui_view::on_unload();
+ ui_view::onUnload();
}
- void on_pause()
+ void onPause()
{
if (this->lifecycle_callback.pause)
{
if (!this->lifecycle_callback.pause(this, this->lifecycle_data)) return;
}
- ui_view::on_pause();
+ ui_view::onPause();
}
- void on_resume()
+ void onResume()
{
if (this->lifecycle_callback.resume)
{
if (!this->lifecycle_callback.resume(this, this->lifecycle_data)) return;
}
- ui_view::on_resume();
+ ui_view::onResume();
}
- void on_activate()
+ void onActivate()
{
if (this->lifecycle_callback.activate)
{
if (!this->lifecycle_callback.activate(this, this->lifecycle_data)) return;
}
- ui_view::on_activate();
+ ui_view::onActivate();
}
- void on_deactivate()
+ void onDeactivate()
{
if (this->lifecycle_callback.deactivate)
{
if (!this->lifecycle_callback.deactivate(this, this->lifecycle_data)) return;
}
- ui_view::on_deactivate();
+ ui_view::onDeactivate();
}
- void on_destroy()
+ void onDestroy()
{
if (this->lifecycle_callback.destroy)
{
if (!this->lifecycle_callback.destroy(this, this->lifecycle_data)) return;
}
- ui_view::on_destroy();
+ ui_view::onDestroy();
}
- void on_portrait()
+ void onPortrait()
{
if (this->event_callback.portrait)
{
if (!this->event_callback.portrait(this, this->event_data)) return;
}
- ui_view::on_portrait();
+ ui_view::onPortrait();
}
- void on_landscape()
+ void onLandscape()
{
if (this->event_callback.landscape)
{
if (!this->event_callback.landscape(this, this->event_data)) return;
}
- ui_view::on_landscape();
+ ui_view::onLandscape();
}
- void on_rotate(int degree)
+ void onRotate(int degree)
{
if (this->event_callback.rotate)
{
if (!this->event_callback.rotate(this, degree, this->event_data)) return;
}
- ui_view::on_rotate(degree);
+ ui_view::onRotate(degree);
}
- void on_back()
+ void onBack()
{
if (this->event_callback.back)
{
if (!this->event_callback.back(this, this->event_data)) return;
}
- ui_view::on_back();
+ ui_view::onBack();
}
- void on_menu(ui_menu *menu)
+ void onMenu(ui_menu *menu)
{
if (this->event_callback.menu)
{
if (!this->event_callback.menu(menu, this->event_data)) return;
}
- ui_view::on_menu(menu);
+ ui_view::onMenu(menu);
}
ui_view_capi(const char *name)
EAPI Evas_Object* ui_view_base_get(ui_view *view)
{
if (!validate_view(view)) return NULL;
- return view->get_base();
+ return view->getBase();
}
EAPI Evas_Object *ui_view_content_unset(ui_view *view)
{
if (!validate_view(view)) return NULL;
- return view->unset_content();
+ return view->unsetContent();
}
EAPI void ui_view_indicator_set(ui_view *view, ui_view_indicator indicator)
{
if (!validate_view(view)) return;
- view->set_indicator(indicator);
+ view->setIndicator(indicator);
}
EAPI ui_view_indicator ui_view_indicator_get(ui_view *view)
{
if (!validate_view(view)) return UI_VIEW_INDICATOR_UNKNOWN;
- return view->get_indicator();
+ return view->getIndicator();
}
EAPI void ui_view_removable_content_set(ui_view *view, bool remove)
{
if (!validate_view(view)) return;
- view->set_removable_content(remove);
+ view->setRemovableContent(remove);
}
EAPI bool ui_view_removable_content_get(ui_view *view)
{
if (!validate_view(view)) return false;
- return view->get_removable_content();
+ return view->getRemovableContent();
}
EAPI int ui_view_degree_get(ui_view *view)
{
if (!validate_view(view)) return -1;
- return view->get_degree();
+ return view->getDegree();
}
EAPI bool ui_view_transition_style_set(ui_view *view, const char *style)
{
if (!validate_view(view)) return false;
- return view->set_transition_style(style);
+ return view->setTransitionStyle(style);
}
EAPI const char *ui_view_transition_style_get(ui_view *view)
{
if (!validate_view(view)) return NULL;
- return view->get_transition_style();
+ return view->getTransitionStyle();
}
EAPI const ui_menu *ui_view_menu_get(ui_view *view)
{
if (!validate_view(view)) return NULL;
- return view->get_menu();
+ return view->getMenu();
}
EAPI const char *ui_view_name_get(ui_view *view)
{
if (!validate_view(view)) return NULL;
- return view->get_name();
+ return view->getName();
}
EAPI ui_view_state ui_view_state_get(ui_view *view)
{
if (!validate_view(view)) return UI_VIEW_STATE_UNKNOWN;
- return view->get_state();
+ return view->getState();
}
EAPI Evas_Object *ui_view_content_get(ui_view *view)
{
if (!validate_view(view)) return NULL;
- return view->get_content();
+ return view->getContent();
}
EAPI bool ui_view_destroy(ui_view *view)
EAPI bool ui_view_content_set(ui_view *view, Evas_Object *content)
{
if (!validate_view(view)) return false;
- return view->set_content(content);
+ return view->setContent(content);
}
EAPI const char *ui_view_type_get(ui_view *view)
return NULL;
}
- return dynamic_cast<ui_view *>(viewmgr->push_view(view));
+ return dynamic_cast<ui_view *>(viewmgr->pushView(view));
}
EAPI bool ui_viewmgr_view_insert_before(ui_viewmgr *viewmgr, ui_view *view, ui_view *before)
return false;
}
- return viewmgr->insert_view_before(view, before);
+ return viewmgr->insertViewBefore(view, before);
}
EAPI bool ui_viewmgr_view_insert_after(ui_viewmgr *viewmgr, ui_view *view, ui_view *after)
return false;
}
- return viewmgr->insert_view_after(view, after);
+ return viewmgr->insertViewAfter(view, after);
}
EAPI bool ui_viewmgr_view_pop(ui_viewmgr *viewmgr)
{
if (!validate_viewmgr(viewmgr)) return false;
- return viewmgr->pop_view();
+ return viewmgr->popView();
}
EAPI bool ui_viewmgr_activate(ui_viewmgr *viewmgr)
EAPI Elm_Win *ui_viewmgr_window_get(ui_viewmgr *viewmgr)
{
if (!validate_viewmgr(viewmgr)) return NULL;
- return viewmgr->get_window();
+ return viewmgr->getWindow();
}
EAPI ui_view *ui_viewmgr_last_view_get(ui_viewmgr *viewmgr)
{
if (!validate_viewmgr(viewmgr)) return NULL;
- return dynamic_cast<ui_view *>(viewmgr->get_last_view());
+ return dynamic_cast<ui_view *>(viewmgr->getLastView());
}
EAPI ui_view *ui_viewmgr_view_get_by_idx(ui_viewmgr *viewmgr, int idx)
{
if (!validate_viewmgr(viewmgr)) return NULL;
- return dynamic_cast<ui_view *>(viewmgr->get_view(idx));
+ return dynamic_cast<ui_view *>(viewmgr->getView(idx));
}
EAPI ui_view *ui_viewmgr_view_get_by_name(ui_viewmgr *viewmgr, const char *name)
{
if (!validate_viewmgr(viewmgr)) return NULL;
- return dynamic_cast<ui_view *>(viewmgr->get_view(name));
+ return dynamic_cast<ui_view *>(viewmgr->getView(name));
}
EAPI Evas_Object *ui_viewmgr_base_get(ui_viewmgr *viewmgr)
{
if (!validate_viewmgr(viewmgr)) return NULL;
- return viewmgr->get_base();
+ return viewmgr->getBase();
}
EAPI int ui_viewmgr_view_index_get(ui_viewmgr *viewmgr, const ui_view *view)
return -1;
}
- return viewmgr->get_view_index(view);
+ return viewmgr->getViewIndex(view);
}
EAPI int ui_viewmgr_view_count_get(ui_viewmgr *viewmgr)
{
if (!validate_viewmgr(viewmgr)) return -1;
- return viewmgr->get_view_count();
+ return viewmgr->getViewCount();
}
EAPI bool ui_viewmgr_soft_key_need_get(ui_viewmgr *viewmgr)
{
if (!validate_viewmgr(viewmgr)) return false;
- return viewmgr->need_soft_key();
+ return viewmgr->needSoftKey();
}
EAPI ui_viewmgr *ui_viewmgr_viewmgr_get()
int run(int argc, char **argv);
bool init();
- bool on_create();
- void on_terminate();
- void on_pause();
- void on_resume();
- void on_control(app_control_h app_control);
-
- void on_low_battery(app_event_info_h event_info);
- void on_low_memory(app_event_info_h event_info);
- void on_region_changed(app_event_info_h event_info);
- void on_orient_changed(app_event_info_h event_info);
- void on_lang_changed(app_event_info_h event_info);
+ bool onCreate();
+ void onTerminate();
+ void onPause();
+ void onResume();
+ void onControl(app_control_h app_control);
+
+ void onLowBattery(app_event_info_h event_info);
+ void onLowMemory(app_event_info_h event_info);
+ void onRegionChanged(app_event_info_h event_info);
+ void onOrientChanged(app_event_info_h event_info);
+ void onLangChanged(app_event_info_h event_info);
};
}
-static bool app_create(void *data)
+static bool appCreate(void *data)
{
UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
- return app->on_create();
+ return app->onCreate();
}
-static void app_terminate(void *data)
+static void appTerminate(void *data)
{
UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
- app->on_terminate();
+ app->onTerminate();
}
-static void app_pause(void *data)
+static void appPause(void *data)
{
UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
- app->on_pause();
+ app->onPause();
}
-static void app_resume(void *data)
+static void appResume(void *data)
{
UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
- app->on_resume();
+ app->onResume();
}
-static void app_control(app_control_s *app_control, void *data)
+static void appControl(app_control_s *app_control, void *data)
{
UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
- app->on_control(app_control);
+ app->onControl(app_control);
}
-static void ui_app_lang_changed(app_event_info_h event_info, void *data)
+static void uiAppLangChanged(app_event_info_h event_info, void *data)
{
UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
- app->on_lang_changed(event_info);
+ app->onLangChanged(event_info);
}
-static void ui_app_orient_changed(app_event_info_h event_info, void *data)
+static void uiAppOrientChanged(app_event_info_h event_info, void *data)
{
UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
- app->on_orient_changed(event_info);
+ app->onOrientChanged(event_info);
}
-static void ui_app_region_changed(app_event_info_h event_info, void *data)
+static void uiAppRegionChanged(app_event_info_h event_info, void *data)
{
UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
- app->on_region_changed(event_info);
+ app->onRegionChanged(event_info);
}
-static void ui_app_low_battery(app_event_info_h event_info, void *data)
+static void uiAppLowBattery(app_event_info_h event_info, void *data)
{
UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
- app->on_low_battery(event_info);
+ app->onLowBattery(event_info);
}
-static void ui_app_low_memory(app_event_info_h event_info, void *data)
+static void uiAppLowMemory(app_event_info_h event_info, void *data)
{
UiIfaceAppImpl *app = static_cast<UiIfaceAppImpl *>(data);
- app->on_low_memory(event_info);
+ app->onLowMemory(event_info);
}
bool UiIfaceAppImpl::init()
ui_app_lifecycle_callback_s event_callback = { 0, };
app_event_handler_h handlers[5] = { NULL, };
- 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;
+ event_callback.create = appCreate;
+ event_callback.terminate = appTerminate;
+ event_callback.pause = appPause;
+ event_callback.resume = appResume;
+ event_callback.app_control = appControl;
- ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, this);
- ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, this);
- ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, this);
- ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, this);
- ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, this);
+ ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, uiAppLowBattery, this);
+ ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, uiAppLowMemory, this);
+ ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, uiAppOrientChanged, this);
+ ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, uiAppLangChanged, this);
+ ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, uiAppRegionChanged, this);
int ret = ui_app_main(argc, argv, &event_callback, this);
eina_stringshare_del(this->locale_dir);
}
-void UiIfaceAppImpl::on_lang_changed(app_event_info_h event_info)
+void UiIfaceAppImpl::onLangChanged(app_event_info_h event_info)
{
- this->app->on_lang_changed(event_info);
+ this->app->onLangChanged(event_info);
}
-void UiIfaceAppImpl::on_low_memory(app_event_info_h event_info)
+void UiIfaceAppImpl::onLowMemory(app_event_info_h event_info)
{
- this->app->on_low_memory(event_info);
+ this->app->onLowMemory(event_info);
}
-void UiIfaceAppImpl::on_low_battery(app_event_info_h event_info)
+void UiIfaceAppImpl::onLowBattery(app_event_info_h event_info)
{
- this->app->on_low_battery(event_info);
+ this->app->onLowBattery(event_info);
}
-void UiIfaceAppImpl::on_region_changed(app_event_info_h event_info)
+void UiIfaceAppImpl::onRegionChanged(app_event_info_h event_info)
{
- this->app->on_region_changed(event_info);
+ this->app->onRegionChanged(event_info);
}
-void UiIfaceAppImpl::on_orient_changed(app_event_info_h event_info)
+void UiIfaceAppImpl::onOrientChanged(app_event_info_h event_info)
{
- this->app->on_orient_changed(event_info);
+ this->app->onOrientChanged(event_info);
}
-bool UiIfaceAppImpl::on_create()
+bool UiIfaceAppImpl::onCreate()
{
- return this->app->on_create();
+ return this->app->onCreate();
}
-void UiIfaceAppImpl::on_pause()
+void UiIfaceAppImpl::onPause()
{
- this->app->on_pause();
+ this->app->onPause();
}
-void UiIfaceAppImpl::on_resume()
+void UiIfaceAppImpl::onResume()
{
- this->app->on_resume();
+ this->app->onResume();
}
-void UiIfaceAppImpl::on_control(app_control_h app_control)
+void UiIfaceAppImpl::onControl(app_control_h app_control)
{
- this->app->on_control(app_control);
+ this->app->onControl(app_control);
}
-void UiIfaceAppImpl::on_terminate()
+void UiIfaceAppImpl::onTerminate()
{
- this->app->on_terminate();
+ this->app->onTerminate();
}
/***********************************************************************************************/
/* External class Implementation */
/***********************************************************************************************/
-static UiIfaceApp *inst = NULL;
+static UiIfaceApp *_inst = NULL;
-void UiIfaceApp::on_lang_changed(app_event_info_h event_info)
+void UiIfaceApp::onLangChanged(app_event_info_h event_info)
{
char *language = NULL;
int ret = app_event_get_language(event_info, &language);
if (language != NULL) {
elm_language_set(language);
- UiIfaceView *view = this->impl->viewmgr->get_last_view();
- view->on_language_changed(language);
+ UiIfaceView *view = this->_impl->viewmgr->getLastView();
+ view->onLanguageChanged(language);
free(language);
}
}
-void UiIfaceApp::on_low_memory(app_event_info_h event_info)
+void UiIfaceApp::onLowMemory(app_event_info_h event_info)
{
- UiIfaceView *view = this->impl->viewmgr->get_last_view();
- view->on_low_memory();
+ UiIfaceView *view = this->_impl->viewmgr->getLastView();
+ view->onLowMemory();
}
-void UiIfaceApp::on_low_battery(app_event_info_h event_info)
+void UiIfaceApp::onLowBattery(app_event_info_h event_info)
{
- UiIfaceView *view = this->impl->viewmgr->get_last_view();
- view->on_low_battery();
+ UiIfaceView *view = this->_impl->viewmgr->getLastView();
+ view->onLowBattery();
}
-void UiIfaceApp::on_region_changed(app_event_info_h event_info)
+void UiIfaceApp::onRegionChanged(app_event_info_h event_info)
{
char *region = NULL;
int ret = app_event_get_region_format(event_info, ®ion);
return;
}
- UiIfaceView *view = this->impl->viewmgr->get_last_view();
- view->on_region_changed(region);
+ UiIfaceView *view = this->_impl->viewmgr->getLastView();
+ view->onRegionChanged(region);
}
-void UiIfaceApp::on_orient_changed(app_event_info_h event_info)
+void UiIfaceApp::onOrientChanged(app_event_info_h event_info)
{
}
-bool UiIfaceApp::on_create()
+bool UiIfaceApp::onCreate()
{
- return this->impl->init();
+ return this->_impl->init();
}
-void UiIfaceApp::on_pause()
+void UiIfaceApp::onPause()
{
- this->impl->viewmgr->deactivate();
+ this->_impl->viewmgr->deactivate();
}
-void UiIfaceApp::on_resume()
+void UiIfaceApp::onResume()
{
-// this->impl->viewmgr->activate();
+// this->_impl->viewmgr->activate();
}
-void UiIfaceApp::on_control(app_control_h app_control)
+void UiIfaceApp::onControl(app_control_h app_control)
{
/* Handle the launch request. */
- this->impl->viewmgr->activate();
+ this->_impl->viewmgr->activate();
}
-void UiIfaceApp::on_terminate()
+void UiIfaceApp::onTerminate()
{
delete(this);
}
UiIfaceApp::UiIfaceApp(const char *pkg, const char *locale_dir, UiIfaceViewmgr *viewmgr)
{
- if (inst)
+ if (_inst)
{
LOGE("You created UiIfaceApp multiple times!!");
}
- inst = this;
+ _inst = this;
- this->impl = new UiIfaceAppImpl(this, pkg, locale_dir, viewmgr);
+ this->_impl = new UiIfaceAppImpl(this, pkg, locale_dir, viewmgr);
}
int UiIfaceApp::run(int argc, char **argv)
{
- return this->impl->run(argc, argv);
+ return this->_impl->run(argc, argv);
}
UiIfaceApp::~UiIfaceApp()
{
- delete (this->impl);
- inst = NULL;
+ delete (this->_impl);
+ _inst = NULL;
}
-UiIfaceViewmgr *UiIfaceApp::get_viewmgr()
+UiIfaceViewmgr *UiIfaceApp::getViewmgr()
{
- return this->impl->viewmgr;
+ return this->_impl->viewmgr;
}
-UiIfaceApp *UiIfaceApp::get_instance()
+UiIfaceApp *UiIfaceApp::getInstance()
{
- return inst;
+ return _inst;
}
friend class UiIfaceOverlay;
private:
- UiIfaceOverlay *overlay;
- UiIfaceView *view;
- T content;
+ UiIfaceOverlay *_overlay;
+ UiIfaceView *_view;
+ T _content;
public:
- bool set_content(T content);
- T unset_content();
- UiIfaceView *get_view();
- T get_content();
+ bool setContent(T content);
+ T unsetContent();
+ UiIfaceView *getView();
+ T getContent();
UiIfaceOverlayImpl(UiIfaceOverlay *overlay, UiIfaceView *view);
~UiIfaceOverlayImpl();
}
UiIfaceOverlayImpl::UiIfaceOverlayImpl(UiIfaceOverlay *overlay, UiIfaceView *view)
- : overlay(overlay), view(view), content(NULL)
+ : _overlay(overlay), _view(view), _content(NULL)
{
}
{
}
-bool UiIfaceOverlayImpl::set_content(T content)
+bool UiIfaceOverlayImpl::setContent(T content)
{
- this->content = content;
+ this->_content = content;
return true;
}
-T UiIfaceOverlayImpl::unset_content()
+T UiIfaceOverlayImpl::unsetContent()
{
- T prev = this->content;
- this->content = NULL;
+ T prev = this->_content;
+ this->_content = NULL;
return prev;
}
-T UiIfaceOverlayImpl::get_content()
+T UiIfaceOverlayImpl::getContent()
{
- return this->content;
+ return this->_content;
}
-UiIfaceView *UiIfaceOverlayImpl::get_view()
+UiIfaceView *UiIfaceOverlayImpl::getView()
{
- return this->view;
+ return this->_view;
}
/***********************************************************************************************/
UiIfaceOverlay::UiIfaceOverlay(UiIfaceView *view)
{
- this->impl = new UiIfaceOverlayImpl(this, view);
+ this->_impl = new UiIfaceOverlayImpl(this, view);
}
UiIfaceOverlay::~UiIfaceOverlay()
{
- delete(this->impl);
+ delete(this->_impl);
}
-bool UiIfaceOverlay::set_content(T content)
+bool UiIfaceOverlay::setContent(T content)
{
- return this->impl->set_content(content);
+ return this->_impl->setContent(content);
}
-T UiIfaceOverlay::unset_content()
+T UiIfaceOverlay::unsetContent()
{
- return this->impl->unset_content();
+ return this->_impl->unsetContent();
}
-T UiIfaceOverlay::get_content()
+T UiIfaceOverlay::getContent()
{
- return this->impl->get_content();
+ return this->_impl->getContent();
}
-UiIfaceView *UiIfaceOverlay::get_view()
+UiIfaceView *UiIfaceOverlay::getView()
{
- return this->impl->get_view();
+ return this->_impl->getView();
}
-void UiIfaceOverlay::on_back()
+void UiIfaceOverlay::onBack()
{
this->deactivate();
}
return true;
}
-bool UiIfaceOverlay::is_activated()
+bool UiIfaceOverlay::isActivated()
{
return true;
}
friend class UiIfaceView;
private:
- UiIfaceView *view;
- T content; ///< A content instance for a screen as a view.
- string name; ///< View name.
- string transition_style; ///< View transition style name.
- UiIfaceViewmgr *viewmgr; ///< Viewmgr which this view belongs to.
- UiViewState state; ///< View state.
- UiViewIndicator indicator; ///< View indicator mode.
- bool event_block; ///< State of event block.
- bool removable_content; ///< When this value is true, view removes it's content internally on unload state.
+ UiIfaceView *_view;
+ T _content; ///< A content instance for a screen as a view.
+ string _name; ///< View name.
+ string _transition_style; ///< View transition style name.
+ UiIfaceViewmgr *_viewmgr; ///< Viewmgr which this view belongs to.
+ UiViewState _state; ///< View state.
+ UiViewIndicator _indicator; ///< View indicator mode.
+ bool _event_block; ///< State of event block.
+ bool _removable_content; ///< When this value is true, view removes it's content internally on unload state.
public:
- void set_event_block(bool block);
- void on_load();
- void on_unload();
- void on_activate();
- void on_deactivate();
- void on_pause();
- void on_resume();
- void on_destroy();
- bool get_event_block();
- bool set_content(T content);
- T unset_content();
+ void setEventBlock(bool block);
+ void onLoad();
+ void onUnload();
+ void onActivate();
+ void onDeactivate();
+ void onPause();
+ void onResume();
+ void onDestroy();
+ bool getEventBlock();
+ bool setContent(T content);
+ T unsetContent();
UiIfaceViewImpl(UiIfaceView *view, const char *name);
~UiIfaceViewImpl();
- bool set_transition_style(const char *style);
- void set_removable_content(bool removable);
- void set_indicator(UiViewIndicator indicator);
- const char *get_transition_style();
- const char *get_name();
- T get_content();
- UiViewState get_state();
- bool get_removable_content();
- UiViewIndicator get_indicator();
- void on_back();
+ bool setTransitionStyle(const char *style);
+ void setRemovableContent(bool removable);
+ void setIndicator(UiViewIndicator indicator);
+ const char *getTransitionStyle();
+ const char *getName();
+ T getContent();
+ UiViewState getState();
+ bool getRemovableContent();
+ UiViewIndicator getIndicator();
+ void onBack();
};
}
-bool UiIfaceViewImpl::get_event_block()
+bool UiIfaceViewImpl::getEventBlock()
{
- return this->event_block;
+ return this->_event_block;
}
-void UiIfaceViewImpl::set_event_block(bool block)
+void UiIfaceViewImpl::setEventBlock(bool block)
{
- this->event_block = block;
+ this->_event_block = block;
}
-void UiIfaceViewImpl::on_load()
+void UiIfaceViewImpl::onLoad()
{
- this->state = UI_VIEW_STATE_LOAD;
+ this->_state = UI_VIEW_STATE_LOAD;
}
-void UiIfaceViewImpl::on_unload()
+void UiIfaceViewImpl::onUnload()
{
- this->state = UI_VIEW_STATE_UNLOAD;
- if (this->get_removable_content())
+ this->_state = UI_VIEW_STATE_UNLOAD;
+ if (this->getRemovableContent())
{
- this->set_content(NULL);
+ this->setContent(NULL);
return;
}
}
-void UiIfaceViewImpl::on_activate()
+void UiIfaceViewImpl::onActivate()
{
- this->state = UI_VIEW_STATE_ACTIVATE;
+ this->_state = UI_VIEW_STATE_ACTIVATE;
}
-void UiIfaceViewImpl::on_deactivate()
+void UiIfaceViewImpl::onDeactivate()
{
- this->state = UI_VIEW_STATE_DEACTIVATE;
+ this->_state = UI_VIEW_STATE_DEACTIVATE;
}
-void UiIfaceViewImpl::on_pause()
+void UiIfaceViewImpl::onPause()
{
- this->state = UI_VIEW_STATE_PAUSE;
+ this->_state = UI_VIEW_STATE_PAUSE;
}
-void UiIfaceViewImpl::on_resume()
+void UiIfaceViewImpl::onResume()
{
- this->state = UI_VIEW_STATE_ACTIVATE;
+ this->_state = UI_VIEW_STATE_ACTIVATE;
}
-void UiIfaceViewImpl::on_destroy()
+void UiIfaceViewImpl::onDestroy()
{
}
UiIfaceViewImpl::UiIfaceViewImpl(UiIfaceView *view, const char *name)
- : view(view), content(NULL), name(string(name ? name : "")), transition_style(string("default")), viewmgr(NULL), state(UI_VIEW_STATE_LOAD),
- indicator(UI_VIEW_INDICATOR_DEFAULT), event_block(false), removable_content(true)
+ : _view(view), _content(NULL), _name(string(name ? name : "")), _transition_style(string("default")), _viewmgr(NULL), _state(UI_VIEW_STATE_LOAD),
+ _indicator(UI_VIEW_INDICATOR_DEFAULT), _event_block(false), _removable_content(true)
{
- this->state = UI_VIEW_STATE_UNLOAD;
+ this->_state = UI_VIEW_STATE_UNLOAD;
}
UiIfaceViewImpl::~UiIfaceViewImpl()
{
- this->viewmgr->remove_view(this->view);
+ this->_viewmgr->removeView(this->_view);
}
-bool UiIfaceViewImpl::set_content(T content)
+bool UiIfaceViewImpl::setContent(T content)
{
- this->content = content;
+ this->_content = content;
return true;
}
-T UiIfaceViewImpl::unset_content()
+T UiIfaceViewImpl::unsetContent()
{
- T prev = this->content;
- this->content = NULL;
+ T prev = this->_content;
+ this->_content = NULL;
return prev;
}
-bool UiIfaceViewImpl::set_transition_style(const char *style)
+bool UiIfaceViewImpl::setTransitionStyle(const char *style)
{
- this->transition_style.assign(style);
+ this->_transition_style.assign(style);
return true;
}
-void UiIfaceViewImpl::set_removable_content(bool removable)
+void UiIfaceViewImpl::setRemovableContent(bool removable)
{
- this->removable_content = removable;
+ this->_removable_content = removable;
//FIXME: If this api is called on unload state? should we remove content right now?
}
-void UiIfaceViewImpl::set_indicator(UiViewIndicator indicator)
+void UiIfaceViewImpl::setIndicator(UiViewIndicator indicator)
{
- this->indicator = indicator;
+ this->_indicator = indicator;
}
-const char *UiIfaceViewImpl::get_transition_style()
+const char *UiIfaceViewImpl::getTransitionStyle()
{
- return this->transition_style.c_str();
+ return this->_transition_style.c_str();
}
-const char *UiIfaceViewImpl::get_name()
+const char *UiIfaceViewImpl::getName()
{
- return this->name.c_str();
+ return this->_name.c_str();
}
-T UiIfaceViewImpl::get_content()
+T UiIfaceViewImpl::getContent()
{
- return this->content;
+ return this->_content;
}
-UiViewState UiIfaceViewImpl::get_state()
+UiViewState UiIfaceViewImpl::getState()
{
- return this->state;
+ return this->_state;
}
-bool UiIfaceViewImpl::get_removable_content()
+bool UiIfaceViewImpl::getRemovableContent()
{
- return this->removable_content;
+ return this->_removable_content;
}
-UiViewIndicator UiIfaceViewImpl::get_indicator()
+UiViewIndicator UiIfaceViewImpl::getIndicator()
{
- return this->indicator;
+ return this->_indicator;
}
-void UiIfaceViewImpl::on_back()
+void UiIfaceViewImpl::onBack()
{
- UiIfaceViewmgr *viewmgr = this->viewmgr;
+ UiIfaceViewmgr *viewmgr = this->_viewmgr;
if (!viewmgr)
{
LOGE("Failed to get a viewmgr, view =%p", this);
return;
}
- viewmgr->pop_view();
+ viewmgr->popView();
}
/***********************************************************************************************/
/* External class Implementation */
/***********************************************************************************************/
-bool UiIfaceView::get_event_block()
+bool UiIfaceView::getEventBlock()
{
- return this->impl->get_event_block();
+ return this->_impl->getEventBlock();
}
-void UiIfaceView::set_event_block(bool block)
+void UiIfaceView::setEventBlock(bool block)
{
- this->impl->set_event_block(block);
+ this->_impl->setEventBlock(block);
}
-void UiIfaceView::on_load()
+void UiIfaceView::onLoad()
{
- this->impl->on_load();
+ this->_impl->onLoad();
}
-void UiIfaceView::on_unload()
+void UiIfaceView::onUnload()
{
- this->impl->on_unload();
+ this->_impl->onUnload();
}
-void UiIfaceView::on_activate()
+void UiIfaceView::onActivate()
{
- this->impl->on_activate();
+ this->_impl->onActivate();
}
-void UiIfaceView::on_deactivate()
+void UiIfaceView::onDeactivate()
{
- this->impl->on_deactivate();
+ this->_impl->onDeactivate();
}
-void UiIfaceView::on_pause()
+void UiIfaceView::onPause()
{
- this->impl->on_pause();
+ this->_impl->onPause();
}
-void UiIfaceView::on_resume()
+void UiIfaceView::onResume()
{
- this->impl->on_resume();
+ this->_impl->onResume();
}
-void UiIfaceView::on_destroy()
+void UiIfaceView::onDestroy()
{
- this->impl->on_destroy();
+ this->_impl->onDestroy();
}
UiIfaceView::UiIfaceView(const char *name)
{
- this->impl = new UiIfaceViewImpl(this, name);
+ this->_impl = new UiIfaceViewImpl(this, name);
}
UiIfaceView::~UiIfaceView()
{
- delete(this->impl);
+ delete(this->_impl);
}
-bool UiIfaceView::set_content(T content)
+bool UiIfaceView::setContent(T content)
{
- return this->impl->set_content(content);
+ return this->_impl->setContent(content);
}
-T UiIfaceView::unset_content()
+T UiIfaceView::unsetContent()
{
- return this->impl->unset_content();
+ return this->_impl->unsetContent();
}
-bool UiIfaceView::set_transition_style(const char *style)
+bool UiIfaceView::setTransitionStyle(const char *style)
{
- return this->impl->set_transition_style(style);
+ return this->_impl->setTransitionStyle(style);
}
-void UiIfaceView::set_removable_content(bool removable)
+void UiIfaceView::setRemovableContent(bool removable)
{
- this->impl->set_removable_content(removable);
+ this->_impl->setRemovableContent(removable);
}
-void UiIfaceView::set_indicator(UiViewIndicator indicator)
+void UiIfaceView::setIndicator(UiViewIndicator indicator)
{
- this->impl->set_indicator(indicator);
+ this->_impl->setIndicator(indicator);
}
-const char *UiIfaceView::get_transition_style()
+const char *UiIfaceView::getTransitionStyle()
{
- return this->impl->get_transition_style();
+ return this->_impl->getTransitionStyle();
}
-const char *UiIfaceView::get_name()
+const char *UiIfaceView::getName()
{
- return this->impl->get_name();
+ return this->_impl->getName();
}
-T UiIfaceView::get_content()
+T UiIfaceView::getContent()
{
- return this->impl->get_content();
+ return this->_impl->getContent();
}
-UiViewState UiIfaceView::get_state()
+UiViewState UiIfaceView::getState()
{
- return this->impl->get_state();
+ return this->_impl->getState();
}
-bool UiIfaceView::get_removable_content()
+bool UiIfaceView::getRemovableContent()
{
- return this->impl->get_removable_content();
+ return this->_impl->getRemovableContent();
}
-UiViewIndicator UiIfaceView::get_indicator()
+UiViewIndicator UiIfaceView::getIndicator()
{
- return this->impl->get_indicator();
+ return this->_impl->getIndicator();
}
-void UiIfaceView::on_back()
+void UiIfaceView::onBack()
{
- this->impl->on_back();
+ this->_impl->onBack();
}
-bool UiIfaceView::set_viewmgr(UiIfaceViewmgr *viewmgr)
+bool UiIfaceView::_setViewmgr(UiIfaceViewmgr *viewmgr)
{
- this->impl->viewmgr = viewmgr;
+ this->_impl->_viewmgr = viewmgr;
return true;
}
-UiIfaceViewmgr *UiIfaceView::get_viewmgr()
+UiIfaceViewmgr *UiIfaceView::_getViewmgr()
{
- return this->impl->viewmgr;
+ return this->_impl->_viewmgr;
}
-void UiIfaceView::on_low_memory()
+void UiIfaceView::onLowMemory()
{
}
-void UiIfaceView::on_low_battery()
+void UiIfaceView::onLowBattery()
{
}
-void UiIfaceView::on_region_changed(const char *region)
+void UiIfaceView::onRegionChanged(const char *region)
{
}
-void UiIfaceView::on_language_changed(const char *language)
+void UiIfaceView::onLanguageChanged(const char *language)
{
}
#include <app.h>
#include <list>
+
#include "../../include/interface/UiIfaceViewManager.h"
using namespace std;
friend class UiIfaceViewmgr;
private:
- static UiIfaceViewmgr *inst;
- static bool soft_key; //If system doesn't support HW back key, then this value is @c true.
- static bool event_block; //Event block on view transition. This value should be configurable by system.
- list<UiIfaceView *> view_list; //View list.
- bool activated; //Activated status of this viewmgr.
- bool destroying; //True, if viewmgr is on destroying.
+ static UiIfaceViewmgr *_inst;
+ static bool _softKey; //If system doesn't support HW back key, then this value is @c true.
+ static bool _eventBlock; //Event block on view transition. This value should be configurable by system.
+ list<UiIfaceView *> _viewList; //View list.
+ bool _activated; //Activated status of this viewmgr.
+ bool _destroying; //True, if viewmgr is on destroying.
public:
- bool connect_view(UiIfaceView *view);
- bool disconnect_view(UiIfaceView *view);
- void set_event_block(UiIfaceView *view, bool block);
-
- bool push_view_finished(UiIfaceView *view);
- bool pop_view_finished(UiIfaceView *view);
- UiIfaceView *push_view(UiIfaceView *view);
- bool pop_view();
- bool insert_view_before(UiIfaceView *view, UiIfaceView *before);
- bool insert_view_after(UiIfaceView *view, UiIfaceView *after);
- bool remove_view(UiIfaceView *view);
- UiIfaceView* get_view(unsigned int idx);
- UiIfaceView *get_view(const char *name);
- UiIfaceView *get_last_view();
- int get_view_index(const UiIfaceView *view);
+ bool connectView(UiIfaceView *view);
+ bool disconnectView(UiIfaceView *view);
+ void setEventBlock(UiIfaceView *view, bool block);
+
+ bool pushViewFinished(UiIfaceView *view);
+ bool popViewFinished(UiIfaceView *view);
+ UiIfaceView *pushView(UiIfaceView *view);
+ bool popView();
+ bool insertViewBefore(UiIfaceView *view, UiIfaceView *before);
+ bool insertViewAfter(UiIfaceView *view, UiIfaceView *after);
+ bool removeView(UiIfaceView *view);
+ UiIfaceView *getView(unsigned int idx);
+ UiIfaceView *getView(const char *name);
+ UiIfaceView *getLastView();
+ int getViewIndex(const UiIfaceView *view);
UiIfaceViewmgrImpl(UiIfaceViewmgr *viewmgr);
~UiIfaceViewmgrImpl();
bool activate();
bool deactivate();
- bool is_activated();
- unsigned int get_view_count();
- static bool need_soft_key();
- static UiIfaceViewmgr* get_instance();
+ bool isActivated();
+ unsigned int getViewCount();
+ static bool needSoftKey();
+ static UiIfaceViewmgr* getInstance();
};
}
-UiIfaceViewmgr* UiIfaceViewmgrImpl::inst = NULL;
+UiIfaceViewmgr* UiIfaceViewmgrImpl::_inst = NULL;
//FIXME: Read system profile to decide whether support software key or not.
-bool UiIfaceViewmgrImpl::soft_key = true;
+bool UiIfaceViewmgrImpl::_softKey = true;
//FIXME: Read system profile to decide whether support event block or not.
-bool UiIfaceViewmgrImpl::event_block = true;
+bool UiIfaceViewmgrImpl::_eventBlock = true;
#define VIEW_ITR list<UiIfaceView *>::iterator
#define VIEW_RITR list<UiIfaceView *>::reverse_iterator
-bool UiIfaceViewmgrImpl::insert_view_after(UiIfaceView *view, UiIfaceView *after)
+bool UiIfaceViewmgrImpl::insertViewAfter(UiIfaceView *view, UiIfaceView *after)
{
VIEW_ITR it;
return false;
}
- if (!this->connect_view(view))
+ if (!this->connectView(view))
{
LOGE("connect view failed");
return false;
}
- if (this->view_list.size() > 0)
+ if (this->_viewList.size() > 0)
{
- for (it = this->view_list.begin(); it != this->view_list.end(); it++)
+ for (it = this->_viewList.begin(); it != this->_viewList.end(); it++)
{
if (after == *it)
{
//If the after is a last item of list.
//view has to push now.
- if (it == this->view_list.end())
- this->push_view(view);
+ if (it == this->_viewList.end())
+ this->pushView(view);
else
- this->view_list.insert(++it, view);
+ this->_viewList.insert(++it, view);
return true;
}
//If there is no matching after view with current list.
//also in case of after is NULL.
- this->push_view(view);
+ this->pushView(view);
return true;
}
-bool UiIfaceViewmgrImpl::need_soft_key()
+bool UiIfaceViewmgrImpl::needSoftKey()
{
- return UiIfaceViewmgrImpl::soft_key;
+ return UiIfaceViewmgrImpl::_softKey;
}
-bool UiIfaceViewmgrImpl::connect_view(UiIfaceView *view)
+bool UiIfaceViewmgrImpl::connectView(UiIfaceView *view)
{
//TODO: Perform this only in debug mode?
//Check whether the same name of this view is already existed in this viewmgr?
- int name_len = strlen(view->get_name());
- const char *name = view->get_name();
+ int nameLen = strlen(view->getName());
+ const char *name = view->getName();
- for (VIEW_ITR it = this->view_list.begin(); it != this->view_list.end(); it++)
+ for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++)
{
UiIfaceView *view = *it;
- const char *view_name = view->get_name();
- if (!view_name) continue;
- int view_name_len = strlen(view_name);
+ const char *viewName = view->getName();
+ if (!viewName) continue;
+ int viewNameLen = strlen(viewName);
//Got you!
- if ((view_name_len == name_len) && !strcmp(name, view_name))
+ if ((viewNameLen == nameLen) && !strcmp(name, viewName))
{
LOGE("the same name of UiIfaceView(%p) is already in this UiIfaceViewmgr(%p)", view, this);
return false;
}
}
- return view->set_viewmgr(this->get_instance());
+ return view->_setViewmgr(this->getInstance());
}
-bool UiIfaceViewmgrImpl::disconnect_view(UiIfaceView *view)
+bool UiIfaceViewmgrImpl::disconnectView(UiIfaceView *view)
{
- if (!view->get_viewmgr()) return false;
- view->set_viewmgr(NULL);
+ if (!view->_getViewmgr()) return false;
+ view->_setViewmgr(NULL);
return true;
}
-void UiIfaceViewmgrImpl::set_event_block(UiIfaceView *view, bool block)
+void UiIfaceViewmgrImpl::setEventBlock(UiIfaceView *view, bool block)
{
- if (!UiIfaceViewmgrImpl::event_block) return;
- view->set_event_block(block);
+ if (!UiIfaceViewmgrImpl::_eventBlock) return;
+ view->setEventBlock(block);
}
-bool UiIfaceViewmgrImpl::push_view_finished(UiIfaceView *view)
+bool UiIfaceViewmgrImpl::pushViewFinished(UiIfaceView *view)
{
- UiIfaceView *last = this->view_list.back();
+ UiIfaceView *last = this->_viewList.back();
//The previous view has been pushed. This should be unload.
if (last != view)
{
- view->on_unload();
+ view->onUnload();
return true;
}
//A new view has been pushed. This should be activate.
- view->on_activate();
- this->set_event_block(view, false);
+ view->onActivate();
+ this->setEventBlock(view, false);
return true;
}
-bool UiIfaceViewmgrImpl::pop_view_finished(UiIfaceView *view)
+bool UiIfaceViewmgrImpl::popViewFinished(UiIfaceView *view)
{
- UiIfaceView *last = this->view_list.back();
+ UiIfaceView *last = this->_viewList.back();
//This view has been popped. It should be destroyed.
if (last == view)
{
- view->on_unload();
- view->on_destroy();
+ view->onUnload();
+ view->onDestroy();
delete (view);
return true;
}
//The previous view has been popped. It should become activate.
- view->on_activate();
- this->set_event_block(view, false);
+ view->onActivate();
+ this->setEventBlock(view, false);
return true;
}
UiIfaceViewmgrImpl::UiIfaceViewmgrImpl(UiIfaceViewmgr* viewmgr)
- : activated(false), destroying(false)
+ : _activated(false), _destroying(false)
{
- UiIfaceViewmgrImpl::inst = viewmgr;
+ UiIfaceViewmgrImpl::_inst = viewmgr;
}
UiIfaceViewmgrImpl::~UiIfaceViewmgrImpl()
{
//Terminate views
- this->destroying = EINA_TRUE;
- for (VIEW_RITR ritr = this->view_list.rbegin(); ritr != this->view_list.rend(); ritr++)
+ this->_destroying = EINA_TRUE;
+ for (VIEW_RITR ritr = this->_viewList.rbegin(); ritr != this->_viewList.rend(); ritr++)
{
UiIfaceView *view = *ritr;
- if ((view->get_state() != UI_VIEW_STATE_DEACTIVATE) &&
- (view->get_state() != UI_VIEW_STATE_UNLOAD))
+ if ((view->getState() != UI_VIEW_STATE_DEACTIVATE) &&
+ (view->getState() != UI_VIEW_STATE_UNLOAD))
{
- view->on_deactivate();
+ view->onDeactivate();
}
- if (view->get_state() != UI_VIEW_STATE_UNLOAD)
+ if (view->getState() != UI_VIEW_STATE_UNLOAD)
{
- view->on_unload();
+ view->onUnload();
}
- view->on_destroy();
+ view->onDestroy();
delete (view);
}
- this->destroying = EINA_FALSE;
+ this->_destroying = EINA_FALSE;
ui_app_exit();
- UiIfaceViewmgrImpl::inst = NULL;
+ UiIfaceViewmgrImpl::_inst = NULL;
}
-UiIfaceView *UiIfaceViewmgrImpl::push_view(UiIfaceView *view)
+UiIfaceView *UiIfaceViewmgrImpl::pushView(UiIfaceView *view)
{
if (!view)
{
return NULL;
}
- if (!this->connect_view(view))
+ if (!this->connectView(view))
{
LOGE("connect view failed");
return NULL;
UiIfaceView *pview;
//Previous view
- if (this->view_list.size() > 0)
+ if (this->_viewList.size() > 0)
{
- pview = this->view_list.back();
- pview->on_deactivate();
- this->set_event_block(pview, true);
+ pview = this->_viewList.back();
+ pview->onDeactivate();
+ this->setEventBlock(pview, true);
}
- this->view_list.push_back(view);
+ this->_viewList.push_back(view);
//If view manager is not activated yet, don't load view.
- if (!this->is_activated()) return view;
+ if (!this->isActivated()) return view;
- view->on_load();
- view->on_deactivate();
+ view->onLoad();
+ view->onDeactivate();
- if (this->view_list.size() != 1)
+ if (this->_viewList.size() != 1)
{
- this->set_event_block(view, true);
+ this->setEventBlock(view, true);
}
return view;
}
-bool UiIfaceViewmgrImpl::pop_view()
+bool UiIfaceViewmgrImpl::popView()
{
//last page to be popped.
- UiIfaceView*view = this->view_list.back();
+ UiIfaceView*view = this->_viewList.back();
- if (view->get_event_block())
+ if (view->getEventBlock())
{
return false;
}
//FIXME: No more view?
- if (this->get_view_count() == 0)
+ if (this->getViewCount() == 0)
{
LOGE("No Views. Can't pop anymore!");
return false;
}
//This is the last page.
- if (this->get_view_count() == 1)
+ if (this->getViewCount() == 1)
{
//destroy viewmgr?
- UiIfaceView*view = this->view_list.back();
- view->on_deactivate();
- view->on_unload();
- view->on_destroy();
+ UiIfaceView*view = this->_viewList.back();
+ view->onDeactivate();
+ view->onUnload();
+ view->onDestroy();
delete(view);
return true;
}
- view->on_deactivate();
- this->set_event_block(view, true);
+ view->onDeactivate();
+ this->setEventBlock(view, true);
//Below object has to be used in child class...
//Make this getter method? or define instance?
//previous page is to be an active page.
- auto nx = prev(this->view_list.end(), 2);
+ auto nx = prev(this->_viewList.end(), 2);
UiIfaceView*pview = *nx;
- pview->on_load();
- pview->on_deactivate();
- this->set_event_block(pview, true);
+ pview->onLoad();
+ pview->onDeactivate();
+ this->setEventBlock(pview, true);
return true;
}
-bool UiIfaceViewmgrImpl::insert_view_before(UiIfaceView *view, UiIfaceView *before)
+bool UiIfaceViewmgrImpl::insertViewBefore(UiIfaceView *view, UiIfaceView *before)
{
VIEW_ITR it;
return false;
}
- if (!this->connect_view(view))
+ if (!this->connectView(view))
{
LOGE("connect view failed");
return false;
}
- if (this->view_list.size() > 0)
+ if (this->_viewList.size() > 0)
{
- for (it = this->view_list.begin(); it != this->view_list.end(); it++)
+ for (it = this->_viewList.begin(); it != this->_viewList.end(); it++)
{
if (before == *it)
{
- this->view_list.insert(it, view);
+ this->_viewList.insert(it, view);
return true;
}
//If there is no matching before view with current list.
//also in case of before is NULL.
- this->push_view(view);
+ this->pushView(view);
return true;
}
-bool UiIfaceViewmgrImpl::remove_view(UiIfaceView *view)
+bool UiIfaceViewmgrImpl::removeView(UiIfaceView *view)
{
- if (this->destroying) return false;
+ if (this->_destroying) return false;
- this->view_list.remove(view);
- this->disconnect_view(view);
+ this->_viewList.remove(view);
+ this->disconnectView(view);
//TODO: If this view is the top on the stack ?
return true;
}
-UiIfaceView *UiIfaceViewmgrImpl::get_view(unsigned int idx)
+UiIfaceView *UiIfaceViewmgrImpl::getView(unsigned int idx)
{
- if (idx < 0 || idx >= this->view_list.size())
+ if (idx < 0 || idx >= this->_viewList.size())
{
- LOGE("Invalid idx(%d)! =? (idx range: %d ~ %d)", idx, 0, this->view_list.size() - 1);
+ LOGE("Invalid idx(%d)! =? (idx range: %d ~ %d)", idx, 0, this->_viewList.size() - 1);
return NULL;
}
- VIEW_ITR it = this->view_list.begin();
+ VIEW_ITR it = this->_viewList.begin();
advance(it, idx);
return *it;
}
-int UiIfaceViewmgrImpl::get_view_index(const UiIfaceView *view)
+int UiIfaceViewmgrImpl::getViewIndex(const UiIfaceView *view)
{
int idx = 0;
- for (VIEW_ITR it = this->view_list.begin(); it != this->view_list.end(); it++)
+ for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++)
{
if (view == *it) return idx;
++idx;
return -1;
}
-UiIfaceView *UiIfaceViewmgrImpl::get_last_view()
+UiIfaceView *UiIfaceViewmgrImpl::getLastView()
{
- int cnt = this->get_view_count();
- return this->get_view(cnt - 1);
+ int cnt = this->getViewCount();
+
+ return this->getView(cnt - 1);
}
bool UiIfaceViewmgrImpl::activate()
{
- if (this->activated) return false;
- if (this->get_view_count() == 0) return false;
- this->activated = true;
- UiIfaceView *view = this->get_last_view();
- view->on_load();
- view->on_deactivate();
- view->on_activate();
+ if (this->_activated) return false;
+ if (this->getViewCount() == 0) return false;
+ this->_activated = true;
+
+ UiIfaceView *view = this->getLastView();
+
+ view->onLoad();
+ view->onDeactivate();
+ view->onActivate();
+
return true;
}
bool UiIfaceViewmgrImpl::deactivate()
{
- if (!this->activated) return false;
- this->activated = false;
- UiIfaceView *view = this->get_last_view();
+ if (!this->_activated) return false;
+ this->_activated = false;
+
+ UiIfaceView *view = this->getLastView();
- if ((view->get_state() != UI_VIEW_STATE_DEACTIVATE) &&
- (view->get_state() != UI_VIEW_STATE_UNLOAD))
+ if ((view->getState() != UI_VIEW_STATE_DEACTIVATE) &&
+ (view->getState() != UI_VIEW_STATE_UNLOAD))
{
- view->on_deactivate();
+ view->onDeactivate();
}
- if (view->get_state() != UI_VIEW_STATE_UNLOAD)
+ if (view->getState() != UI_VIEW_STATE_UNLOAD)
{
- view->on_unload();
+ view->onUnload();
}
return true;
}
-UiIfaceView *UiIfaceViewmgrImpl::get_view(const char *name)
+UiIfaceView *UiIfaceViewmgrImpl::getView(const char *name)
{
if (!name) return NULL;
- int name_len = strlen(name);
+ int nameLen = strlen(name);
- for (VIEW_ITR it = this->view_list.begin(); it != this->view_list.end(); it++)
+ for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++)
{
UiIfaceView *view = *it;
- const char *view_name = view->get_name();
- if (!view_name) continue;
- int view_name_len = strlen(view_name);
+ const char *viewName = view->getName();
+ if (!viewName) continue;
+ int viewNameLen = strlen(viewName);
//Got you!
- if ((view_name_len == name_len) && !strcmp(name, view_name))
+ if ((viewNameLen == nameLen) && !strcmp(name, viewName))
{
return view;
}
return NULL;
}
-bool UiIfaceViewmgrImpl::is_activated()
+bool UiIfaceViewmgrImpl::isActivated()
{
- return this->activated;
+ return this->_activated;
}
-unsigned int UiIfaceViewmgrImpl::get_view_count()
+unsigned int UiIfaceViewmgrImpl::getViewCount()
{
- return this->view_list.size();
+ return this->_viewList.size();
}
-UiIfaceViewmgr* UiIfaceViewmgrImpl::get_instance()
+UiIfaceViewmgr* UiIfaceViewmgrImpl::getInstance()
{
- return UiIfaceViewmgrImpl::inst;
+ return UiIfaceViewmgrImpl::_inst;
}
/***********************************************************************************************/
/* External class Implementation */
/***********************************************************************************************/
-bool UiIfaceViewmgr::insert_view_after(UiIfaceView *view, UiIfaceView *after)
+bool UiIfaceViewmgr::insertViewAfter(UiIfaceView *view, UiIfaceView *after)
{
- return this->impl->insert_view_after(view, after);
+ return this->_impl->insertViewAfter(view, after);
}
-bool UiIfaceViewmgr::need_soft_key()
+bool UiIfaceViewmgr::needSoftKey()
{
- return UiIfaceViewmgrImpl::need_soft_key();
+ return UiIfaceViewmgrImpl::needSoftKey();
}
-bool UiIfaceViewmgr::push_view_finished(UiIfaceView *view)
+bool UiIfaceViewmgr::pushViewFinished(UiIfaceView *view)
{
- return this->impl->push_view_finished(view);
+ return this->_impl->pushViewFinished(view);
}
-bool UiIfaceViewmgr::pop_view_finished(UiIfaceView *view)
+bool UiIfaceViewmgr::popViewFinished(UiIfaceView *view)
{
- return this->impl->pop_view_finished(view);
+ return this->_impl->popViewFinished(view);
}
UiIfaceViewmgr::UiIfaceViewmgr()
{
- this->impl = new UiIfaceViewmgrImpl(this);
+ this->_impl = new UiIfaceViewmgrImpl(this);
}
UiIfaceViewmgr::~UiIfaceViewmgr()
{
- delete(this->impl);
+ delete(this->_impl);
}
-UiIfaceView *UiIfaceViewmgr::push_view(UiIfaceView *view)
+UiIfaceView *UiIfaceViewmgr::pushView(UiIfaceView *view)
{
- return this->impl->push_view(view);
+ return this->_impl->pushView(view);
}
-bool UiIfaceViewmgr::pop_view()
+bool UiIfaceViewmgr::popView()
{
- return this->impl->pop_view();
+ return this->_impl->popView();
}
-bool UiIfaceViewmgr::insert_view_before(UiIfaceView *view, UiIfaceView *before)
+bool UiIfaceViewmgr::insertViewBefore(UiIfaceView *view, UiIfaceView *before)
{
- return this->impl->insert_view_before(view, before);
+ return this->_impl->insertViewBefore(view, before);
}
-bool UiIfaceViewmgr::remove_view(UiIfaceView *view)
+bool UiIfaceViewmgr::removeView(UiIfaceView *view)
{
- return this->impl->remove_view(view);
+ return this->_impl->removeView(view);
}
-UiIfaceView *UiIfaceViewmgr::get_view(unsigned int idx)
+UiIfaceView *UiIfaceViewmgr::getView(unsigned int idx)
{
- return this->impl->get_view(idx);
+ return this->_impl->getView(idx);
}
-int UiIfaceViewmgr::get_view_index(const UiIfaceView *view)
+int UiIfaceViewmgr::getViewIndex(const UiIfaceView *view)
{
- return this->get_view_index(view);
+ return this->getViewIndex(view);
}
-UiIfaceView *UiIfaceViewmgr::get_last_view()
+UiIfaceView *UiIfaceViewmgr::getLastView()
{
- return this->impl->get_last_view();
+ return this->_impl->getLastView();
}
bool UiIfaceViewmgr::activate()
{
- return this->impl->activate();
+ return this->_impl->activate();
}
bool UiIfaceViewmgr::deactivate()
{
- return this->impl->deactivate();
+ return this->_impl->deactivate();
}
-UiIfaceView *UiIfaceViewmgr::get_view(const char *name)
+UiIfaceView *UiIfaceViewmgr::getView(const char *name)
{
- return this->impl->get_view(name);
+ return this->_impl->getView(name);
}
-bool UiIfaceViewmgr::is_activated()
+bool UiIfaceViewmgr::isActivated()
{
- return this->impl->is_activated();
+ return this->_impl->isActivated();
}
-unsigned int UiIfaceViewmgr::get_view_count()
+unsigned int UiIfaceViewmgr::getViewCount()
{
- return this->impl->get_view_count();
+ return this->_impl->getViewCount();
}
-UiIfaceViewmgr* UiIfaceViewmgr::get_instance()
+UiIfaceViewmgr* UiIfaceViewmgr::getInstance()
{
- return UiIfaceViewmgrImpl::get_instance();
+ return UiIfaceViewmgrImpl::getInstance();
}