gdbusmessage.h 11.2 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 16 17 18 19 20 21 22
 *
 * 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
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Author: David Zeuthen <davidz@redhat.com>
 */

23 24 25
#ifndef __G_DBUS_MESSAGE_H__
#define __G_DBUS_MESSAGE_H__

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

30 31 32 33
#include <gio/giotypes.h>

G_BEGIN_DECLS

34
#define G_TYPE_DBUS_MESSAGE         (g_dbus_message_get_type ())
35 36 37
#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))

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

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

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

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

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

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

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

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

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

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

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

172
GLIB_AVAILABLE_IN_ALL
173 174 175
const gchar              *g_dbus_message_get_arg0           (GDBusMessage             *message);


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

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

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

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

G_END_DECLS

#endif /* __G_DBUS_MESSAGE_H__ */