2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef __BT_SERVICE_OBEX_AGENT_H
19 #define __BT_SERVICE_OBEX_AGENT_H
21 #include <glib-object.h>
28 BT_AGENT_EVENT_PIN_REQUEST,
29 BT_AGENT_EVENT_PASSKEY_CONFIRM_REQUEST,
30 BT_AGENT_EVENT_PASSKEY_AUTO_ACCEPTED,
31 BT_AGENT_EVENT_PASSKEY_REQUEST,
32 BT_AGENT_EVENT_PASSKEY_DISPLAY_REQUEST,
33 BT_AGENT_EVENT_AUTHORIZE_REQUEST,
34 BT_AGENT_EVENT_CONFIRM_MODE_REQUEST,
35 BT_AGENT_EVENT_APP_CONFIRM_REQUEST,
36 BT_AGENT_EVENT_FILE_RECEIVED,
37 BT_AGENT_EVENT_KEYBOARD_PASSKEY_REQUEST,
38 BT_AGENT_EVENT_SECURITY,
39 BT_AGENT_EVENT_TERMINATE,
40 BT_AGENT_EVENT_EXCHANGE_REQUEST,
41 BT_AGENT_EVENT_PBAP_REQUEST,
42 BT_AGENT_EVENT_MAP_REQUEST,
43 BT_AGENT_EVENT_SYSTEM_RESET_REQUEST,
44 BT_AGENT_EVENT_LEGACY_PAIR_FAILED_FROM_REMOTE,
45 } bt_agent_event_type_t;
48 BT_OBEX_AGENT_ERROR_REJECT,
49 BT_OBEX_AGENT_ERROR_CANCEL,
50 BT_OBEX_AGENT_ERROR_TIMEOUT,
59 GObjectClass parent_class;
62 GType bt_obex_agent_get_type(void);
64 #define BT_OBEX_TYPE_AGENT (bt_obex_agent_get_type())
65 #define BT_OBEX_AGENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BT_OBEX_TYPE_AGENT, BtObexAgent))
66 #define BT_OBEX_AGENT_CLASS(agent_class) (G_TYPE_CHECK_CLASS_CAST((agent_class), BT_OBEX_TYPE_AGENT, BtObexAgentClass))
67 #define BT_OBEX_GET_AGENT_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BT_OBEX_TYPE_AGENT, BtObexAgentClass))
69 typedef gboolean(*bt_obex_authorize_cb)(GDBusMethodInvocation *context,
73 typedef gboolean(*bt_obex_request_cb)(GDBusMethodInvocation *context,
77 typedef gboolean(*bt_obex_progress_cb)(GDBusMethodInvocation *context,
82 typedef gboolean(*bt_obex_error_cb)(GDBusMethodInvocation *context,
87 typedef gboolean(*bt_obex_complete_cb)(GDBusMethodInvocation *context,
91 typedef gboolean(*bt_obex_release_cb)(GDBusMethodInvocation *context,
96 void _bt_obex_set_authorize_cb(char *object_path,
97 bt_obex_authorize_cb func,
100 void _bt_obex_set_request_cb(char *object_path,
101 bt_obex_request_cb func,
104 void _bt_obex_set_progress_cb(char *object_path,
105 bt_obex_progress_cb func,
108 void _bt_obex_set_error_cb(char *object_path,
109 bt_obex_error_cb func,
112 void _bt_obex_set_complete_cb(char *object_path,
113 bt_obex_complete_cb func,
116 void _bt_obex_set_release_cb(char *object_path,
117 bt_obex_release_cb func,
120 void _bt_obex_agent_new(char *path);
122 void _bt_obex_agent_destroy(char *path);
124 gboolean _bt_obex_setup(const char *path);
128 #endif /* __cplusplus */
130 #endif /* __BT_SERVICE_OBEX_AGENT_H */