604ea1b90f591de958242f43b6b6bdce244c6c26
[profile/ivi/message-port.git] / lib / msgport-service.h
1 /* vi: set et sw=4 ts=4 cino=t0,(0: */
2 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 /*
4  * Copyright (C) 2013 Intel Corporation.
5  *
6  * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  */
23
24 #ifndef __MSGPORT_SERVICE_H
25 #define __MSGPORT_SERVICE_H
26
27 #include <glib.h>
28 #include <gio/gio.h>
29 #include <glib-object.h>
30 #include <message-port.h>
31
32 G_BEGIN_DECLS
33
34 #define MSGPORT_TYPE_SERVICE          (msgport_service_get_type())
35 #define MSGPORT_SERVICE(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), MSGPORT_TYPE_SERVICE, MsgPortService))
36 #define MSGPORT_IS_SERVICE(obj)       (G_TYPE_CHECK_INSTANCE_TYPE((obj), MSGPORT_TYPE_SERVICE))
37 #define MSGPORT_SERVICE_CLASS(cls)    (G_TYPE_CHECK_CLASS_CAST((cls), MSGPORT_TYPE_SERVICE, MsgPortServiceClass))
38 #define MSGPORT_IS_SERVICE_CLASS(cls) (G_TYPE_CHECK_CLASS_TYPE((cls), MSGPORT_TYPE_SERVICE))
39
40 typedef struct _MsgPortService MsgPortService;
41 typedef struct _MsgPortServiceClass MsgPortServiceClass;
42
43 struct _MsgPortServiceClass
44 {
45     GObjectClass parent_class;
46 };
47
48 GType msgport_service_get_type(void);
49
50 MsgPortService *
51 msgport_service_new (GDBusConnection *connection, const gchar *path, messageport_message_cb message_cb);
52
53 const gchar *
54 msgport_service_name (MsgPortService *service);
55
56 gboolean
57 msgport_service_is_trusted (MsgPortService *service);
58
59 guint
60 msgport_service_id (MsgPortService *service);
61
62 void
63 msgport_service_set_message_handler (MsgPortService *service, messageport_message_cb handler);
64
65 gboolean
66 msgport_service_unregister (MsgPortService *service);
67
68 messageport_error_e
69 msgport_service_send_message (MsgPortService *service, guint remote_service_id, GVariant *message);
70
71 G_END_DECLS
72
73 #endif /* __MSGPORT_SERVICE_H */