diff options
Diffstat (limited to 'src/ui/bt-main-ug.c')
-rw-r--r-- | src/ui/bt-main-ug.c | 503 |
1 files changed, 325 insertions, 178 deletions
diff --git a/src/ui/bt-main-ug.c b/src/ui/bt-main-ug.c index fa64bc5..fafecc4 100644 --- a/src/ui/bt-main-ug.c +++ b/src/ui/bt-main-ug.c @@ -1,18 +1,25 @@ /* - * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +* ug-bluetooth-efl +* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Contact: Hocheol Seo <hocheol.seo@samsung.com> +* GirishAshok Joshi <girish.joshi@samsung.com> +* DoHyun Pyun <dh79.pyun@samsung.com> +* +* Licensed under the Flora License, Version 1.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.tizenopensource.org/license +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +*/ #include <aul.h> #include <vconf.h> @@ -22,6 +29,13 @@ #include <dbus/dbus.h> #include <dbus/dbus-glib-bindings.h> #include <notification.h> +#include <efl_assist.h> +#include <device/power.h> +#include <gesture_recognition.h> + +#ifdef TIZEN_REDWOOD +#include <setting-cfg.h> +#endif #include "bt-main-ug.h" #include "bt-util.h" @@ -34,7 +48,7 @@ #include "bt-string-define.h" #include "bt-net-connection.h" -static void __on_destroy(ui_gadget_h ug, service_h service, void *priv); +static void __on_destroy(ui_gadget_h ug, app_control_h service, void *priv); /********************************************************************** @@ -62,50 +76,14 @@ static void bt_ug_change_language(bt_ug_data *ugd) if (ugd->navi_it) elm_object_item_text_set(ugd->navi_it, BT_STR_BLUETOOTH); - if (ugd->scan_btn) - elm_object_text_set(ugd->scan_btn, BT_STR_STOP); - - - FN_END; -} - -static Evas_Object *__bt_create_fullview(Evas_Object * parent, bt_ug_data *ugd) -{ - FN_START; - - Evas_Object *base = NULL; - - base = elm_layout_add(parent); - if (!base) - return NULL; - - elm_layout_theme_set(base, "layout", "application", "default"); - evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL); - - FN_END; - return base; -} - -static Evas_Object *__bt_create_frameview(Evas_Object * parent, - bt_ug_data *ugd) -{ - FN_START; - - Evas_Object *base = NULL; - - base = elm_layout_add(parent); - if (!base) - return NULL; - - elm_layout_theme_set(base, "layout", "application", "default"); - evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL); + if (ugd->scan_btn) { + if (ugd->op_status == BT_SEARCHING) + elm_object_text_set(ugd->scan_btn, BT_STR_STOP); + else + elm_object_text_set(ugd->scan_btn, BT_STR_SCAN); + } FN_END; - return base; } static void __bt_ug_release_memory(bt_ug_data *ugd) @@ -132,15 +110,19 @@ static void __bt_ug_release_memory(bt_ug_data *ugd) _bt_util_free_device_item(dev); } - /* Release genlist item class */ - if (ugd->sp_itc) { - elm_genlist_item_class_free(ugd->sp_itc); - ugd->sp_itc = NULL; + if (ugd->device_name_itc) { + elm_genlist_item_class_free(ugd->device_name_itc); + ugd->device_name_itc = NULL; + } + + if (ugd->rename_entry_itc) { + elm_genlist_item_class_free(ugd->rename_entry_itc); + ugd->rename_entry_itc = NULL; } - if (ugd->status_itc) { - elm_genlist_item_class_free(ugd->status_itc); - ugd->status_itc = NULL; + if (ugd->rename_desc_itc) { + elm_genlist_item_class_free(ugd->rename_desc_itc); + ugd->rename_desc_itc = NULL; } if (ugd->visible_itc) { @@ -163,14 +145,14 @@ static void __bt_ug_release_memory(bt_ug_data *ugd) ugd->searched_title_itc = NULL; } - if (ugd->device_itc) { - elm_genlist_item_class_free(ugd->device_itc); - ugd->device_itc = NULL; + if (ugd->paired_device_itc) { + elm_genlist_item_class_free(ugd->paired_device_itc); + ugd->paired_device_itc = NULL; } - if (ugd->searched_itc) { - elm_genlist_item_class_free(ugd->searched_itc); - ugd->searched_itc = NULL; + if (ugd->searched_device_itc) { + elm_genlist_item_class_free(ugd->searched_device_itc); + ugd->searched_device_itc = NULL; } if (ugd->no_device_itc) { @@ -178,13 +160,20 @@ static void __bt_ug_release_memory(bt_ug_data *ugd) ugd->no_device_itc = NULL; } - if (ugd->visibility_status_itc) { - elm_genlist_item_class_free(ugd->visibility_status_itc); - ugd->visibility_status_itc = NULL; + if (ugd->empty_status_itc) { + elm_genlist_item_class_free(ugd->empty_status_itc); + ugd->empty_status_itc = NULL; + } + + if (ugd->turning_on_itc) { + elm_genlist_item_class_free(ugd->turning_on_itc); + ugd->turning_on_itc = NULL; + } + + if (ugd->onoff_itc) { + elm_genlist_item_class_free(ugd->onoff_itc); + ugd->onoff_itc = NULL; } - /* Unref the Dbus connections */ - if (ugd->conn) - dbus_g_connection_unref(ugd->conn); if (ugd->popup_bundle) { free(ugd->popup_bundle); @@ -199,7 +188,31 @@ static void __bt_ug_release_memory(bt_ug_data *ugd) FN_END; } -static void *__on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, +static void __bt_main_vconf_change_cb(keynode_t *key, void *data) +{ + retm_if(NULL == key, "key is NULL"); + retm_if(NULL == data, "data is NULL"); + bt_ug_data *ugd = (bt_ug_data *)data; + + int status = vconf_keynode_get_int(key); + char *vconf_name = vconf_keynode_get_name(key); + + if (!g_strcmp0(vconf_name, VCONFKEY_SETAPPL_DEVICE_NAME_STR)){ + char *name_value = NULL; + name_value = vconf_get_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR); + retm_if (!name_value, "Get string is failed"); + BT_INFO("name : %s", name_value); + + if (ugd->device_name_item && g_strcmp0(ugd->phone_name, name_value)) + _bt_update_genlist_item(ugd->device_name_item); + + g_free(name_value); + } else { + BT_ERR("vconf_name is error"); + } +} + +static void *__on_create(ui_gadget_h ug, enum ug_mode mode, app_control_h service, void *priv) { FN_START; @@ -207,96 +220,129 @@ static void *__on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, bt_ug_data *ugd = NULL; Evas_Object *bg = NULL; notification_error_e noti_res; +#ifndef __TIZEN_OPEN__ + gesture_h handle; +#endif + Ea_Theme_Color_Table *color_table; + Ea_Theme_Font_Table *font_table; int err; if (!ug || !priv) return NULL; + BT_INFO("Create UG"); + ugd = (bt_ug_data *)priv; ugd->ug = ug; bindtextdomain(PKGNAME, LOCALEDIR); - ugd->win_main = ug_get_parent_layout(ug); + ugd->win_main = ug_get_window(); if (!ugd->win_main) { __on_destroy(ug, NULL, ugd); return NULL; } - if (mode == UG_MODE_FULLVIEW) { - ugd->base = __bt_create_fullview(ugd->win_main, ugd); - bg = _bt_create_bg(ugd->win_main, "group_list"); - elm_object_part_content_set(ugd->base, "elm.swallow.bg", bg); - } else { - ugd->base = __bt_create_frameview(ugd->win_main, ugd); - bg = _bt_create_bg(ugd->win_main, "transparent"); - elm_object_part_content_set(ugd->base, "elm.swallow.bg", bg); - } + + ugd->base = _bt_main_layout_conform_create(ugd->win_main, ugd); if (!ugd->base) { __on_destroy(ug, NULL, ugd); return NULL; } + /* Enable Changeable UI feature */ + ea_theme_changeable_ui_enabled_set(EINA_TRUE); + + color_table = _bt_color_table_set(); + + font_table = _bt_font_table_set(); + + /* Add layout for custom styles */ + elm_theme_extension_add(NULL, BT_GENLIST_EDJ); + _bt_main_init_status(ugd, service); + + if (ugd->bt_launch_mode == BT_LAUNCH_HELP) + ea_screen_reader_support_set(ugd->win_main, EINA_FALSE); + err = _bt_ipc_register_popup_event_signal(ugd); if (err != BT_UG_ERROR_NONE) - BT_DBG("_bt_ipc_register_popup_event_signal failed: %d", err); + BT_ERR("_bt_ipc_register_popup_event_signal failed: %d", err); ugd->service = service; if (ugd->bt_launch_mode == BT_LAUNCH_NORMAL) { - noti_res = notification_delete_all_by_type("bluetooth-notification", NOTIFICATION_TYPE_ONGOING); + noti_res = notification_delete_all_by_type( + "bluetooth-notification", + NOTIFICATION_TYPE_ONGOING); if (noti_res != NOTIFICATION_ERROR_NONE) - BT_DBG("Unable to delete notification"); + BT_ERR("Unable to delete notification"); } - if (ugd->bt_launch_mode != BT_LAUNCH_VISIBILITY) { - _bt_main_draw_list_view(ugd); - } else { + if (ugd->bt_launch_mode == BT_LAUNCH_VISIBILITY) { _bt_main_draw_visibility_view(ugd); + } else if (ugd->bt_launch_mode == BT_LAUNCH_ONOFF) { + _bt_main_draw_onoff_view(ugd); + } else { + _bt_main_draw_list_view(ugd); } - evas_object_show(ugd->base); - + ugd->visibility_changed_by_ug = FALSE; ugd->ug_status = BT_UG_CREATE; - if (_bt_util_is_emulator() == TRUE) - _bt_main_create_error_destroy_popup(ugd, BT_STR_NOT_SUPPORT_IN_EMUL); - - FN_END; return ugd->base; } -static void __on_start(ui_gadget_h ug, service_h service, void *priv) +static void __on_start(ui_gadget_h ug, app_control_h service, void *priv) { FN_START; - int g_angle = 0; bt_ug_data *ugd = NULL; + int ret = 0; - retm_if(priv == NULL, "Invalid argument: priv is NULL\n"); + retm_if(priv == NULL, "Invalid argument: priv is NULL"); ugd = priv; - g_angle = elm_win_rotation_get(ugd->win_main); - ugd->rotation = (int)(g_angle / 90); - - BT_DBG("rotation: %d", ugd->rotation); - + elm_win_wm_rotation_preferred_rotation_set(ugd->win_main, 0); + + /* In the NFC case, we don't need to display the paired device */ + if (ugd->op_status == BT_ACTIVATED && + ugd->bt_launch_mode != BT_LAUNCH_USE_NFC && + ugd->bt_launch_mode != BT_LAUNCH_ONOFF) { + if (_bt_util_is_battery_low() == FALSE) { + ret = bt_adapter_start_device_discovery(); + if (!ret) { + ugd->op_status = BT_SEARCHING; + elm_object_text_set(ugd->scan_btn, + BT_STR_STOP); + + if (ugd->searched_title == NULL) + _bt_main_add_searched_title + (ugd); + } else { + BT_ERR + ("Operation failed : Error Cause[%d]", + ret); + } + } + } ugd->ug_status = BT_UG_START; FN_END; } -static void __on_pause(ui_gadget_h ug, service_h service, void *priv) +static void __on_pause(ui_gadget_h ug, app_control_h service, void *priv) { FN_START; bt_ug_data *ugd = NULL; - retm_if(priv == NULL, "Invalid argument: priv is NULL\n"); + retm_if(priv == NULL, "Invalid argument: priv is NULL"); + + BT_INFO("Pause UG"); ugd = (bt_ug_data *)priv; @@ -308,24 +354,25 @@ static void __on_pause(ui_gadget_h ug, service_h service, void *priv) FN_END; } -static void __on_resume(ui_gadget_h ug, service_h service, void *priv) +static void __on_resume(ui_gadget_h ug, app_control_h service, void *priv) { FN_START; bt_ug_data *ugd = NULL; - retm_if(priv == NULL, "Invalid argument: priv is NULL\n"); + retm_if(priv == NULL, "Invalid argument: priv is NULL"); + + BT_INFO("Resume UG"); ugd = (bt_ug_data *)priv; ugd->ug_status = BT_UG_RESUME; - _bt_update_genlist_item(ugd->visible_item); FN_END; } -static void __on_destroy(ui_gadget_h ug, service_h service, void *priv) +static void __on_destroy(ui_gadget_h ug, app_control_h service, void *priv) { FN_START; @@ -350,67 +397,77 @@ static void __on_destroy(ui_gadget_h ug, service_h service, void *priv) ugd->timeout_id = 0; } + if (ugd->network_timer) { + ecore_timer_del(ugd->network_timer); + ugd->network_timer = NULL; + } + /* This has been added before cancel discovery so as to prevent device addition till cancel discovery */ err = bt_adapter_unset_device_discovery_state_changed_cb(); if (err != BT_ERROR_NONE) - BT_DBG("unset of device discovery state cb failed: %d", err); + BT_ERR("unset of device discovery state cb failed: %d", err); if (ugd->op_status == BT_SEARCHING) { err = bt_adapter_stop_device_discovery(); if (err != BT_ERROR_NONE) - BT_DBG("Stop device discovery failed: %d", err); + BT_ERR("Stop device discovery failed: %d", err); } err = bt_adapter_unset_state_changed_cb(); if (err != BT_ERROR_NONE) - BT_DBG("unset of state change cb failed: %d", err); + BT_ERR("unset of state change cb failed: %d", err); err = bt_device_unset_bond_created_cb(); if (err != BT_ERROR_NONE) - BT_DBG("unset of bond creation cb failed: %d", err); + BT_ERR("unset of bond creation cb failed: %d", err); err = bt_device_unset_bond_destroyed_cb(); if (err != BT_ERROR_NONE) - BT_DBG("unset of bond destroyed cb failed: %d", err); + BT_ERR("unset of bond destroyed cb failed: %d", err); err = bt_device_unset_service_searched_cb(); if (err != BT_ERROR_NONE) - BT_DBG("unset of service search cb failed: %d", err); + BT_ERR("unset of service search cb failed: %d", err); err = bt_audio_unset_connection_state_changed_cb(); if (err != BT_ERROR_NONE) - BT_DBG("unset audio connection state cb failed: %d", err); + BT_ERR("unset audio connection state cb failed: %d", err); + + err = bt_device_unset_connection_state_changed_cb(); + if (err != BT_ERROR_NONE) + BT_ERR("unset device connection state cb failed: %d", err); err = bt_adapter_unset_name_changed_cb(); if (err != BT_ERROR_NONE) - BT_DBG("unset name change cb failed: %d", err); + BT_ERR("unset name change cb failed: %d", err); err = bt_hid_host_deinitialize(); if (err != BT_ERROR_NONE) - BT_DBG("bt_hid_host_deinitialize failed: %d", err); + BT_ERR("bt_hid_host_deinitialize failed: %d", err); err = bt_audio_deinitialize(); if (err != BT_ERROR_NONE) - BT_DBG("bt_audio_deinitialize failed: %d", err); + BT_ERR("bt_audio_deinitialize failed: %d", err); err = bt_nap_unset_connection_state_changed_cb(); if (err != BT_ERROR_NONE) - BT_DBG("bt_nap_unset_connection_state_changed_cb err=%d", err); + BT_ERR("bt_nap_unset_connection_state_changed_cb err=%d", err); err = bt_deinitialize(); if (err != BT_ERROR_NONE) - BT_DBG("bt_deinitialize failed: %d", err); + BT_ERR("bt_deinitialize failed: %d", err); + if (ugd->connection) { + err = _bt_destroy_net_connection(ugd->connection); + if (err != BT_UG_ERROR_NONE) + BT_ERR("_bt_destroy_net_connection failed: %d", err); - err = _bt_destroy_net_connection(ugd->connection); - if (err != BT_UG_ERROR_NONE) - BT_DBG("_bt_destroy_net_connection failed: %d", err); - - ugd->connection = NULL; + ugd->connection = NULL; + } err = _bt_ipc_unregister_popup_event_signal(ugd); if (err != BT_UG_ERROR_NONE) - BT_DBG("_bt_ipc_unregister_popup_event_signal failed: %d", err); + BT_ERR("_bt_ipc_unregister_popup_event_signal failed: %d", err); __bt_ug_release_memory(ugd); @@ -422,14 +479,14 @@ static void __on_destroy(ui_gadget_h ug, service_h service, void *priv) FN_END; } -static void __on_message(ui_gadget_h ug, service_h msg, service_h service, +static void __on_message(ui_gadget_h ug, app_control_h msg, app_control_h service, void *priv) { FN_START; FN_END; } -static void __on_event(ui_gadget_h ug, enum ug_event event, service_h service, +static void __on_event(ui_gadget_h ug, enum ug_event event, app_control_h service, void *priv) { FN_START; @@ -440,58 +497,37 @@ static void __on_event(ui_gadget_h ug, enum ug_event event, service_h service, ugd = (bt_ug_data *)priv; - BT_DBG("event: %d", event); + BT_INFO("Event UG : %d", event); switch (event) { - case UG_EVENT_LOW_MEMORY: - break; - case UG_EVENT_LOW_BATTERY: - if (_bt_util_is_battery_low() == FALSE) - return; - - if (ugd->op_status == BT_SEARCHING) - bt_adapter_stop_device_discovery(); - - _bt_main_create_information_popup(ugd, BT_STR_LOW_BATTERY); - break; - case UG_EVENT_LANG_CHANGE: - bt_ug_change_language(ugd); - break; - case UG_EVENT_ROTATE_PORTRAIT: - ugd->rotation = BT_ROTATE_PORTRAIT; - break; - case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN: - ugd->rotation = BT_ROTATE_PORTRAIT_UPSIDEDOWN; - break; - case UG_EVENT_ROTATE_LANDSCAPE: - ugd->rotation = BT_ROTATE_LANDSCAPE; - break; - case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN: - ugd->rotation = BT_ROTATE_LANDSCAPE_UPSIDEDOWN; - break; - default: - break; - } - - if (event == UG_EVENT_ROTATE_PORTRAIT || - event == UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN || - event == UG_EVENT_ROTATE_LANDSCAPE || - event == UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN) { - _bt_main_change_rotate_mode((void *)ugd); - _bt_profile_change_rotate_mode((void *)ugd); + case UG_EVENT_LOW_MEMORY: + break; + case UG_EVENT_LOW_BATTERY: + if (_bt_util_is_battery_low() == FALSE) + return; + + if (ugd->op_status == BT_SEARCHING) + bt_adapter_stop_device_discovery(); + + _bt_main_create_information_popup(ugd, BT_STR_LOW_BATTERY); + break; + case UG_EVENT_LANG_CHANGE: + bt_ug_change_language(ugd); + break; + default: + break; } - FN_END; } static void __on_key_event(ui_gadget_h ug, enum ug_key_event event, - service_h service, void *priv) + app_control_h service, void *priv) { FN_START; bt_ug_data *ugd = NULL; - BT_DBG("event: %d\n", event); + BT_INFO("Key event UG : %d", event); ugd = (bt_ug_data *)priv; @@ -553,7 +589,7 @@ UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops) FN_END; } -UG_MODULE_API int setting_plugin_reset(service_h service, void *priv) +UG_MODULE_API int setting_plugin_reset(app_control_h service, void *priv) { FN_START; @@ -563,21 +599,21 @@ UG_MODULE_API int setting_plugin_reset(service_h service, void *priv) ret = bt_initialize(); if (ret != BT_ERROR_NONE) { - BT_DBG("Fail to init BT %d", ret); + BT_ERR("Fail to init BT %d", ret); return ret; } ret = bt_adapter_reset(); if (ret != BT_ERROR_NONE) { - BT_DBG("Fail to reset adapter: %d", ret); + BT_ERR("Fail to reset adapter: %d", ret); result = ret; } ret = bt_deinitialize(); if (ret != BT_ERROR_NONE) - BT_DBG("Fail to deinit BT: %d", ret); + BT_ERR("Fail to deinit BT: %d", ret); FN_END; return result; @@ -589,6 +625,8 @@ void _bt_ug_destroy(void *data, void *result) int ret = 0; bt_ug_data *ugd = NULL; + BT_INFO("Destroy UG"); + ret_if(data == NULL); ugd = (bt_ug_data *)data; @@ -601,7 +639,116 @@ void _bt_ug_destroy(void *data, void *result) ret = ug_destroy_me(ugd->ug); if (ret < 0) - BT_DBG("Fail to destroy me"); + BT_ERR("Fail to destroy me"); + + FN_END; +} + +#ifdef TIZEN_REDWOOD + +static bt_setting_cfg_node_t s_cfg_node_array_bt[] = { + {"IDS_BT_BODY_BLUETOOTH", NULL, + "viewtype:frontpage;tab:first;keyword:IDS_BT_BODY_BLUETOOTH", + Cfg_Item_Pos_Level0, 0, 0, Cfg_Item_View_Node_Toggle, NULL}, + {"IDS_BT_BODY_VISIBLE", NULL, + "viewtype:frontpage;tab:first;keyword:IDS_BT_BODY_VISIBLE", + Cfg_Item_Pos_Level0, 0, 0, BT_CFG_ITEM_VIEW_NODE, NULL}, +}; + +UG_MODULE_API int setting_plugin_search_init(app_control_h service, + void *priv, char **applocale) +{ + FN_START; + BT_DBG("ug-bluetooth-efl DB search code: SETTING_SEARCH"); + + Eina_List **pplist = NULL; + int i; + int size = sizeof(s_cfg_node_array_bt)/sizeof(s_cfg_node_array_bt[0]); + + *applocale = strdup(PKGNAME); + pplist = (Eina_List **)priv; + + for (i = 0; i < size; i++) { + bt_setting_cfg_node_t *node = + (bt_setting_cfg_node_t *)setting_plugin_search_item_add( + s_cfg_node_array_bt[i].key_name, + s_cfg_node_array_bt[i].ug_args, + NULL, s_cfg_node_array_bt[i].item_type, + s_cfg_node_array_bt[i].data); + *pplist = eina_list_append(*pplist, node); + } + FN_END; + return 0; +} + +/************************************************************** + toggle state get/set function for "bluetooth status" +************************************************************/ +EXPORT_PUBLIC +int get_display_ug_state(Cfg_Item_State *stat, void *data) +{ + FN_START; + + int value = -1; + int ret = vconf_get_int(VCONFKEY_BT_STATUS, &value); + retvm_if (ret != 0, ret, "fail to get vconf key!"); + + if (value == VCONFKEY_BT_STATUS_OFF){ + *stat = Cfg_Item_Off; + } else { + *stat = Cfg_Item_On; + } + + FN_END; + return ret; +} + +EXPORT_PUBLIC +int set_display_ug_state(Cfg_Item_State stat, void *item, void *data) +{ + FN_START; + int value = -1; + int ret = 0; + + if (stat == Cfg_Item_On){ + value = VCONFKEY_BT_STATUS_ON; + } else { + value = VCONFKEY_BT_STATUS_OFF; + } + + ret = vconf_set_int(VCONFKEY_BT_STATUS, value); + retvm_if (ret != 0, ret, "fail to set vconf key!"); + + FN_END; + return ret; +} + +EXPORT_PUBLIC +int set_display_ug_update_ui(Cfg_Item_State stat, void* data) +{ + FN_START; FN_END; + return 0; } + +EXPORT_PUBLIC +cfg_func_table opt_tab_bluetooth = { + .get_item_state = get_display_ug_state, + .set_item_state = set_display_ug_state, + .set_item_update_ui = set_display_ug_update_ui, +}; + +UG_MODULE_API int setting_plugin_search_query_ops(char *str_id, + void **tfunc_obj) +{ + FN_START; + BT_DBG(">> get tfunc operation via plugin-model 1"); + if (str_id && !g_strcmp0(str_id, _("IDS_BT_BODY_BLUETOOTH"))) { + *tfunc_obj = (void*)&opt_tab_bluetooth; + } + FN_END; + return 0; +} +#endif + |