tizen 2.3.1 release
[apps/home/b2-clocksetting.git] / include / setting-bluetooth.h
1 /*
2  *  Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  *  Licensed under the Flora License, Version 1.0 (the License);
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://floralicense.org/license/
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an AS IS BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  *
16  */
17 /*
18  * setting-bluetooth.h
19  *
20  *  Created on: Oct 9, 2013
21  *      Author: min-hoyun
22  */
23
24 #ifndef SETTING_BLUETOOTH_H_
25 #define SETTING_BLUETOOTH_H_
26
27 #include <Elementary.h>
28 #include <libintl.h>
29 #include <string.h>
30 #include <bluetooth-api.h>
31 #include <bluetooth.h>
32 #include <vconf.h>
33
34 #define VISIBILITY_TIMEOUT              120
35 #define BT_LIST_ITEM_COUNT              3
36
37
38 enum {
39         BT_NON_OPERATING,
40         BT_OPERATING
41 };
42
43 enum {
44         BT_MENU_TYPE_BT_ON_OFF,
45         BT_MENU_TYPE_BT_HEADSET,
46         BT_MENU_TYPE_VISIBLE_ON_OFF
47 };
48
49 struct _bt_menu_item {
50         char *name;
51         int is_enable;
52         void (*func)(void *data, Evas_Object *obj, void *event_info);
53 };
54
55 typedef struct Bt_Item_Data {
56         int index;
57         Elm_Object_Item *item;
58         Evas_Object *check;
59         Evas_Object *state_label;
60 } Bt_Item_Data;
61
62 static char *_gl_bt_title_get(void *data, Evas_Object *obj, const char *part);
63 static Evas_Object *_gl_bt_check_get(void *data, Evas_Object *obj, const char *part);
64 Evas_Object *_create_bt_list(void *data);
65 static void _bt_chk_changed_cb(void *data, Evas_Object *obj, void *event_info);
66 static void _blutooth_cb(void *data, Evas_Object *obj, void *event_info);
67 static void _visibility_cb(void *data, Evas_Object *obj, void *event_info);
68 static void _alternate_bt_mode(void *data);
69 static void _deamon_cb(void *data, Evas_Object *obj, void *event_info);
70
71 static void _BT_headset_cb(void *data, Evas_Object *obj, void *event_info);
72
73 void initialize_bt();
74 void clear_bt_resource();
75 Eina_Bool _clear_bluetooth_cb(void *data, Elm_Object_Item *it);
76 void _update_visibility_item_view(int is_hf_connected);
77
78 static void bt_state_vconf_change_cb(keynode_t *key, void *data);
79 static void hf_event_handler(int event, void *data, void *user_data);
80
81 #endif /* SETTING_BLUETOOTH_H_ */