Initialize Tizen 2.3
[apps/home/b2-clocksetting.git] / include / setting-bluetooth.h
1 /*
2  * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 {
57         int index;
58         Elm_Object_Item *item;
59         Evas_Object *check;
60         Evas_Object *state_label;
61 } Bt_Item_Data;
62
63 static char * _gl_bt_title_get(void *data, Evas_Object *obj, const char *part);
64 static Evas_Object * _gl_bt_check_get(void *data, Evas_Object *obj, const char *part);
65 Evas_Object* _create_bt_list(void* data);
66 static void _bt_chk_changed_cb(void *data, Evas_Object *obj, void *event_info);
67 static void _blutooth_cb(void *data, Evas_Object *obj, void *event_info);
68 static void _visibility_cb(void *data, Evas_Object *obj, void *event_info);
69 static void _alternate_bt_mode( void* data );
70 static void _deamon_cb(void *data, Evas_Object *obj, void *event_info);
71
72 static void _BT_headset_cb(void *data, Evas_Object *obj, void *event_info);
73
74 void initialize_bt();
75 void clear_bt_resource();
76 Eina_Bool _clear_bluetooth_cb(void *data, Elm_Object_Item *it);
77 void _update_visibility_item_view(int is_hf_connected);
78
79 static void bt_state_vconf_change_cb(keynode_t * key, void * data);
80 static void hf_event_handler(int event, void *data, void *user_data);
81
82 #endif /* SETTING_BLUETOOTH_H_ */