Code Sync [Tizen3.0]: Merged the tizen_2.4 Spin code to tizen.org
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / include / bt-event-handler.h
1 /*
2  * Bluetooth-frwk
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:  Hocheol Seo <hocheol.seo@samsung.com>
7  *               Girishashok Joshi <girish.joshi@samsung.com>
8  *               Chanyeol Park <chanyeol.park@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *              http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */
23
24 #ifndef _BT_EVENT_HANDLER_H_
25 #define _BT_EVENT_HANDLER_H_
26
27 #include <sys/types.h>
28 #include <dbus/dbus.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #define EVENT_MATCH_RULE \
35         "type='signal'," \
36         "interface='%s'," \
37         "path='%s'"
38
39 typedef struct {
40         int event_type;
41         guint id;
42         GDBusConnection *conn;
43         void *cb;
44         void *user_data;
45 } bt_event_info_t;
46
47 int _bt_init_event_handler(void);
48
49 int _bt_deinit_event_handler(void);
50
51 int _bt_register_event(int event_type, void *event_cb, void *user_data);
52
53 int _bt_unregister_event(int event_type);
54
55 bt_event_info_t *_bt_event_get_cb_data(int event_type);
56
57 void _bt_add_server(int server_fd);
58
59 void _bt_remove_server(int server_fd);
60
61 void _bt_add_push_request_id(int request_id);
62
63 void _bt_set_obex_server_id(int server_type);
64
65 int _bt_get_obex_server_id(void);
66
67 void _bt_register_name_owner_changed(void);
68
69 void _bt_unregister_name_owner_changed(void);
70
71 #ifdef __cplusplus
72 }
73 #endif
74
75 #endif /* _BT_EVENT_HANDLER_H_ */