GSocketControlMessage: clean up confusing code
[platform/upstream/glib.git] / gio / gdbusmessage.h
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 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, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Author: David Zeuthen <davidz@redhat.com>
21  */
22
23 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
24 #error "Only <gio/gio.h> can be included directly."
25 #endif
26
27 #ifndef __G_DBUS_MESSAGE_H__
28 #define __G_DBUS_MESSAGE_H__
29
30 #include <gio/giotypes.h>
31
32 G_BEGIN_DECLS
33
34 #define G_TYPE_DBUS_MESSAGE         (g_dbus_message_get_type ())
35 #define G_DBUS_MESSAGE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_MESSAGE, GDBusMessage))
36 #define G_IS_DBUS_MESSAGE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_MESSAGE))
37
38 GType                     g_dbus_message_get_type           (void) G_GNUC_CONST;
39 GDBusMessage             *g_dbus_message_new                (void);
40 GDBusMessage             *g_dbus_message_new_signal         (const gchar              *path,
41                                                              const gchar              *interface_,
42                                                              const gchar              *signal);
43 GDBusMessage             *g_dbus_message_new_method_call    (const gchar              *name,
44                                                              const gchar              *path,
45                                                              const gchar              *interface_,
46                                                              const gchar              *method);
47 GDBusMessage             *g_dbus_message_new_method_reply   (GDBusMessage             *method_call_message);
48 GDBusMessage             *g_dbus_message_new_method_error   (GDBusMessage             *method_call_message,
49                                                              const gchar              *error_name,
50                                                              const gchar              *error_message_format,
51                                                              ...);
52 GDBusMessage             *g_dbus_message_new_method_error_valist (GDBusMessage             *method_call_message,
53                                                                   const gchar              *error_name,
54                                                                   const gchar              *error_message_format,
55                                                                   va_list                   var_args);
56 GDBusMessage             *g_dbus_message_new_method_error_literal (GDBusMessage             *method_call_message,
57                                                                    const gchar              *error_name,
58                                                                    const gchar              *error_message);
59 gchar                    *g_dbus_message_print              (GDBusMessage             *message,
60                                                              guint                     indent);
61 gboolean                  g_dbus_message_get_locked         (GDBusMessage             *message);
62 void                      g_dbus_message_lock               (GDBusMessage             *message);
63 GDBusMessage             *g_dbus_message_copy               (GDBusMessage             *message,
64                                                              GError                  **error);
65 GDBusMessageByteOrder     g_dbus_message_get_byte_order     (GDBusMessage             *message);
66 void                      g_dbus_message_set_byte_order     (GDBusMessage             *message,
67                                                              GDBusMessageByteOrder     byte_order);
68
69 GDBusMessageType          g_dbus_message_get_message_type   (GDBusMessage             *message);
70 void                      g_dbus_message_set_message_type   (GDBusMessage             *message,
71                                                              GDBusMessageType          type);
72 GDBusMessageFlags         g_dbus_message_get_flags          (GDBusMessage             *message);
73 void                      g_dbus_message_set_flags          (GDBusMessage             *message,
74                                                              GDBusMessageFlags         flags);
75 guint32                   g_dbus_message_get_serial         (GDBusMessage             *message);
76 void                      g_dbus_message_set_serial         (GDBusMessage             *message,
77                                                              guint32                   serial);
78 GVariant                 *g_dbus_message_get_header         (GDBusMessage             *message,
79                                                              GDBusMessageHeaderField   header_field);
80 void                      g_dbus_message_set_header         (GDBusMessage             *message,
81                                                              GDBusMessageHeaderField   header_field,
82                                                              GVariant                 *value);
83 guchar                   *g_dbus_message_get_header_fields  (GDBusMessage             *message);
84 GVariant                 *g_dbus_message_get_body           (GDBusMessage             *message);
85 void                      g_dbus_message_set_body           (GDBusMessage             *message,
86                                                              GVariant                 *body);
87 GUnixFDList              *g_dbus_message_get_unix_fd_list   (GDBusMessage             *message);
88 void                      g_dbus_message_set_unix_fd_list   (GDBusMessage             *message,
89                                                              GUnixFDList              *fd_list);
90
91 guint32                   g_dbus_message_get_reply_serial   (GDBusMessage             *message);
92 void                      g_dbus_message_set_reply_serial   (GDBusMessage             *message,
93                                                              guint32                   value);
94
95 const gchar              *g_dbus_message_get_interface      (GDBusMessage             *message);
96 void                      g_dbus_message_set_interface      (GDBusMessage             *message,
97                                                              const gchar              *value);
98
99 const gchar              *g_dbus_message_get_member         (GDBusMessage             *message);
100 void                      g_dbus_message_set_member         (GDBusMessage             *message,
101                                                              const gchar              *value);
102
103 const gchar              *g_dbus_message_get_path           (GDBusMessage             *message);
104 void                      g_dbus_message_set_path           (GDBusMessage             *message,
105                                                              const gchar              *value);
106
107 const gchar              *g_dbus_message_get_sender         (GDBusMessage             *message);
108 void                      g_dbus_message_set_sender         (GDBusMessage             *message,
109                                                              const gchar              *value);
110
111 const gchar              *g_dbus_message_get_destination    (GDBusMessage             *message);
112 void                      g_dbus_message_set_destination    (GDBusMessage             *message,
113                                                              const gchar              *value);
114
115 const gchar              *g_dbus_message_get_error_name     (GDBusMessage             *message);
116 void                      g_dbus_message_set_error_name     (GDBusMessage             *message,
117                                                              const gchar              *value);
118
119 const gchar              *g_dbus_message_get_signature      (GDBusMessage             *message);
120 void                      g_dbus_message_set_signature      (GDBusMessage             *message,
121                                                              const gchar              *value);
122
123 guint32                   g_dbus_message_get_num_unix_fds   (GDBusMessage             *message);
124 void                      g_dbus_message_set_num_unix_fds   (GDBusMessage             *message,
125                                                              guint32                   value);
126
127 const gchar              *g_dbus_message_get_arg0           (GDBusMessage             *message);
128
129
130 GDBusMessage             *g_dbus_message_new_from_blob      (guchar                   *blob,
131                                                              gsize                     blob_len,
132                                                              GDBusCapabilityFlags      capabilities,
133                                                              GError                  **error);
134
135 gssize                    g_dbus_message_bytes_needed       (guchar                   *blob,
136                                                              gsize                     blob_len,
137                                                              GError                  **error);
138
139 guchar                   *g_dbus_message_to_blob            (GDBusMessage             *message,
140                                                              gsize                    *out_size,
141                                                              GDBusCapabilityFlags      capabilities,
142                                                              GError                  **error);
143
144 gboolean                  g_dbus_message_to_gerror          (GDBusMessage             *message,
145                                                              GError                  **error);
146
147 G_END_DECLS
148
149 #endif /* __G_DBUS_MESSAGE_H__ */