gdbusmessage.h 11.1 KB
Newer Older
1 2
/* GDBus - GLib D-Bus Library
 *
3
 * Copyright (C) 2008-2010 Red Hat, Inc.
4 5 6 7 8 9 10 11 12 13 14 15
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * 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 19 20
 *
 * Author: David Zeuthen <davidz@redhat.com>
 */

21 22 23
#ifndef __G_DBUS_MESSAGE_H__
#define __G_DBUS_MESSAGE_H__

24 25 26 27
#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
#error "Only <gio/gio.h> can be included directly."
#endif

28 29 30 31
#include <gio/giotypes.h>

G_BEGIN_DECLS

32
#define G_TYPE_DBUS_MESSAGE         (g_dbus_message_get_type ())
33 34 35
#define G_DBUS_MESSAGE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_MESSAGE, GDBusMessage))
#define G_IS_DBUS_MESSAGE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_MESSAGE))

36
GLIB_AVAILABLE_IN_ALL
37
GType                     g_dbus_message_get_type           (void) G_GNUC_CONST;
38
GLIB_AVAILABLE_IN_ALL
39
GDBusMessage             *g_dbus_message_new                (void);
40
GLIB_AVAILABLE_IN_ALL
41
GDBusMessage             *g_dbus_message_new_signal         (const gchar              *path,
42
                                                             const gchar              *interface_,
43
                                                             const gchar              *signal);
44
GLIB_AVAILABLE_IN_ALL
45 46
GDBusMessage             *g_dbus_message_new_method_call    (const gchar              *name,
                                                             const gchar              *path,
47
                                                             const gchar              *interface_,
48
                                                             const gchar              *method);
49
GLIB_AVAILABLE_IN_ALL
50
GDBusMessage             *g_dbus_message_new_method_reply   (GDBusMessage             *method_call_message);
51
GLIB_AVAILABLE_IN_ALL
52 53 54 55
GDBusMessage             *g_dbus_message_new_method_error   (GDBusMessage             *method_call_message,
                                                             const gchar              *error_name,
                                                             const gchar              *error_message_format,
                                                             ...);
56
GLIB_AVAILABLE_IN_ALL
57 58 59 60
GDBusMessage             *g_dbus_message_new_method_error_valist (GDBusMessage             *method_call_message,
                                                                  const gchar              *error_name,
                                                                  const gchar              *error_message_format,
                                                                  va_list                   var_args);
61
GLIB_AVAILABLE_IN_ALL
62 63 64
GDBusMessage             *g_dbus_message_new_method_error_literal (GDBusMessage             *method_call_message,
                                                                   const gchar              *error_name,
                                                                   const gchar              *error_message);
65
GLIB_AVAILABLE_IN_ALL
66 67
gchar                    *g_dbus_message_print              (GDBusMessage             *message,
                                                             guint                     indent);
68
GLIB_AVAILABLE_IN_ALL
69
gboolean                  g_dbus_message_get_locked         (GDBusMessage             *message);
70
GLIB_AVAILABLE_IN_ALL
71
void                      g_dbus_message_lock               (GDBusMessage             *message);
72
GLIB_AVAILABLE_IN_ALL
73 74
GDBusMessage             *g_dbus_message_copy               (GDBusMessage             *message,
                                                             GError                  **error);
75
GLIB_AVAILABLE_IN_ALL
76
GDBusMessageByteOrder     g_dbus_message_get_byte_order     (GDBusMessage             *message);
77
GLIB_AVAILABLE_IN_ALL
78 79 80
void                      g_dbus_message_set_byte_order     (GDBusMessage             *message,
                                                             GDBusMessageByteOrder     byte_order);

81
GLIB_AVAILABLE_IN_ALL
82
GDBusMessageType          g_dbus_message_get_message_type   (GDBusMessage             *message);
83
GLIB_AVAILABLE_IN_ALL
84
void                      g_dbus_message_set_message_type   (GDBusMessage             *message,
85
                                                             GDBusMessageType          type);
86
GLIB_AVAILABLE_IN_ALL
87
GDBusMessageFlags         g_dbus_message_get_flags          (GDBusMessage             *message);
88
GLIB_AVAILABLE_IN_ALL
89 90
void                      g_dbus_message_set_flags          (GDBusMessage             *message,
                                                             GDBusMessageFlags         flags);
91
GLIB_AVAILABLE_IN_ALL
92
guint32                   g_dbus_message_get_serial         (GDBusMessage             *message);
93
GLIB_AVAILABLE_IN_ALL
94 95
void                      g_dbus_message_set_serial         (GDBusMessage             *message,
                                                             guint32                   serial);
96
GLIB_AVAILABLE_IN_ALL
97 98
GVariant                 *g_dbus_message_get_header         (GDBusMessage             *message,
                                                             GDBusMessageHeaderField   header_field);
99
GLIB_AVAILABLE_IN_ALL
100 101 102
void                      g_dbus_message_set_header         (GDBusMessage             *message,
                                                             GDBusMessageHeaderField   header_field,
                                                             GVariant                 *value);
