3
* BlueZ - Bluetooth protocol stack for Linux
5
* Copyright (C) 2010 Giovanni Campagna <scampa.giovanni@gmail.com>
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
#ifndef __BLUETOOTH_APPLET_H__
26
#define __BLUETOOTH_APPLET_H__
29
#include <glib-object.h>
31
#include <bluetooth-enums.h>
34
* BluetoothCapabilities:
36
* special actions that can be invoked on the object
40
BLUETOOTH_CAPABILITIES_NONE = 0,
41
BLUETOOTH_CAPABILITIES_OBEX_PUSH = 0x1,
42
BLUETOOTH_CAPABILITIES_OBEX_FILE_TRANSFER = 0x2
43
} BluetoothCapabilities;
46
* BluetoothSimpleDevice:
48
* represents user visible properties of a device known to the default adapter
59
} BluetoothSimpleDevice;
61
#define BLUETOOTH_TYPE_SIMPLE_DEVICE (bluetooth_simple_device_get_type ())
63
GType bluetooth_simple_device_get_type (void) G_GNUC_CONST;
66
* BluetoothKillswitchState:
68
* public version of that found in bluetooth-killswitch.h
72
BLUETOOTH_KILLSWITCH_STATE_NO_ADAPTER = -1,
73
BLUETOOTH_KILLSWITCH_STATE_SOFT_BLOCKED = 0,
74
BLUETOOTH_KILLSWITCH_STATE_UNBLOCKED,
75
BLUETOOTH_KILLSWITCH_STATE_HARD_BLOCKED
76
} BluetoothKillswitchState;
81
#define BLUETOOTH_TYPE_APPLET (bluetooth_applet_get_type ())
82
#define BLUETOOTH_APPLET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BLUETOOTH_TYPE_APPLET, BluetoothApplet))
83
#define BLUETOOTH_IS_APPLET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BLUETOOTH_TYPE_APPLET))
84
#define BLUETOOTH_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BLUETOOTH_TYPE_APPLET, BluetoothAppletClass))
85
#define BLUETOOTH_IS_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BLUETOOTH_TYPE_APPLET))
86
#define BLUETOOTH_APPLET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BLUETOOTH_TYPE_APPLET, BluetoothAppletClass))
88
/* These structs are fully opaque, type is not derivable */
89
typedef struct _BluetoothApplet BluetoothApplet;
90
typedef struct _BluetoothAppletClass BluetoothAppletClass;
92
/* used by BLUETOOTH_TYPE_APPLET */
93
GType bluetooth_applet_get_type (void) G_GNUC_CONST;
99
GList* bluetooth_applet_get_devices(BluetoothApplet* self);
101
BluetoothKillswitchState bluetooth_applet_get_killswitch_state(BluetoothApplet* self);
102
gboolean bluetooth_applet_set_killswitch_state(BluetoothApplet* self, BluetoothKillswitchState state);
104
gboolean bluetooth_applet_get_discoverable(BluetoothApplet* self);
105
void bluetooth_applet_set_discoverable(BluetoothApplet* self, gboolean visible);
107
typedef void (*BluetoothAppletConnectFunc) (BluetoothApplet *applet,
111
gboolean bluetooth_applet_connect_device(BluetoothApplet *applet,
113
BluetoothAppletConnectFunc func,
115
gboolean bluetooth_applet_disconnect_device (BluetoothApplet *applet,
117
BluetoothAppletConnectFunc func,
120
gboolean bluetooth_applet_browse_address_finish (BluetoothApplet *applet,
121
GAsyncResult *result,
123
void bluetooth_applet_browse_address (BluetoothApplet *applet,
126
GAsyncReadyCallback callback,
128
void bluetooth_applet_send_to_address (BluetoothApplet *applet,
132
gboolean bluetooth_applet_get_show_full_menu(BluetoothApplet* self);
134
void bluetooth_applet_agent_reply_pincode(BluetoothApplet* self, const gchar* request_key, const gchar* pincode);
135
void bluetooth_applet_agent_reply_passkey(BluetoothApplet* self, const gchar* request_key, gint passkey);
136
void bluetooth_applet_agent_reply_confirm(BluetoothApplet* self, const gchar* request_key, gboolean confirm);
137
void bluetooth_applet_agent_reply_auth(BluetoothApplet* self, const gchar* request_key, gboolean auth, gboolean trusted);
139
#endif /* __BLUETOOTH_APPLET_H__ */