now come the big changes...
[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 #if 0
54                                                                          GDBusCapabilityFlags                     capabilities,
55                                                                          gboolean                                 initially_frozen,
56                                                                          GDBusWorkerMessageReceivedCallback       message_received_callback,
57                                                                          GDBusWorkerMessageAboutToBeSentCallback  message_about_to_be_sent_callback,
58                                                                          GDBusWorkerDisconnectedCallback          disconnected_callback,
59                                                                          gpointer                                 user_data);
60 #endif
61
62 void                    g_kdbus_worker_unfreeze                         (GKDBusWorker *worker);
63
64 gboolean                g_kdbus_worker_send_message                     (GKDBusWorker  *worker,
65                                                                          GDBusMessage  *message,
66                                                                          GError       **error);
67
68 void                    g_kdbus_worker_stop                             (GKDBusWorker *worker);
69
70 void                    g_kdbus_worker_flush_sync                       (GKDBusWorker *worker);
71
72 void                    g_kdbus_worker_close                            (GKDBusWorker       *worker,
73                                                                          GCancellable       *cancellable,
74                                                                          GSimpleAsyncResult *result);
75
76
77 gboolean                                _g_kdbus_open                       (GKDBusWorker   *kdbus,
78                                                                              const gchar    *address,
79                                                                              GError        **error);
80
81 void                                    _g_kdbus_close                      (GKDBusWorker         *kdbus);
82
83 gboolean                                _g_kdbus_is_closed                  (GKDBusWorker         *kdbus);
84
85 GVariant *                              _g_kdbus_Hello                      (GKDBusWorker  *worker,
86                                                                              GError       **error);
87
88 GVariant *                              _g_kdbus_GetBusId                   (GKDBusWorker  *worker,
89                                                                              GError          **error);
90
91 GVariant *                              _g_kdbus_RequestName                (GKDBusWorker     *worker,
92                                                                              const gchar         *name,
93                                                                              GBusNameOwnerFlags   flags,
94                                                                              GError             **error);
95
96 GVariant *                              _g_kdbus_ReleaseName                (GKDBusWorker     *worker,
97                                                                              const gchar         *name,
98                                                                              GError             **error);
99
100 GVariant *                              _g_kdbus_GetListNames               (GKDBusWorker  *worker,
101                                                                              guint             flags,
102                                                                              GError          **error);
103
104 GVariant *                              _g_kdbus_GetListQueuedOwners        (GKDBusWorker  *worker,
105                                                                              const gchar      *name,
106                                                                              GError          **error);
107
108 GVariant *                              _g_kdbus_GetNameOwner               (GKDBusWorker  *worker,
109                                                                              const gchar      *name,
110                                                                              GError          **error);
111
112 GVariant *                              _g_kdbus_GetConnectionUnixProcessID (GKDBusWorker  *worker,
113                                                                              const gchar      *name,
114                                                                              GError          **error);
115
116 GVariant *                              _g_kdbus_GetConnectionUnixUser      (GKDBusWorker  *worker,
117                                                                              const gchar      *name,
118                                                                              GError          **error);
119
120 void                                    _g_kdbus_subscribe_name_acquired    (GKDBusWorker  *worker,
121                                                                              const gchar      *name);
122
123 void                                    _g_kdbus_subscribe_name_lost        (GKDBusWorker  *worker,
124                                                                              const gchar      *name);
125
126 void                                    _g_kdbus_unsubscribe_name_acquired  (GKDBusWorker  *worker);
127
128 void                                    _g_kdbus_unsubscribe_name_lost      (GKDBusWorker  *worker);
129
130 gchar *                                 _g_kdbus_hexdump_all_items          (GSList           *kdbus_msg_items);
131
132 G_END_DECLS
133
134 #endif /* __G_KDBUS_H__ */