~ubuntu-branches/ubuntu/wily/bluez/wily

« back to all changes in this revision

Viewing changes to gdbus/gdbus.h

  • Committer: Bazaar Package Importer
  • Author(s): Mario Limonciello
  • Date: 2008-10-07 12:10:29 UTC
  • Revision ID: james.westby@ubuntu.com-20081007121029-4gup4fmmh2vfo5nh
Tags: upstream-4.12
ImportĀ upstreamĀ versionĀ 4.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *
 
3
 *  BlueZ - Bluetooth protocol stack for Linux
 
4
 *
 
5
 *  Copyright (C) 2004-2008  Marcel Holtmann <marcel@holtmann.org>
 
6
 *
 
7
 *
 
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.
 
12
 *
 
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.
 
17
 *
 
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
 
21
 *
 
22
 */
 
23
 
 
24
#ifndef __GDBUS_H
 
25
#define __GDBUS_H
 
26
 
 
27
#ifdef __cplusplus
 
28
extern "C" {
 
29
#endif
 
30
 
 
31
#include <dbus/dbus.h>
 
32
#include <glib.h>
 
33
 
 
34
typedef void (* GDBusWatchFunction) (void *user_data);
 
35
 
 
36
DBusConnection *g_dbus_setup_bus(DBusBusType type, const char *name,
 
37
                                                        DBusError *error);
 
38
 
 
39
gboolean g_dbus_set_disconnect_function(DBusConnection *connection,
 
40
                                GDBusWatchFunction function,
 
41
                                void *user_data, DBusFreeFunction destroy);
 
42
 
 
43
typedef void (* GDBusDestroyFunction) (void *user_data);
 
44
 
 
45
typedef DBusMessage * (* GDBusMethodFunction) (DBusConnection *connection,
 
46
                                        DBusMessage *message, void *user_data);
 
47
 
 
48
typedef enum {
 
49
        G_DBUS_METHOD_FLAG_DEPRECATED = (1 << 0),
 
50
        G_DBUS_METHOD_FLAG_NOREPLY    = (1 << 1),
 
51
        G_DBUS_METHOD_FLAG_ASYNC      = (1 << 2),
 
52
} GDBusMethodFlags;
 
53
 
 
54
typedef enum {
 
55
        G_DBUS_SIGNAL_FLAG_DEPRECATED = (1 << 0),
 
56
} GDBusSignalFlags;
 
57
 
 
58
typedef enum {
 
59
        G_DBUS_PROPERTY_FLAG_DEPRECATED = (1 << 0),
 
60
} GDBusPropertyFlags;
 
61
 
 
62
typedef struct {
 
63
        const char *name;
 
64
        const char *signature;
 
65
        const char *reply;
 
66
        GDBusMethodFunction function;
 
67
        GDBusMethodFlags flags;
 
68
} GDBusMethodTable;
 
69
 
 
70
typedef struct {
 
71
        const char *name;
 
72
        const char *signature;
 
73
        GDBusSignalFlags flags;
 
74
} GDBusSignalTable;
 
75
 
 
76
typedef struct {
 
77
        const char *name;
 
78
        const char *type;
 
79
        GDBusPropertyFlags flags;
 
80
} GDBusPropertyTable;
 
81
 
 
82
gboolean g_dbus_register_interface(DBusConnection *connection,
 
83
                                        const char *path, const char *name,
 
84
                                        GDBusMethodTable *methods,
 
85
                                        GDBusSignalTable *signals,
 
86
                                        GDBusPropertyTable *properties,
 
87
                                        void *user_data,
 
88
                                        GDBusDestroyFunction destroy);
 
89
gboolean g_dbus_unregister_interface(DBusConnection *connection,
 
90
                                        const char *path, const char *name);
 
91
 
 
92
DBusMessage *g_dbus_create_error(DBusMessage *message, const char *name,
 
93
                                                const char *format, ...);
 
94
DBusMessage *g_dbus_create_error_valist(DBusMessage *message, const char *name,
 
95
                                        const char *format, va_list args);
 
96
DBusMessage *g_dbus_create_reply(DBusMessage *message, int type, ...);
 
97
DBusMessage *g_dbus_create_reply_valist(DBusMessage *message,
 
98
                                                int type, va_list args);
 
99
 
 
100
gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message);
 
101
gboolean g_dbus_send_reply(DBusConnection *connection,
 
102
                                DBusMessage *message, int type, ...);
 
103
gboolean g_dbus_send_reply_valist(DBusConnection *connection,
 
104
                                DBusMessage *message, int type, va_list args);
 
105
 
 
106
gboolean g_dbus_emit_signal(DBusConnection *connection,
 
107
                                const char *path, const char *interface,
 
108
                                const char *name, int type, ...);
 
109
gboolean g_dbus_emit_signal_valist(DBusConnection *connection,
 
110
                                const char *path, const char *interface,
 
111
                                const char *name, int type, va_list args);
 
112
 
 
113
guint g_dbus_add_disconnect_watch(DBusConnection *connection,
 
114
                                const char *name,
 
115
                                GDBusWatchFunction function,
 
116
                                void *user_data, GDBusDestroyFunction destroy);
 
117
gboolean g_dbus_remove_watch(DBusConnection *connection, guint tag);
 
118
void g_dbus_remove_all_watches(DBusConnection *connection);
 
119
 
 
120
#ifdef __cplusplus
 
121
}
 
122
#endif
 
123
 
 
124
#endif /* __GDBUS_H */