From: Woochan Lee Date: Thu, 2 Jun 2016 12:36:46 +0000 (+0900) Subject: CAPI implement. X-Git-Tag: submit/tizen/20160617.075742~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f68d768f0b2a43785deaa8c780639569cf9a76c;p=platform%2Fcore%2Fuifw%2Fui-viewmgr.git CAPI implement. Change-Id: I62a7bc4d4237c9bab3dd19ddce2297b8c16c6069 --- diff --git a/src/include/efl/mobile/c/ui_app.h b/src/include/efl/mobile/c/ui_app.h index 50d38f3..ecb698b 100644 --- a/src/include/efl/mobile/c/ui_app.h +++ b/src/include/efl/mobile/c/ui_app.h @@ -8,9 +8,11 @@ namespace efl_viewmanager extern "C" { #endif bool ui_app_init(const char *pkg, const char *locale_dir); + int ui_app_run(int argc, char **argv, ui_app_lifecycle_callback_s *event_callback, void *data); + ui_viewmgr *ui_app_viewmgr_get(); - //Is it needed? + ui_app *ui_app_app_get(); #ifdef __cplusplus } diff --git a/src/include/efl/mobile/c/ui_menu.h b/src/include/efl/mobile/c/ui_menu.h index ae567bb..ece2dca 100644 --- a/src/include/efl/mobile/c/ui_menu.h +++ b/src/include/efl/mobile/c/ui_menu.h @@ -8,14 +8,17 @@ namespace efl_viewmananger extern "C" { #endif bool ui_menu_content_set(ui_menu *menu, Elm_Ctxpopup *ctxpopup); + Elm_Ctxpopup ui_menu_content_get(ui_menu *menu); Elm_Ctxpopup *ui_menu_content_unset(ui_menu *menu); + bool ui_menu_activate(ui_menu *menu); bool ui_menu_deactivate(ui_menu *menu); bool ui_menu_activate_get(ui_menu *menu); - //Is it needed? + Evas_Object *ui_menu_base_get(ui_menu *menu); + int ui_menu_degree_get(ui_menu *menu); - Elm_Ctxpopup ui_menu_content_get(ui_menu *menu); + ui_view *ui_menu_view_get(ui_menu *menu); #ifdef __cplusplus } diff --git a/src/include/efl/mobile/c/ui_popup.h b/src/include/efl/mobile/c/ui_popup.h index 660547e..36679fe 100644 --- a/src/include/efl/mobile/c/ui_popup.h +++ b/src/include/efl/mobile/c/ui_popup.h @@ -8,16 +8,20 @@ namespace efl_viewmananger extern "C" { #endif ui_popup *ui_popup_create(ui_view *view); + void ui_popup_del(ui_popup *popup); + bool ui_popup_content_set(ui_popup *popup, Elm_Popup *elm_popup); + Elm_Popup ui_popup_content_get(ui_popup *popup); Elm_Popup *ui_popup_content_unset(ui_popup *popup); + bool ui_popup_activate(ui_popup *popup); bool ui_popup_deactivate(ui_popup *popup); - void ui_popup_del(ui_popup *popup); bool ui_popup_activate_get(ui_popup *popup); - //Is it needed? + Evas_Object *ui_popup_base_get(ui_popup *popup); + int ui_popup_degree_get(ui_popup *popup); - Elm_Popup ui_popup_content_get(ui_popup *popup); + ui_view *ui_popup_view_get(ui_popup *popup); #ifdef __cplusplus } diff --git a/src/include/efl/mobile/c/ui_view.h b/src/include/efl/mobile/c/ui_view.h index a9b0e06..e664ea2 100644 --- a/src/include/efl/mobile/c/ui_view.h +++ b/src/include/efl/mobile/c/ui_view.h @@ -40,43 +40,69 @@ extern "C" { ui_view_event_back_cb back; ui_view_event_menu_cb menu; } ui_view_event_callback_s; +//================================== view common APIs ======================================== + + bool ui_view_lifecycle_callbacks_set(ui_view *view, ui_view_lifecycle_callback_s *lifecycle_callback, void *data); + bool ui_view_event_callbacks_set(ui_view *view, ui_view_event_callback_s *event_callback, void *data); + + Evas_Object* ui_view_base_get(ui_view *view); + + Evas_Object *ui_view_content_unset(ui_view *view); + + void ui_view_indicator_set(ui_view *view, ui_view_indicator indicator); + ui_view_indicator ui_view_indicator_get(ui_view *view); + + void ui_view_removable_content_set(ui_view *view, bool remove); + bool ui_view_removable_content_get(ui_view *view); + + int ui_view_degree_get(ui_view *view); + + bool ui_view_transition_style_set(ui_view *view, const char *style); + const char *ui_view_transition_style_get(ui_view *view); + + ui_menu *ui_view_menu_get(ui_view *view); + + bool ui_view_name_set(ui_view *view, const char *name); + const char *ui_view_name_get(ui_view *view); + + ui_view_state ui_view_state_get(ui_view *view); + + Evas_Object *ui_view_content_get(ui_view *view); + +//================================ ui_standard view APIs ===================================== ui_view *ui_standard_view_create(const char *name); + bool ui_standard_view_content_set(ui_view *view, Evas_Object *content, const char *title, const char *subtitle, Evas_Object *title_left_btn, Evas_Object *title_right_btn); - bool ui_standard_view_title_badge_set(ui_view *view, const char *badge_text); + + bool ui_standard_view_title_set(ui_view *view, const char *text); + bool ui_standard_view_sub_title_set(ui_view *view, const char *text); + + bool ui_standard_view_title_badge_set(ui_view *view, const char *badge_text); + bool ui_standard_view_title_right_btn_set(ui_view *view, Evas_Object *title_right_btn); - bool ui_standard_view_title_left_btn_set(ui_view *view, Evas_Object *title_left_btn); - bool ui_standard_view_title_set(ui_view *view, const char *text); - bool ui_standard_view_toolbar_set(ui_view *view, Elm_Toolbar *toolbar); - bool ui_standard_view_title_visible_set(ui_view *view, bool visible, bool anim); - Elm_Button ui_standard_view_title_right_btn_unset(ui_view *view); - Elm_Button ui_standard_view_title_left_btn_unset(ui_view *view); - Elm_toolbar ui_standard_view_toolbar_unset(ui_view *view); Elm_Button ui_standard_view_title_right_btn_get(ui_view *view); + Elm_Button ui_standard_view_title_right_btn_unset(ui_view *view); + + bool ui_standard_view_title_left_btn_set(ui_view *view, Evas_Object *title_left_btn); Elm_Button ui_standard_view_title_left_btn_get(ui_view *view); + Elm_Button ui_standard_view_title_left_btn_unset(ui_view *view); + + bool ui_standard_view_toolbar_set(ui_view *view, Elm_Toolbar *toolbar); Elm_toolbar ui_standard_view_toolbar_get(ui_view *view); + Elm_toolbar ui_standard_view_toolbar_unset(ui_view *view); + + bool ui_standard_view_title_visible_set(ui_view *view, bool visible, bool anim); + +//==================================== ui_view APIs ========================================== ui_view *ui_view_create(const char *name); - bool ui_view_lifecycle_callbacks_set(ui_view *view, ui_view_lifecycle_callback_s *lifecycle_callback, void *data); - Evas_Object* ui_view_base_get(ui_view *view); + bool ui_view_content_set(ui_view *view, Evas_Object *content); - Evas_Object *ui_view_content_unset(ui_view *view); - void ui_view_indicator_set(ui_view *view, ui_view_indicator indicator); - void ui_view_removable_content_set(ui_view *view, bool remove); - bool ui_view_event_callbacks_set(ui_view *view, ui_view_event_callback_s *event_callback, void *data); - int ui_view_degree_get(ui_view *view); - bool ui_view_transition_style_set(ui_view *view, const char *style); - ui_menu *ui_view_menu_get(ui_view *view); - bool ui_view_name_set(ui_view *view, const char *name); - const char *ui_view_transition_style_get(ui_view *view); - const char *ui_view_name_get(ui_view *view); - Evas_Object *ui_view_content_get(ui_view *view); - ui_view_state ui_view_state_get(ui_view *view); - bool ui_view_removable_content_get(ui_view *view); - ui_view_indicator ui_view_indicator_get(ui_view *view); + #ifdef __cplusplus } diff --git a/src/include/efl/mobile/c/ui_viewmgr.h b/src/include/efl/mobile/c/ui_viewmgr.h index e48a211..b0adb55 100644 --- a/src/include/efl/mobile/c/ui_viewmgr.h +++ b/src/include/efl/mobile/c/ui_viewmgr.h @@ -6,23 +6,30 @@ using namespace efl_viewmananger; #ifdef __cplusplus extern "C" { #endif - ui_view *ui_viewmgr_view_push_insert_before(ui_viewmgr *viewmgr, ui_view *view, ui_view *before); - ui_view *ui_viewmgr_view_push_insert_after(ui_viewmgr *viewmgr, ui_view *view, ui_view *after); ui_view *ui_viewmgr_view_push(ui_viewmgr *viewmgr, ui_view *view); + bool ui_viewmgr_view_push_insert_before(ui_viewmgr *viewmgr, ui_view *view, ui_view *before); + bool ui_viewmgr_view_push_insert_after(ui_viewmgr *viewmgr, ui_view *view, ui_view *after); bool ui_viewmgr_view_pop(ui_viewmgr *viewmgr); + bool ui_viewmgr_activate(ui_viewmgr *viewmgr); bool ui_viewmgr_deactivate(ui_viewmgr *viewmgr); + Elm_Win ui_viewmgr_window_get(ui_viewmgr *viewmgr); + Elm_Conformant ui_viewmgr_conformant_get(ui_viewmgr *viewmgr); + ui_view *ui_viewmgr_last_view_get(ui_viewmgr *viewmgr); + ui_view *ui_viewmgr_view_get(ui_viewmgr *viewmgr, int idx); + Evas_Object *ui_viewmgr_base_get(ui_viewmgr *viewmgr); - unsigned int ui_viewmgr_view_count_get(ui_viewmgr *viewmgr); - //Is it needed? + + int ui_viewmgr_view_count_get(ui_viewmgr *viewmgr); + bool ui_viewmgr_soft_key_need_get(ui_viewmgr *viewmgr); + ui_viewmgr *ui_viewmgr_viewmgr_get(); - //TODO #define UI_VIEWMGR_DEACTIVATE() (ui_viewmgr_deactivate(ui_app_viewmgr_get())) #define UI_VIEWMGR_VIEW_PUSH(x) (ui_viewmgr_view_push(ui_app_viewmgr_get(), x)) #define UI_VIEWMGR_VIEW_POP() (ui_viewmgr_view_pop(ui_app_viewmgr_get())) diff --git a/src/lib/efl/mobile/c/ui_app.cpp b/src/lib/efl/mobile/c/ui_app.cpp index 6e6bb97..564b2d1 100644 --- a/src/lib/efl/mobile/c/ui_app.cpp +++ b/src/lib/efl/mobile/c/ui_app.cpp @@ -101,7 +101,6 @@ extern "C" { ui_app *ui_app_app_get() { - //TODO - return NULL; + return app; } } diff --git a/src/lib/efl/mobile/c/ui_menu.cpp b/src/lib/efl/mobile/c/ui_menu.cpp index 7ebfeca..088feb4 100644 --- a/src/lib/efl/mobile/c/ui_menu.cpp +++ b/src/lib/efl/mobile/c/ui_menu.cpp @@ -15,52 +15,92 @@ extern "C" { return menu->set_content(ctxpopup); } + Elm_Ctxpopup ui_menu_content_get(ui_menu *menu) + { + if (!menu) + { + LOGE("Invalid Menu"); + return NULL; + } + + return menu->get_content(); + } + Elm_Ctxpopup *ui_menu_content_unset(ui_menu *menu) { - //TODO - return NULL; + if (!menu) + { + LOGE("Invalid Menu"); + return NULL; + } + + return menu->unset_content(); } bool ui_menu_activate(ui_menu *menu) { - //TODO - return 1; + if (!menu) + { + LOGE("Invalid Menu"); + return false; + } + + return menu->activate(); } bool ui_menu_deactivate(ui_menu *menu) { - //TODO - return 1; + if (!menu) + { + LOGE("Invalid Menu"); + return false; + } + + return menu->deactivate(); } bool ui_menu_activate_get(ui_menu *menu) { - //TODO - return 1; + if (!menu) + { + LOGE("Invalid Menu"); + return false; + } + + return menu->is_activated(); } Evas_Object *ui_menu_base_get(ui_menu *menu) { - //TODO - return NULL; + if (!menu) + { + LOGE("Invalid Menu"); + return NULL; + } + + return menu->get_base(); } int ui_menu_degree_get(ui_menu *menu) { - //TODO - return 0; - } + if (!menu) + { + LOGE("Invalid Menu"); + return -1; + } - Elm_Ctxpopup ui_menu_content_get(ui_menu *menu) - { - //TODO - return NULL; + return menu->get_degree(); } ui_view *ui_menu_view_get(ui_menu *menu) { - //TODO - return NULL; + if (!menu) + { + LOGE("Invalid Menu"); + return NULL; + } + + return menu->get_view(); } } diff --git a/src/lib/efl/mobile/c/ui_popup.cpp b/src/lib/efl/mobile/c/ui_popup.cpp index bae909e..efecba2 100644 --- a/src/lib/efl/mobile/c/ui_popup.cpp +++ b/src/lib/efl/mobile/c/ui_popup.cpp @@ -9,6 +9,17 @@ extern "C" { return new ui_popup(view); } + void ui_popup_del(ui_popup *popup) + { + if (!popup) + { + LOGE("Invalid popup"); + return; + } + + delete(popup); + } + bool ui_popup_content_set(ui_popup *popup, Elm_Popup *elm_popup) { if (!popup) @@ -26,10 +37,26 @@ extern "C" { return popup->set_content(elm_popup); } + Elm_Popup ui_popup_content_get(ui_popup *popup) + { + if (!popup) + { + LOGE("Invalid popup"); + return NULL; + } + + return popup->get_content(); + } + Elm_Popup *ui_popup_content_unset(ui_popup *popup) { - //TODO - return NULL; + if (!popup) + { + LOGE("Invalid popup"); + return NULL; + } + + return popup->unset_content(); } bool ui_popup_activate(ui_popup *popup) @@ -44,49 +71,57 @@ extern "C" { } bool ui_popup_deactivate(ui_popup *popup) - { - //TODO - return 1; - } - - void ui_popup_del(ui_popup *popup) { if (!popup) { LOGE("Invalid popup"); - return; + return false; } - delete(popup); + return popup->deactivate(); } bool ui_popup_activate_get(ui_popup *popup) { - //TODO - return 1; + if (!popup) + { + LOGE("Invalid popup"); + return false; + } + + return popup->is_activated(); } Evas_Object *ui_popup_base_get(ui_popup *popup) { - //TODO - return NULL; + if (!popup) + { + LOGE("Invalid popup"); + return NULL; + } + + return popup->get_base(); } int ui_popup_degree_get(ui_popup *popup) { - //TODO - return 1; - } + if (!popup) + { + LOGE("Invalid popup"); + return -1; + } - Elm_Popup ui_popup_content_get(ui_popup *popup) - { - //TODO - return NULL; + return popup->get_degree(); } ui_view *ui_popup_view_get(ui_popup *popup) { - //TODO - return NULL; + if (!popup) + { + LOGE("Invalid popup"); + return NULL; + } + + return popup->get_view(); } } diff --git a/src/lib/efl/mobile/c/ui_view.cpp b/src/lib/efl/mobile/c/ui_view.cpp index 1525805..604a802 100644 --- a/src/lib/efl/mobile/c/ui_view.cpp +++ b/src/lib/efl/mobile/c/ui_view.cpp @@ -179,17 +179,9 @@ public: }; extern "C" { - ui_view* ui_standard_view_create(const char *name) - { - return new ui_standard_view_capi(name); - } - - ui_view* ui_view_create(const char *name) - { - return new ui_view_capi(name); - } +//================================== view common APIs ======================================== - bool ui_view_lifecycle_callbacks_set(ui_view *view, ui_view_lifecycle_callback_s *lifecycle_callback, void *data) +bool ui_view_lifecycle_callbacks_set(ui_view *view, ui_view_lifecycle_callback_s *lifecycle_callback, void *data) { if (!view) { @@ -214,7 +206,9 @@ extern "C" { return true; } - Evas_Object* ui_view_base_get(ui_view *view) + + bool ui_view_event_callbacks_set(ui_view *view, + ui_view_event_callback_s *event_callback, void *data) { if (!view) { @@ -222,12 +216,25 @@ extern "C" { return false; } - ui_standard_view_capi *capi_view = static_cast(view); + //FIXME: Maybe... There is a more nice way for it... + ui_standard_view_capi *capi_standard_view = dynamic_cast(view); + if (capi_standard_view) + { + if (event_callback) capi_standard_view->set_event_callback(event_callback); + if (data) capi_standard_view->set_event_data(data); + } + else + { + ui_view_capi *capi_view = dynamic_cast(view); + + if (event_callback) capi_view->set_event_callback(event_callback); + if (data) capi_view->set_event_data(data); + } - return capi_view->get_base(); + return true; } - bool ui_view_content_set(ui_view *view, Evas_Object *content) + Evas_Object* ui_view_base_get(ui_view *view) { if (!view) { @@ -235,77 +242,125 @@ extern "C" { return false; } - ui_view_capi *capi_view = static_cast(view); + ui_standard_view_capi *capi_standard_view = dynamic_cast(view); + if (capi_standard_view) + return capi_standard_view->get_base(); + else + { + ui_view_capi *capi_view = dynamic_cast(view); - return capi_view->set_content(content); + return capi_view->get_base(); + } } Evas_Object *ui_view_content_unset(ui_view *view) { - //TODO - return NULL; + if (!view) + { + LOGE("Invalid View"); + return NULL; + } + + ui_standard_view_capi *capi_standard_view = dynamic_cast(view); + if (capi_standard_view) + return capi_standard_view->unset_content(); + else + { + ui_view_capi *capi_view = dynamic_cast(view); + + return capi_view->unset_content(); + } } - bool ui_standard_view_content_set(ui_view *view, Evas_Object *content, - const char *title, const char *subtitle, - Evas_Object *title_left_btn, Evas_Object *title_right_btn) + void ui_view_indicator_set(ui_view *view, ui_view_indicator indicator) { if (!view) { LOGE("Invalid View"); - return false; + return; } - ui_standard_view_capi *capi_view = static_cast(view); - - return capi_view->set_content(content, title, subtitle, title_left_btn, title_right_btn); + return view->set_indicator(indicator); } - bool ui_standard_view_title_badge_set(ui_view *view, const char *badge_text) + ui_view_indicator ui_view_indicator_get(ui_view *view) { if (!view) { LOGE("Invalid View"); - return false; + return -1; } - ui_standard_view_capi *capi_view = static_cast(view); + return view->get_indicator(); + } - return capi_view->set_title_badge(badge_text); + void ui_view_removable_content_set(ui_view *view, bool remove) + { + if (!view) + { + LOGE("Invalid View"); + return; + } + + view->set_removable_content(remove); } - bool ui_standard_view_sub_title_set(ui_view *view, const char *text) + bool ui_view_removable_content_get(ui_view *view) { - //TODO - return 1; + if (!view) + { + LOGE("Invalid View"); + return false; + } + + return view->get_removable_content(); } - bool ui_standard_view_title_left_btn_set(ui_view *view, Evas_Object *title_left_btn) + int ui_view_degree_get(ui_view *view) { - //TODO - return 1; + if (!view) + { + LOGE("Invalid View"); + return -1; + } + + return view->get_degree(); } - bool ui_standard_view_title_set(ui_view *view, const char *text) + bool ui_view_transition_style_set(ui_view *view, const char *style) { - //TODO - return 1; + if (!view) + { + LOGE("Invalid View"); + return false; + } + + return view->set_transition_style(style); } - void ui_view_indicator_set(ui_view *view, ui_view_indicator indicator) + const char *ui_view_transition_style_get(ui_view *view) { if (!view) { LOGE("Invalid View"); - return; + return NULL; } - ui_view_capi *capi_view = static_cast(view); + return view->get_transition_style(); + } - capi_view->set_indicator(indicator); + ui_menu *ui_view_menu_get(ui_view *view) + { + if (!view) + { + LOGE("Invalid View"); + return NULL; + } + + return view->get_menu(); } - bool ui_standard_view_toolbar_set(ui_view *view, Elm_Toolbar *toolbar) + bool ui_view_name_set(ui_view *view, const char *name) { if (!view) { @@ -313,184 +368,255 @@ extern "C" { return false; } - ui_standard_view_capi *capi_view = static_cast(view); + return view->set_name(name); - return capi_view->set_toolbar(toolbar); } - void ui_view_removable_content_set(ui_view *view, bool remove) + const char *ui_view_name_get(ui_view *view) { if (!view) { LOGE("Invalid View"); - return; + return NULL; } - ui_standard_view_capi *capi_view = static_cast(view); + return view->get_name(); - capi_view->set_removable_content(remove); } - bool ui_view_event_callbacks_set(ui_view *view, - ui_view_event_callback_s *event_callback, void *data) + ui_view_state ui_view_state_get(ui_view *view) { if (!view) { LOGE("Invalid View"); - return false; + return -1; } - //FIXME: Maybe... There is a more nice way for it... - ui_standard_view_capi *capi_standard_view = dynamic_cast(view); - if (capi_standard_view) + return view->get_state(); + } + + Evas_Object *ui_view_content_get(ui_view *view) + { + if (!view) { - if (event_callback) capi_standard_view->set_event_callback(event_callback); - if (data) capi_standard_view->set_event_data(data); + LOGE("Invalid View"); + return NULL; } - else - { - ui_view_capi *capi_view = dynamic_cast(view); - if (event_callback) capi_view->set_event_callback(event_callback); - if (data) capi_view->set_event_data(data); - } + return view->get_content(); - return true; } - int ui_view_degree_get(ui_view *view) +//================================ ui_standard view APIs ===================================== + + ui_view* ui_standard_view_create(const char *name) + { + return new ui_standard_view_capi(name); + } + + bool ui_standard_view_content_set(ui_view *view, Evas_Object *content, + const char *title, const char *subtitle, + Evas_Object *title_left_btn, Evas_Object *title_right_btn) { if (!view) { LOGE("Invalid View"); - return -1; + return false; } ui_standard_view_capi *capi_view = static_cast(view); - return capi_view->get_degree(); + return capi_view->set_content(content, title, subtitle, title_left_btn, title_right_btn); } - bool ui_standard_view_title_right_btn_set(ui_view *view, Evas_Object *title_right_btn) + + bool ui_standard_view_title_set(ui_view *view, const char *text) { if (!view) { LOGE("Invalid View"); - return -1; + return false; } ui_standard_view_capi *capi_view = static_cast(view); - return capi_view->set_title_right_btn(title_right_btn); + return capi_view->set_sutitle(text); } - bool ui_view_transition_style_set(ui_view *view, const char *style) + bool ui_standard_view_sub_title_set(ui_view *view, const char *text) { if (!view) { LOGE("Invalid View"); - return -1; + return false; } ui_standard_view_capi *capi_view = static_cast(view); - return capi_view->set_transition_style(style); + return capi_view->set_subtitle(); } - bool ui_standard_view_title_visible_set(ui_view *view, bool visible, bool anim) + bool ui_standard_view_title_badge_set(ui_view *view, const char *badge_text) { if (!view) { LOGE("Invalid View"); - return -1; + return false; } ui_standard_view_capi *capi_view = static_cast(view); - return capi_view->set_title_visible(visible, anim); + return capi_view->set_title_badge(badge_text); } - Elm_Button ui_standard_view_title_right_btn_unset(ui_view *view) + bool ui_standard_view_title_right_btn_set(ui_view *view, Evas_Object *title_right_btn) { - //TODO - return NULL; - } + if (!view) + { + LOGE("Invalid View"); + return false; + } - Elm_Button ui_standard_view_title_left_btn_unset(ui_view *view) - { - //TODO - return NULL; - } + ui_standard_view_capi *capi_view = static_cast(view); - Elm_toolbar ui_standard_view_toolbar_unset(ui_view *view) - { - //TODO - return NULL; + return capi_view->set_title_right_btn(title_right_btn); } Elm_Button ui_standard_view_title_right_btn_get(ui_view *view) { - //TODO - return NULL; + if (!view) + { + LOGE("Invalid View"); + return NULL; + } + + ui_standard_view_capi *capi_view = static_cast(view); + + return capi_view->get_title_right_btn(); } - Elm_Button ui_standard_view_title_left_btn_get(ui_view *view) + Elm_Button ui_standard_view_title_right_btn_unset(ui_view *view) { - //TODO - return NULL; + if (!view) + { + LOGE("Invalid View"); + return NULL; + } + + ui_standard_view_capi *capi_view = static_cast(view); + + return capi_view->unset_title_right_btn(); } - Elm_toolbar ui_standard_view_toolbar_get(ui_view *view) + bool ui_standard_view_title_left_btn_set(ui_view *view, Evas_Object *title_left_btn) { - //TODO - return NULL; + if (!view) + { + LOGE("Invalid View"); + return false; + } + + ui_standard_view_capi *capi_view = static_cast(view); + + return capi_view->set_title_left_btn(title_right_btn); } - ui_menu *ui_view_menu_get(ui_view *view) + Elm_Button ui_standard_view_title_left_btn_get(ui_view *view) { - //TODO - return NULL; + if (!view) + { + LOGE("Invalid View"); + return NULL; + } + + ui_standard_view_capi *capi_view = static_cast(view); + + return capi_view->get_title_left_btn(); } - bool ui_view_name_set(ui_view *view, const char *name) + Elm_Button ui_standard_view_title_left_btn_unset(ui_view *view) { - //TODO - return 1; + if (!view) + { + LOGE("Invalid View"); + return NULL; + } + + ui_standard_view_capi *capi_view = static_cast(view); + + return capi_view->unset_title_right_btn(); } - const char *ui_view_transition_style_get(ui_view *view) + + bool ui_standard_view_toolbar_set(ui_view *view, Elm_Toolbar *toolbar) { - //TODO - return NULL; + if (!view) + { + LOGE("Invalid View"); + return false; + } + + ui_standard_view_capi *capi_view = static_cast(view); + + return capi_view->set_toolbar(toolbar); } - const char *ui_view_name_get(ui_view *view) + Elm_toolbar ui_standard_view_toolbar_get(ui_view *view) { - //TODO - return NULL; + if (!view) + { + LOGE("Invalid View"); + return NULL; + } + + ui_standard_view_capi *capi_view = static_cast(view); + + return capi_view->get_toolbar(); } - Evas_Object *ui_view_content_get(ui_view *view) + Elm_toolbar ui_standard_view_toolbar_unset(ui_view *view) { - //TODO - return NULL; + if (!view) + { + LOGE("Invalid View"); + return NULL; + } + + ui_standard_view_capi *capi_view = static_cast(view); + + return capi_view->unset_toolbar(); } - ui_view_state ui_view_state_get(ui_view *view) + bool ui_standard_view_title_visible_set(ui_view *view, bool visible, bool anim) { - //TODO - return 0; + if (!view) + { + LOGE("Invalid View"); + return -1; + } + + ui_standard_view_capi *capi_view = static_cast(view); + + return capi_view->set_title_visible(visible, anim); } - bool ui_view_removable_content_get(ui_view *view) +//==================================== ui_view APIs ========================================== + + ui_view* ui_view_create(const char *name) { - //TODO - return 1; + return new ui_view_capi(name); } - ui_view_indicator ui_view_indicator_get(ui_view *view) + bool ui_view_content_set(ui_view *view, Evas_Object *content) { - //TODO - return 0; + if (!view) + { + LOGE("Invalid View"); + return false; + } + + ui_view_capi *capi_view = static_cast(view); + + return capi_view->set_content(content); } } diff --git a/src/lib/efl/mobile/c/ui_viewmgr.cpp b/src/lib/efl/mobile/c/ui_viewmgr.cpp index b81375c..bcb6896 100644 --- a/src/lib/efl/mobile/c/ui_viewmgr.cpp +++ b/src/lib/efl/mobile/c/ui_viewmgr.cpp @@ -4,84 +4,151 @@ using namespace efl_viewmanager; extern "C" { - ui_view *ui_viewmgr_view_push_insert_before(ui_viewmgr *viewmgr, ui_view *view, ui_view *before) + ui_view *ui_viewmgr_view_push(ui_viewmgr *viewmgr, ui_view *view) { - //TODO - return NULL; + if (!viewmgr || !view) + { + LOGE("Invalid Parameter viewmgr = %p, view = %p", viewmgr, view); + return NULL; + } + + return static_cast(viewmgr->push_view(view)); } - ui_view *ui_viewmgr_view_push_insert_after(ui_viewmgr *viewmgr, ui_view *view, ui_view *after) + bool ui_viewmgr_view_push_insert_before(ui_viewmgr *viewmgr, ui_view *view, ui_view *before) { - //TODO - return NULL; + if (!viewmgr || !view || !before) + { + LOGE("Invalid Parameter viewmgr = %p, view = %p, before = %p", viewmgr, view, before); + return -1; + } + + return viewmgr->insert_view_before(view, before); } - ui_view *ui_viewmgr_view_push(ui_viewmgr *viewmgr, ui_view *view) + bool ui_viewmgr_view_push_insert_after(ui_viewmgr *viewmgr, ui_view *view, ui_view *after) { - return static_cast(viewmgr->push_view(view)); + if (!viewmgr || !view || !after) + { + LOGE("Invalid Parameter viewmgr = %p, view = %p, after = %p", viewmgr, view, after); + return -1; + } + + return viewmgr->insert_view_after(view, after); } bool ui_viewmgr_view_pop(ui_viewmgr *viewmgr) { + if (!viewmgr) + { + LOGE("Invalid Viewmgr"); + return -1; + } + return viewmgr->pop_view(); } bool ui_viewmgr_activate(ui_viewmgr *viewmgr) { - //TODO - return 1; + if (!viewmgr) + { + LOGE("Invalid Viewmgr"); + return -1; + } + + return viewmgr->activate(); } bool ui_viewmgr_deactivate(ui_viewmgr *viewmgr) { + if (!viewmgr) + { + LOGE("Invalid Viewmgr"); + return -1; + } + return viewmgr->deactivate(); } Elm_Win ui_viewmgr_window_get(ui_viewmgr *viewmgr) { - //TODO - return NULL; + if (!viewmgr) + { + LOGE("Invalid Viewmgr"); + return NULL; + } + + return viewmgr->get_window(); } Elm_Conformant ui_viewmgr_conformant_get(ui_viewmgr *viewmgr) { - //TODO - return NULL; + if (!viewmgr) + { + LOGE("Invalid Viewmgr"); + return NULL; + } + + return viewmgr->get_conformant(); } ui_view *ui_viewmgr_last_view_get(ui_viewmgr *viewmgr) { - //TODO - return NULL; + if (!viewmgr) + { + LOGE("Invalid Viewmgr"); + return NULL; + } + + return static_cast(viewmgr->get_last_view()); } ui_view *ui_viewmgr_view_get(ui_viewmgr *viewmgr, int idx) { - //TODO - return NULL; + if (!viewmgr) + { + LOGE("Invalid Viewmgr"); + return NULL; + } + + return static_cast(viewmgr->get_view(idx)); } Evas_Object *ui_viewmgr_base_get(ui_viewmgr *viewmgr) { - //TODO - return NULL; + if (!viewmgr) + { + LOGE("Invalid Viewmgr"); + return NULL; + } + + return viewmgr->get_base(); } - unsigned int ui_viewmgr_view_count_get(ui_viewmgr *viewmgr) + int ui_viewmgr_view_count_get(ui_viewmgr *viewmgr) { - //TODO - return 1; + if (!viewmgr) + { + LOGE("Invalid Viewmgr"); + return -1; + } + + return viewmgr->get_view_count(); } bool ui_viewmgr_soft_key_need_get(ui_viewmgr *viewmgr) { - //TODO - return 1; + if (!viewmgr) + { + LOGE("Invalid Viewmgr"); + return false; + } + + return viewmgr->need_soft_key(); } ui_viewmgr *ui_viewmgr_viewmgr_get() { - //TODO - return NULL; + return UI_VIEWMGR; } }