103
GLIB_AVAILABLE_IN_ALL
104
guchar                   *g_dbus_message_get_header_fields  (GDBusMessage             *message);
105
GLIB_AVAILABLE_IN_ALL
106
GVariant                 *g_dbus_message_get_body           (GDBusMessage             *message);
107
GLIB_AVAILABLE_IN_ALL
108 109
void                      g_dbus_message_set_body           (GDBusMessage             *message,
                                                             GVariant                 *body);
110
GLIB_AVAILABLE_IN_ALL
111
GUnixFDList              *g_dbus_message_get_unix_fd_list   (GDBusMessage             *message);
112
GLIB_AVAILABLE_IN_ALL
113 114 115
void                      g_dbus_message_set_unix_fd_list   (GDBusMessage             *message,
                                                             GUnixFDList              *fd_list);

116
GLIB_AVAILABLE_IN_ALL
117
guint32                   g_dbus_message_get_reply_serial   (GDBusMessage             *message);
118
GLIB_AVAILABLE_IN_ALL
119 120 121
void                      g_dbus_message_set_reply_serial   (GDBusMessage             *message,
                                                             guint32                   value);

122
GLIB_AVAILABLE_IN_ALL
123
const gchar              *g_dbus_message_get_interface      (GDBusMessage             *message);
124
GLIB_AVAILABLE_IN_ALL
125 126 127
void                      g_dbus_message_set_interface      (GDBusMessage             *message,
                                                             const gchar              *value);

128
GLIB_AVAILABLE_IN_ALL
129
const gchar              *g_dbus_message_get_member         (GDBusMessage             *message);
130
GLIB_AVAILABLE_IN_ALL
131 132 133
void                      g_dbus_message_set_member         (GDBusMessage             *message,
                                                             const gchar              *value);

134
GLIB_AVAILABLE_IN_ALL
135
const gchar              *g_dbus_message_get_path           (GDBusMessage             *message);
136
GLIB_AVAILABLE_IN_ALL
137 138 139
void                      g_dbus_message_set_path           (GDBusMessage             *message,
                                                             const gchar              *value);

140
GLIB_AVAILABLE_IN_ALL
141
const gchar              *g_dbus_message_get_sender         (GDBusMessage             *message);
142
GLIB_AVAILABLE_IN_ALL
143 144 145
void                      g_dbus_message_set_sender         (GDBusMessage             *message,
                                                             const gchar              *value);

146
GLIB_AVAILABLE_IN_ALL
147
const gchar              *g_dbus_message_get_destination    (GDBusMessage             *message);
148
GLIB_AVAILABLE_IN_ALL
149 150 151
void                      g_dbus_message_set_destination    (GDBusMessage             *message,
                                                             const gchar              *value);

152
GLIB_AVAILABLE_IN_ALL
153
const gchar              *g_dbus_message_get_error_name     (GDBusMessage             *message);
154
GLIB_AVAILABLE_IN_ALL
155 156 157
void                      g_dbus_message_set_error_name     (GDBusMessage             *message,
                                                             const gchar              *value);

158
GLIB_AVAILABLE_IN_ALL
159
const gchar              *g_dbus_message_get_signature      (GDBusMessage             *message);
160
GLIB_AVAILABLE_IN_ALL
161 162 163
void                      g_dbus_message_set_signature      (GDBusMessage             *message,
                                                             const gchar              *value);

164
GLIB_AVAILABLE_IN_ALL
165
guint32                   g_dbus_message_get_num_unix_fds   (GDBusMessage             *message);
166
GLIB_AVAILABLE_IN_ALL
167 168 169
void                      g_dbus_message_set_num_unix_fds   (GDBusMessage             *message,
                                                             guint32                   value);

170
GLIB_AVAILABLE_IN_ALL
171 172 173
const gchar              *g_dbus_message_get_arg0           (GDBusMessage             *message);


174
GLIB_AVAILABLE_IN_ALL
175 176
GDBusMessage             *g_dbus_message_new_from_blob      (guchar                   *blob,
                                                             gsize                     blob_len,
177
                                                             GDBusCapabilityFlags      capabilities,
178 179
                                                             GError                  **error);

180
GLIB_AVAILABLE_IN_ALL
181 182 183 184
gssize                    g_dbus_message_bytes_needed       (guchar                   *blob,
                                                             gsize                     blob_len,
                                                             GError                  **error);

185
GLIB_AVAILABLE_IN_ALL
186 187
guchar                   *g_dbus_message_to_blob            (GDBusMessage             *message,
                                                             gsize                    *out_size,
188
                                                             GDBusCapabilityFlags      capabilities,
189 190
                                                             GError                  **error);

191
GLIB_AVAILABLE_IN_ALL
192 193 194 195 196 197
gboolean                  g_dbus_message_to_gerror          (GDBusMessage             *message,
                                                             GError                  **error);

G_END_DECLS

#endif /* __G_DBUS_MESSAGE_H__ */