daemon: dbus errors defined
[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  * 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_DBUS_SERVICE_H
25 #define _MSGPORT_DBUS_SERVICE_H
26
27 #include <glib.h>
28 #include <gio/gio.h>
29 #include <glib-object.h>
30 #include "dbus-manager.h"
31
32 G_BEGIN_DECLS
33
34 #define MSGPORT_TYPE_DBUS_SERVICE (msgport_dbus_service_get_type())
35 #define MSGPORT_DBUS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MSGPORT_TYPE_DBUS_SERVICE, MsgPortDbusService))
36 #define MSGPORT_DBUS_SERVICE_CLASS(obj)  (G_TYPE_CHECK_CLASS_CAST((kls), MSGPORT_TYPE_DBUS_SERVICE, MsgPortDbusServiceClass))
37 #define MSGPORT_IS_DBUS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MSGPORT_TYPE_DBUS_SERVICE))
38 #define MSGPORT_IS_DBUS_SERVICE_CLASS(kls) (G_TYPE_CHECK_CLASS_TYPE((kls), MSGPORT_TYPE_DBUS_SERVICE))
39
40 typedef struct _MsgPortDbusService MsgPortDbusService;
41 typedef struct _MsgPortDbusServiceClass MsgPortDbusServiceClass;
42 typedef struct _MsgPortDbusServicePrivate MsgPortDbusServicePrivate;
43
44 struct _MsgPortDbusService
45 {
46     GObject parent;
47
48     /* private */
49     MsgPortDbusServicePrivate *priv;
50 };
51
52 struct _MsgPortDbusServiceClass
53 {
54     GObjectClass parenet_class;
55 };
56
57 GType msgport_dbus_service_get_type (void);
58
59 MsgPortDbusService *
60 msgport_dbus_service_new (MsgPortDbusManager *owner, const gchar *name, gboolean is_trusted, GError **error_out);
61
62 const gchar *
63 msgport_dbus_service_get_object_path (MsgPortDbusService *dbus_service);
64
65 GDBusConnection *
66 msgport_dbus_service_get_connection (MsgPortDbusService *dbus_service);
67
68 guint
69 msgport_dbus_service_get_id (MsgPortDbusService *dbus_service);
70
71 MsgPortDbusManager *
72 msgport_dbus_service_get_owner (MsgPortDbusService *dbus_service);
73
74 const gchar *
75 msgport_dbus_service_get_app_id (MsgPortDbusService *dbus_service);
76
77 const gchar *
78 msgport_dbus_service_get_port_name (MsgPortDbusService *dbus_service);
79
80 gboolean
81 msgport_dbus_service_get_is_trusted (MsgPortDbusService *dbus_service);
82
83 gboolean
84 msgport_dbus_service_send_message (MsgPortDbusService *dbus_service,
85                                    GVariant    *data,
86                                    const gchar *remote_app_id,
87                                    const gchar *remote_port_name,
88                                    gboolean     remote_is_trusted,
89                                    GError     **error_out);
90
91 G_END_DECLS
92
93 #endif /* _MSGPORT_DBUS_SERVICE_H */
94