e21e91d1bd4cd76ddac09fac109b26f41287497e
[platform/upstream/glib.git] / gio / gkdbus.h
1 /*  GIO - GLib Input, Output and Streaming Library
2  *
3  * Copyright © 2013 Samsung
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  * Authors: Michal Eljasiewicz <m.eljasiewic@samsung.com>
21  * Authors: Lukasz Skalski <l.skalski@partner.samsung.com>
22  */
23
24 #ifndef __G_KDBUS_H__
25 #define __G_KDBUS_H__
26
27 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
28 #error "Only <gio/gio.h> can be included directly."
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(inst)                                      (G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
38                                                              G_TYPE_KDBUS, GKdbus))
39 #define G_KDBUS_CLASS(class)                               (G_TYPE_CHECK_CLASS_CAST ((class),                       \
40                                                              G_TYPE_KDBUS, GKdbusClass))
41 #define G_IS_KDBUS(inst)                                   (G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
42                                                              G_TYPE_KDBUS))
43 #define G_IS_KDBUS_CLASS(class)                            (G_TYPE_CHECK_CLASS_TYPE ((class),                       \
44                                                              G_TYPE_KDBUS))
45 #define G_KDBUS_GET_CLASS(inst)                            (G_TYPE_INSTANCE_GET_CLASS ((inst),                      \
46                                                              G_TYPE_KDBUS, GKdbusClass))
47
48 typedef struct _GKdbusPrivate                              GKdbusPrivate;
49 typedef struct _GKdbusClass                                GKdbusClass;
50
51 struct _GKdbusClass
52 {
53   GObjectClass parent_class;
54
55   /*< private >*/
56
57   /* Padding for future expansion */
58   void (*_g_reserved1) (void);
59   void (*_g_reserved2) (void);
60   void (*_g_reserved3) (void);
61   void (*_g_reserved4) (void);
62   void (*_g_reserved5) (void);
63   void (*_g_reserved6) (void);
64   void (*_g_reserved7) (void);
65   void (*_g_reserved8) (void);
66   void (*_g_reserved9) (void);
67   void (*_g_reserved10) (void);
68 };
69
70 struct _GKdbus
71 {
72   GObject parent_instance;
73   GKdbusPrivate *priv;
74 };
75
76 GLIB_AVAILABLE_IN_ALL
77 GType                   g_kdbus_get_type                (void) G_GNUC_CONST;
78 GLIB_AVAILABLE_IN_ALL
79 gint                    g_kdbus_get_fd                  (GKdbus           *kdbus);
80 GLIB_AVAILABLE_IN_ALL
81 gboolean                            g_kdbus_open                                      (GKdbus           *kdbus,
82                                                                                              const gchar      *address,
83                                                                                        GCancellable     *cancellable,
84                                                                                              GError           **error);
85 GLIB_AVAILABLE_IN_ALL
86 gboolean                            g_kdbus_close                                   (GKdbus           *kdbus,
87                                                                                                    GError           **error);
88 GLIB_AVAILABLE_IN_ALL
89 gboolean                            g_kdbus_is_closed                     (GKdbus           *kdbus);
90 GLIB_AVAILABLE_IN_ALL
91 gssize                  g_kdbus_receive                 (GKdbus       *kdbus,
92                                                          char         *data,
93                                                                      GError       **error);
94 GLIB_AVAILABLE_IN_ALL
95 gssize                  g_kdbus_send_message            (GDBusWorker     *worker,
96                                                          GKdbus          *kdbus,
97                                                          GDBusMessage    *dbus_msg,
98                                                          gchar           *blob,
99                                                          gsize            blob_size,
100                                                                      GError          **error);
101 GLIB_AVAILABLE_IN_ALL
102 gboolean                g_kdbus_register                (GKdbus           *kdbus);
103 GLIB_AVAILABLE_IN_ALL
104 gchar*                  g_kdbus_get_sender                (GKdbus           *kdbus);
105 GLIB_AVAILABLE_IN_ALL
106 GSource *              g_kdbus_create_source           (GKdbus                 *kdbus,
107                                                                                                    GIOCondition             condition,
108                                                                                                    GCancellable            *cancellable);
109 GLIB_AVAILABLE_IN_ALL
110 GIOCondition           g_kdbus_condition_check         (GKdbus                 *kdbus,
111                                                                                                   GIOCondition             condition);
112
113 G_END_DECLS
114
115 #endif /* __G_KDBUS_H__ */