1/* GDBus - GLib D-Bus Library
2 *
3 * Copyright (C) 2008-2010 Red Hat, Inc.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 *
18 * Author: David Zeuthen <davidz@redhat.com>
19 */
20
21#ifndef __G_DBUS_MESSAGE_H__
22#define __G_DBUS_MESSAGE_H__
23
24#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
25#error "Only <gio/gio.h> can be included directly."
26#endif
27
28#include <gio/giotypes.h>
29
30G_BEGIN_DECLS
31
32#define G_TYPE_DBUS_MESSAGE (g_dbus_message_get_type ())
33#define G_DBUS_MESSAGE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_MESSAGE, GDBusMessage))
34#define G_IS_DBUS_MESSAGE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_MESSAGE))
35
36GLIB_AVAILABLE_IN_ALL
37GType g_dbus_message_get_type (void) G_GNUC_CONST;
38GLIB_AVAILABLE_IN_ALL
39GDBusMessage *g_dbus_message_new (void);
40GLIB_AVAILABLE_IN_ALL
41GDBusMessage *g_dbus_message_new_signal (const gchar *path,
42 const gchar *interface_,
43 const gchar *signal);
44GLIB_AVAILABLE_IN_ALL
45GDBusMessage *g_dbus_message_new_method_call (const gchar *name,
46 const gchar *path,
47 const gchar *interface_,
48 const gchar *method);
49GLIB_AVAILABLE_IN_ALL
50GDBusMessage *g_dbus_message_new_method_reply (GDBusMessage *method_call_message);
51GLIB_AVAILABLE_IN_ALL
52GDBusMessage *g_dbus_message_new_method_error (GDBusMessage *method_call_message,
53 const gchar *error_name,
54 const gchar *error_message_format,
55 ...) G_GNUC_PRINTF(3, 4);
56GLIB_AVAILABLE_IN_ALL
57GDBusMessage *g_dbus_message_new_method_error_valist (GDBusMessage *method_call_message,
58 const gchar *error_name,
59 const gchar *error_message_format,
60 va_list var_args);
61GLIB_AVAILABLE_IN_ALL
62GDBusMessage *g_dbus_message_new_method_error_literal (GDBusMessage *method_call_message,
63 const gchar *error_name,
64 const gchar *error_message);
65GLIB_AVAILABLE_IN_ALL
66gchar *g_dbus_message_print (GDBusMessage *message,
67 guint indent);
68GLIB_AVAILABLE_IN_ALL
69gboolean g_dbus_message_get_locked (GDBusMessage *message);
70GLIB_AVAILABLE_IN_ALL
71void g_dbus_message_lock (GDBusMessage *message);
72GLIB_AVAILABLE_IN_ALL
73GDBusMessage *g_dbus_message_copy (GDBusMessage *message,
74 GError **error);
75GLIB_AVAILABLE_IN_ALL
76GDBusMessageByteOrder g_dbus_message_get_byte_order (GDBusMessage *message);
77GLIB_AVAILABLE_IN_ALL
78void g_dbus_message_set_byte_order (GDBusMessage *message,
79 GDBusMessageByteOrder byte_order);
80
81GLIB_AVAILABLE_IN_ALL
82GDBusMessageType g_dbus_message_get_message_type (GDBusMessage *message);
83GLIB_AVAILABLE_IN_ALL
84void g_dbus_message_set_message_type (GDBusMessage *message,
85 GDBusMessageType type);
86GLIB_AVAILABLE_IN_ALL
87GDBusMessageFlags g_dbus_message_get_flags (GDBusMessage *message);
88GLIB_AVAILABLE_IN_ALL
89void g_dbus_message_set_flags (GDBusMessage *message,
90 GDBusMessageFlags flags);
91GLIB_AVAILABLE_IN_ALL
92guint32 g_dbus_message_get_serial (GDBusMessage *message);
93GLIB_AVAILABLE_IN_ALL
94void g_dbus_message_set_serial (GDBusMessage *message,
95 guint32 serial);
96GLIB_AVAILABLE_IN_ALL
97GVariant *g_dbus_message_get_header (GDBusMessage *message,
98 GDBusMessageHeaderField header_field);
99GLIB_AVAILABLE_IN_ALL
100void g_dbus_message_set_header (GDBusMessage *message,
101 GDBusMessageHeaderField header_field,
102 GVariant *value);
103GLIB_AVAILABLE_IN_ALL
104guchar *g_dbus_message_get_header_fields (GDBusMessage *message);
105GLIB_AVAILABLE_IN_ALL
106GVariant *g_dbus_message_get_body (GDBusMessage *message);
107GLIB_AVAILABLE_IN_ALL
108void g_dbus_message_set_body (GDBusMessage *message,
109 GVariant *body);
110GLIB_AVAILABLE_IN_ALL
111GUnixFDList *g_dbus_message_get_unix_fd_list (GDBusMessage *message);
112GLIB_AVAILABLE_IN_ALL
113void g_dbus_message_set_unix_fd_list (GDBusMessage *message,
114 GUnixFDList *fd_list);
115
116GLIB_AVAILABLE_IN_ALL
117guint32 g_dbus_message_get_reply_serial (GDBusMessage *message);
118GLIB_AVAILABLE_IN_ALL
119void g_dbus_message_set_reply_serial (GDBusMessage *message,
120 guint32 value);
121
122GLIB_AVAILABLE_IN_ALL
123const gchar *g_dbus_message_get_interface (GDBusMessage *message);
124GLIB_AVAILABLE_IN_ALL
125void g_dbus_message_set_interface (GDBusMessage *message,
126 const gchar *value);
127
128GLIB_AVAILABLE_IN_ALL
129const gchar *g_dbus_message_get_member (GDBusMessage *message);
130GLIB_AVAILABLE_IN_ALL
131void g_dbus_message_set_member (GDBusMessage *message,
132 const gchar *value);
133
134GLIB_AVAILABLE_IN_ALL
135const gchar *g_dbus_message_get_path (GDBusMessage *message);
136GLIB_AVAILABLE_IN_ALL
137void g_dbus_message_set_path (GDBusMessage *message,
138 const gchar *value);
139
140GLIB_AVAILABLE_IN_ALL
141const gchar *g_dbus_message_get_sender (GDBusMessage *message);
142GLIB_AVAILABLE_IN_ALL
143void g_dbus_message_set_sender (GDBusMessage *message,
144 const gchar *value);
145
146GLIB_AVAILABLE_IN_ALL
147const gchar *g_dbus_message_get_destination (GDBusMessage *message);
148GLIB_AVAILABLE_IN_ALL
149void g_dbus_message_set_destination (GDBusMessage *message,
150 const gchar *value);
151
152GLIB_AVAILABLE_IN_ALL
153const gchar *g_dbus_message_get_error_name (GDBusMessage *message);
154GLIB_AVAILABLE_IN_ALL
155void g_dbus_message_set_error_name (GDBusMessage *message,
156 const gchar *value);
157
158GLIB_AVAILABLE_IN_ALL
159const gchar *g_dbus_message_get_signature (GDBusMessage *message);
160GLIB_AVAILABLE_IN_ALL
161void g_dbus_message_set_signature (GDBusMessage *message,
162 const gchar *value);
163
164GLIB_AVAILABLE_IN_ALL
165guint32 g_dbus_message_get_num_unix_fds (GDBusMessage *message);
166GLIB_AVAILABLE_IN_ALL
167void g_dbus_message_set_num_unix_fds (GDBusMessage *message,
168 guint32 value);
169
170GLIB_AVAILABLE_IN_ALL
171const gchar *g_dbus_message_get_arg0 (GDBusMessage *message);
172
173
174GLIB_AVAILABLE_IN_ALL
175GDBusMessage *g_dbus_message_new_from_blob (guchar *blob,
176 gsize blob_len,
177 GDBusCapabilityFlags capabilities,
178 GError **error);
179
180GLIB_AVAILABLE_IN_ALL
181gssize g_dbus_message_bytes_needed (guchar *blob,
182 gsize blob_len,
183 GError **error);
184
185GLIB_AVAILABLE_IN_ALL
186guchar *g_dbus_message_to_blob (GDBusMessage *message,
187 gsize *out_size,
188 GDBusCapabilityFlags capabilities,
189 GError **error);
190
191GLIB_AVAILABLE_IN_ALL
192gboolean g_dbus_message_to_gerror (GDBusMessage *message,
193 GError **error);
194
195G_END_DECLS
196
197#endif /* __G_DBUS_MESSAGE_H__ */
198

source code of include/glib-2.0/gio/gdbusmessage.h