bidirectional messages implemented, updated the example code
[profile/ivi/message-port.git] / lib / msgport-service.h
1 #ifndef __MSGPORT_SERVICE_H
2 #define __MSGPORT_SERVICE_H
3
4 #include <glib.h>
5 #include <gio/gio.h>
6 #include <glib-object.h>
7 #include <message-port.h>
8
9 G_BEGIN_DECLS
10
11 #define MSGPORT_TYPE_SERVICE          (msgport_service_get_type())
12 #define MSGPORT_SERVICE(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), MSGPORT_TYPE_SERVICE, MsgPortService))
13 #define MSGPORT_IS_SERVICE(obj)       (G_TYPE_CHECK_INSTANCE_TYPE((obj), MSGPORT_TYPE_SERVICE))
14 #define MSGPORT_SERVICE_CLASS(cls)    (G_TYPE_CHECK_CLASS_CAST((cls), MSGPORT_TYPE_SERVICE, MsgPortServiceClass))
15 #define MSGPORT_IS_SERVICE_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE((cls), MSGPORT_TYPE_SERVICE))
16
17 typedef struct _MsgPortService MsgPortService;
18 typedef struct _MsgPortServiceClass MsgPortServiceClass;
19
20 struct _MsgPortServiceClass
21 {
22     GObjectClass parent_class;
23 };
24
25 GType msgport_service_get_type(void);
26
27 MsgPortService *
28 msgport_service_new (GDBusConnection *connection, const gchar *path, messageport_message_cb message_cb);
29
30 const gchar *
31 msgport_service_name (MsgPortService *service);
32
33 gboolean
34 msgport_service_is_trusted (MsgPortService *service);
35
36 int
37 msgport_service_id (MsgPortService *service);
38
39 gboolean
40 msgport_service_unregister (MsgPortService *service);
41
42 messageport_error_e
43 msgport_service_send_message (MsgPortService *service, guint remote_service_id, GVariant *message);
44
45 G_END_DECLS
46
47 #endif /* __MSGPORT_SERVICE_H */