FIX TIVI-2641: Fix issue in trusted ports with no valid certificate info.
[profile/ivi/message-port.git] / lib / msgport-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  * 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_MANAGER_H
27 #define __MSGPORT_MANAGER_H
28
29 #include <glib.h>
30 #include <glib-object.h>
31 #include <message-port.h>
32
33 #define MSGPORT_TYPE_MANAGER (msgport_manager_get_type())
34 #define MSGPORT_MANAGER(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), MSGPORT_TYPE_MANAGER, MsgPortManager))
35 #define MSGPORT_MANAGER_CLASS(kls)    (G_TYPE_CHECK_CLASS_CAST((kls), MSGPORT_TYPE_MANAGER, MsgPortManagerClass))
36 #define MSGPORT_IS_MANAGER(obj)       (G_TYPE_CHECK_INSTANCE_TYPE((obj), MSGPORT_TYPE_MANAGER))
37 #define MSGPORT_IS_MANAGER_CLASS(kls) (G_TYPE_CHECK_CLASS_TYPE((kls), MSGPORT_TYPE_MANAGER)
38
39 typedef struct _MsgPortManager MsgPortManager;
40 typedef struct _MsgPortManagerClass MsgPortManagerClass;
41 typedef struct _MsgPortService MsgPortService;
42
43 G_BEGIN_DECLS
44
45 struct _MsgPortManagerClass
46 {
47     GObjectClass parent_class;
48 };
49
50 GType msgport_manager_get_type (void);
51
52 MsgPortManager *
53 msgport_manager_new ();
54
55 messageport_error_e
56 msgport_manager_register_service (MsgPortManager *manager, const gchar *port_name, gboolean is_trusted, messageport_message_cb cb, int *service_id_out);
57
58 messageport_error_e
59 msgport_manager_check_remote_service (MsgPortManager *manager, const gchar *remote_app_id, const gchar *port_name, gboolean is_trusted, guint *service_id_out);
60
61 messageport_error_e
62 msgport_manager_get_service_name (MsgPortManager *manager, int port_id, gchar **name_out);
63
64 messageport_error_e
65 msgport_manager_get_service_is_trusted (MsgPortManager *manager, int port_id, gboolean *is_trusted_out);
66
67 messageport_error_e
68 msgport_manager_unregister_service (MsgPortManager *manager, int service_id);
69
70 messageport_error_e
71 msgport_manager_send_message (MsgPortManager *manager, const gchar *remote_app_id, const gchar *port_name, gboolean is_trusted, GVariant *data);
72
73 messageport_error_e
74 msgport_manager_send_bidirectional_message (MsgPortManager *manager, int from_id, const gchar *remote_app_id, const gchar *port_name, gboolean is_trusted, GVariant *data);
75
76 G_END_DECLS
77
78 #endif /* __MSGPORT_MANAGER_PROXY_H */