[kdbus] Enable adding bloom filters items. Signals subscription refactoring.
[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 #define G_TYPE_KDBUS_WORKER                                (g_kdbus_worker_get_type ())
35 #define G_KDBUS_WORKER(inst)                               (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
36                                                             G_TYPE_KDBUS_WORKER, GKDBusWorker))
37 #define G_KDBUS_WORKER_CLASS(class)                        (G_TYPE_CHECK_CLASS_CAST ((class),                       \
38                                                             G_TYPE_KDBUS_WORKER, GKDBusWorkerClass))
39 #define G_IS_KDBUS_WORKER(inst)                            (G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
40                                                             G_TYPE_KDBUS_WORKER))
41 #define G_IS_KDBUS_WORKER_CLASS(class)                     (G_TYPE_CHECK_CLASS_TYPE ((class),                       \
42                                                             G_TYPE_KDBUS_WORKER))
43 #define G_KDBUS_WORKER_GET_CLASS(inst)                     (G_TYPE_INSTANCE_GET_CLASS ((inst),                      \
44                                                             G_TYPE_KDBUS_WORKER, GKDBusWorkerClass))
45
46 typedef struct _GKDBusWorker                               GKDBusWorker;
47
48 GType                   g_kdbus_worker_get_type                         (void);
49
50 GKDBusWorker *          g_kdbus_worker_new                              (const gchar  *address,
51                                                                          GError      **error);
52
53 void                    g_kdbus_worker_associate                        (GKDBusWorker                            *worker,
54                                                                          GDBusCapabilityFlags                     capabilities,
55                                                                          GDBusWorkerMessageReceivedCallback       message_received_callback,
56                                                                          GDBusWorkerMessageAboutToBeSentCallback  message_about_to_be_sent_callback,
57                                                                          GDBusWorkerDisconnectedCallback          disconnected_callback,
58                                                                          gpointer                                 user_data);
59
60 void                    g_kdbus_worker_unfreeze                         (GKDBusWorker *worker);
61
62 gboolean                g_kdbus_worker_send_message                     (GKDBusWorker  *worker,
63                                                                          GDBusMessage  *message,
64                                                                          GError       **error);
65
66 void                    g_kdbus_worker_stop                             (GKDBusWorker *worker);
67
68 void                    g_kdbus_worker_flush_sync                       (GKDBusWorker *worker);
69
70 void                    g_kdbus_worker_close                            (GKDBusWorker       *worker,
71                                                                          GCancellable       *cancellable,
72                                                                          GSimpleAsyncResult *result);
73
74
75 gboolean                                _g_kdbus_open                       (GKDBusWorker   *kdbus,
76                                                                              const gchar    *address,
77                                                                              GError        **error);
78
79 void                                    _g_kdbus_close                      (GKDBusWorker         *kdbus);
80
81 gboolean                                _g_kdbus_is_closed                  (GKDBusWorker         *kdbus);
82
83 GVariant *                              _g_kdbus_Hello                      (GKDBusWorker  *worker,
84                                                                              GError       **error);
85
86 GVariant *                              _g_kdbus_GetBusId                   (GKDBusWorker  *worker,
87                                                                              GError          **error);
88
89 GVariant *                              _g_kdbus_RequestName                (GKDBusWorker     *worker,
90                                                                              const gchar         *name,
91                                                                              GBusNameOwnerFlags   flags,
92                                                                              GError             **error);
93
94 GVariant *                              _g_kdbus_ReleaseName                (GKDBusWorker     *worker,
95                                                                              const gchar         *name,
96                                                                              GError             **error);
97
98 GVariant *                              _g_kdbus_GetListNames               (GKDBusWorker  *worker,
99                                                                              guint             flags,
100                                                                              GError          **error);
101
102 GVariant *                              _g_kdbus_GetListQueuedOwners        (GKDBusWorker  *worker,
103                                                                              const gchar      *name,
104                                                                              GError          **error);
105
106 GVariant *                              _g_kdbus_GetNameOwner               (GKDBusWorker  *worker,
107                                                                              const gchar      *name,
108                                                                              GError          **error);
109
110 GVariant *                              _g_kdbus_GetConnectionUnixProcessID (GKDBusWorker  *worker,
111                                                                              const gchar      *name,
112                                                                              GError          **error);
113
114 GVariant *                              _g_kdbus_GetConnectionUnixUser      (GKDBusWorker  *worker,
115                                                                              const gchar      *name,
116                                                                              GError          **error);
117
118 void                                    _g_kdbus_AddMatch                   (GKDBusWorker     *worker,
119                                                                              const gchar      *match_rule,
120                                                                              guint64           cookie);
121
122 void                                    _g_kdbus_RemoveMatch                (GKDBusWorker     *worker,
123                                                                              guint64           cookie);
124
125 void                                    _g_kdbus_subscribe_name_acquired    (GKDBusWorker  *worker,
126                                                                              const gchar   *name,
127                                                                              guint64        cookie);
128
129 void                                    _g_kdbus_subscribe_name_lost        (GKDBusWorker  *worker,
130                                                                              const gchar   *name,
131                                                                              guint64        cookie);
132
133 void                                    _g_kdbus_subscribe_name_owner_changed (GKDBusWorker  *worker,
134                                                                                const gchar   *name,
135                                                                                guint64        cookie);
136 G_END_DECLS
137
138 #endif /* __G_KDBUS_H__ */