From: Nibha Sharma Date: Fri, 11 Dec 2020 10:30:03 +0000 (+0530) Subject: [TBT][tbtcoreapp][NonACR][TSIX-6194, Guide overlap with tc disaply issue fix] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2ffcfcc3fb4d6e1c51507df20aafd7d344a420a;p=test%2Ftct%2Fnative%2Fbehavior.git [TBT][tbtcoreapp][NonACR][TSIX-6194, Guide overlap with tc disaply issue fix] Change-Id: Iedf2141dd2d292812e823baf52353cae65a33257 Signed-off-by: Nibha Sharma --- diff --git a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk index 99ec066..4e2b85b 100755 Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ diff --git a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk index c5293a1..5821da7 100755 Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk differ diff --git a/tbtcoreapp/src/view/tbt-animation-view.c b/tbtcoreapp/src/view/tbt-animation-view.c old mode 100644 new mode 100755 index e93ddaf..bd14143 --- a/tbtcoreapp/src/view/tbt-animation-view.c +++ b/tbtcoreapp/src/view/tbt-animation-view.c @@ -73,33 +73,28 @@ static Elm_Transit *create_transit(Evas_Object* button, Eina_Bool fade_add, Eina static void _app_destroy_cb(void* this); static Eina_Bool _animation_view_timer_cb(void *data); - +static animation_view *this = NULL; /** - * @function animation_view_add - * @since_tizen 2.3 - * @description Animation View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return animation_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -animation_view *animation_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); - animation_view *this = NULL; - this = calloc(1, sizeof(animation_view)); - RETVM_IF(!this, NULL, "calloc failed"); + RETM_IF(NULL == data, "data is null"); - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); - tbt_info->layout_group = "2_part_cnt_btn"; - tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(NULL == this->view, NULL, "navi is null"); - - this->x = 0; + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->x = 0; this->y = 0; @@ -199,6 +194,52 @@ animation_view *animation_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Ob } this->timer = ecore_timer_add(5, _animation_view_timer_cb, this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function animation_view_add + * @since_tizen 2.3 + * @description Animation View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return animation_view* + */ +animation_view *animation_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); + + this = calloc(1, sizeof(animation_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-attachpanel-view.c b/tbtcoreapp/src/view/tbt-attachpanel-view.c index 09431c3..9626d6d 100755 --- a/tbtcoreapp/src/view/tbt-attachpanel-view.c +++ b/tbtcoreapp/src/view/tbt-attachpanel-view.c @@ -86,6 +86,47 @@ static void send_button_clicked_cb(void *data, Evas_Object *obj, void *event_inf static void _result_cb(attach_panel_h attach_panel, attach_panel_content_category_e content_category, app_control_h result, app_control_result_e result_code, void *data); static void _attach_panel_event_cb(attach_panel_h attach_panel, attach_panel_event_e event, void *event_info, void *user_data); static char* get_attach_panel_error(attach_panel_error_e error); +static attachpanel_view *this = NULL; + +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->attach_panel = NULL; + create_main_view(this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function attachpanel_view_add @@ -96,10 +137,9 @@ static char* get_attach_panel_error(attach_panel_error_e error); */ attachpanel_view *attachpanel_view_add(Evas_Object *navi, Evas_Object *conform, tbt_info *tbt_info, Elm_Object_Item *item) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - RETVM_IF(NULL == conform, NULL, "conform is null"); + RETVM_IF(NULL == navi, NULL, "navi is null"); + RETVM_IF(NULL == conform, NULL, "conform is null"); - attachpanel_view *this = NULL; this = calloc(1, sizeof(attachpanel_view)); RETVM_IF(!this, NULL, "calloc failed"); this->view = calloc(1, sizeof(common_view)); @@ -111,12 +151,12 @@ attachpanel_view *attachpanel_view_add(Evas_Object *navi, Evas_Object *conform, common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); this->conform = conform; - RETVM_IF(NULL == this->view, NULL, "navi is null"); - - this->attach_panel = NULL; + RETVM_IF(NULL == this->view, NULL, "navi is null"); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); - create_main_view(this); return this; } diff --git a/tbtcoreapp/src/view/tbt-autofill-view.c b/tbtcoreapp/src/view/tbt-autofill-view.c index 8312ef9..b023e58 100755 --- a/tbtcoreapp/src/view/tbt-autofill-view.c +++ b/tbtcoreapp/src/view/tbt-autofill-view.c @@ -51,6 +51,7 @@ char *value = NULL; static void _app_destroy_cb(void* this); static void save_autofill_view_info(autofill_h ah); +static autofill_view *this = NULL; static void connection_status_changed_cb(autofill_h ah, autofill_connection_status_e status, void *user_data) { @@ -288,12 +289,91 @@ static void autofill_app_launch_button_pressed_cb(void *data, Evas_Object *obj, send_fill_request(g_ah); } +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->input_entry1 = ui_utils_entry_add(this, this->view->layout, ELM_INPUT_PANEL_LAYOUT_NORMAL, ""); + elm_entry_input_panel_language_set(this->input_entry1, ELM_INPUT_PANEL_LANG_AUTOMATIC); + Elm_Input_Panel_Lang lang = elm_entry_input_panel_language_get(this->input_entry1); + char msg[100]; + snprintf(msg, sizeof(msg), "Autofill Input : %d", lang ); + elm_object_part_text_set(this->input_entry1, PART_ENTRY_GUIDE, msg); + input_entry1_handle = this->input_entry1; + elm_object_part_content_set(this->view->layout, "main_button", this->input_entry1); + evas_object_smart_callback_add(this->input_entry1, "changed", editfield_changed_cb, this->view->layout); + evas_object_smart_callback_add(this->input_entry1, "preedit,changed", editfield_changed_cb, this->view->layout); + + this->btn_autofill = ui_utils_push_button_add(this, this->view->layout, "Login with Autofill", autofill_app_launch_button_pressed_cb); + elm_object_part_content_set(this->view->layout, "controller_part", this->btn_autofill); + evas_object_event_callback_add(this->input_entry1, EVAS_CALLBACK_DEL, entry_del_cb, this->view->layout); + autofill_item_create(&ai_h); + autofill_item_set_autofill_hint(ai_h, AUTOFILL_HINT_ID); + autofill_item_set_id(ai_h, "id"); + autofill_item_set_label(ai_h, "ID"); + autofill_item_set_sensitive_data(ai_h, false); + + // create autofill item for save + autofill_save_item_create(&si_h); + autofill_save_item_set_autofill_hint(si_h, AUTOFILL_HINT_ID); + autofill_save_item_set_id(si_h, "id"); + autofill_save_item_set_label(si_h, "ID"); + autofill_save_item_set_sensitive_data(si_h, false); + + int ret; + ret = autofill_create(&g_ah); + if (ret == AUTOFILL_ERROR_NONE) + DBG("Succeeded to create autofill"); + else + { + DBG("Failed to create autofill. error code: 0x%X, error message: '%s'", ret, get_error_message(ret)); + return this; + } + + ret = autofill_connect(g_ah, connection_status_changed_cb, NULL); + if (ret == AUTOFILL_ERROR_NONE) + DBG("Succeeded to connect"); + else + DBG("Failed to connect. error code: 0x%X, error message: '%s'", ret, get_error_message(ret)); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} autofill_view *autofill_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) { RETVM_IF(NULL == navi, NULL, "navi is null"); - autofill_view *this = NULL; + this = calloc(1, sizeof(autofill_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -307,48 +387,10 @@ autofill_view *autofill_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Obje common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->input_entry1 = ui_utils_entry_add(this, this->view->layout, ELM_INPUT_PANEL_LAYOUT_NORMAL, ""); - elm_entry_input_panel_language_set(this->input_entry1, ELM_INPUT_PANEL_LANG_AUTOMATIC); - Elm_Input_Panel_Lang lang = elm_entry_input_panel_language_get(this->input_entry1); - char msg[100]; - snprintf(msg, sizeof(msg), "Autofill Input : %d", lang ); - elm_object_part_text_set(this->input_entry1, PART_ENTRY_GUIDE, msg); - input_entry1_handle = this->input_entry1; - elm_object_part_content_set(this->view->layout, "main_button", this->input_entry1); - evas_object_smart_callback_add(this->input_entry1, "changed", editfield_changed_cb, this->view->layout); - evas_object_smart_callback_add(this->input_entry1, "preedit,changed", editfield_changed_cb, this->view->layout); - - this->btn_autofill = ui_utils_push_button_add(this, this->view->layout, "Login with Autofill", autofill_app_launch_button_pressed_cb); - elm_object_part_content_set(this->view->layout, "controller_part", this->btn_autofill); - evas_object_event_callback_add(this->input_entry1, EVAS_CALLBACK_DEL, entry_del_cb, this->view->layout); - autofill_item_create(&ai_h); - autofill_item_set_autofill_hint(ai_h, AUTOFILL_HINT_ID); - autofill_item_set_id(ai_h, "id"); - autofill_item_set_label(ai_h, "ID"); - autofill_item_set_sensitive_data(ai_h, false); - - // create autofill item for save - autofill_save_item_create(&si_h); - autofill_save_item_set_autofill_hint(si_h, AUTOFILL_HINT_ID); - autofill_save_item_set_id(si_h, "id"); - autofill_save_item_set_label(si_h, "ID"); - autofill_save_item_set_sensitive_data(si_h, false); - - int ret; - ret = autofill_create(&g_ah); - if (ret == AUTOFILL_ERROR_NONE) - DBG("Succeeded to create autofill"); - else - { - DBG("Failed to create autofill. error code: 0x%X, error message: '%s'", ret, get_error_message(ret)); - return this; - } - ret = autofill_connect(g_ah, connection_status_changed_cb, NULL); - if (ret == AUTOFILL_ERROR_NONE) - DBG("Succeeded to connect"); - else - DBG("Failed to connect. error code: 0x%X, error message: '%s'", ret, get_error_message(ret)); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-bluetooth-callback-view.c b/tbtcoreapp/src/view/tbt-bluetooth-callback-view.c old mode 100644 new mode 100755 index 4330d0d..920eeee --- a/tbtcoreapp/src/view/tbt-bluetooth-callback-view.c +++ b/tbtcoreapp/src/view/tbt-bluetooth-callback-view.c @@ -50,7 +50,7 @@ static void Bluetooth_bt_device_bond_destroyed_cb_p(int result, char *remote_add static void Bluetooth_adapter_device_discovery_state_changed_cb_p(int result, bt_adapter_device_discovery_state_e discovery_state, bt_adapter_device_discovery_info_s *discovery_info, void *user_data); static void Bluetooth_bt_adapter_le_scan_result_cb(int result,bt_adapter_le_device_scan_result_info_s *info, void *user_data); static void Bluetooth_bt_adapter_name_changed_cb_p(char *pszDeviceName, void *user_data); - +static bluetooth_view *this = NULL; /** * @function get_bluetooth_error @@ -146,30 +146,25 @@ switch(error) } /** - * @function bluetooth_callback_view_add - * @since_tizen 2.3 - * @description Bluetooth Callback View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return bluetooth_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -bluetooth_view *bluetooth_callback_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - int ret, value; - bluetooth_view *this = NULL; - this = calloc(1, sizeof(bluetooth_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); + RETM_IF(NULL == data, "data is null"); - tbt_info->layout_group = "bluetooth_callback_viewer"; - tbt_info->layout_file = get_edje_path("bluetooth_callback_viewer.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + int ret, value; ret = bt_initialize(); if (this->view->tbt_info->apptype == TBT_APP_BT_CALLBACK_CREATE_BOND_TEST) @@ -372,6 +367,52 @@ bluetooth_view *bluetooth_callback_view_add(Evas_Object *navi, tbt_info *tbt_inf } elm_object_part_content_set(this->view->layout, "info_text", this->create_label); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function bluetooth_callback_view_add + * @since_tizen 2.3 + * @description Bluetooth Callback View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return bluetooth_view* + */ +bluetooth_view *bluetooth_callback_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(bluetooth_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "bluetooth_callback_viewer"; + tbt_info->layout_file = get_edje_path("bluetooth_callback_viewer.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-bluetooth-view.c b/tbtcoreapp/src/view/tbt-bluetooth-view.c old mode 100644 new mode 100755 index f9baee8..9616e3c --- a/tbtcoreapp/src/view/tbt-bluetooth-view.c +++ b/tbtcoreapp/src/view/tbt-bluetooth-view.c @@ -283,74 +283,31 @@ static void _pbap_list_clicked_cb(void* data, Evas_Object *obj, void* event_info static void _pbap_search_button_pressed_cb(void *data, Evas_Object *obj, void *event_info); static void _bt_avrcp_control_connection_state_changed_cb(bool connected, const char *remote_address, void *user_data); - +static bluetooth_view *this = NULL; /** - * @function bluetooth_view_add - * @since_tizen 2.3 - * @description Bluetooth View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return bluetooth_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -bluetooth_view *bluetooth_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); - - int result; - bluetooth_view *this = NULL; - this = calloc(1, sizeof(bluetooth_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); + RETM_IF(NULL == data, "data is null"); - this->devices_list = NULL; - this->bonded_devices_list = NULL; - this->selected_device_profile_list = NULL; - this->service_list = NULL; - this->discovery_state = BT_ADAPTER_DEVICE_DISCOVERY_NONE; - this->rfcomm_created = false; - this->rfcomm_client_connected = false; - this->no_of_profiles = 0; - this->hdp_app_id = NULL; - this->hdp_channel = 0; - this->hdp_send_data_flag = false; - this->is_opp_push_cancelled = false; + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); -// #ifdef DEVICE_TYPE_WEARABLE -// if(get_device_type() == DEVICE_WEARABLE_320_320) -// { -// elm_theme_overlay_add(NULL, get_edje_path("custom_button.edj")); -// } -// #endif - - if(tbt_info->apptype == TBT_APP_BT_CLIENT_PAIRED || tbt_info->apptype == TBT_APP_BT_OPP_CLIENT) - { - tbt_info->layout_group = "5_part_txt_cnt_cnt_btn_btn"; - tbt_info->layout_file = get_edje_path("5_part_txt_cnt1.5_cnt_btn_btn.edj"); - //tbt_info->layout_group = "bluetooth_viewer"; - } - else if(tbt_info->apptype == TBT_APP_BT_PBAP_ALL_VCARDS) + if(event_info) { - tbt_info->layout_group = "5_part_txt_entry_cnt_btn_btn"; - tbt_info->layout_file = get_edje_path("4_part_txt_cnt2_btn_btn.edj"); - this->pbap_phonebook_size = 0; + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); } - else - { - tbt_info->layout_group = "4_part_txt_cnt_btn_btn"; - tbt_info->layout_file = get_edje_path("4_part_txt_cnt2_btn_btn.edj"); - } - - - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(NULL == this->view, NULL, "view is null"); - + int result; this->bluetooth_label = ui_utils_label_add(this->view->layout, "Bluetooth"); elm_object_part_content_set(this->view->layout, "1txt", this->bluetooth_label); - if(tbt_info->apptype == TBT_APP_BT_PBAP_ALL_VCARDS) + if(this->view->tbt_info->apptype == TBT_APP_BT_PBAP_ALL_VCARDS) { this->input_text = ui_utils_entry_add(this, this->view->layout, ELM_INPUT_PANEL_LAYOUT_NORMAL, ""); elm_object_part_text_set(this->input_text, PART_ENTRY_GUIDE, "Enter name:"); @@ -369,10 +326,10 @@ bluetooth_view *bluetooth_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Ob evas_object_data_set(this->bluetooth_list, "bluetooth_view", this); elm_object_part_content_set(this->view->layout, "1txt_2cnt", this->bluetooth_list); - if(strcmp(tbt_info->layout_group, "5_part_txt_cnt_cnt_btn_btn") == 0) + if(strcmp(this->view->tbt_info->layout_group, "5_part_txt_cnt_cnt_btn_btn") == 0) { Evas_Object *table = elm_table_add(this->view->layout); - if(tbt_info->apptype == TBT_APP_BT_CLIENT_PAIRED) + if(this->view->tbt_info->apptype == TBT_APP_BT_CLIENT_PAIRED) { this->bluetooth_check_label = ui_utils_label_add(table, "Cancel Pair"); this->bluetooth_check = ui_utils_check_add(this, table); @@ -382,7 +339,7 @@ bluetooth_view *bluetooth_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Ob } - else if(tbt_info->apptype == TBT_APP_BT_OPP_CLIENT) + else if(this->view->tbt_info->apptype == TBT_APP_BT_OPP_CLIENT) { DBG("CANCEL BUTTON!!"); this->bluetooth_check_button = ui_utils_push_button_add(this, table, "Cancel Transfer", _cancel_button_pressed_cb); @@ -397,7 +354,7 @@ bluetooth_view *bluetooth_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Ob Evas_Object *control = add_control_layout(this, this->view->layout); - if(tbt_info->apptype == TBT_APP_BT_CLIENT_PAIRED || tbt_info->apptype == TBT_APP_BT_OPP_CLIENT) + if(this->view->tbt_info->apptype == TBT_APP_BT_CLIENT_PAIRED || this->view->tbt_info->apptype == TBT_APP_BT_OPP_CLIENT) { elm_object_part_content_set(this->view->layout, "1txt_2cnt_3cnt_4btn", control); } @@ -458,6 +415,87 @@ bluetooth_view *bluetooth_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Ob } update_view_controls(this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function bluetooth_view_add + * @since_tizen 2.3 + * @description Bluetooth View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return bluetooth_view* + */ +bluetooth_view *bluetooth_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); + + this = calloc(1, sizeof(bluetooth_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + this->devices_list = NULL; + this->bonded_devices_list = NULL; + this->selected_device_profile_list = NULL; + this->service_list = NULL; + this->discovery_state = BT_ADAPTER_DEVICE_DISCOVERY_NONE; + this->rfcomm_created = false; + this->rfcomm_client_connected = false; + this->no_of_profiles = 0; + this->hdp_app_id = NULL; + this->hdp_channel = 0; + this->hdp_send_data_flag = false; + this->is_opp_push_cancelled = false; + +// #ifdef DEVICE_TYPE_WEARABLE +// if(get_device_type() == DEVICE_WEARABLE_320_320) +// { +// elm_theme_overlay_add(NULL, get_edje_path("custom_button.edj")); +// } +// #endif + + if(tbt_info->apptype == TBT_APP_BT_CLIENT_PAIRED || tbt_info->apptype == TBT_APP_BT_OPP_CLIENT) + { + tbt_info->layout_group = "5_part_txt_cnt_cnt_btn_btn"; + tbt_info->layout_file = get_edje_path("5_part_txt_cnt1.5_cnt_btn_btn.edj"); + //tbt_info->layout_group = "bluetooth_viewer"; + } + else if(tbt_info->apptype == TBT_APP_BT_PBAP_ALL_VCARDS) + { + tbt_info->layout_group = "5_part_txt_entry_cnt_btn_btn"; + tbt_info->layout_file = get_edje_path("4_part_txt_cnt2_btn_btn.edj"); + this->pbap_phonebook_size = 0; + } + else + { + tbt_info->layout_group = "4_part_txt_cnt_btn_btn"; + tbt_info->layout_file = get_edje_path("4_part_txt_cnt2_btn_btn.edj"); + } + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "view is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-bluetoothle-view.c b/tbtcoreapp/src/view/tbt-bluetoothle-view.c index 6462ad0..f9dac42 100755 --- a/tbtcoreapp/src/view/tbt-bluetoothle-view.c +++ b/tbtcoreapp/src/view/tbt-bluetoothle-view.c @@ -164,6 +164,66 @@ static void services_list_show(bluetoothle_view *this); static void on_hardware_back_button_pressed(void *user_data, Evas_Object *obj, void *event_info); static void _notify_button_pressed_cb(void *user_data, Evas_Object *obj, void *event_info); static void _bt_gatt_server_notification_sent_cb(int result, const char *remote_address, bt_gatt_server_h server, bt_gatt_h characteristic, bool completed, void *user_data); +static bluetoothle_view *this = NULL; + +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->scan_info = NULL; + this->is_read_completed = true; + + //Add Label, Button and List + this->bluetoothle_label = ui_utils_label_add(this->view->layout, "BLE"); + elm_object_part_content_set(this->view->layout, "bluetoothle_text", this->bluetoothle_label); + + this->bluetoothle_list = elm_list_add(this->view->layout); + RETVM_IF(!this->bluetoothle_list, NULL, "elm_list_add failed"); + evas_object_data_set(this->bluetoothle_list, "bluetooth_view", this); + elm_object_part_content_set(this->view->layout, "bluetoothle_list", this->bluetoothle_list); + + Evas_Object *control = add_control_layout(this, this->view->layout); + elm_object_part_content_set(this->view->layout, "controlr_part", control); + + //Initialize Bluetooth + init_bluetooth(this); + if(this->view->tbt_info->apptype == TBT_APP_BLE_GATT_CLIENT) + { + eext_object_event_callback_add(this->view->layout, EEXT_CALLBACK_BACK, on_hardware_back_button_pressed, this); + } +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function bluetoothle_view_add @@ -176,7 +236,6 @@ bluetoothle_view *bluetoothle_view_add(Evas_Object *navi, tbt_info *tbt_info, El { RETVM_IF(NULL == navi, NULL, "navi is null"); - bluetoothle_view *this = NULL; this = calloc(1, sizeof(bluetoothle_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -205,27 +264,9 @@ bluetoothle_view *bluetoothle_view_add(Evas_Object *navi, tbt_info *tbt_info, El RETVM_IF(!this, NULL, "calloc failed"); RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->scan_info = NULL; - this->is_read_completed = true; - - //Add Label, Button and List - this->bluetoothle_label = ui_utils_label_add(this->view->layout, "BLE"); - elm_object_part_content_set(this->view->layout, "bluetoothle_text", this->bluetoothle_label); - - this->bluetoothle_list = elm_list_add(this->view->layout); - RETVM_IF(!this->bluetoothle_list, NULL, "elm_list_add failed"); - evas_object_data_set(this->bluetoothle_list, "bluetooth_view", this); - elm_object_part_content_set(this->view->layout, "bluetoothle_list", this->bluetoothle_list); - - Evas_Object *control = add_control_layout(this, this->view->layout); - elm_object_part_content_set(this->view->layout, "controlr_part", control); - - //Initialize Bluetooth - init_bluetooth(this); - if(this->view->tbt_info->apptype == TBT_APP_BLE_GATT_CLIENT) - { - eext_object_event_callback_add(this->view->layout, EEXT_CALLBACK_BACK, on_hardware_back_button_pressed, this); - } + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-bluetoothoob-view.c b/tbtcoreapp/src/view/tbt-bluetoothoob-view.c old mode 100644 new mode 100755 index 157b339..9d6f78f --- a/tbtcoreapp/src/view/tbt-bluetoothoob-view.c +++ b/tbtcoreapp/src/view/tbt-bluetoothoob-view.c @@ -66,7 +66,61 @@ static void _nfc_tag_read_completed_cb(nfc_error_e result, nfc_ndef_message_h me static void _adapter_device_bond_created_cb(int result, bt_device_info_s *device_info, void *data); static nfc_ndef_message_h create_ndef_message(); static void nfc_ndef_message_read(nfc_ndef_message_h message, void *user_data); +static bluetoothoob_view *this = NULL; +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + int result; + if(this->view->tbt_info->apptype == TBT_APP_BT_OOB_DEVICE) + { + Evas_Object *table = elm_table_add(this->view->layout); + this->btn_make_pair = ui_utils_push_button_add(this, table, "Make Pair", on_make_pair_button_pressed_cb); + elm_table_pack(table, this->btn_make_pair, 1, 0, 1, 1); + elm_object_part_content_set(this->view->layout, "controlr_part", table); + evas_object_show(table); + } + + bt_initialize(); + + result = bt_device_set_bond_created_cb(_adapter_device_bond_created_cb, this); + RETVM_IF(result != BT_ERROR_NONE, NULL, "bt_device_set_bond_created_cb Failed"); + + initialize_nfc(this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function bluetoothoob_view_add @@ -78,9 +132,7 @@ static void nfc_ndef_message_read(nfc_ndef_message_h message, void *user_data); bluetoothoob_view *bluetoothoob_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) { RETVM_IF(NULL == navi, NULL, "navi is null"); - int result; - bluetoothoob_view *this = NULL; this = calloc(1, sizeof(bluetoothoob_view)); this->view = calloc(1, sizeof(common_view)); @@ -97,22 +149,6 @@ bluetoothoob_view *bluetoothoob_view_add(Evas_Object *navi, tbt_info *tbt_info, RETVM_IF(!this, NULL, "calloc failed"); RETVM_IF(NULL == this->view, NULL, "navi is null"); - if(this->view->tbt_info->apptype == TBT_APP_BT_OOB_DEVICE) - { - Evas_Object *table = elm_table_add(this->view->layout); - this->btn_make_pair = ui_utils_push_button_add(this, table, "Make Pair", on_make_pair_button_pressed_cb); - elm_table_pack(table, this->btn_make_pair, 1, 0, 1, 1); - elm_object_part_content_set(this->view->layout, "controlr_part", table); - evas_object_show(table); - } - - bt_initialize(); - - result = bt_device_set_bond_created_cb(_adapter_device_bond_created_cb, this); - RETVM_IF(result != BT_ERROR_NONE, NULL, "bt_device_set_bond_created_cb Failed"); - - initialize_nfc(this); - return this; } diff --git a/tbtcoreapp/src/view/tbt-camera-view.c b/tbtcoreapp/src/view/tbt-camera-view.c index 15c3053..01705c1 100755 --- a/tbtcoreapp/src/view/tbt-camera-view.c +++ b/tbtcoreapp/src/view/tbt-camera-view.c @@ -115,7 +115,7 @@ char* get_recorder_state(int state); static void create_render_rect_and_bg(camera_view *this); static void destroy_render_rect_and_bg(camera_view *this); - +static camera_view *this = NULL; static void create_render_rect_and_bg(camera_view *this) { @@ -156,56 +156,24 @@ static void destroy_render_rect_and_bg(camera_view *this) } /** - * @function camera_view_add - * @since_tizen 2.3 - * @description Camera View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return camera_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -camera_view *camera_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item, Evas_Object *win) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); - - camera_view *this = NULL; - this = calloc(1, sizeof(camera_view)); - RETVM_IF(NULL == this, NULL, "calloc failed"); - - this->win = win; - this->rect = NULL; - this->camera = NULL; - this->player = NULL; - this->recorder = NULL; - this->file_path = NULL; - this->recording = EINA_FALSE; - this->playing = EINA_FALSE; - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - -// #ifdef DEVICE_TYPE_WEARABLE -// if(get_device_type() == DEVICE_WEARABLE_320_320 || (get_device_type() == DEVICE_WEARABLE_360_360)) -// { -// elm_theme_overlay_add(NULL, get_edje_path("custom_button.edj")); -// } -// #endif + RETM_IF(NULL == data, "data is null"); - if (tbt_info->apptype == TBT_APP_CAMERA_CAPTURE || tbt_info->apptype == TBT_APP_CAMERA_RECORD - || tbt_info->apptype == TBT_APP_CAMERA_HDR_CAPTURE) - { - tbt_info->layout_group = "6_part_txt_cnt_txt_cnt_btn_btn"; - tbt_info->layout_file = get_edje_path("6_part_txt_cnt_txt_cnt_btn_btn.edj"); - } - else if (tbt_info->apptype == TBT_APP_CAMERA_FACE_DETECT) - { - tbt_info->layout_group = "2_part_cnt_btn"; - tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); - } - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(!this, NULL, "calloc failed"); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } this->is_feature_supported = true; evas_object_size_hint_weight_set(this->view->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -329,6 +297,79 @@ camera_view *camera_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I update_view_controls(this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function camera_view_add + * @since_tizen 2.3 + * @description Camera View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return camera_view* + */ +camera_view *camera_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item, Evas_Object *win) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); + + this = calloc(1, sizeof(camera_view)); + RETVM_IF(NULL == this, NULL, "calloc failed"); + + this->win = win; + this->rect = NULL; + this->camera = NULL; + this->player = NULL; + this->recorder = NULL; + this->file_path = NULL; + this->recording = EINA_FALSE; + this->playing = EINA_FALSE; + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + +// #ifdef DEVICE_TYPE_WEARABLE +// if(get_device_type() == DEVICE_WEARABLE_320_320 || (get_device_type() == DEVICE_WEARABLE_360_360)) +// { +// elm_theme_overlay_add(NULL, get_edje_path("custom_button.edj")); +// } +// #endif + + if (tbt_info->apptype == TBT_APP_CAMERA_CAPTURE || tbt_info->apptype == TBT_APP_CAMERA_RECORD + || tbt_info->apptype == TBT_APP_CAMERA_HDR_CAPTURE) + { + tbt_info->layout_group = "6_part_txt_cnt_txt_cnt_btn_btn"; + tbt_info->layout_file = get_edje_path("6_part_txt_cnt_txt_cnt_btn_btn.edj"); + } + else if (tbt_info->apptype == TBT_APP_CAMERA_FACE_DETECT) + { + tbt_info->layout_group = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); + } + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(!this, NULL, "calloc failed"); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + return this; } diff --git a/tbtcoreapp/src/view/tbt-common-view.c b/tbtcoreapp/src/view/tbt-common-view.c old mode 100644 new mode 100755 index c39936c..b0be321 --- a/tbtcoreapp/src/view/tbt-common-view.c +++ b/tbtcoreapp/src/view/tbt-common-view.c @@ -87,9 +87,9 @@ common_view *common_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I elm_object_item_part_content_set(elm_naviframe_top_item_get(view->navi), "toolbar", view->toolbar); #endif - char instrcuction[2048]={'\0',}; - snprintf(instrcuction, sizeof(instrcuction), "%s%s", view->tbt_info->info, "
Note:You can also refer info section"); - ui_utils_guide_instruction_popup_button(view->navi, instrcuction ); + // char instrcuction[2048]={'\0',}; + // snprintf(instrcuction, sizeof(instrcuction), "%s%s", view->tbt_info->info, "
Note:You can also refer info section"); + // ui_utils_guide_instruction_popup_button(view->navi, instrcuction ); update_view_controls(view); update_view_controls(view); diff --git a/tbtcoreapp/src/view/tbt-connection-view.c b/tbtcoreapp/src/view/tbt-connection-view.c index 7654860..e0b0e28 100755 --- a/tbtcoreapp/src/view/tbt-connection-view.c +++ b/tbtcoreapp/src/view/tbt-connection-view.c @@ -48,31 +48,27 @@ connection_h g_hConenctionHandle = NULL; static char* get_connection_error(connection_error_e err_code); static void _app_destroy_cb(void* this); static bool is_not_supported = false; +static connection_view *this = NULL; /** - * @function connection_view_add + * @function guide_pop_up_button_callback * @since_tizen 3.0 - * @description connection View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return connection_view* + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -connection_view *connection_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - - connection_view *this = NULL; - this = calloc(1, sizeof(connection_view)); - RETVM_IF(!this, NULL, "calloc failed"); - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - tbt_info->layout_group = "2_part_cnt_btn"; - tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); + RETM_IF(NULL == data, "data is null"); - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(!this, NULL, "calloc failed"); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } this->connection_label = ui_utils_label_add(this->view->layout, ""); elm_label_line_wrap_set(this->connection_label, ELM_WRAP_WORD); int result; @@ -181,6 +177,52 @@ connection_view *connection_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_ } elm_object_part_content_set(this->view->layout, "1cnt", this->connection_label); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function connection_view_add + * @since_tizen 3.0 + * @description connection View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return connection_view* + */ +connection_view *connection_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(connection_view)); + RETVM_IF(!this, NULL, "calloc failed"); + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(!this, NULL, "calloc failed"); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + return this; } diff --git a/tbtcoreapp/src/view/tbt-contacts-view.c b/tbtcoreapp/src/view/tbt-contacts-view.c old mode 100644 new mode 100755 index 4dbc8a3..c1a5540 --- a/tbtcoreapp/src/view/tbt-contacts-view.c +++ b/tbtcoreapp/src/view/tbt-contacts-view.c @@ -44,6 +44,7 @@ struct _contacts_view static bool is_not_supported = false; static void _app_destroy_cb(void* this); +static contacts_view *this = NULL; /** @@ -101,32 +102,26 @@ char* get_contacts_error(int ret) return err_msg; } - /** - * @function contacts_view_add - * @since_tizen 2.3 - * @description Contacts View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return contacts_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -contacts_view *contacts_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - int ret; - contacts_view *this = NULL; - this = calloc(1, sizeof(contacts_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); + RETM_IF(NULL == data, "data is null"); - tbt_info->layout_group = "contacts_viewer"; - tbt_info->layout_file = get_edje_path("contacts_viewer.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + int ret; this->info_label = ui_utils_label_add(this->view->layout, "Contacts: "); elm_label_line_wrap_set(this->info_label, ELM_WRAP_WORD); //ui_utils_guide_instruction_popup_button(navi, "Instructions:
1. Make a contact Test with number 12345678.
1. Call and message Test.
3. Verify the count with the number of calls and messages made to test.
4. Delete the contact Test.
Note:You can also refer info section"); @@ -186,6 +181,52 @@ contacts_view *contacts_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Obje } elm_object_part_content_set(this->view->layout, "info_text", this->info_label); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function contacts_view_add + * @since_tizen 2.3 + * @description Contacts View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return contacts_view* + */ +contacts_view *contacts_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(contacts_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "contacts_viewer"; + tbt_info->layout_file = get_edje_path("contacts_viewer.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-datacontrol-view.c b/tbtcoreapp/src/view/tbt-datacontrol-view.c old mode 100644 new mode 100755 index 20a4053..52fcfcf --- a/tbtcoreapp/src/view/tbt-datacontrol-view.c +++ b/tbtcoreapp/src/view/tbt-datacontrol-view.c @@ -199,6 +199,80 @@ Elm_Object_Item* _elm_genlist_item_append(char *item_text, datacontrol_view *thi } #endif +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + +#ifdef USE_GENLIST + this->dc_list = elm_genlist_add(this->view->layout); + RETVM_IF(!this->dc_list, NULL, "elm_genlist_add failed"); + + evas_object_data_set(this->dc_list, "view_data", this); + _elm_genlist_item_append("Press start", this); + evas_object_show(this->dc_list); + elm_object_part_content_set(this->view->layout, "datacontrol_view", this->dc_list); +#else + this->dc_list = elm_list_add(this->view->layout); + RETVM_IF(!this->dc_list, NULL, "elm_list_add failed"); + + evas_object_data_set(this->dc_list, "view_data", this); + elm_list_item_append(this->dc_list, "Press start to check", NULL, NULL, NULL, NULL); + elm_list_go(this->dc_list); + evas_object_show(this->dc_list); + elm_object_part_content_set(this->view->layout, "datacontrol_view", this->dc_list); +#endif + + Evas_Object *control = add_control_layout(this, this->view->layout); + elm_object_part_content_set(this->view->layout, "controlr_part", control); + + + if(this->view->tbt_info->apptype == TBT_APP_DC_INSERT || + this->view->tbt_info->apptype == TBT_APP_DC_DELETE || + this->view->tbt_info->apptype == TBT_APP_DC_UPDATE || + this->view->tbt_info->apptype == TBT_APP_DC_SELECT || + this->view->tbt_info->apptype == TBT_APP_DC_CURSOR) + { + data_consumer_create(this); + } + else if(this->view->tbt_info->apptype == TBT_APP_DC_MAP) + { + data_consumer_map_create(this); + } +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + /** * @function datacontrol_view_add * @since_tizen 2.3 @@ -241,42 +315,9 @@ datacontrol_view *datacontrol_view_add(Evas_Object *navi, tbt_info *tbt_info, El RETVM_IF(!this, NULL, "calloc failed"); RETVM_IF(NULL == this->view, NULL, "navi is null"); - -#ifdef USE_GENLIST - this->dc_list = elm_genlist_add(this->view->layout); - RETVM_IF(!this->dc_list, NULL, "elm_genlist_add failed"); - - evas_object_data_set(this->dc_list, "view_data", this); - _elm_genlist_item_append("Press start", this); - evas_object_show(this->dc_list); - elm_object_part_content_set(this->view->layout, "datacontrol_view", this->dc_list); -#else - this->dc_list = elm_list_add(this->view->layout); - RETVM_IF(!this->dc_list, NULL, "elm_list_add failed"); - - evas_object_data_set(this->dc_list, "view_data", this); - elm_list_item_append(this->dc_list, "Press start to check", NULL, NULL, NULL, NULL); - elm_list_go(this->dc_list); - evas_object_show(this->dc_list); - elm_object_part_content_set(this->view->layout, "datacontrol_view", this->dc_list); -#endif - - Evas_Object *control = add_control_layout(this, this->view->layout); - elm_object_part_content_set(this->view->layout, "controlr_part", control); - - - if(this->view->tbt_info->apptype == TBT_APP_DC_INSERT || - this->view->tbt_info->apptype == TBT_APP_DC_DELETE || - this->view->tbt_info->apptype == TBT_APP_DC_UPDATE || - this->view->tbt_info->apptype == TBT_APP_DC_SELECT || - this->view->tbt_info->apptype == TBT_APP_DC_CURSOR) - { - data_consumer_create(this); - } - else if(this->view->tbt_info->apptype == TBT_APP_DC_MAP) - { - data_consumer_map_create(this); - } + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-display-view.c b/tbtcoreapp/src/view/tbt-display-view.c old mode 100644 new mode 100755 index d042a8b..e7302af --- a/tbtcoreapp/src/view/tbt-display-view.c +++ b/tbtcoreapp/src/view/tbt-display-view.c @@ -49,32 +49,27 @@ struct _display_view }; static void _app_destroy_cb(void* this); - +static display_view *this = NULL; /** - * @function display_view_add - * @since_tizen 2.3 - * @description Display View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return display_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -display_view *display_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - - display_view *this = NULL; - this = calloc(1, sizeof(display_view)); - RETVM_IF(!this, NULL, "calloc failed"); - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); + RETM_IF(NULL == data, "data is null"); - tbt_info->layout_group = "3_part_txt_txt_btn"; - tbt_info->layout_file = get_edje_path("3_part_txt_txt_btn.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } int res; res = system_info_get_platform_int("tizen.org/feature/screen.width", &this->width); RETVM_IF(res != 0, NULL, "tizen.org/feature/screen.width"); @@ -96,6 +91,51 @@ display_view *display_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object elm_object_part_content_set(this->view->layout, "1txt", this->width_label); elm_object_part_content_set(this->view->layout, "2txt", this->height_label); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function display_view_add + * @since_tizen 2.3 + * @description Display View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return display_view* + */ +display_view *display_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(display_view)); + RETVM_IF(!this, NULL, "calloc failed"); + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "3_part_txt_txt_btn"; + tbt_info->layout_file = get_edje_path("3_part_txt_txt_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-efl-callbacks.c b/tbtcoreapp/src/view/tbt-efl-callbacks.c old mode 100644 new mode 100755 index 02d023c..515c1c3 --- a/tbtcoreapp/src/view/tbt-efl-callbacks.c +++ b/tbtcoreapp/src/view/tbt-efl-callbacks.c @@ -57,32 +57,27 @@ static void _control_button_pressed_cb(void *data, Evas_Object *obj, static void update(efl_callbacks_view *this); static void on_hardware_back_button_pressed(void *data, Evas_Object *obj, void *event_info); - +static efl_callbacks_view *this = NULL; /** - * @function efl_callbacks_view_add - * @since_tizen 2.3 - * @description Efl Callbacks View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return efl_callbacks_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -efl_callbacks_view *efl_callbacks_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - - efl_callbacks_view *this = NULL; - this = calloc(1, sizeof(efl_callbacks_view)); - RETVM_IF(!this, NULL, "calloc failed"); - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); + RETM_IF(NULL == data, "data is null"); - tbt_info->layout_group = "4_part_txt_txt_btn_btn"; - tbt_info->layout_file = get_edje_path("4_part_txt_txt_btn_btn.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } this->lat_label = ui_utils_label_add(this->view->layout, "???"); this->lon_label = ui_utils_label_add(this->view->layout, "???"); @@ -105,6 +100,51 @@ efl_callbacks_view *efl_callbacks_view_add(Evas_Object *navi, tbt_info *tbt_in eext_object_event_callback_add(this->action_btn, EEXT_CALLBACK_BACK, on_hardware_back_button_pressed, this); update(this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function efl_callbacks_view_add + * @since_tizen 2.3 + * @description Efl Callbacks View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return efl_callbacks_view* + */ +efl_callbacks_view *efl_callbacks_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(efl_callbacks_view)); + RETVM_IF(!this, NULL, "calloc failed"); + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "4_part_txt_txt_btn_btn"; + tbt_info->layout_file = get_edje_path("4_part_txt_txt_btn_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-event-view.c b/tbtcoreapp/src/view/tbt-event-view.c old mode 100644 new mode 100755 index 84af357..ca31b7c --- a/tbtcoreapp/src/view/tbt-event-view.c +++ b/tbtcoreapp/src/view/tbt-event-view.c @@ -59,6 +59,7 @@ static void _app_low_battery_cb(app_event_info_h event_info, void *user_data); static void _app_low_memory_cb(app_event_info_h event_info, void *user_data); static void _app_destroy_cb(void* this); +static event_view *this = NULL; /** @@ -172,29 +173,24 @@ static void _app_low_memory_cb(app_event_info_h event_info, void *user_data) #endif /** - * @function event_view_add - * @since_tizen 2.3 - * @description Event View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return event_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -event_view *event_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - - event_view *this = NULL; - this = calloc(1, sizeof(event_view)); - RETVM_IF(!this, NULL, "calloc failed"); - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - tbt_info->layout_group = "6_part_txt_txt_txt_txt_txt_btn"; - tbt_info->layout_file = get_edje_path("6_part_txt_txt_txt_txt_txt_btn.edj"); + RETM_IF(NULL == data, "data is null"); - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } bool is_orientation_supported = does_feature_exist("tizen.org/feature/screen.auto_rotation"); int result = APP_ERROR_NONE; DBG("ui_app_add_event_handler"); @@ -237,6 +233,52 @@ event_view *event_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite ui_utils_label_set_text(this->low_memory_label, "Low Memory: ", "left"); elm_object_part_content_set(this->view->layout, "1txt_2txt_3txt_4txt_5txt", this->low_memory_label); #endif +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function event_view_add + * @since_tizen 2.3 + * @description Event View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return event_view* + */ +event_view *event_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(event_view)); + RETVM_IF(!this, NULL, "calloc failed"); + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "6_part_txt_txt_txt_txt_txt_btn"; + tbt_info->layout_file = get_edje_path("6_part_txt_txt_txt_txt_txt_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + return this; } diff --git a/tbtcoreapp/src/view/tbt-feature-view.c b/tbtcoreapp/src/view/tbt-feature-view.c old mode 100644 new mode 100755 index f22fdbb..a3c60ac --- a/tbtcoreapp/src/view/tbt-feature-view.c +++ b/tbtcoreapp/src/view/tbt-feature-view.c @@ -63,6 +63,7 @@ static bool is_feature_exist(char* feature); static void feature_summary_list_prepare(feature_view *this); static char* get_system_info_error(system_info_error_e err_code); static void _app_destroy_cb(void* this); +static feature_view *this = NULL; #ifdef USE_GENLIST static void _gl_del_cb(void *data, Evas_Object *obj EINA_UNUSED) @@ -126,6 +127,58 @@ Elm_Object_Item* _feature_elm_genlist_item_append(feature_view *this, char *item return item; } #endif + +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } +#ifdef USE_GENLIST + this->list = elm_genlist_add(this->view->layout); + RETVM_IF(!this->list, NULL, "elm_genlist_add failed"); +#else + this->list = elm_list_add(this->view->layout); + RETVM_IF(!this->list, NULL, "elm_list_add failed"); +#endif + + + evas_object_data_set(this->list, "view_data", this); + elm_object_part_content_set(this->view->layout, "1cnt", this->list); + + feature_summary_list_prepare(this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + /** * @function feature_view_add * @since_tizen 2.3 @@ -137,7 +190,6 @@ feature_view *feature_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object { RETVM_IF(NULL == navi, NULL, "navi is null"); - feature_view *this = NULL; this = calloc(1, sizeof(feature_view)); RETVM_IF(!this, NULL, "calloc failed"); this->view = calloc(1, sizeof(common_view)); @@ -150,19 +202,9 @@ feature_view *feature_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object RETVM_IF(NULL == this->view, NULL, "navi is null"); -#ifdef USE_GENLIST - this->list = elm_genlist_add(this->view->layout); - RETVM_IF(!this->list, NULL, "elm_genlist_add failed"); -#else - this->list = elm_list_add(this->view->layout); - RETVM_IF(!this->list, NULL, "elm_list_add failed"); -#endif - - - evas_object_data_set(this->list, "view_data", this); - elm_object_part_content_set(this->view->layout, "1cnt", this->list); - - feature_summary_list_prepare(this); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-genlist-view.c b/tbtcoreapp/src/view/tbt-genlist-view.c old mode 100644 new mode 100755 diff --git a/tbtcoreapp/src/view/tbt-gps-view.c b/tbtcoreapp/src/view/tbt-gps-view.c old mode 100644 new mode 100755 index b2e7b5a..11d1a30 --- a/tbtcoreapp/src/view/tbt-gps-view.c +++ b/tbtcoreapp/src/view/tbt-gps-view.c @@ -49,32 +49,27 @@ struct _gps_view static void _position_updated_cb(double latitude, double longitude, double altitude, time_t timestamp, void *data); static void _gps_state_changed_cb(location_service_state_e state, void *data); static void _app_destroy_cb(void* this); - +static gps_view *this = NULL; /** - * @function gps_view_add - * @since_tizen 2.3 - * @description Gps View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return gps_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -gps_view *gps_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - - gps_view *this = NULL; - this = calloc(1, sizeof(gps_view)); - RETVM_IF(!this, NULL, "calloc failed"); - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); + RETM_IF(NULL == data, "data is null"); - tbt_info->layout_group = "3_part_txt_txt_btn"; - tbt_info->layout_file = get_edje_path("3_part_txt_txt_btn.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } int ret = location_manager_create(LOCATIONS_METHOD_GPS, &this->manager); RETVM_IF(ret != LOCATIONS_ERROR_NONE, NULL, "location_manager_create fail > Error = %d", ret); @@ -112,6 +107,51 @@ gps_view *gps_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *i elm_object_part_content_set(this->view->layout, "1txt", this->lat_label); elm_object_part_content_set(this->view->layout, "2txt", this->lon_label); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function gps_view_add + * @since_tizen 2.3 + * @description Gps View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return gps_view* + */ +gps_view *gps_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(gps_view)); + RETVM_IF(!this, NULL, "calloc failed"); + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "3_part_txt_txt_btn"; + tbt_info->layout_file = get_edje_path("3_part_txt_txt_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-graphics-view.c b/tbtcoreapp/src/view/tbt-graphics-view.c index 52a78ce..857d494 100755 --- a/tbtcoreapp/src/view/tbt-graphics-view.c +++ b/tbtcoreapp/src/view/tbt-graphics-view.c @@ -134,7 +134,53 @@ static void _gles_cube_view_glview_del_cb(Evas_Object *obj); static void _gles_cube_view_glview_resize_cb(Evas_Object *obj); static void _gles_cube_view_glview_render_cb(Evas_Object *obj); static void _gles_cube_view_layout_free_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); +static graphics_view *this = NULL; +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->gl_layout = gles_cube_view_init(this); + if(this->gl_layout == NULL) + { + gles_cube_view_del(this); + return NULL; + } + + elm_object_part_content_set(this->view->layout, "1cnt", this->gl_layout); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function graphics_view_add @@ -147,7 +193,6 @@ graphics_view *graphics_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Obje { RETVM_IF(NULL == navi, NULL, "navi is null"); - graphics_view *this = NULL; this = calloc(1, sizeof(graphics_view)); RETVM_IF(!this, NULL, "calloc failed"); this->view = calloc(1, sizeof(common_view)); @@ -160,14 +205,9 @@ graphics_view *graphics_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Obje RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->gl_layout = gles_cube_view_init(this); - if(this->gl_layout == NULL) - { - gles_cube_view_del(this); - return NULL; - } - - elm_object_part_content_set(this->view->layout, "1cnt", this->gl_layout); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-image-view.c b/tbtcoreapp/src/view/tbt-image-view.c old mode 100644 new mode 100755 index 1e8d595..865ef59 --- a/tbtcoreapp/src/view/tbt-image-view.c +++ b/tbtcoreapp/src/view/tbt-image-view.c @@ -44,7 +44,65 @@ struct _image_view }; static void _app_destroy_cb(void* this); +static image_view *this = NULL; +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + int x,y,w,h; + evas_object_geometry_get(this->view->navi, &x, &y, &w, &h); + DBG("Dim: %d %d %d %d", x, y, w, h); + const char *file_path; + file_path = get_resource_path(this->view->tbt_info->file_name); + this->image = ui_utils_create_image(this->view->layout, file_path); + + RETVM_IF(NULL == this->image, false, "create of layout elements failed"); + + if(EINA_TRUE == elm_image_animated_available_get(this->image)) + { + elm_image_animated_set(this->image, EINA_TRUE); + elm_image_animated_play_set(this->image, EINA_TRUE); + } + + elm_object_part_content_set(this->view->layout, "1cnt", this->image); + + //int x,y,w,h; + evas_object_geometry_get(this->image, &x, &y, &w, &h); + DBG("Dim: %d %d %d %d", x, y, w, h); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function image_view_add @@ -57,11 +115,6 @@ image_view *image_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite { RETVM_IF(NULL == navi, NULL, "navi is null"); - int x,y,w,h; - evas_object_geometry_get(navi, &x, &y, &w, &h); - DBG("Dim: %d %d %d %d", x, y, w, h); - - image_view *this = NULL; this = calloc(1, sizeof(image_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -75,23 +128,9 @@ image_view *image_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite RETVM_IF(NULL == this->view, NULL, "navi is null"); - const char *file_path; - file_path = get_resource_path(this->view->tbt_info->file_name); - this->image = ui_utils_create_image(this->view->layout, file_path); - - RETVM_IF(NULL == this->image, false, "create of layout elements failed"); - - if(EINA_TRUE == elm_image_animated_available_get(this->image)) - { - elm_image_animated_set(this->image, EINA_TRUE); - elm_image_animated_play_set(this->image, EINA_TRUE); - } - - elm_object_part_content_set(this->view->layout, "1cnt", this->image); - - //int x,y,w,h; - evas_object_geometry_get(this->image, &x, &y, &w, &h); - DBG("Dim: %d %d %d %d", x, y, w, h); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-ime-view.c b/tbtcoreapp/src/view/tbt-ime-view.c old mode 100644 new mode 100755 index 1c9cf48..5c3f971 --- a/tbtcoreapp/src/view/tbt-ime-view.c +++ b/tbtcoreapp/src/view/tbt-ime-view.c @@ -51,37 +51,27 @@ static void _app_destroy_cb(void* this); static void _lang_set_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); static void _lang_get_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); static void _return_key_button_clicked_cb(void *data, Evas_Object *obj, void *event_info); - +static ime_view *this = NULL; /** - * @function ime_view_add - * @since_tizen 2.3 - * @description Ime View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return ime_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -ime_view *ime_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - DBG("Inside ime_view_add"); - - ime_view *this = NULL; - this = calloc(1, sizeof(ime_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - tbt_info->layout_group = "ime_viewer"; - tbt_info->layout_file = get_edje_path("input_viewer.edj"); - - - DBG("EDJ added."); - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(!this, NULL, "calloc failed"); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + RETM_IF(NULL == data, "data is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } if(this->view->tbt_info->apptype == TBT_APP_IME_ALPHABATIC) { this->ime_entry1 = ui_utils_entry_add(this, this->view->layout, ELM_INPUT_PANEL_LAYOUT_NORMAL, ""); @@ -122,7 +112,55 @@ ime_view *ime_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *i Elm_Input_Panel_Layout l; l = elm_entry_input_panel_layout_get(this->ime_entry1); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function ime_view_add + * @since_tizen 2.3 + * @description Ime View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return ime_view* + */ +ime_view *ime_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + DBG("Inside ime_view_add"); + + this = calloc(1, sizeof(ime_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "ime_viewer"; + tbt_info->layout_file = get_edje_path("input_viewer.edj"); + + + DBG("EDJ added."); + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(!this, NULL, "calloc failed"); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-input-view.c b/tbtcoreapp/src/view/tbt-input-view.c old mode 100644 new mode 100755 index 7e0008d..60bf806 --- a/tbtcoreapp/src/view/tbt-input-view.c +++ b/tbtcoreapp/src/view/tbt-input-view.c @@ -43,32 +43,27 @@ struct _input_view }; static void _app_destroy_cb(void* this); - +static input_view *this = NULL; /** - * @function input_view_add - * @since_tizen 2.3 - * @description Input View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return input_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -input_view *input_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - - input_view *this = NULL; - this = calloc(1, sizeof(input_view)); - RETVM_IF(!this, NULL, "calloc failed"); + RETM_IF(NULL == data, "data is null"); - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - tbt_info->layout_group = "2_part_cnt_btntop"; - tbt_info->layout_file = get_edje_path("2_part_cnt1.5_btntop.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } if(this->view->tbt_info->apptype == TBT_APP_IDEV_NUM_KEYPAD) { this->input_text = ui_utils_entry_add(this, this->view->layout, ELM_INPUT_PANEL_LAYOUT_NUMBER, ""); @@ -91,6 +86,51 @@ input_view *input_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite Elm_Input_Panel_Layout l; l = elm_entry_input_panel_layout_get(this->input_text); RETVM_IF(ELM_INPUT_PANEL_LAYOUT_INVALID == l, NULL, "elm_entry_input_panel_layout_get failed"); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function input_view_add + * @since_tizen 2.3 + * @description Input View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return input_view* + */ +input_view *input_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(input_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "2_part_cnt_btntop"; + tbt_info->layout_file = get_edje_path("2_part_cnt1.5_btntop.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-list-view.c b/tbtcoreapp/src/view/tbt-list-view.c old mode 100644 new mode 100755 diff --git a/tbtcoreapp/src/view/tbt-local-view.c b/tbtcoreapp/src/view/tbt-local-view.c old mode 100644 new mode 100755 index 1e573c4..f811219 --- a/tbtcoreapp/src/view/tbt-local-view.c +++ b/tbtcoreapp/src/view/tbt-local-view.c @@ -91,7 +91,7 @@ static void destroy_render_rect_and_bg(local_view *this); static bool was_playing; static local_view *view; - +static local_view *this = NULL; /** * @function get_system_error @@ -259,6 +259,69 @@ static void destroy_render_rect_and_bg(local_view *this) } } +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + + #ifdef DEVICE_TYPE_MOBILE + Evas *evas = evas_object_evas_get(this->view->navi); + this->video_rect = evas_object_image_filled_add(evas); + #else + int width, height; + + int ret = system_info_get_platform_int("tizen.org/feature/screen.width", &width); + RETVM_IF(SYSTEM_INFO_ERROR_NONE!=ret, NULL, "system_info_get_platform_int failed %s", get_system_error(ret)); + RETVM_IF(width <= 0, NULL, "width is zero or negative"); + ret = system_info_get_platform_int("tizen.org/feature/screen.height", &height); + RETVM_IF(SYSTEM_INFO_ERROR_NONE!=ret, NULL, "system_info_get_platform_int failed %s", get_system_error(ret)); + RETVM_IF(height <= 0, NULL, "height is zero or negative"); + + //this->video_rect = elm_win_util_standard_add("Video", "Video"); + #endif + + //evas_object_show(this->video_rect); + #ifdef DEVICE_TYPE_MOBILE + elm_object_part_content_set(this->view->layout, "video_view", this->video_rect); + #endif + + Evas_Object *control = add_control_layout(this, this->view->layout); + elm_object_part_content_set(this->view->layout, "controlr_part", control); + + update_view_controls(this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function local_view_add @@ -270,7 +333,6 @@ static void destroy_render_rect_and_bg(local_view *this) local_view *local_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item, Evas_Object *win) { RETVM_IF(NULL == navi, NULL, "navi is null"); - local_view *this = NULL; _tbt_pause_resume_cb = _on_app_pause_resume_cb; _tbt_app_terminate_cb = _app_destroy_cb; @@ -287,6 +349,10 @@ local_view *local_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); RETVM_IF(NULL == this->view, NULL, "navi is null"); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + this->main_win = win; this->win = NULL; @@ -294,33 +360,6 @@ local_view *local_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite this->rect = NULL; this->video_rect = NULL; this->is_feature_supported = true; - - #ifdef DEVICE_TYPE_MOBILE - Evas *evas = evas_object_evas_get(this->view->navi); - this->video_rect = evas_object_image_filled_add(evas); - #else - int width, height; - - int ret = system_info_get_platform_int("tizen.org/feature/screen.width", &width); - RETVM_IF(SYSTEM_INFO_ERROR_NONE!=ret, NULL, "system_info_get_platform_int failed %s", get_system_error(ret)); - RETVM_IF(width <= 0, NULL, "width is zero or negative"); - ret = system_info_get_platform_int("tizen.org/feature/screen.height", &height); - RETVM_IF(SYSTEM_INFO_ERROR_NONE!=ret, NULL, "system_info_get_platform_int failed %s", get_system_error(ret)); - RETVM_IF(height <= 0, NULL, "height is zero or negative"); - - //this->video_rect = elm_win_util_standard_add("Video", "Video"); - #endif - - //evas_object_show(this->video_rect); - #ifdef DEVICE_TYPE_MOBILE - elm_object_part_content_set(this->view->layout, "video_view", this->video_rect); - #endif - - Evas_Object *control = add_control_layout(this, this->view->layout); - elm_object_part_content_set(this->view->layout, "controlr_part", control); - - update_view_controls(this); - return this; } diff --git a/tbtcoreapp/src/view/tbt-media-key-view.c b/tbtcoreapp/src/view/tbt-media-key-view.c index c672be2..4193e6a 100755 --- a/tbtcoreapp/src/view/tbt-media-key-view.c +++ b/tbtcoreapp/src/view/tbt-media-key-view.c @@ -46,7 +46,7 @@ struct _mediakey_view static void _app_destroy_cb(void* this); static void _media_key_event_cb(media_key_e key, media_key_event_e status, void *user_data); - +static mediakey_view *this = NULL; /** * @function get_mediakey_type_error * @since_tizen 3.0 @@ -75,6 +75,56 @@ char* get_mediakey_type_error(int ret) return err_msg; } +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + int ret; + ret = media_key_reserve(_media_key_event_cb,this); + RETVM_IF(ret != MEDIA_KEY_ERROR_NONE, NULL, "media_key_reserve failed : %s", get_mediakey_type_error(ret)); + + this->mediakey_label = ui_utils_label_add(this->view->layout, "Status[Press audiojack key] "); + elm_label_line_wrap_set(this->mediakey_label, ELM_WRAP_WORD); + + this->mediakey2_label = ui_utils_label_add(this->view->layout, "Type[Press audiojack key]"); + elm_label_line_wrap_set(this->mediakey2_label, ELM_WRAP_WORD); + + elm_object_part_content_set(this->view->layout, "1cnt", this->mediakey_label); + elm_object_part_content_set(this->view->layout, "1cnt_2cnt", this->mediakey2_label); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + /** * @function mediakey_view_add * @since_tizen 3.0 @@ -85,8 +135,7 @@ char* get_mediakey_type_error(int ret) mediakey_view *mediakey_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) { RETVM_IF(NULL == navi, NULL, "navi is null"); - int ret; - mediakey_view *this = NULL; + this = calloc(1, sizeof(mediakey_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -98,18 +147,10 @@ mediakey_view *mediakey_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Obje common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); RETVM_IF(NULL == this->view, NULL, "navi is null"); - - ret = media_key_reserve(_media_key_event_cb,this); - RETVM_IF(ret != MEDIA_KEY_ERROR_NONE, NULL, "media_key_reserve failed : %s", get_mediakey_type_error(ret)); - - this->mediakey_label = ui_utils_label_add(this->view->layout, "Status[Press audiojack key] "); - elm_label_line_wrap_set(this->mediakey_label, ELM_WRAP_WORD); - this->mediakey2_label = ui_utils_label_add(this->view->layout, "Type[Press audiojack key]"); - elm_label_line_wrap_set(this->mediakey2_label, ELM_WRAP_WORD); - - elm_object_part_content_set(this->view->layout, "1cnt", this->mediakey_label); - elm_object_part_content_set(this->view->layout, "1cnt_2cnt", this->mediakey2_label); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-mock-view.c b/tbtcoreapp/src/view/tbt-mock-view.c old mode 100644 new mode 100755 index 3c7c76f..c5a6717 --- a/tbtcoreapp/src/view/tbt-mock-view.c +++ b/tbtcoreapp/src/view/tbt-mock-view.c @@ -84,7 +84,7 @@ static void clear_spots(mock_view *this); static void enable_control(mock_view *this, bool enable); static bool __is_mock_test_running=false; - +static mock_view *this = NULL; /** * @function get_system_error @@ -120,36 +120,25 @@ switch (ret) return error; } - /** - * @function mock_view_add - * @since_tizen 2.3 - * @description Mock View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return mock_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -mock_view *mock_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - - mock_view *this = NULL; - this = calloc(1, sizeof(mock_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); + RETM_IF(NULL == data, "data is null"); - this->down = false; - tbt_info->layout_group = "4_part_txt_cnt_btn_btn"; - tbt_info->layout_file = get_edje_path("4_part_txt_cnt2_btn_btn.edj"); - - get_screen_resolution(this); - this->timer = NULL; - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } this->is_mock_event = false; this->label = ui_utils_label_add(this->view->layout, ""); ui_utils_label_set_text(this->label, "Clear: ", "left"); @@ -174,6 +163,56 @@ mock_view *mock_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item Evas_Object *control = add_control_layout(this, this->view->layout); elm_object_part_content_set(this->view->layout, "1txt_2cnt_3btn", control); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function mock_view_add + * @since_tizen 2.3 + * @description Mock View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return mock_view* + */ +mock_view *mock_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(mock_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + this->down = false; + tbt_info->layout_group = "4_part_txt_cnt_btn_btn"; + tbt_info->layout_file = get_edje_path("4_part_txt_cnt2_btn_btn.edj"); + + get_screen_resolution(this); + this->timer = NULL; + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-motion-detection-view.c b/tbtcoreapp/src/view/tbt-motion-detection-view.c old mode 100644 new mode 100755 index 4445408..46a0928 --- a/tbtcoreapp/src/view/tbt-motion-detection-view.c +++ b/tbtcoreapp/src/view/tbt-motion-detection-view.c @@ -63,7 +63,69 @@ static char * _motion_get_activity_type(activity_type_e activity_type); static Evas_Object *add_control_layout(motion_detection_view *this, Evas_Object *parent); static void activity_recognition_callback_check_type(activity_type_e activity, const activity_data_h data, double timestamp, activity_error_e error, void *user_data); static char *_activity_error(int activity_error); +static motion_detection_view *this = NULL; +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + int x,y,w,h; + evas_object_geometry_get(this->view->navi, &x, &y, &w, &h); + DBG("Dim: %d %d %d %d", x, y, w, h); + + this->activity_label = ui_utils_label_add(this->view->layout, "Activity Status"); + RETVM_IF(NULL == this->activity_label, NULL, "Label is null"); + + elm_object_part_content_set(this->view->layout, "activity_text", this->activity_label); + ui_utils_label_set_text(this->activity_label, "Activity Status", "left"); + const char *file_path; + file_path = get_resource_path(this->view->tbt_info->file_name); + this->activity_image = ui_utils_create_image(this->view->layout, file_path); + + //int x,y,w,h; + evas_object_geometry_get(this->activity_image, &x, &y, &w, &h); + DBG("Dim: %d %d %d %d", x, y, w, h); + + RETVM_IF(NULL == this->activity_image, false, "creation of layout elements failed"); + + elm_object_part_content_set(this->view->layout, "activity_image", this->activity_image); + + Evas_Object *control = add_control_layout(this, this->view->layout); + elm_object_part_content_set(this->view->layout, "controlr_part", control); + evas_object_show(control); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function motion_detection_view_add @@ -76,11 +138,6 @@ motion_detection_view *motion_detection_view_add(Evas_Object *navi, tbt_info *tb { RETVM_IF(NULL == navi, NULL, "navi is null"); - int x,y,w,h; - evas_object_geometry_get(navi, &x, &y, &w, &h); - DBG("Dim: %d %d %d %d", x, y, w, h); - - motion_detection_view *this = NULL; this = calloc(1, sizeof(motion_detection_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -94,26 +151,10 @@ motion_detection_view *motion_detection_view_add(Evas_Object *navi, tbt_info *tb RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->activity_label = ui_utils_label_add(this->view->layout, "Activity Status"); - RETVM_IF(NULL == this->activity_label, NULL, "Label is null"); - - elm_object_part_content_set(this->view->layout, "activity_text", this->activity_label); - ui_utils_label_set_text(this->activity_label, "Activity Status", "left"); - const char *file_path; - file_path = get_resource_path(this->view->tbt_info->file_name); - this->activity_image = ui_utils_create_image(this->view->layout, file_path); - - //int x,y,w,h; - evas_object_geometry_get(this->activity_image, &x, &y, &w, &h); - DBG("Dim: %d %d %d %d", x, y, w, h); - - RETVM_IF(NULL == this->activity_image, false, "creation of layout elements failed"); - - elm_object_part_content_set(this->view->layout, "activity_image", this->activity_image); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); - Evas_Object *control = add_control_layout(this, this->view->layout); - elm_object_part_content_set(this->view->layout, "controlr_part", control); - evas_object_show(control); return this; } diff --git a/tbtcoreapp/src/view/tbt-mtp-view.c b/tbtcoreapp/src/view/tbt-mtp-view.c old mode 100644 new mode 100755 index 450447b..15234bc --- a/tbtcoreapp/src/view/tbt-mtp-view.c +++ b/tbtcoreapp/src/view/tbt-mtp-view.c @@ -70,7 +70,56 @@ static void _image_file_list_item_clicked(void *data, Evas_Object *obj, void *ev static void _mtp_event_cb(mtp_event_e event, int event_parameter, void *user_data); static void mtp_functions(mtp_view *this); +static mtp_view *this = NULL; +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->list = elm_list_add(this->view->layout); + RETVM_IF(!this->list, NULL, "elm_list_add failed"); + evas_object_data_set(this->list, "view_data", this); + elm_object_part_content_set(this->view->layout, "mtp_view", this->list); + + this->info_list = elm_list_add(this->view->layout); + RETVM_IF(!this->info_list, NULL, "elm_list_add failed"); + evas_object_data_set(this->info_list, "view_data", this); + elm_object_part_content_set(this->view->layout, "mtp_info_view", this->info_list); + + mtp_functions(this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function mtp_view_add @@ -83,7 +132,6 @@ mtp_view *mtp_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *i { RETVM_IF(NULL == navi, NULL, "navi is null"); - mtp_view *this = NULL; this = calloc(1, sizeof(mtp_view)); RETVM_IF(!this, NULL, "calloc failed"); this->view = calloc(1, sizeof(common_view)); @@ -96,17 +144,9 @@ mtp_view *mtp_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *i RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->list = elm_list_add(this->view->layout); - RETVM_IF(!this->list, NULL, "elm_list_add failed"); - evas_object_data_set(this->list, "view_data", this); - elm_object_part_content_set(this->view->layout, "mtp_view", this->list); - - this->info_list = elm_list_add(this->view->layout); - RETVM_IF(!this->info_list, NULL, "elm_list_add failed"); - evas_object_data_set(this->info_list, "view_data", this); - elm_object_part_content_set(this->view->layout, "mtp_info_view", this->info_list); - - mtp_functions(this); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-nfc-ese-view.c b/tbtcoreapp/src/view/tbt-nfc-ese-view.c old mode 100644 new mode 100755 index 8f4eaea..189addb --- a/tbtcoreapp/src/view/tbt-nfc-ese-view.c +++ b/tbtcoreapp/src/view/tbt-nfc-ese-view.c @@ -54,7 +54,7 @@ static Evas_Object *add_control_layout(nfc_ese_view *this, Evas_Object *parent); static void _app_destroy_cb(void* this); static void _view_button_pressed_cb(void *data, Evas_Object *obj, void *event_info); static void app_control_view_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *data); - +static nfc_ese_view *this = NULL; /** * @function get_app_control_error @@ -118,6 +118,50 @@ static char* get_app_control_error(int ret) return error; } +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->label = ui_utils_label_add(this->view->layout, ""); + RETVM_IF(!this->label, NULL, "elm_list_add failed"); + ui_utils_label_set_text(this->label, "Launch nfc ese test app.", "left"); + elm_object_part_content_set(this->view->layout, "1txt", this->label); + + Evas_Object *control = add_control_layout(this, this->view->layout); + elm_object_part_content_set(this->view->layout, "1txt_2cnt_3btn", control); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function nfc_ese_view_add @@ -130,7 +174,6 @@ nfc_ese_view *nfc_ese_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object { RETVM_IF(NULL == navi, NULL, "navi is null"); - nfc_ese_view *this = NULL; this = calloc(1, sizeof(nfc_ese_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -143,13 +186,10 @@ nfc_ese_view *nfc_ese_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->label = ui_utils_label_add(this->view->layout, ""); - RETVM_IF(!this->label, NULL, "elm_list_add failed"); - ui_utils_label_set_text(this->label, "Launch nfc ese test app.", "left"); - elm_object_part_content_set(this->view->layout, "1txt", this->label); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); - Evas_Object *control = add_control_layout(this, this->view->layout); - elm_object_part_content_set(this->view->layout, "1txt_2cnt_3btn", control); return this; } diff --git a/tbtcoreapp/src/view/tbt-nfc-hce-preferred-view.c b/tbtcoreapp/src/view/tbt-nfc-hce-preferred-view.c old mode 100644 new mode 100755 index 66d524c..44e5fb5 --- a/tbtcoreapp/src/view/tbt-nfc-hce-preferred-view.c +++ b/tbtcoreapp/src/view/tbt-nfc-hce-preferred-view.c @@ -54,7 +54,7 @@ static Evas_Object *add_control_layout(nfc_hce_preferred_view *this, Evas_Object static void _app_destroy_cb(void* this); static void _view_button_pressed_cb(void *data, Evas_Object *obj, void *event_info); static void app_control_view_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *data); - +static nfc_hce_preferred_view *this = NULL; /** * @function get_app_control_error @@ -118,6 +118,50 @@ static char* get_app_control_error(int ret) return error; } +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->label = ui_utils_label_add(this->view->layout, ""); + RETVM_IF(!this->label, NULL, "elm_list_add failed"); + ui_utils_label_set_text(this->label, "Launch nfc hce pref app.", "left"); + elm_object_part_content_set(this->view->layout, "1txt", this->label); + + Evas_Object *control = add_control_layout(this, this->view->layout); + elm_object_part_content_set(this->view->layout, "1txt_2cnt_3btn", control); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function nfc_hce_preferred_view_add @@ -130,7 +174,6 @@ nfc_hce_preferred_view *nfc_hce_preferred_view_add(Evas_Object *navi, tbt_info * { RETVM_IF(NULL == navi, NULL, "navi is null"); - nfc_hce_preferred_view *this = NULL; this = calloc(1, sizeof(nfc_hce_preferred_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -143,13 +186,10 @@ nfc_hce_preferred_view *nfc_hce_preferred_view_add(Evas_Object *navi, tbt_info * common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->label = ui_utils_label_add(this->view->layout, ""); - RETVM_IF(!this->label, NULL, "elm_list_add failed"); - ui_utils_label_set_text(this->label, "Launch nfc hce pref app.", "left"); - elm_object_part_content_set(this->view->layout, "1txt", this->label); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); - Evas_Object *control = add_control_layout(this, this->view->layout); - elm_object_part_content_set(this->view->layout, "1txt_2cnt_3btn", control); return this; } diff --git a/tbtcoreapp/src/view/tbt-nfc-view.c b/tbtcoreapp/src/view/tbt-nfc-view.c old mode 100644 new mode 100755 index 28e2150..18ea414 --- a/tbtcoreapp/src/view/tbt-nfc-view.c +++ b/tbtcoreapp/src/view/tbt-nfc-view.c @@ -95,42 +95,26 @@ void nfc_ndef_message_read(nfc_ndef_message_h message, void *user_data); void on_nfc_snep_started(void* data); void on_nfc_snep_get(void* data); void _nfc_p2p_send_completed_cb(nfc_error_e result, void *user_data); - - +static nfc_view *this = NULL; /** - * @function nfc_view_add - * @since_tizen 2.3 - * @description Nfc View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return nfc_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -nfc_view *nfc_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); + RETM_IF(NULL == data, "data is null"); - nfc_view *this = NULL; - this = calloc(1, sizeof(nfc_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); - if(tbt_info->apptype == TBT_APP_NFC_TAG) - { - tbt_info->layout_group = "nfc_viewer_tag"; - tbt_info->layout_file = get_edje_path("nfc_viewer.edj"); - - - } - else if(tbt_info->apptype == TBT_APP_NFC_P2P) - { - tbt_info->layout_group = "nfc_viewer_p2p"; - tbt_info->layout_file = get_edje_path("nfc_viewer.edj"); - } - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(!this->view, NULL, "view NULL after common_view_add"); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } Evas_Object *tabbar; Elm_Object_Item *nf_it; Evas_Object *nf = this->view->navi; @@ -161,6 +145,61 @@ nfc_view *nfc_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *i initialize_nfc(this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function nfc_view_add + * @since_tizen 2.3 + * @description Nfc View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return nfc_view* + */ +nfc_view *nfc_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(nfc_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + if(tbt_info->apptype == TBT_APP_NFC_TAG) + { + tbt_info->layout_group = "nfc_viewer_tag"; + tbt_info->layout_file = get_edje_path("nfc_viewer.edj"); + + + } + else if(tbt_info->apptype == TBT_APP_NFC_P2P) + { + tbt_info->layout_group = "nfc_viewer_p2p"; + tbt_info->layout_file = get_edje_path("nfc_viewer.edj"); + } + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(!this->view, NULL, "view NULL after common_view_add"); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-notification-view.c b/tbtcoreapp/src/view/tbt-notification-view.c index bbb74e9..990857a 100755 --- a/tbtcoreapp/src/view/tbt-notification-view.c +++ b/tbtcoreapp/src/view/tbt-notification-view.c @@ -45,7 +45,7 @@ struct _notification_view }; static void _app_destroy_cb(void* this); - +static notification_view *this = NULL; notification_h g_NotificationHandle; /** @@ -98,30 +98,25 @@ char* get_notification_error(int ret) } /** - * @function notification_view_add + * @function guide_pop_up_button_callback * @since_tizen 3.0 - * @description Notification View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return notification_view* + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -notification_view *notification_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - int ret; - notification_view *this = NULL; - this = calloc(1, sizeof(notification_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - tbt_info->layout_group = "2_part_cnt_btn"; - tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); + RETM_IF(NULL == data, "data is null"); - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + int ret; g_NotificationHandle = notification_create(NOTIFICATION_TYPE_NOTI); if(this->view->tbt_info->apptype == TBT_APP_NOTIFICATION_TITLE) @@ -166,6 +161,53 @@ notification_view *notification_view_add(Evas_Object *navi, tbt_info *tbt_info, return this; } +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function notification_view_add + * @since_tizen 3.0 + * @description Notification View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return notification_view* + */ +notification_view *notification_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(notification_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + return this; } diff --git a/tbtcoreapp/src/view/tbt-nsd-dns-sd-view.c b/tbtcoreapp/src/view/tbt-nsd-dns-sd-view.c old mode 100644 new mode 100755 index d11a7ab..8379754 --- a/tbtcoreapp/src/view/tbt-nsd-dns-sd-view.c +++ b/tbtcoreapp/src/view/tbt-nsd-dns-sd-view.c @@ -64,7 +64,7 @@ static void _on_browse_btn_clickded_cb(void *data, Evas_Object *obj, void *event static void _on_add_record_btn_clickded_cb(void *data, Evas_Object *obj, void *event_info); static void _dnssd_found_cb(dnssd_service_state_e service_state, dnssd_service_h remote_service, void *user_data); static char** str_split(char* a_str, const char a_delim); - +static nsd_dnssd_view *this = NULL; #ifdef USE_GENLIST typedef struct @@ -145,30 +145,24 @@ Elm_Object_Item* _nsd_dnssd_elm_genlist_item_append(Evas_Object* list, char *ite #endif /** - * @function nsd_dnssd_view_add + * @function guide_pop_up_button_callback * @since_tizen 3.0 - * @description nsd_dnssd View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return nsd_dnssd_view* + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -nsd_dnssd_view *nsd_dnssd_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - - nsd_dnssd_view *this = NULL; - this = calloc(1, sizeof(nsd_dnssd_view)); - RETVM_IF(!this, NULL, "calloc failed"); - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - tbt_info->layout_group = "4_part_cnt_cnt_btn_btn"; - tbt_info->layout_file = get_edje_path("4_part_cnt1.25_cnt1.5_btn_btn.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - - RETVM_IF(NULL == this->view, NULL, "navi is null"); + RETM_IF(NULL == data, "data is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } #ifdef USE_GENLIST this->list = elm_genlist_add(this->view->layout); RETVM_IF(!this->list, NULL, "elm_genlist_add failed"); @@ -227,6 +221,52 @@ nsd_dnssd_view *nsd_dnssd_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Ob dns_sd_api(this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function nsd_dnssd_view_add + * @since_tizen 3.0 + * @description nsd_dnssd View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return nsd_dnssd_view* + */ +nsd_dnssd_view *nsd_dnssd_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(nsd_dnssd_view)); + RETVM_IF(!this, NULL, "calloc failed"); + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "4_part_cnt_cnt_btn_btn"; + tbt_info->layout_file = get_edje_path("4_part_cnt1.25_cnt1.5_btn_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + return this; } diff --git a/tbtcoreapp/src/view/tbt-nsd-ssdp-view.c b/tbtcoreapp/src/view/tbt-nsd-ssdp-view.c old mode 100644 new mode 100755 index a096b10..1ca78a6 --- a/tbtcoreapp/src/view/tbt-nsd-ssdp-view.c +++ b/tbtcoreapp/src/view/tbt-nsd-ssdp-view.c @@ -67,34 +67,27 @@ static void _ssdp_registered_cb(ssdp_error_e result, ssdp_service_h local_servic static void _on_browse_btn_clickded_cb(void *data, Evas_Object *obj, void *event_info); static void _on_add_record_btn_clickded_cb(void *data, Evas_Object *obj, void *event_info); static void _ssdp_found_cb(ssdp_service_state_e service_state, ssdp_service_h remote_service, void *user_data); - - +static nsd_ssdp_view *this = NULL; /** - * @function nsd_ssdp_view_add + * @function guide_pop_up_button_callback * @since_tizen 3.0 - * @description nsd_ssdp View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return nsd_ssdp_view* + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -nsd_ssdp_view *nsd_ssdp_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - - nsd_ssdp_view *this = NULL; - this = calloc(1, sizeof(nsd_ssdp_view)); - RETVM_IF(!this, NULL, "calloc failed"); - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - tbt_info->layout_group = "4_part_cnt_cnt_btn_btn"; - tbt_info->layout_file = get_edje_path("4_part_cnt1.25_cnt1.5_btn_btn.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - - RETVM_IF(NULL == this->view, NULL, "navi is null"); + RETM_IF(NULL == data, "data is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } this->list = elm_list_add(this->view->layout); RETVM_IF(!this->list, NULL, "elm_list_add failed"); evas_object_data_set(this->list, "view_data", this); @@ -142,6 +135,52 @@ nsd_ssdp_view *nsd_ssdp_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Obje ssdp_api(this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function nsd_ssdp_view_add + * @since_tizen 3.0 + * @description nsd_ssdp View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return nsd_ssdp_view* + */ +nsd_ssdp_view *nsd_ssdp_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(nsd_ssdp_view)); + RETVM_IF(!this, NULL, "calloc failed"); + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "4_part_cnt_cnt_btn_btn"; + tbt_info->layout_file = get_edje_path("4_part_cnt1.25_cnt1.5_btn_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + return this; } diff --git a/tbtcoreapp/src/view/tbt-oauth2-info-view.c b/tbtcoreapp/src/view/tbt-oauth2-info-view.c old mode 100644 new mode 100755 index 48e94dc..5e946f6 --- a/tbtcoreapp/src/view/tbt-oauth2-info-view.c +++ b/tbtcoreapp/src/view/tbt-oauth2-info-view.c @@ -37,7 +37,51 @@ #include "view/tbt-common-view.h" static void _app_destroy_cb(void* this); +static oauth2_info_view *this = NULL; +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->access_token = NULL; + this->expire_in = 0; + this->refresh_token = NULL; + this->scope = NULL; + this->token_type = NULL; + this->state = NULL; + this->custom_data = NULL; +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function _oauth2_info_view_add @@ -51,7 +95,6 @@ oauth2_info_view *_oauth2_info_view_add(Evas_Object *navi, tbt_info *tbt_info, E RETVM_IF(NULL == navi, NULL, "navi is null"); - oauth2_info_view *this = NULL; this = calloc(1, sizeof(oauth2_info_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -65,13 +108,10 @@ oauth2_info_view *_oauth2_info_view_add(Evas_Object *navi, tbt_info *tbt_info, E RETVM_IF(!this, NULL, "calloc failed"); RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->access_token = NULL; - this->expire_in = 0; - this->refresh_token = NULL; - this->scope = NULL; - this->token_type = NULL; - this->state = NULL; - this->custom_data = NULL; + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + return this; } diff --git a/tbtcoreapp/src/view/tbt-oauth2-view.c b/tbtcoreapp/src/view/tbt-oauth2-view.c old mode 100644 new mode 100755 index 877ad3f..2fc81cb --- a/tbtcoreapp/src/view/tbt-oauth2-view.c +++ b/tbtcoreapp/src/view/tbt-oauth2-view.c @@ -95,7 +95,64 @@ static char* strip_google_json(const char *s); static void show_google_auth_output(void* user_data); static void oauth2_info_button_pressed_cb(void *data, Evas_Object *obj, void *event_info); static char* get_oauth2_error(oauth2_error_e error); +static oauth2_view *this = NULL; +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->list = elm_list_add(this->view->layout); + RETVM_IF(!this->list, NULL, "elm_list_add failed"); + elm_object_part_content_set(this->view->layout, "oauth2_view", this->list); + + prepare_oauth2_list(this); + + this->btn_clear_cache = ui_utils_push_button_add(this, this->view->layout, "Clear Cache", clear_chache_button_pressed_cb); + elm_object_part_content_set(this->view->layout, "oauth2_btn", this->btn_clear_cache); + evas_object_show(this->btn_clear_cache); + + this->btn_oauth2_info = ui_utils_push_button_add(this, this->view->layout, "Info", oauth2_info_button_pressed_cb); + elm_object_part_content_set(this->view->layout, "oauth2_info_btn", this->btn_oauth2_info); + evas_object_show(this->btn_oauth2_info); + + this->google_desc_obj = ui_utils_label_add(this->view->layout, ""); + elm_object_part_content_set(this->view->layout, "oauth2_description", this->google_desc_obj); + evas_object_show(this->google_desc_obj); + + this->google_img_text = ui_utils_label_add(this->view->layout, "Image"); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function oauth2_view_add @@ -108,7 +165,6 @@ oauth2_view *oauth2_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I { RETVM_IF(NULL == navi, NULL, "navi is null"); - oauth2_view *this = NULL; this = calloc(1, sizeof(oauth2_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -123,6 +179,9 @@ oauth2_view *oauth2_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I RETVM_IF(NULL == this->view, NULL, "navi is null"); RETVM_IF(NULL == this->view->layout, NULL, "navi is null"); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); this->oauth2_mgr = NULL; this->google_name = NULL; this->google_pic = NULL; @@ -136,26 +195,6 @@ oauth2_view *oauth2_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I this->state = NULL; this->custom_data = NULL; - this->list = elm_list_add(this->view->layout); - RETVM_IF(!this->list, NULL, "elm_list_add failed"); - elm_object_part_content_set(this->view->layout, "oauth2_view", this->list); - - prepare_oauth2_list(this); - - this->btn_clear_cache = ui_utils_push_button_add(this, this->view->layout, "Clear Cache", clear_chache_button_pressed_cb); - elm_object_part_content_set(this->view->layout, "oauth2_btn", this->btn_clear_cache); - evas_object_show(this->btn_clear_cache); - - this->btn_oauth2_info = ui_utils_push_button_add(this, this->view->layout, "Info", oauth2_info_button_pressed_cb); - elm_object_part_content_set(this->view->layout, "oauth2_info_btn", this->btn_oauth2_info); - evas_object_show(this->btn_oauth2_info); - - this->google_desc_obj = ui_utils_label_add(this->view->layout, ""); - elm_object_part_content_set(this->view->layout, "oauth2_description", this->google_desc_obj); - evas_object_show(this->google_desc_obj); - - this->google_img_text = ui_utils_label_add(this->view->layout, "Image"); - return this; } diff --git a/tbtcoreapp/src/view/tbt-package-manager-view.c b/tbtcoreapp/src/view/tbt-package-manager-view.c index b19e275..7d9e4b0 100755 --- a/tbtcoreapp/src/view/tbt-package-manager-view.c +++ b/tbtcoreapp/src/view/tbt-package-manager-view.c @@ -46,7 +46,7 @@ struct _packagemanager_view static void _app_destroy_cb(void* this); static void _package_manager_event_cb(const char *type, const char *package, package_manager_event_type_e event_type, package_manager_event_state_e event_state, int progress, package_manager_error_e error, void *user_data); - +static packagemanager_view *this = NULL; package_manager_h g_pstPkgMngr; /** @@ -83,6 +83,60 @@ char* get_package_manager_error(int ret) return err_msg; } +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + int ret; + ret = package_manager_create(&g_pstPkgMngr); + RETVM_IF(ret != PACKAGE_MANAGER_ERROR_NONE, NULL, "package_manager_create failed : %s", get_package_manager_error(ret)); + + ret = package_manager_set_event_cb(g_pstPkgMngr,_package_manager_event_cb, this); + RETVM_IF(ret != PACKAGE_MANAGER_ERROR_NONE, NULL, "package_manager_set_event_cb failed : %s", get_package_manager_error(ret)); + + this->packagemanager_label = ui_utils_label_add(this->view->layout, "Package Status:Install/Uninstall/Update "); + elm_label_line_wrap_set(this->packagemanager_label, ELM_WRAP_WORD); + + this->packagemanagerstate_label = ui_utils_label_add(this->view->layout, "State: No Progress"); + elm_label_line_wrap_set(this->packagemanagerstate_label, ELM_WRAP_WORD); + + elm_object_part_content_set(this->view->layout, "1cnt", this->packagemanager_label); + elm_object_part_content_set(this->view->layout, "1cnt_2cnt", this->packagemanagerstate_label); + +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + /** * @function packagemanager_view_add * @since_tizen 3.0 @@ -93,8 +147,7 @@ char* get_package_manager_error(int ret) packagemanager_view *packagemanager_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) { RETVM_IF(NULL == navi, NULL, "navi is null"); - int ret; - packagemanager_view *this = NULL; + this = calloc(1, sizeof(packagemanager_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -108,20 +161,9 @@ packagemanager_view *packagemanager_view_add(Evas_Object *navi, tbt_info *tbt_in common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); RETVM_IF(NULL == this->view, NULL, "navi is null"); - ret = package_manager_create(&g_pstPkgMngr); - RETVM_IF(ret != PACKAGE_MANAGER_ERROR_NONE, NULL, "package_manager_create failed : %s", get_package_manager_error(ret)); - - ret = package_manager_set_event_cb(g_pstPkgMngr,_package_manager_event_cb, this); - RETVM_IF(ret != PACKAGE_MANAGER_ERROR_NONE, NULL, "package_manager_set_event_cb failed : %s", get_package_manager_error(ret)); - - this->packagemanager_label = ui_utils_label_add(this->view->layout, "Package Status:Install/Uninstall/Update "); - elm_label_line_wrap_set(this->packagemanager_label, ELM_WRAP_WORD); - - this->packagemanagerstate_label = ui_utils_label_add(this->view->layout, "State: No Progress"); - elm_label_line_wrap_set(this->packagemanagerstate_label, ELM_WRAP_WORD); - - elm_object_part_content_set(this->view->layout, "1cnt", this->packagemanager_label); - elm_object_part_content_set(this->view->layout, "1cnt_2cnt", this->packagemanagerstate_label); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-pick-view.c b/tbtcoreapp/src/view/tbt-pick-view.c old mode 100644 new mode 100755 index ef3390e..d04b66b --- a/tbtcoreapp/src/view/tbt-pick-view.c +++ b/tbtcoreapp/src/view/tbt-pick-view.c @@ -113,7 +113,7 @@ static void _add_videos(pick_view *this); static void _view(void *data, Evas_Object *obj, void *event_info); static void app_control_view_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *data); static bool _app_control_extra_data_cb(app_control_h app_control, const char *key, void *data); - +static pick_view *this = NULL; #ifdef USE_GENLIST @@ -241,6 +241,61 @@ static char* get_app_control_error(int ret) return error; } +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->label = ui_utils_label_add(this->view->layout, ""); + RETVM_IF(!this->label, NULL, "elm_list_add failed"); + ui_utils_label_set_text(this->label, "Pick/View Data: ", "left"); + elm_object_part_content_set(this->view->layout, "1txt", this->label); + +#ifdef USE_GENLIST + this->data_list = elm_genlist_add(this->view->layout); + RETVM_IF(!this->data_list, NULL, "elm_genlist_add failed"); +#else + this->data_list = elm_list_add(this->view->layout); + RETVM_IF(!this->data_list, NULL, "elm_list_add failed"); +#endif + + evas_object_data_set(this->data_list, "data_view", this); + elm_object_part_content_set(this->view->layout, "1txt_2cnt", this->data_list); + + Evas_Object *control = add_control_layout(this, this->view->layout); + elm_object_part_content_set(this->view->layout, "1txt_2cnt_3btn", control); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function pick_view_add @@ -253,7 +308,6 @@ pick_view *pick_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item { RETVM_IF(NULL == navi, NULL, "navi is null"); - pick_view *this = NULL; this = calloc(1, sizeof(pick_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -291,24 +345,9 @@ pick_view *pick_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->label = ui_utils_label_add(this->view->layout, ""); - RETVM_IF(!this->label, NULL, "elm_list_add failed"); - ui_utils_label_set_text(this->label, "Pick/View Data: ", "left"); - elm_object_part_content_set(this->view->layout, "1txt", this->label); - -#ifdef USE_GENLIST - this->data_list = elm_genlist_add(this->view->layout); - RETVM_IF(!this->data_list, NULL, "elm_genlist_add failed"); -#else - this->data_list = elm_list_add(this->view->layout); - RETVM_IF(!this->data_list, NULL, "elm_list_add failed"); -#endif - - evas_object_data_set(this->data_list, "data_view", this); - elm_object_part_content_set(this->view->layout, "1txt_2cnt", this->data_list); - - Evas_Object *control = add_control_layout(this, this->view->layout); - elm_object_part_content_set(this->view->layout, "1txt_2cnt_3btn", control); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-push-view.c b/tbtcoreapp/src/view/tbt-push-view.c old mode 100644 new mode 100755 index c6a8138..3c35d0a --- a/tbtcoreapp/src/view/tbt-push-view.c +++ b/tbtcoreapp/src/view/tbt-push-view.c @@ -94,35 +94,27 @@ static size_t _curl_response_cb(char *ptr, size_t size, size_t nmemb, void *user static void push_service_update_btn_state(void* user_data); static char* push_service_get_error(int error_code); static char* get_xml_element_value (xmlDocPtr doc, xmlNodePtr cur, const char* tag); +static push_view *this = NULL; /** - * @function push_view_add - * @since_tizen 2.3 - * @description Push View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return push_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -push_view *push_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - - push_view *this = NULL; - this = calloc(1, sizeof(push_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - this->push_btn_state = DISCONNECTED_STATE; - push_service_update_btn_state(this); - - tbt_info->layout_group = "push_service"; - tbt_info->layout_file = get_edje_path("push_service.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETM_IF(NULL == data, "data is null"); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } //get appID and appSecret from file char auth_file_path[256]={'\0',}; @@ -154,13 +146,13 @@ push_view *push_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item Evas_Object *control = add_control_layout(this, this->view->layout); elm_object_part_content_set(this->view->layout, "controlr_part", control); - if(tbt_info->is_push_from_outside == true) + if(this->view->tbt_info->is_push_from_outside == true) { //Get Push from outside this->push_btn_state = DISABLED_STATE; push_service_update_btn_state(this); char *noti_data = NULL; - noti_data = push_service_app_control_to_noti_data(tbt_info->push_app_control, tbt_info->push_operation_id); + noti_data = push_service_app_control_to_noti_data(this->view->tbt_info->push_app_control, this->view->tbt_info->push_operation_id); RETVM_IF( NULL == noti_data, NULL, "noti_data is NULL"); elm_object_text_set(this->push_label, noti_data); @@ -168,10 +160,58 @@ push_view *push_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item free(noti_data); } - tbt_info->is_push_from_outside = false; + this->view->tbt_info->is_push_from_outside = false; } +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function push_view_add + * @since_tizen 2.3 + * @description Push View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return push_view* + */ +push_view *push_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(push_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + this->push_btn_state = DISCONNECTED_STATE; + push_service_update_btn_state(this); + + tbt_info->layout_group = "push_service"; + tbt_info->layout_file = get_edje_path("push_service.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + + RETVM_IF(NULL == this->view, NULL, "navi is null"); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-radio-view.c b/tbtcoreapp/src/view/tbt-radio-view.c index 23379e2..ca4593b 100755 --- a/tbtcoreapp/src/view/tbt-radio-view.c +++ b/tbtcoreapp/src/view/tbt-radio-view.c @@ -47,6 +47,7 @@ static void _radio_interrupted_cb(radio_interrupted_code_e code, void *user_data radio_h g_pstRadio; static bool is_not_supported = false; +static radio_view *this = NULL; /** * @function get_radio_type_error @@ -86,30 +87,25 @@ char* get_radio_type_error(int ret) } /** - * @function radio_view_add + * @function guide_pop_up_button_callback * @since_tizen 3.0 - * @description Radio View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return radio_view* + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -radio_view *radio_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - int ret; - radio_view *this = NULL; - this = calloc(1, sizeof(radio_view)); - RETVM_IF(!this, NULL, "calloc failed"); + RETM_IF(NULL == data, "data is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - tbt_info->layout_group = "2_part_cnt_btn"; - tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(NULL == this->view, NULL, "navi is null"); - + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + int ret; ret = radio_create(&g_pstRadio); RETVM_IF(ret != RADIO_ERROR_NONE && ret != RADIO_ERROR_NOT_SUPPORTED, NULL, "radio_create failed : %s", get_radio_type_error(ret)); @@ -141,6 +137,52 @@ radio_view *radio_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite elm_object_part_content_set(this->view->layout, "1cnt", this->radio_label); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function radio_view_add + * @since_tizen 3.0 + * @description Radio View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return radio_view* + */ +radio_view *radio_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(radio_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-runtimeinfo-view.c b/tbtcoreapp/src/view/tbt-runtimeinfo-view.c old mode 100644 new mode 100755 index bbfdb36..6a4b486 --- a/tbtcoreapp/src/view/tbt-runtimeinfo-view.c +++ b/tbtcoreapp/src/view/tbt-runtimeinfo-view.c @@ -57,7 +57,7 @@ static void _wifi_state_changed_cb(runtime_info_key_e key, void *user_data); static void _position_updated_cb(double latitude, double longitude, double altitude, time_t timestamp, void *data); static void _gps_state_changed_gps_cb(location_service_state_e state, void *data); - +static runtimeinfo_view *this = NULL; /** * @function get_runtime_info_error * @since_tizen 2.3 @@ -104,33 +104,26 @@ char* get_runtime_info_error(int ret) return err_msg; } - /** - * @function runtimeinfo_view_add - * @since_tizen 2.3 - * @description Runtimeinfo View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return runtimeinfo_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -runtimeinfo_view *runtimeinfo_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - int ret, value; - runtimeinfo_view *this = NULL; - this = calloc(1, sizeof(runtimeinfo_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); + RETM_IF(NULL == data, "data is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); - tbt_info->layout_group = "2_part_cnt_btn"; - tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(NULL == this->view, NULL, "navi is null"); - + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + int ret, value; bool bvalue; if(this->view->tbt_info->apptype == TBT_APP_AUDIO_JACK) { @@ -543,6 +536,53 @@ runtimeinfo_view *runtimeinfo_view_add(Evas_Object *navi, tbt_info *tbt_info, El return this; } +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function runtimeinfo_view_add + * @since_tizen 2.3 + * @description Runtimeinfo View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return runtimeinfo_view* + */ +runtimeinfo_view *runtimeinfo_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(runtimeinfo_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + + tbt_info->layout_group = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-screenmirrorsink-view.c b/tbtcoreapp/src/view/tbt-screenmirrorsink-view.c old mode 100644 new mode 100755 index a930c01..d3f41df --- a/tbtcoreapp/src/view/tbt-screenmirrorsink-view.c +++ b/tbtcoreapp/src/view/tbt-screenmirrorsink-view.c @@ -82,34 +82,27 @@ static char* sc_mirroring_get_error(scmirroring_error_e err_code); static void scmirroring_sink_show_info(void* user_data); static char* get_scmirroring_audio_codec(scmirroring_audio_codec_e audio_codec); static char* get_scmirroring_video_codec(scmirroring_video_codec_e video_codec); - +static screenmirror_sink_view *this = NULL; /** - * @function screenmirror_sink_view_add - * @since_tizen 2.4 - * @description Screen Mirror Sink View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return screenmirror_sink_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -screenmirror_sink_view *screenmirror_sink_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); + RETM_IF(NULL == data, "data is null"); - screenmirror_sink_view *this = NULL; - this = calloc(1, sizeof(screenmirror_sink_view)); - RETVM_IF(!this, NULL, "calloc failed"); - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - this->scmirroring_sink = NULL; - this->scmirroring_resolution = 0; - - tbt_info->layout_group = "screenmirror_sink_viewer"; - tbt_info->layout_file = get_edje_path("screenmirror_sink_viewer.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(NULL == this->view, NULL, "this->view is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } this->status_text = ui_utils_label_add(this->view->layout, ""); elm_object_part_content_set(this->view->layout, "status_text", this->status_text); @@ -140,6 +133,54 @@ screenmirror_sink_view *screenmirror_sink_view_add(Evas_Object *navi, tbt_info * //this->display_window = elm_win_xwindow_get(this->display_object); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function screenmirror_sink_view_add + * @since_tizen 2.4 + * @description Screen Mirror Sink View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return screenmirror_sink_view* + */ +screenmirror_sink_view *screenmirror_sink_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(screenmirror_sink_view)); + RETVM_IF(!this, NULL, "calloc failed"); + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + this->scmirroring_sink = NULL; + this->scmirroring_resolution = 0; + + tbt_info->layout_group = "screenmirror_sink_viewer"; + tbt_info->layout_file = get_edje_path("screenmirror_sink_viewer.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "this->view is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + return this; } diff --git a/tbtcoreapp/src/view/tbt-sensor-view.c b/tbtcoreapp/src/view/tbt-sensor-view.c index 5dceaa7..d365158 100755 --- a/tbtcoreapp/src/view/tbt-sensor-view.c +++ b/tbtcoreapp/src/view/tbt-sensor-view.c @@ -267,7 +267,7 @@ static void rotate_image(Evas_Object* obj, float angle); static float convert_magnatic_value(float value); static float convert_pressure_value(float value); static void get_current_sensor_data(sensor_view *view); - +static sensor_view *this = NULL; /** * @function get_sensor_error @@ -309,91 +309,26 @@ static char* get_sensor_error(int ret) return error; } - /** - * @function sensor_view_add - * @since_tizen 2.3 - * @description Sensor View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return sensor_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -sensor_view *sensor_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - DBG("Inside sensor_view_add"); - RETVM_IF(NULL == navi, NULL, "navi is null"); + RETM_IF(NULL == data, "data is null"); - sensor_view *this = NULL; - this = calloc(1, sizeof(sensor_view)); - RETVM_IF(!this, NULL, "calloc failed"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - if (tbt_info->apptype == TBT_APP_SENSOR_PROXIMITY) - { - tbt_info->layout_group = "3_part_cnt_txt_btn"; - tbt_info->layout_file = get_edje_path("3_part_cnt2.75_txt_btn.edj"); - - } - else if (tbt_info->apptype == TBT_APP_SENSOR_LIGHT) - { - tbt_info->layout_group = "3_part_cnt_txt_btn"; - tbt_info->layout_file = get_edje_path("3_part_cnt2.75_txt_btn.edj"); - } - else if (tbt_info->apptype == TBT_APP_SENSOR_ULTRA_VIOLET) - { - tbt_info->layout_group = "3_part_cnt_txt_btn"; - tbt_info->layout_file = get_edje_path("3_part_cnt2.75_txt_btn.edj"); - } - - else if (tbt_info->apptype == TBT_APP_SENSOR_PRESSURE) - { - tbt_info->layout_group = "6_part_cnt_cnt_cnt_cnt_txt_btn"; - tbt_info->layout_file = get_edje_path("6_part_cnt0.75_cnt0.75_cnt0.75_cnt0.75_cnt0.75_btn.edj"); - } - - else if (tbt_info->apptype == TBT_APP_SENSOR_ACCELEROMETER) - { - tbt_info->layout_group = "3_part_cnt_cnt_btn"; - tbt_info->layout_file = get_edje_path("3_part_cnt2.75_cnt_btn.edj"); - } - else if(tbt_info->apptype == TBT_APP_SENSOR_GYROSCOPE) - { - tbt_info->layout_group = "4_part_cnt_cnt_btn_btn"; - tbt_info->layout_file = get_edje_path("4_part_cnt1.25_cnt1.5_btn_btn.edj"); - - } - else if(tbt_info->apptype == TBT_APP_SENSOR_MAGNATOMETER) - { - tbt_info->layout_group = "5_part_cnt_cnt_cnt_cnt_btn"; - tbt_info->layout_file = get_edje_path("5_part_cnt__cnt__cnt__cnt_btn.edj"); - } - else if(tbt_info->apptype == TBT_APP_SENSOR_PEDOMETER) - { - tbt_info->layout_group = "3_part_cnt_txt_btn"; - tbt_info->layout_file = get_edje_path("3_part_cnt2.75_txt_btn.edj"); - } - else - { - tbt_info->layout_group = "4_part_cnt_cnt_btn_btn"; - tbt_info->layout_file = get_edje_path("4_part_cnt1.25_cnt1.5_btn_btn.edj"); - } - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - - RETVM_IF(NULL == this->view, NULL, "navi is null"); - - this->sensor_info = this->view->tbt_info; - - if(is_sensor_supported(this) == false) - { - Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); - elm_object_text_set(popup, "Sensor is not supported"); - RETVM_IF(!this->view, NULL,"Sensor is not supported"); - - } - - if(this->sensor_info->apptype == TBT_APP_SENSOR_GYROSCOPE) + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + if(this->sensor_info->apptype == TBT_APP_SENSOR_GYROSCOPE) { this->gyro_current_state = 1; create_control(this, "Next"); @@ -594,51 +529,156 @@ sensor_view *sensor_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I elm_object_part_content_set(this->view->layout, "1cnt_2txt", this->pedometer_label); sensor_get_default_sensor(SENSOR_HUMAN_PEDOMETER, &this->sensor_info->sensor); } + //elm_object_part_content_set(this->view->layout, "gl_view", this->glview); + //elm_object_part_content_set(this->view->layout, "value_view", this->genlist); + if (this->view->tbt_info->apptype == TBT_APP_SENSOR_PRESSURE) + { + elm_object_part_content_set(this->view->layout, "1cnt_2cnt_3cnt_4cnt", this->genlist); + } - this->glview = gles_cube_view_init(this); - if(this->glview == NULL) + else if (this->view->tbt_info->apptype == TBT_APP_SENSOR_ACCELEROMETER) { - gles_cube_view_del(this); - return NULL; + elm_object_part_content_set(this->view->layout, "1cnt", this->glview); + elm_object_part_content_set(this->view->layout, "1cnt_2cnt", this->genlist); + } + else if(this->view->tbt_info->apptype == TBT_APP_SENSOR_GYROSCOPE) + { + elm_object_part_content_set(this->view->layout, "1cnt", this->glview); + elm_object_part_content_set(this->view->layout, "1cnt_2cnt", this->genlist); + } + else if(this->view->tbt_info->apptype == TBT_APP_SENSOR_MAGNATOMETER) + { + elm_object_part_content_set(this->view->layout, "1cnt_2txt_3cnt_4cnt", this->genlist); + } + else + { + elm_object_part_content_set(this->view->layout, "1cnt", this->glview); + elm_object_part_content_set(this->view->layout, "1cnt_2cnt", this->genlist); } - this->genlist = genlist_create(this); - RETVM_IF(NULL == this->genlist, NULL, "genlist_create is null"); +} +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} - sensor_value_items_create(this); - sensor_value_items_prepare(this); +/** + * @function sensor_view_add + * @since_tizen 2.3 + * @description Sensor View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return sensor_view* + */ +sensor_view *sensor_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + DBG("Inside sensor_view_add"); + RETVM_IF(NULL == navi, NULL, "navi is null"); - //elm_object_part_content_set(this->view->layout, "gl_view", this->glview); - //elm_object_part_content_set(this->view->layout, "value_view", this->genlist); - if (tbt_info->apptype == TBT_APP_SENSOR_PRESSURE) + this = calloc(1, sizeof(sensor_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + if (tbt_info->apptype == TBT_APP_SENSOR_PROXIMITY) { - elm_object_part_content_set(this->view->layout, "1cnt_2cnt_3cnt_4cnt", this->genlist); + tbt_info->layout_group = "3_part_cnt_txt_btn"; + tbt_info->layout_file = get_edje_path("3_part_cnt2.75_txt_btn.edj"); + + } + else if (tbt_info->apptype == TBT_APP_SENSOR_LIGHT) + { + tbt_info->layout_group = "3_part_cnt_txt_btn"; + tbt_info->layout_file = get_edje_path("3_part_cnt2.75_txt_btn.edj"); + } + else if (tbt_info->apptype == TBT_APP_SENSOR_ULTRA_VIOLET) + { + tbt_info->layout_group = "3_part_cnt_txt_btn"; + tbt_info->layout_file = get_edje_path("3_part_cnt2.75_txt_btn.edj"); + } + + else if (tbt_info->apptype == TBT_APP_SENSOR_PRESSURE) + { + tbt_info->layout_group = "6_part_cnt_cnt_cnt_cnt_txt_btn"; + tbt_info->layout_file = get_edje_path("6_part_cnt0.75_cnt0.75_cnt0.75_cnt0.75_cnt0.75_btn.edj"); } else if (tbt_info->apptype == TBT_APP_SENSOR_ACCELEROMETER) { - elm_object_part_content_set(this->view->layout, "1cnt", this->glview); - elm_object_part_content_set(this->view->layout, "1cnt_2cnt", this->genlist); + tbt_info->layout_group = "3_part_cnt_cnt_btn"; + tbt_info->layout_file = get_edje_path("3_part_cnt2.75_cnt_btn.edj"); } else if(tbt_info->apptype == TBT_APP_SENSOR_GYROSCOPE) { - elm_object_part_content_set(this->view->layout, "1cnt", this->glview); - elm_object_part_content_set(this->view->layout, "1cnt_2cnt", this->genlist); + tbt_info->layout_group = "4_part_cnt_cnt_btn_btn"; + tbt_info->layout_file = get_edje_path("4_part_cnt1.25_cnt1.5_btn_btn.edj"); + } else if(tbt_info->apptype == TBT_APP_SENSOR_MAGNATOMETER) { - elm_object_part_content_set(this->view->layout, "1cnt_2txt_3cnt_4cnt", this->genlist); + tbt_info->layout_group = "5_part_cnt_cnt_cnt_cnt_btn"; + tbt_info->layout_file = get_edje_path("5_part_cnt__cnt__cnt__cnt_btn.edj"); + } + else if(tbt_info->apptype == TBT_APP_SENSOR_PEDOMETER) + { + tbt_info->layout_group = "3_part_cnt_txt_btn"; + tbt_info->layout_file = get_edje_path("3_part_cnt2.75_txt_btn.edj"); } else { - elm_object_part_content_set(this->view->layout, "1cnt", this->glview); - elm_object_part_content_set(this->view->layout, "1cnt_2cnt", this->genlist); + tbt_info->layout_group = "4_part_cnt_cnt_btn_btn"; + tbt_info->layout_file = get_edje_path("4_part_cnt1.25_cnt1.5_btn_btn.edj"); } - evas_object_smart_callback_add(this->view->navi, "transition,finished", _sensor_view_transition_finished_cb, this); + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + this->sensor_info = this->view->tbt_info; + + + + if(is_sensor_supported(this) == false) + { + Evas_Object *popup = ui_utils_popup_add(this->view->navi, "Message"); + elm_object_text_set(popup, "Sensor is not supported"); + RETVM_IF(!this->view, NULL,"Sensor is not supported"); + + } + + this->glview = gles_cube_view_init(this); + if(this->glview == NULL) + { + gles_cube_view_del(this); + return NULL; + } + + this->genlist = genlist_create(this); + RETVM_IF(NULL == this->genlist, NULL, "genlist_create is null"); + + + + + sensor_value_items_create(this); + sensor_value_items_prepare(this); + + evas_object_smart_callback_add(this->view->navi, "transition,finished", _sensor_view_transition_finished_cb, this); return this; } diff --git a/tbtcoreapp/src/view/tbt-shortcut-view.c b/tbtcoreapp/src/view/tbt-shortcut-view.c old mode 100644 new mode 100755 index d8ed4aa..762266c --- a/tbtcoreapp/src/view/tbt-shortcut-view.c +++ b/tbtcoreapp/src/view/tbt-shortcut-view.c @@ -57,7 +57,60 @@ static void _app_destroy_cb(void* this); static void _control_button_pressed_cb(void *data, Evas_Object *obj, void *event_info); static int _result_cb(int ret, void *data); char* get_shortcut_error(int err); +static shortcut_view *this = NULL; +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->shortcut_label = ui_utils_label_add(this->view->layout, ""); + elm_object_part_content_set(this->view->layout, "shortcut_text", this->shortcut_label); + + this->cBox_label = ui_utils_label_add(this->view->layout, "Allow duplicate"); + elm_object_part_content_set(this->view->layout, "shortcut_body", this->cBox_label); + + this->cBox = elm_check_add(this->view->layout); + evas_object_resize(this->cBox, 20, 20); + elm_check_state_set(this->cBox, EINA_FALSE); + elm_object_text_set(this->cBox , "Allow duplicate"); + elm_check_state_pointer_set(this->cBox, NULL); + elm_object_part_content_set(this->view->layout, "shortcut_body2", this->cBox); + this->state = elm_check_state_get(this->cBox); + + Evas_Object *control = add_control_layout(this, this->view->layout); + elm_object_part_content_set(this->view->layout, "controlr_part", control); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function shortcut_view_add @@ -72,7 +125,6 @@ shortcut_view *shortcut_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Obje RETVM_IF(NULL == navi, NULL, "navi is null"); - shortcut_view *this = NULL; this = calloc(1, sizeof(shortcut_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -86,22 +138,9 @@ shortcut_view *shortcut_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Obje RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->shortcut_label = ui_utils_label_add(this->view->layout, ""); - elm_object_part_content_set(this->view->layout, "shortcut_text", this->shortcut_label); - - this->cBox_label = ui_utils_label_add(this->view->layout, "Allow duplicate"); - elm_object_part_content_set(this->view->layout, "shortcut_body", this->cBox_label); - - this->cBox = elm_check_add(this->view->layout); - evas_object_resize(this->cBox, 20, 20); - elm_check_state_set(this->cBox, EINA_FALSE); - elm_object_text_set(this->cBox , "Allow duplicate"); - elm_check_state_pointer_set(this->cBox, NULL); - elm_object_part_content_set(this->view->layout, "shortcut_body2", this->cBox); - this->state = elm_check_state_get(this->cBox); - - Evas_Object *control = add_control_layout(this, this->view->layout); - elm_object_part_content_set(this->view->layout, "controlr_part", control); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-smartcard-view.c b/tbtcoreapp/src/view/tbt-smartcard-view.c old mode 100644 new mode 100755 index 07fdbf9..ed3d972 --- a/tbtcoreapp/src/view/tbt-smartcard-view.c +++ b/tbtcoreapp/src/view/tbt-smartcard-view.c @@ -56,7 +56,7 @@ static void _app_destroy_cb(void* this); static void signed_app_launch_button_pressed_cb(void *data, Evas_Object *obj, void *event_info); static void unsigned_app_launch_button_pressed_cb(void *data, Evas_Object *obj, void *event_info); static void app_control_view_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *data); - +static smartcard_view *this = NULL; static char* get_app_control_error(int ret) { @@ -113,13 +113,57 @@ static char* get_app_control_error(int ret) return error; } +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->label = ui_utils_label_add(this->view->layout, ""); + RETVM_IF(!this->label, NULL, "elm_list_add failed"); + ui_utils_label_set_text(this->label, "press button to launch app", "left"); + elm_object_part_content_set(this->view->layout, "1txt", this->label); + + + Evas_Object *control = add_control_layout(this, this->view->layout); + elm_object_part_content_set(this->view->layout, "1txt_2cnt_3btn", control); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} smartcard_view *smartcard_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) { DBG("smartcard_view_add"); RETVM_IF(NULL == navi, NULL, "navi is null"); - smartcard_view *this = NULL; this = calloc(1, sizeof(smartcard_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -133,14 +177,9 @@ smartcard_view *smartcard_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Ob common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->label = ui_utils_label_add(this->view->layout, ""); - RETVM_IF(!this->label, NULL, "elm_list_add failed"); - ui_utils_label_set_text(this->label, "press button to launch app", "left"); - elm_object_part_content_set(this->view->layout, "1txt", this->label); - - - Evas_Object *control = add_control_layout(this, this->view->layout); - elm_object_part_content_set(this->view->layout, "1txt_2cnt_3btn", control); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-sound-manager-view.c b/tbtcoreapp/src/view/tbt-sound-manager-view.c index cc28d26..74ef0cb 100755 --- a/tbtcoreapp/src/view/tbt-sound-manager-view.c +++ b/tbtcoreapp/src/view/tbt-sound-manager-view.c @@ -48,7 +48,7 @@ void _sound_device_connection_changed_cb(sound_device_h device, bool is_connecte void _sound_device_state_changed_cb(sound_device_h device, sound_device_state_e state, void *user_data); static bool is_not_supported = false; - +static soundmanager_view *this = NULL; /** * @function get_soundmanager_error * @since_tizen 3.0 @@ -97,32 +97,26 @@ char* get_soundmanager_error(int ret) return err_msg; } - /** - * @function soundmanager_view_add + * @function guide_pop_up_button_callback * @since_tizen 3.0 - * @description soundmanager View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return soundmanager_view* + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -soundmanager_view *soundmanager_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - int ret; - soundmanager_view *this = NULL; - this = calloc(1, sizeof(soundmanager_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); + RETM_IF(NULL == data, "data is null"); - tbt_info->layout_group = "2_part_cnt_btn"; - tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + int ret; if(this->view->tbt_info->apptype == TBT_APP_SOUND_MANAGER) { @@ -162,6 +156,52 @@ soundmanager_view *soundmanager_view_add(Evas_Object *navi, tbt_info *tbt_info, elm_object_part_content_set(this->view->layout, "1cnt", this->info_label); return this; } +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function soundmanager_view_add + * @since_tizen 3.0 + * @description soundmanager View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return soundmanager_view* + */ +soundmanager_view *soundmanager_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(soundmanager_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-sound-view.c b/tbtcoreapp/src/view/tbt-sound-view.c old mode 100644 new mode 100755 index 0de8dff..12fa085 --- a/tbtcoreapp/src/view/tbt-sound-view.c +++ b/tbtcoreapp/src/view/tbt-sound-view.c @@ -83,7 +83,7 @@ static Eina_Bool __progressbar_timer_cb(void *data); static bool was_playing; static sound_view *view; - +static sound_view *this = NULL; static Eina_Bool __progressbar_timer_cb(void *data) { @@ -284,34 +284,26 @@ static void _on_app_pause_resume_cb(bool resume) } } - /** - * @function sound_view_add - * @since_tizen 2.3 - * @description Sound View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return sound_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -sound_view *sound_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); + RETM_IF(NULL == data, "data is null"); - sound_view *this = NULL; - int ret; - this = calloc(1, sizeof(sound_view)); - RETVM_IF(!this, NULL, "calloc failed"); - view = this; - _tbt_pause_resume_cb = _on_app_pause_resume_cb; - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - tbt_info->layout_group = "5_part_txt_cnt_cnt_btn_btn"; - tbt_info->layout_file = get_edje_path("5_part_txt_cnt1.5_cnt_btn_btn.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(!this, NULL, "calloc failed"); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + int ret; this->is_feature_supported = true; this->audio_icon = ui_utils_create_image(this->view->layout, get_resource_path("images/audio-icon.png")); @@ -341,6 +333,54 @@ else{ update_view_controls(this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function sound_view_add + * @since_tizen 2.3 + * @description Sound View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return sound_view* + */ +sound_view *sound_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(sound_view)); + RETVM_IF(!this, NULL, "calloc failed"); + view = this; + _tbt_pause_resume_cb = _on_app_pause_resume_cb; + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "5_part_txt_cnt_cnt_btn_btn"; + tbt_info->layout_file = get_edje_path("5_part_txt_cnt1.5_cnt_btn_btn.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(!this, NULL, "calloc failed"); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + return this; } diff --git a/tbtcoreapp/src/view/tbt-stt-view.c b/tbtcoreapp/src/view/tbt-stt-view.c old mode 100644 new mode 100755 index 20480d1..a642675 --- a/tbtcoreapp/src/view/tbt-stt-view.c +++ b/tbtcoreapp/src/view/tbt-stt-view.c @@ -140,6 +140,44 @@ Elm_Object_Item* _stt_elm_genlist_item_append(Evas_Object* list, char *item_text } #endif +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + /** * @function stt_view_add @@ -165,6 +203,10 @@ stt_view *stt_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *i RETVM_IF(NULL == this->view, NULL, "navi is null"); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + this->is_recognition_completed = false; this->is_unprepared = false; diff --git a/tbtcoreapp/src/view/tbt-systemsettings-view.c b/tbtcoreapp/src/view/tbt-systemsettings-view.c index 948057d..f0e0fc6 100755 --- a/tbtcoreapp/src/view/tbt-systemsettings-view.c +++ b/tbtcoreapp/src/view/tbt-systemsettings-view.c @@ -53,7 +53,7 @@ void _system_settings_screen_rotation_changed_cb(system_settings_key_e key, void void _system_settings_motion_changed_cb(system_settings_key_e key, void *user_data); void _system_settings_flight_mode_changed_cb(system_settings_key_e key, void *user_data); void _system_settings_lock_state_changed_cb(system_settings_key_e key, void *user_data); - +static systemsettings_view *this = NULL; /** * @function get_system_settings_error @@ -94,34 +94,28 @@ char* get_system_settings_error(int ret) return err_msg; } - /** - * @function systemsettings_view_add - * @since_tizen 2.3 - * @description System settings View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return systemsettings_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -systemsettings_view *systemsettings_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } int ret, value; int timevalue = 0; bool bvalue; - systemsettings_view *this = NULL; - this = calloc(1, sizeof(systemsettings_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - tbt_info->layout_group = "systemsettings_viewer"; - tbt_info->layout_file = get_edje_path("systemsettings_viewer.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(NULL == this->view, NULL, "navi is null"); - if (this->view->tbt_info->apptype == TBT_APP_SYSTEM_SETTINGS_FONT) { ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE, _system_settings_font_size_changed_cb, this); @@ -419,6 +413,53 @@ systemsettings_view *systemsettings_view_add(Evas_Object *navi, tbt_info *tbt_in elm_object_part_content_set(this->view->layout, "info_text", this->create_label); DBG("view complete: %d", value); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function systemsettings_view_add + * @since_tizen 2.3 + * @description System settings View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return systemsettings_view* + */ +systemsettings_view *systemsettings_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(systemsettings_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "systemsettings_viewer"; + tbt_info->layout_file = get_edje_path("systemsettings_viewer.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + return this; } diff --git a/tbtcoreapp/src/view/tbt-touch-view.c b/tbtcoreapp/src/view/tbt-touch-view.c old mode 100644 new mode 100755 index 8d48da0..b7a5c71 --- a/tbtcoreapp/src/view/tbt-touch-view.c +++ b/tbtcoreapp/src/view/tbt-touch-view.c @@ -64,7 +64,64 @@ static void _app_destroy_cb(void* this); static void _mouse_up_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info); static void _mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info); static void _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info); +static touch_view *this = NULL; +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + get_screen_resolution(this); + + this->label = ui_utils_label_add(this->view->layout, ""); + ui_utils_label_set_text(this->label, "Clear: ", "left"); + elm_object_part_content_set(this->view->layout, "1txt", this->label); + + Evas *evas; + evas = evas_object_evas_get(this->view->layout); + this->canvas = evas_object_rectangle_add(evas); + elm_object_part_content_set(this->view->layout, "1txt_2cnt", this->canvas); + evas_object_size_hint_weight_set(this->canvas, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(this->canvas, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_color_set(this->canvas, 255, 255, 255, 255); + evas_object_repeat_events_set(this->canvas, EINA_TRUE); + evas_object_show(this->canvas); + + evas_object_event_callback_add(this->canvas, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, this); + evas_object_event_callback_add(this->canvas, EVAS_CALLBACK_MOUSE_UP, _mouse_up_cb, this); + evas_object_event_callback_add(this->canvas, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function touch_view_add @@ -78,7 +135,6 @@ touch_view *touch_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite RETVM_IF(NULL == navi, NULL, "navi is null"); RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); - touch_view *this = NULL; this = calloc(1, sizeof(touch_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -92,25 +148,9 @@ touch_view *touch_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); RETVM_IF(NULL == this->view, NULL, "navi is null"); - get_screen_resolution(this); - - this->label = ui_utils_label_add(this->view->layout, ""); - ui_utils_label_set_text(this->label, "Clear: ", "left"); - elm_object_part_content_set(this->view->layout, "1txt", this->label); - - Evas *evas; - evas = evas_object_evas_get(this->view->layout); - this->canvas = evas_object_rectangle_add(evas); - elm_object_part_content_set(this->view->layout, "1txt_2cnt", this->canvas); - evas_object_size_hint_weight_set(this->canvas, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(this->canvas, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_color_set(this->canvas, 255, 255, 255, 255); - evas_object_repeat_events_set(this->canvas, EINA_TRUE); - evas_object_show(this->canvas); - - evas_object_event_callback_add(this->canvas, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, this); - evas_object_event_callback_add(this->canvas, EVAS_CALLBACK_MOUSE_UP, _mouse_up_cb, this); - evas_object_event_callback_add(this->canvas, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, this); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-tts-view.c b/tbtcoreapp/src/view/tbt-tts-view.c old mode 100644 new mode 100755 index 914b1d4..25ee335 --- a/tbtcoreapp/src/view/tbt-tts-view.c +++ b/tbtcoreapp/src/view/tbt-tts-view.c @@ -53,32 +53,27 @@ static void _tts_state_changed_cb(tts_h tts, tts_state_e previous, tts_state_e c static bool _tts_supported_voice_cb(tts_h tts, const char* language, int voice_type, void* user_data); static char* get_tts_state_str(tts_state_e state); static void _tts_utterance_completed_cb(tts_h tts, int utt_id, void *user_data); - +static tts_view *this = NULL; /** - * @function tts_view_add - * @since_tizen 2.3 - * @description Gps View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return tts_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -tts_view *tts_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - - tts_view *this = NULL; - this = calloc(1, sizeof(tts_view)); - RETVM_IF(!this, NULL, "calloc failed"); - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); + RETM_IF(NULL == data, "data is null"); - tbt_info->layout_group = "tts_viewer"; - tbt_info->layout_file = get_edje_path("tts_viewer.edj"); - - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } this->is_utterance_completed = false; this->is_tts_btn_pressed = false; @@ -98,6 +93,50 @@ tts_view *tts_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *i elm_table_pack(table, this->btn_tts, 0, 0, 1, 1); elm_object_part_content_set(this->view->layout, "btn_part", table); elm_object_text_set(this->btn_tts, ui_utils_text_add("Text to Speech", NULL)); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} +/** + * @function tts_view_add + * @since_tizen 2.3 + * @description Gps View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return tts_view* + */ +tts_view *tts_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + + this = calloc(1, sizeof(tts_view)); + RETVM_IF(!this, NULL, "calloc failed"); + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "tts_viewer"; + tbt_info->layout_file = get_edje_path("tts_viewer.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-ui-view.c b/tbtcoreapp/src/view/tbt-ui-view.c old mode 100644 new mode 100755 index e09c4c3..48e44d4 --- a/tbtcoreapp/src/view/tbt-ui-view.c +++ b/tbtcoreapp/src/view/tbt-ui-view.c @@ -65,35 +65,27 @@ static void get_screen_resolution(ui_view *this); static void _app_destroy_cb(void* this); static Eina_Bool _ui_view_timer_cb(void *data); - +static ui_view *this = NULL; /** - * @function ui_view_add - * @since_tizen 2.3 - * @description Ui View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return ui_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -ui_view *ui_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); - ui_view *this = NULL; - this = calloc(1, sizeof(ui_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - tbt_info->layout_group = "2_part_cnt_btn"; - tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); - - common_view* view = common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(!view, NULL, "common_view_add failed"); + RETM_IF(NULL == data, "data is null"); - RETVM_IF(!this, NULL, "calloc failed"); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } this->x = 0; this->y = 0; @@ -237,6 +229,55 @@ ui_view *ui_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *ite } this->timer = ecore_timer_add(1, _ui_view_timer_cb, this); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function ui_view_add + * @since_tizen 2.3 + * @description Ui View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return ui_view* + */ +ui_view *ui_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); + + this = calloc(1, sizeof(ui_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "2_part_cnt_btn"; + tbt_info->layout_file = get_edje_path("2_part_cnt3.5_btn.edj"); + + common_view* view = common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(!view, NULL, "common_view_add failed"); + + RETVM_IF(!this, NULL, "calloc failed"); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-widget-view.c b/tbtcoreapp/src/view/tbt-widget-view.c old mode 100644 new mode 100755 index 18bfc5d..8be411f --- a/tbtcoreapp/src/view/tbt-widget-view.c +++ b/tbtcoreapp/src/view/tbt-widget-view.c @@ -48,7 +48,54 @@ static Evas_Object *add_control_layout(widget_view *this, Evas_Object *parent); static void _view_button_pressed_cb(void *data, Evas_Object *obj, void *event_info); static void app_control_view_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *data); static char* get_app_control_error(app_control_error_e err_code); +static widget_view *this = NULL; +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->label = ui_utils_label_add(this->view->layout, ""); + RETVM_IF(!this->label, NULL, "elm_list_add failed"); + ui_utils_label_set_text(this->label, "Widget View Data: ", "left"); + elm_object_part_content_set(this->view->layout, "widget_text", this->label); + + + Evas_Object *control = add_control_layout(this, this->view->layout); + elm_object_part_content_set(this->view->layout, "controlr_part", control); + elm_object_text_set(this->single_btn, ui_utils_text_add("Launch Widget", NULL)); +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function widget_view_add @@ -61,7 +108,6 @@ widget_view *widget_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I { RETVM_IF(NULL == navi, NULL, "navi is null"); - widget_view *this = NULL; this = calloc(1, sizeof(widget_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -77,15 +123,9 @@ widget_view *widget_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_I RETVM_IF(!this, NULL, "calloc failed"); RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->label = ui_utils_label_add(this->view->layout, ""); - RETVM_IF(!this->label, NULL, "elm_list_add failed"); - ui_utils_label_set_text(this->label, "Widget View Data: ", "left"); - elm_object_part_content_set(this->view->layout, "widget_text", this->label); - - - Evas_Object *control = add_control_layout(this, this->view->layout); - elm_object_part_content_set(this->view->layout, "controlr_part", control); - elm_object_text_set(this->single_btn, ui_utils_text_add("Launch Widget", NULL)); + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-wifi-view.c b/tbtcoreapp/src/view/tbt-wifi-view.c old mode 100644 new mode 100755 index 9d7c28c..34faf87 --- a/tbtcoreapp/src/view/tbt-wifi-view.c +++ b/tbtcoreapp/src/view/tbt-wifi-view.c @@ -52,8 +52,65 @@ static void _app_destroy_cb(void* this); static void _wifi_activated_cb(wifi_error_e result, void *data); static void _wifi_deactivated_cb(wifi_error_e result, void *data); static void _wifi_button_pressed_cb(void *data, Evas_Object *obj, void *event_info); +static wifi_view *this = NULL; +/** + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void + */ +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) +{ + RETM_IF(NULL == data, "data is null"); + + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + this->wifi_label = ui_utils_label_add(this->view->layout, ""); + ui_utils_label_set_text(this->wifi_label, "Wifi is switched On", "left"); + elm_object_part_content_set(this->view->layout, "wifi_text", this->wifi_label); + Evas_Object *control = add_control_layout(this, this->view->layout); + elm_object_part_content_set(this->view->layout, "controlr_part", control); + elm_object_text_set(this->capture_btn, ui_utils_text_add("Wifi Off", NULL)); + + int result; + bool is_activated= false; + result = wifi_initialize(); + RETVM_IF(result != WIFI_ERROR_NONE, NULL, "wifi_initialize fail > Error = %s", get_wifi_error(result)); + + result = wifi_is_activated(&is_activated); + RETVM_IF(result != WIFI_ERROR_NONE, NULL, "wifi_is_activated fail > Error = %s", get_wifi_error(result)); + if(!is_activated) + { + elm_object_text_set(this->capture_btn, ui_utils_text_add("Wifi On", NULL)); + ui_utils_label_set_text(this->wifi_label, "Wifi is switched Off ", "left"); + } +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} /** * @function wifi_view_add @@ -67,7 +124,6 @@ wifi_view *wifi_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item RETVM_IF(NULL == navi, NULL, "navi is null"); RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); - wifi_view *this = NULL; this = calloc(1, sizeof(wifi_view)); RETVM_IF(!this, NULL, "calloc failed"); @@ -81,26 +137,9 @@ wifi_view *wifi_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item RETVM_IF(!this, NULL, "calloc failed"); RETVM_IF(NULL == this->view, NULL, "navi is null"); - this->wifi_label = ui_utils_label_add(this->view->layout, ""); - ui_utils_label_set_text(this->wifi_label, "Wifi is switched On", "left"); - elm_object_part_content_set(this->view->layout, "wifi_text", this->wifi_label); - - Evas_Object *control = add_control_layout(this, this->view->layout); - elm_object_part_content_set(this->view->layout, "controlr_part", control); - elm_object_text_set(this->capture_btn, ui_utils_text_add("Wifi Off", NULL)); - - int result; - bool is_activated= false; - result = wifi_initialize(); - RETVM_IF(result != WIFI_ERROR_NONE, NULL, "wifi_initialize fail > Error = %s", get_wifi_error(result)); - - result = wifi_is_activated(&is_activated); - RETVM_IF(result != WIFI_ERROR_NONE, NULL, "wifi_is_activated fail > Error = %s", get_wifi_error(result)); - if(!is_activated) - { - elm_object_text_set(this->capture_btn, ui_utils_text_add("Wifi On", NULL)); - ui_utils_label_set_text(this->wifi_label, "Wifi is switched Off ", "left"); - } + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-wifidirect-info-view.c b/tbtcoreapp/src/view/tbt-wifidirect-info-view.c old mode 100644 new mode 100755 index bb8aa41..c96740e --- a/tbtcoreapp/src/view/tbt-wifidirect-info-view.c +++ b/tbtcoreapp/src/view/tbt-wifidirect-info-view.c @@ -55,36 +55,29 @@ struct _wifidirect_info_view static void _app_destroy_cb(void* this); static char* get_wifi_direct_error(wifi_direct_error_e err_code); - +static wifidirect_info_view *this = NULL; /** - * @function _wifidirect_info_view_add - * @since_tizen 2.3 - * @description Wifidirect Info View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return wifidirect_info_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -wifidirect_info_view *_wifidirect_info_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - int result = 0; - bool is_persistence_group_enabled; - RETVM_IF(NULL == navi, NULL, "navi is null"); - RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); - - wifidirect_info_view *this = NULL; - this = calloc(1, sizeof(wifidirect_info_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - tbt_info->layout_group = "wifidirect_viewer"; - tbt_info->layout_file = get_edje_path("wifidirect_info_viewer.edj"); + RETM_IF(NULL == data, "data is null"); - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(!this, NULL, "calloc failed"); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } + int result = 0; + bool is_persistence_group_enabled; this->mac_address = NULL; this->ip_address = NULL; this->subnet_mask = NULL; @@ -207,6 +200,54 @@ wifidirect_info_view *_wifidirect_info_view_add(Evas_Object *navi, tbt_info *tbt elm_object_part_text_set(this->view->layout, "info7", str); SAFE_DELETE(str); } +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function _wifidirect_info_view_add + * @since_tizen 2.3 + * @description Wifidirect Info View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return wifidirect_info_view* + */ +wifidirect_info_view *_wifidirect_info_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + + RETVM_IF(NULL == navi, NULL, "navi is null"); + RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); + + this = calloc(1, sizeof(wifidirect_info_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "wifidirect_viewer"; + tbt_info->layout_file = get_edje_path("wifidirect_info_viewer.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(!this, NULL, "calloc failed"); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); return this; } diff --git a/tbtcoreapp/src/view/tbt-wifidirect-view.c b/tbtcoreapp/src/view/tbt-wifidirect-view.c old mode 100644 new mode 100755 index d220738..5077373 --- a/tbtcoreapp/src/view/tbt-wifidirect-view.c +++ b/tbtcoreapp/src/view/tbt-wifidirect-view.c @@ -137,7 +137,7 @@ static void _safe_print(const char *msg,const wifidirect_view *this); Evas_Object* wifi_direct_check_button_add(Evas_Object *parent, Evas_Smart_Cb func, void *user_data); void wifi_direct_check_button_changed_cb(void *data, Evas_Object *obj, void *event_info); static int result; - +static wifidirect_view *this = NULL; static char* get_wifi_error(wifi_error_e err_code) { @@ -389,34 +389,25 @@ static void _wifi_deactivated_cb(wifi_error_e result, void *data) } - - /** - * @function wifidirect_view_add - * @since_tizen 2.3 - * @description Wifidirect View Add - * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer - * @return wifidirect_view* + * @function guide_pop_up_button_callback + * @since_tizen 3.0 + * @description Callback for OK press by user + * @parameter void *data, Evas_Object *obj, void *event_info + * @return void */ -wifidirect_view *wifidirect_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +static void guide_pop_up_button_callback(void *data, Evas_Object *obj, void *event_info) { - RETVM_IF(NULL == navi, NULL, "navi is null"); - RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); - - wifidirect_view *this = NULL; - this = calloc(1, sizeof(wifidirect_view)); - RETVM_IF(!this, NULL, "calloc failed"); - - this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); - - tbt_info->layout_group = "wifidirect_viewer"; - tbt_info->layout_file = get_edje_path("wifidirect_viewer.edj"); + RETM_IF(NULL == data, "data is null"); - common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); - RETVM_IF(!this, NULL, "calloc failed"); - RETVM_IF(NULL == this->view, NULL, "navi is null"); + Evas_Object *obj_to_del = data; + evas_object_del(obj_to_del); + if(event_info) + { + Elm_Object_Item *item = event_info; + elm_genlist_item_selected_set(item, EINA_FALSE); + } this->devices_list = NULL; this->mac_address = NULL; this->ip_address = NULL; @@ -476,6 +467,54 @@ wifidirect_view *wifidirect_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_ return initilize_wifi_direct(this); } +} + +/** + * @function ui_utils_guide_instruction_popup_button + * @since_tizen 3.0 + * @description Pop up Manual Instruction Button + * @parameter common_view*: Common View Pointer, const char* txtMessage: Instruction Message to render + * @return static void + */ +static void guide_instruction_popup_button(const Evas_Object* view, const char* txtInstruction) +{ + RETM_IF(NULL == view, "view is NULL"); + + Evas_Object *popup = ui_utils_popup_title_text_add(view,"Instruction Guide",txtInstruction); + RETM_IF(NULL == popup,"popup is NULL"); + + ui_utils_popup_button_add(popup, caption_ok, guide_pop_up_button_callback, popup); +} + +/** + * @function wifidirect_view_add + * @since_tizen 2.3 + * @description Wifidirect View Add + * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer + * @return wifidirect_view* + */ +wifidirect_view *wifidirect_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) +{ + RETVM_IF(NULL == navi, NULL, "navi is null"); + RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null"); + + this = calloc(1, sizeof(wifidirect_view)); + RETVM_IF(!this, NULL, "calloc failed"); + + this->view = calloc(1, sizeof(common_view)); + RETVM_IF(!this->view, NULL, "calloc failed"); + + tbt_info->layout_group = "wifidirect_viewer"; + tbt_info->layout_file = get_edje_path("wifidirect_viewer.edj"); + + common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this); + RETVM_IF(!this, NULL, "calloc failed"); + RETVM_IF(NULL == this->view, NULL, "navi is null"); + + char instrcuction[2048]={'\0',}; + snprintf(instrcuction, sizeof(instrcuction), "%s%s", this->view->tbt_info->info, "
Note:You can also refer info section"); + guide_instruction_popup_button(this->view->navi, instrcuction ); + return this; }