updated licence header
[platform/core/appfw/message-port-dbus.git] / daemon / dbus-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  * This file is part of message-port.
5  *
6  * Copyright (C) 2013 Intel Corporation.
7  *
8  * Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23  * 02110-1301 USA
24  */
25
26 #ifndef __MSGPORT_DBUS_SERVICE_H
27 #define __MSGPORT_DBUS_SERVICE_H
28
29 #include <glib.h>
30 #include <gio/gio.h>
31 #include <glib-object.h>
32 #include "dbus-manager.h"
33
34 G_BEGIN_DECLS
35
36 #define MSGPORT_TYPE_DBUS_SERVICE (msgport_dbus_service_get_type())
37 #define MSGPORT_DBUS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MSGPORT_TYPE_DBUS_SERVICE, MsgPortDbusService))
38 #define MSGPORT_DBUS_SERVICE_CLASS(obj)  (G_TYPE_CHECK_CLASS_CAST((kls), MSGPORT_TYPE_DBUS_SERVICE, MsgPortDbusServiceClass))
39 #define MSGPORT_IS_DBUS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MSGPORT_TYPE_DBUS_SERVICE))
40 #define MSGPORT_IS_DBUS_SERVICE_CLASS(kls) (G_TYPE_CHECK_CLASS_TYPE((kls), MSGPORT_TYPE_DBUS_SERVICE))
41
42 typedef struct _MsgPortDbusService MsgPortDbusService;
43 typedef struct _MsgPortDbusServiceClass MsgPortDbusServiceClass;
44 typedef struct _MsgPortDbusServicePrivate MsgPortDbusServicePrivate;
45
46 struct _MsgPortDbusService
47 {
48     GObject parent;
49
50     /* private */
51     MsgPortDbusServicePrivate *priv;
52 };
53
54 struct _MsgPortDbusServiceClass
55 {
56     GObjectClass parenet_class;
57 };
58
59 GType msgport_dbus_service_get_type (void);
60
61 MsgPortDbusService *
62 msgport_dbus_service_new (MsgPortDbusManager *owner,
63                           const gchar *name,
64                           gboolean is_trusted,
65                           GError **error_out);
66
67 const gchar *
68 msgport_dbus_service_get_object_path (MsgPortDbusService *dbus_service);
69
70 GDBusConnection *
71 msgport_dbus_service_get_connection (MsgPortDbusService *dbus_service);
72
73 guint
74 msgport_dbus_service_get_id (MsgPortDbusService *dbus_service);
75
76 MsgPortDbusManager *
77 msgport_dbus_service_get_owner (MsgPortDbusService *dbus_service);
78
79 const gchar *
80 msgport_dbus_service_get_app_id (MsgPortDbusService *dbus_service);
81
82 const gchar *
83 msgport_dbus_service_get_port_name (MsgPortDbusService *dbus_service);
84
85 gboolean
86 msgport_dbus_service_get_is_trusted (MsgPortDbusService *dbus_service);
87
88 gboolean
89 msgport_dbus_service_send_message (MsgPortDbusService *dbus_service,
90                                    GVariant    *data,
91                                    const gchar *remote_app_id,
92                                    const gchar *remote_port_name,
93                                    gboolean     remote_is_trusted,
94                                    GError     **error_out);
95
96 G_END_DECLS
97
98 #endif /* __MSGPORT_DBUS_SERVICE_H */
99