content = create_content(base, "ViewMgr Demo<br>Basic View", prev_btn_clicked_cb, next_btn_clicked_cb);
if (!content) return false;
- if (!ui_standard_view_set_content(view, content, "Page1", NULL, NULL, NULL))
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page1"))
{
- dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view content");
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
return false;
}
ui_view_set_indicator(view, UI_VIEW_INDICATOR_OPTIMAL);
}
- ui_standard_view_set_content(view, content, "Page10", NULL, NULL, NULL);
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page10"))
+ {
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
+ return false;
+ }
return true;
}
content = create_content(base, "ViewMgr Demo<br>Menu Popup", prev_btn_clicked_cb, next_btn_clicked_cb);
if (!content) return false;
- if (!ui_standard_view_set_content(view, content, "Page11", NULL, NULL, NULL))
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page11"))
{
- dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view content");
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
return false;
}
content = create_content(base, "ViewMgr Demo<br>Popup", prev_btn_clicked_cb, next_btn_clicked_cb);
if (!content) return false;
- ui_standard_view_set_content(view, content, "Page12", NULL, NULL, NULL);
-
//Title Right button
right_btn = elm_button_add(base);
elm_object_text_set(right_btn, "popup");
evas_object_smart_callback_add(right_btn, "clicked", view12_btn_clicked, view);
- ui_standard_view_set_title_right_btn(view, right_btn);
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page12") ||
+ !ui_standard_view_set_title_right_btn(view, right_btn))
+ {
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
+ return false;
+ }
return true;
}
content = create_content(base, "ViewMgr Demo<br>Fade Transition", prev_btn_clicked_cb, next_btn_clicked_cb);
if (!content) return false;
- ui_standard_view_set_content(view, content, "Page13", NULL, NULL, NULL);
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page13"))
+ {
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
+ return false;
+ }
return true;
}
content = create_content(base, "ViewMgr Demo<br>None Transition", prev_btn_clicked_cb, next_btn_clicked_cb);
if (!content) return false;
- ui_standard_view_set_content(view, content, "Page14", NULL, NULL, NULL);
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page14"))
+ {
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
+ return false;
+ }
return true;
}
content = create_scrolling_content(base);
if (!content) return false;
- ui_standard_view_set_content(view, content, "Page 15 Scroller In Viewmgr", NULL, NULL, NULL);
-
//Title Right button
Elm_Button *right_btn = elm_button_add(base);
elm_object_text_set(right_btn, "Next");
evas_object_smart_callback_add(right_btn, "clicked", view15_btn_clicked_cb, NULL);
- ui_standard_view_set_title_right_btn(view, right_btn);
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page15 Scroller in Viewmgr") ||
+ !ui_standard_view_set_title_right_btn(view, right_btn))
+ {
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
+ return false;
+ }
return true;
}
content = create_title_handle_content(base, prev_btn_clicked_cb, next_btn_clicked_cb, title_show_btn_clicked_cb, title_hide_btn_clicked_cb, title_show_anim_btn_clicked_cb, title_hide_anim_btn_clicked_cb, view);
if (!content) return false;
- ui_standard_view_set_content(view, content, "Page16", NULL, NULL, NULL);
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page16"))
+ {
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
+ return false;
+ }
return true;
}
const int rots[2] = { 0, 90 };
ui_view_set_available_rotations(view, rots, 2);
- if (!ui_standard_view_set_content(view, content, "Page2", NULL, left_title_btn, right_title_btn))
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page2") ||
+ !ui_standard_view_set_title_left_btn(view, left_title_btn) ||
+ !ui_standard_view_set_title_right_btn(view, right_title_btn))
{
- dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view content");
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
return false;
}
content = create_content(base, "ViewMgr Demo<br>Subtitle", prev_btn_clicked_cb, next_btn_clicked_cb);
if (!content) return false;
- if (!ui_standard_view_set_content(view, content, "Page3", "Subtitle", NULL, NULL))
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page3") ||
+ !ui_standard_view_set_sub_title(view, "Subtitle"))
{
- dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view content");
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
return false;
}
content = create_content(base, "ViewMgr Demo<br>Title Badge", prev_btn_clicked_cb, next_btn_clicked_cb);
if (!content) return false;
- if (!ui_standard_view_set_content(view, content, "Page4 We put a long title here intentionally", NULL, NULL, NULL))
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page4 We put a long title here intentionally") ||
+ !ui_standard_view_set_title_badge(view, "999+"))
{
- dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view content");
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
return false;
}
- ui_standard_view_set_title_badge(view, "999+");
-
return true;
}
if (!ui_view_set_content(view, content))
{
- dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view content");
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
return false;
}
+
ui_view_set_indicator(view, UI_VIEW_INDICATOR_HIDE);
return true;
content = create_content(base, "ViewMgr Demo<br>Toolbar", prev_btn_clicked_cb, next_btn_clicked_cb);
if (!content) return false;
- if (!ui_standard_view_set_content(view, content, "Page6", NULL, NULL, NULL))
+ Elm_Toolbar *toolbar = create_toolbar(base, "toolbar_with_title");
+ if (!toolbar) return false;
+
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page6") ||
+ !ui_standard_view_set_toolbar(view, toolbar))
{
- dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view content");
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
return false;
}
- Elm_Toolbar *toolbar = create_toolbar(base, "toolbar_with_title");
- if (toolbar) ui_standard_view_set_toolbar(view, toolbar);
-
return true;
}
content = create_content(base, "ViewMgr Demo<br>Navigationbar", prev_btn_clicked_cb, next_btn_clicked_cb);
if (!content) return false;
- if (!ui_standard_view_set_content(view, content, "Page7", NULL, NULL, NULL))
+ Elm_Toolbar *toolbar = create_toolbar(base, "navigationbar");
+ if (!toolbar) return false;
+
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page7") ||
+ !ui_standard_view_set_toolbar(view, toolbar))
{
- dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view content");
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
return false;
}
- Elm_Toolbar *toolbar = create_toolbar(base, "navigationbar");
- if (toolbar) ui_standard_view_set_toolbar(view, toolbar);
-
return true;
}
return;
}
- if (!ui_standard_view_set_content(view, content, "Page8", NULL, NULL, NULL))
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page8"))
{
- dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view content");
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
ui_view_destroy(view);
return;
}
content = create_content(base, "ViewMgr Demo<br>Portrait/Landscape", prev_btn_clicked_cb, next_btn_clicked_cb);
if (!content) return false;
- if (!ui_standard_view_set_content(view, content, "Page9", NULL, NULL, NULL))
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page9"))
{
- dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view content");
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
return false;
}
content = create_landscape_content(base, "ViewMgr Demo<br>Portrait/Landscape", prev_btn_clicked_cb, next_btn_clicked_cb);
if (!content) return false;
- if (!ui_standard_view_set_content(view, content, "Page9", NULL, NULL, NULL))
+ if (!ui_view_set_content(view, content) ||
+ !ui_standard_view_set_title(view, "Page9"))
{
- dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view content");
+ dlog_print(DLOG_ERROR, LOG_TAG, "failed to set view property");
return false;
}
{
UI_VIEWMGR->pushView(new page2());
});
- this->setContent(content, "Page1");
+
+ //Set title text, content
+ this->setTitle("Page1");
+ this->setContent(content);
}
public:
UI_VIEWMGR->pushView(new page11());
});
- this->setContent(content, "Page 10");
+ //Set title text, content, indicator property
+ this->setTitle("Page10");
+ this->setContent(content);
this->setIndicator(UI_VIEW_INDICATOR_DEFAULT);
} else {
//Landscape
UI_VIEWMGR->pushView(new page11());
});
- this->setContent(content, "Page 10");
+ //Set title text, content, indicator property
+ this->setTitle("Page10");
+ this->setContent(content);
this->setIndicator(UI_VIEW_INDICATOR_OPTIMAL);
}
}
UI_VIEWMGR->pushView(new page12());
});
- this->setContent(content, "Page11");
+ //Set title text, content
+ this->setTitle("Page11");
+ this->setContent(content);
}
void onMenu(UiMenu *menu)
UI_VIEWMGR->pushView(new page13());
});
- this->setContent(content, "Page12");
-
//Title Right button
Elm_Button *rightBtn = elm_button_add(this->getBase());
elm_object_text_set(rightBtn, "popup");
},
this);
+ //Set title text, right button, content
+ this->setTitle("Page12");
+ this->setContent(content);
this->setTitleRightBtn(rightBtn);
}
UI_VIEWMGR->pushView(new page14());
});
- this->setContent(content, "Page13");
+ //Set title text, content
+ this->setTitle("Page13");
+ this->setContent(content);
}
public:
UI_VIEWMGR->pushView(new page15());
});
- this->setContent(content, "Page14");
+ //Set title text, right button, content
+ this->setTitle("Page14");
+ this->setContent(content);
}
public:
//Create a main content.
Evas_Object *content = createScrollingContent(this->getBase());
- this->setContent(content, "Page15 Scroller In Viewmgr");
-
//Title Right button
Elm_Button *rightBtn = elm_button_add(this->getBase());
elm_object_text_set(rightBtn, "Next");
},
this);
+ //Set title text, right button, content
+ this->setTitle("Page15 Scroller In Viewmgr");
+ this->setContent(content);
this->setTitleRightBtn(rightBtn);
}
view->setTitleVisible(false, true);
}, this);
- this->setContent(content, "Page16");
+ //Set title text, content
+ this->setTitle("Page16");
+ this->setContent(content);
}
public:
const int rots[2] = { 0, 90 };
this->setAvailableRotations(rots, 2);
- //Arguments: content, title, subtitle, title left button, title right button
- this->setContent(content, "Page2", NULL, leftTitleBtn, rightTitleBtn);
+ //Set title text, left/right buttons, content
+ this->setTitle("Page2");
+ this->setTitleLeftBtn(leftTitleBtn);
+ this->setTitleRightBtn(rightTitleBtn);
+ this->setContent(content);
}
public:
UI_VIEWMGR->pushView(new page4());
});
- //Arguments: content, title, subtitle, title left button, title right button
- this->setContent(content, "Page3", "Subtitle", NULL, NULL);
+ //Set title text, subtitle text, content
+ this->setTitle("Page3");
+ this->setSubtitle("subtitle");
+ this->setContent(content);
}
public:
UI_VIEWMGR->pushView(new page5());
});
- //Arguments: content, title
- this->setContent(content, "Page4. We put a long title here intentionally");
+ //Set title text, badge text, content
+ this->setTitle("Page4. We put a long title here intentionally");
this->setTitleBadge("999+");
+ this->setContent(content);
}
public:
UI_VIEWMGR->pushView(new page6());
});
+ //Set content, indicator property
this->setContent(content);
this->setIndicator(UI_VIEW_INDICATOR_HIDE);
}
UI_VIEWMGR->pushView(new page7());
});
- //Arguments: content, title
- this->setContent(content, "Page6");
Elm_Toolbar *toolbar = createToolbar(this->getBase(), "toolbar_with_title");
+
+ //Set title text, content, toolbar
+ this->setTitle("Page6");
+ this->setContent(content);
this->setToolbar(toolbar);
}
UI_VIEWMGR->pushView(new page8());
});
- //Arguments: content, title
- this->setContent(content, "Page7");
Elm_Toolbar *toolbar = createToolbar(this->getBase(), "navigationbar");
+
+ //Set title text, content, toolbar
+ this->setTitle("Page7");
+ this->setContent(content);
this->setToolbar(toolbar);
}
public:
UI_VIEWMGR->pushView(new page9());
});
- this->setContent(content, "Page 8");
+ //Set title text, content
+ this->setTitle("Page8");
+ this->setContent(content);
//Don't delete view's content when this view popped.
//This is a show case for saving this content for reuse later.
UI_VIEWMGR->pushView(new page10());
});
- this->setContent(content, "Page 9");
+ //Set title text, content, indicator property
+ this->setTitle("Page9");
+ this->setContent(content);
this->setIndicator(UI_VIEW_INDICATOR_DEFAULT);
}
UI_VIEWMGR->pushView(new page10());
});
- this->setContent(content, "Page 9");
+ //Set title text, content, indicator property
+ this->setTitle("Page9");
+ this->setContent(content);
this->setIndicator(UI_VIEW_INDICATOR_OPTIMAL);
}
*
* @return @c true if it succeeds, @c false otherwise.
*/
- bool setContent(Evas_Object *content, const char *title = NULL);
-
- /**
- * @brief Replace or set a content of the view.
- *
- * @param content A new content. It allows @c NULL for canceling the previous content.
- * @param title The label in the title area. The name of the title label part is "elm.text.title".
- * @param subtitle The label in the subtitle area. The name of the subtitle label part is "elm.text.subtitle".
- * @param title_left_btn The button in the left part of title area.
- * @param title_right_btn The button in the right part of title area.
- *
- * @return @c true if it succeeds, @c false otherwise.
- */
- bool setContent(Evas_Object *content, const char *title, const char *subtitle, Elm_Button *titleLeftBtn, Elm_Button *titleRightBtn);
+ bool setContent(Evas_Object *content);
/**
* @brief Set a title badge text.
*/
EAPI ui_standard_view *ui_standard_view_create(const char *name);
-/**
- * @brief Replace or set a content of the view.
- *
- * @param view An ui_standard_view instance.
- * @param content A new content. It allows @c NULL for canceling the previous content.
- * @param title The label in the title area. The name of the title label part is "elm.text.title".
- * @param subtitle The label in the subtitle area. The name of the subtitle label part is "elm.text.subtitle".
- * @param title_left_btn The button in the left part of title area.
- * @param title_right_btn The button in the right part of title area.
- *
- * @return @c true if it succeeds, @c false otherwise.
- *
- * @see ui_view_content_get()
- */
-EAPI bool ui_standard_view_set_content(ui_standard_view *view, Evas_Object *content, const char *title, const char *subtitle, Evas_Object *title_left_btn, Evas_Object *title_right_btn);
-
/**
* @brief Set a title text.
*
explicit UiStandardViewImpl(UiStandardView *view);
~UiStandardViewImpl();
- 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 setContent(Evas_Object *content);
bool setTitleBadge(const char *text);
bool setSubtitle(const char *text);
bool setTitleLeftBtn(Elm_Button *titleLeftBtn);
_destroyLayout();
}
-bool UiStandardViewImpl::setContent(Evas_Object *content, const char *title)
+bool UiStandardViewImpl::setContent(Evas_Object *content)
{
Elm_Layout *layout = this->getBase();
LAYOUT_VALIDATE();
elm_object_signal_emit(layout, "elm.state,elm.swallow.content,hide", "viewmgr");
}
- this->setTitle(title);
-
return true;
}
evas_object_hide(layout);
}
-bool UiStandardView::setContent(Evas_Object *content, const char *title)
+bool UiStandardView::setContent(Evas_Object *content)
{
UiView::setContent(content);
- return this->_impl->setContent(content, title);
+ return this->_impl->setContent(content);
}
bool UiStandardView::setSubtitle(const char *text)
return this->_impl->setTitle(text);
}
-bool UiStandardView::setContent(Evas_Object *content, const char *title, const char *subtitle, Elm_Button *titleLeftBtn, Elm_Button *titleRightBtn)
-{
- 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::setToolbar(Elm_Toolbar *toolbar)
{
return this->_impl->setToolbar(toolbar);
return new ui_standard_view_capi(name);
}
-EAPI bool ui_standard_view_set_content(ui_standard_view *view, Evas_Object *content, const char *title, const char *subtitle, Evas_Object *title_left_btn,
- Evas_Object *title_right_btn)
-{
- ui_standard_view_capi *capi_view;
- if (!(capi_view = validate_view(view))) return false;
- return capi_view->setContent(content, title, subtitle, title_left_btn, title_right_btn);
-}
-
EAPI bool ui_standard_view_set_title(ui_standard_view *view, const char *text)
{
ui_standard_view_capi *capi_view;