[kdbus] Add support for 'ReleaseName' on 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 GType                                   _g_kdbus_get_type                   (void) G_GNUC_CONST;
59
60 gboolean                                _g_kdbus_open                       (GKdbus         *kdbus,
61                                                                              const gchar    *address,
62                                                                              GError        **error);
63
64 gboolean                                _g_kdbus_close                      (GKdbus         *kdbus,
65                                                                              GError        **error);
66
67 gboolean                                _g_kdbus_is_closed                  (GKdbus         *kdbus);
68
69 GSource *                               _g_kdbus_create_source              (GKdbus         *kdbus,
70                                                                              GIOCondition    condition,
71                                                                              GCancellable   *cancellable);
72
73 GVariant *                              _g_kdbus_Hello                      (GIOStream        *stream,
74                                                                              GError          **error);
75
76 GVariant *                              _g_kdbus_GetBusId                   (GDBusConnection  *connection,
77                                                                              GError          **error);
78
79 GVariant *                              _g_kdbus_RequestName                (GDBusConnection     *connection,
80                                                                              const gchar         *name,
81                                                                              GBusNameOwnerFlags   flags,
82                                                                              GError             **error);
83
84 GVariant *                              _g_kdbus_ReleaseName                (GDBusConnection     *connection,
85                                                                              const gchar         *name,
86                                                                              GError             **error);
87
88 GVariant *                              _g_kdbus_GetListNames               (GDBusConnection  *connection,
89                                                                              guint             flags,
90                                                                              GError          **error);
91
92 GVariant *                              _g_kdbus_GetListQueuedOwners        (GDBusConnection  *connection,
93                                                                              const gchar      *name,
94                                                                              GError          **error);
95
96 GVariant *                              _g_kdbus_NameHasOwner               (GDBusConnection  *connection,
97                                                                              const gchar      *name,
98                                                                              GError          **error);
99
100 GVariant *                              _g_kdbus_GetNameOwner               (GDBusConnection  *connection,
101                                                                              const gchar      *name,
102                                                                              GError          **error);
103
104 GVariant *                              _g_kdbus_GetConnectionUnixProcessID (GDBusConnection  *connection,
105                                                                              const gchar      *name,
106                                                                              GError          **error);
107
108 GVariant *                              _g_kdbus_GetConnectionUnixUser      (GDBusConnection  *connection,
109                                                                              const gchar      *name,
110                                                                              GError          **error);
111 G_END_DECLS
112
113 #endif /* __G_KDBUS_H__ */