tizen 2.3 release
[apps/home/b2-clocksetting.git] / include / setting-bluetooth.h
1 /*
2  * Copyright (c) 2010 Samsung Electronics, Inc.
3  * All rights reserved.
4  *
5  * This software is a confidential and proprietary information
6  * of Samsung Electronics, Inc. ("Confidential Information").  You
7  * shall not disclose such Confidential Information and shall use
8  * it only in accordance with the terms of the license agreement
9  * you entered into with Samsung Electronics.
10  */
11 /*
12  * setting-bluetooth.h
13  *
14  *  Created on: Oct 9, 2013
15  *      Author: min-hoyun
16  */
17
18 #ifndef SETTING_BLUETOOTH_H_
19 #define SETTING_BLUETOOTH_H_
20
21 #include <Elementary.h>
22 #include <libintl.h>
23 #include <string.h>
24 #include <bluetooth-api.h>
25 #include <bluetooth.h>
26 #include <vconf.h>
27
28 #define VISIBILITY_TIMEOUT              120
29 #define BT_LIST_ITEM_COUNT              3
30
31
32 enum {
33         BT_NON_OPERATING,
34         BT_OPERATING
35 };
36
37 enum {
38         BT_MENU_TYPE_BT_ON_OFF,
39         BT_MENU_TYPE_BT_HEADSET,
40         BT_MENU_TYPE_VISIBLE_ON_OFF
41 };
42
43 struct _bt_menu_item {
44         char *name;
45         int is_enable;
46         void (*func)(void *data, Evas_Object *obj, void *event_info);
47 };
48
49 typedef struct Bt_Item_Data
50 {
51         int index;
52         Elm_Object_Item *item;
53         Evas_Object *check;
54         Evas_Object *state_label;
55 } Bt_Item_Data;
56
57 static char * _gl_bt_title_get(void *data, Evas_Object *obj, const char *part);
58 static Evas_Object * _gl_bt_check_get(void *data, Evas_Object *obj, const char *part);
59 Evas_Object* _create_bt_list(void* data);
60 static void _bt_chk_changed_cb(void *data, Evas_Object *obj, void *event_info);
61 static void _blutooth_cb(void *data, Evas_Object *obj, void *event_info);
62 static void _visibility_cb(void *data, Evas_Object *obj, void *event_info);
63 static void _alternate_bt_mode( void* data );
64 static void _deamon_cb(void *data, Evas_Object *obj, void *event_info);
65
66 static void _BT_headset_cb(void *data, Evas_Object *obj, void *event_info);
67
68 void initialize_bt();
69 void clear_bt_resource();
70 Eina_Bool _clear_bluetooth_cb(void *data, Elm_Object_Item *it);
71 void _update_visibility_item_view(int is_hf_connected);
72
73 static void bt_state_vconf_change_cb(keynode_t * key, void * data);
74 static void hf_event_handler(int event, void *data, void *user_data);
75
76 #endif /* SETTING_BLUETOOTH_H_ */