hook gvariant vectors up to kdbus
[platform/upstream/glib.git] / gio / gkdbus.h
1 /*  GIO - GLib Input, Output and Streaming Library
2  *
3  * Copyright (C) 2013 Samsung Electronics
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: Michal Eljasiewicz   <m.eljasiewic@samsung.com>
21  * Author: Lukasz Skalski       <l.skalski@samsung.com>
22  */
23
24 #ifndef __G_KDBUS_H__
25 #define __G_KDBUS_H__
26
27 #if !defined (GIO_COMPILATION)
28 #error "gkdbus.h is a private header file."
29 #endif
30
31 #include <gio/giotypes.h>
32 #include "gdbusprivate.h"
33
34 G_BEGIN_DECLS
35
36 #define G_TYPE_KDBUS                                       (_g_kdbus_get_type ())
37 #define G_KDBUS(o)                                         (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_KDBUS, GKdbus))
38 #define G_KDBUS_CLASS(k)                                   (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_KDBUS, GKdbusClass))
39 #define G_KDBUS_GET_CLASS(o)                               (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_KDBUS, GKdbusClass))
40 #define G_IS_KDBUS(o)                                      (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_KDBUS))
41 #define G_IS_KDBUS_CLASS(k)                                (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_KDBUS))
42
43 typedef struct _GKdbus                                      GKdbus;
44 typedef struct _GKdbusClass                                 GKdbusClass;
45 typedef struct _GKdbusPrivate                               GKdbusPrivate;
46
47 struct _GKdbusClass
48 {
49   GObjectClass parent_class;
50 };
51
52 struct _GKdbus
53 {
54   GObject parent_instance;
55   GKdbusPrivate *priv;
56 };
57
58 typedef struct
59 {
60   gchar  *data;
61   gsize   size;
62 } msg_part;
63
64 GType                                   _g_kdbus_get_type                   (void) G_GNUC_CONST;
65
66 gboolean                                _g_kdbus_open                       (GKdbus         *kdbus,
67                                                                              const gchar    *address,
68                                                                              GError        **error);
69
70 gboolean                                _g_kdbus_close                      (GKdbus         *kdbus,
71                                                                              GError        **error);
72
73 gboolean                                _g_kdbus_is_closed                  (GKdbus         *kdbus);
74
75 GSource *                               _g_kdbus_create_source              (GKdbus         *kdbus,
76                                                                              GIOCondition    condition,
77                                                                              GCancellable   *cancellable);
78
79 GVariant *                              _g_kdbus_Hello                      (GIOStream        *stream,
80                                                                              GError          **error);
81
82 GVariant *                              _g_kdbus_GetBusId                   (GDBusConnection  *connection,
83                                                                              GError          **error);
84
85 GVariant *                              _g_kdbus_RequestName                (GDBusConnection     *connection,
86                                                                              const gchar         *name,
87                                                                              GBusNameOwnerFlags   flags,
88                                                                              GError             **error);
89
90 GVariant *                              _g_kdbus_ReleaseName                (GDBusConnection     *connection,
91                                                                              const gchar         *name,
92                                                                              GError             **error);
93
94 GVariant *                              _g_kdbus_GetListNames               (GDBusConnection  *connection,
95                                                                              guint             flags,
96                                                                              GError          **error);
97
98 GVariant *                              _g_kdbus_GetListQueuedOwners        (GDBusConnection  *connection,
99                                                                              const gchar      *name,
100                                                                              GError          **error);
101
102 GVariant *                              _g_kdbus_GetNameOwner               (GDBusConnection  *connection,
103                                                                              const gchar      *name,
104                                                                              GError          **error);
105
106 GVariant *                              _g_kdbus_GetConnectionUnixProcessID (GDBusConnection  *connection,
107                                                                              const gchar      *name,
108                                                                              GError          **error);
109
110 GVariant *                              _g_kdbus_GetConnectionUnixUser      (GDBusConnection  *connection,
111                                                                              const gchar      *name,
112                                                                              GError          **error);
113
114 void                                    _g_kdbus_subscribe_name_acquired    (GDBusConnection  *connection,
115                                                                              const gchar      *name);
116
117 void                                    _g_kdbus_subscribe_name_lost        (GDBusConnection  *connection,
118                                                                              const gchar      *name);
119
120 void                                    _g_kdbus_unsubscribe_name_acquired  (GDBusConnection  *connection);
121
122 void                                    _g_kdbus_unsubscribe_name_lost      (GDBusConnection  *connection);
123
124 gboolean                                _g_kdbus_send                       (GDBusWorker      *worker,
125                                                                              GKdbus           *kdbus,
126                                                                              GDBusMessage     *dbus_msg,
127                                                                              GUnixFDList      *fd_list,
128                                                                              GCancellable     *cancellable,
129                                                                              GError          **error);
130
131 gssize                                  _g_kdbus_receive                    (GKdbus           *kdbus,
132                                                                              GCancellable     *cancellable,
133                                                                              GError          **error);
134
135 GSList *                                _g_kdbus_get_last_msg_items         (GKdbus           *kdbus);
136
137 gchar *                                 _g_kdbus_get_last_msg_sender        (GKdbus           *kdbus);
138
139 gchar *                                 _g_kdbus_get_last_msg_destination   (GKdbus           *kdbus);
140
141 gchar *                                 _g_kdbus_hexdump_all_items          (GSList           *kdbus_msg_items);
142
143 void                                    _g_kdbus_release_kmsg               (GKdbus           *kdbus);
144
145 void                                    _g_kdbus_attach_fds_to_msg          (GKdbus           *kdbus,
146                                                                              GUnixFDList     **fd_list);
147 G_END_DECLS
148
149 #endif /* __G_KDBUS_H__ */