daemon: fixed issue in registring more than one ports by a client.
[profile/ivi/message-port.git] / daemon / manager.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_MANAGER_H
25 #define _MSGPORT_MANAGER_H
26
27 #include <glib-object.h>
28 #include <gio/gio.h>
29
30 G_BEGIN_DECLS
31
32 #define MSGPORT_TYPE_MANAGER (msgport_manager_get_type())
33 #define MSGPORT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MSGPORT_TYPE_MANAGER, MsgPortManager))
34 #define MSGPORT_MANAGER_CLASS(obj)  (G_TYPE_CHECK_CLASS_CAST((kls), MSGPORT_TYPE_MANAGER, MsgPortManagerClass))
35 #define MSGPORT_IS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MSGPORT_TYPE_MANAGER))
36 #define MSGPORT_IS_MANAGER_CLASS(kls) (G_TYPE_CHECK_CLASS_TYPE((kls), MSGPORT_TYPE_MANAGER))
37
38 typedef struct _MsgPortManager MsgPortManager;
39 typedef struct _MsgPortManagerClass MsgPortManagerClass;
40 typedef struct _MsgPortManagerPrivate MsgPortManagerPrivate;
41
42 typedef struct _MsgPortDbusManager MsgPortDbusManager;
43 typedef struct _MsgPortDbusService MsgPortDbusService;
44
45 struct _MsgPortManager
46 {
47     GObject parent;
48
49     /* private */
50     MsgPortManagerPrivate *priv;
51 };
52
53 struct _MsgPortManagerClass
54 {
55     GObjectClass parenet_class;
56 };
57
58 GType msgport_manager_get_type (void);
59
60 MsgPortManager *
61 msgport_manager_new ();
62
63 MsgPortDbusService *
64 msgport_manager_register_service (
65     MsgPortManager     *manager,
66     MsgPortDbusManager *owner,
67     const gchar        *port_name,
68     gboolean            is_trusted,
69     GError            **error_out);
70
71 MsgPortDbusService *
72 msgport_manager_get_service (
73     MsgPortManager     *manager,
74     MsgPortDbusManager *owner,
75     const gchar        *remote_port_name,
76     gboolean            is_trusted,
77     GError            **error_out);
78
79 MsgPortDbusService *
80 msgport_manager_get_service_by_id (
81     MsgPortManager *manager,
82     guint           service_id,
83     GError        **error_out);
84
85 gboolean
86 msgport_manager_unregister_services (
87     MsgPortManager     *manager,
88     MsgPortDbusManager *owned_by,
89     GError            **error_out);
90
91 G_END_DECLS
92
93 #endif /* _MSGPORT_MANAER_H */
94