lib: made API multi thread safe(untested)
[platform/core/appfw/message-port-dbus.git] / lib / msgport-manager.h
1 #ifndef __MSGPORT_MANAGER_H
2 #define __MSGPORT_MANAGER_H
3
4 #include <glib.h>
5 #include <glib-object.h>
6 #include <message-port.h>
7
8 #define MSGPORT_TYPE_MANAGER (msgport_manager_get_type())
9 #define MSGPORT_MANAGER(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj), MSGPORT_TYPE_MANAGER, MsgPortManager))
10 #define MSGPORT_MANAGER_CLASS(kls)    (G_TYPE_CHECK_CLASS_CAST((kls), MSGPORT_TYPE_MANAGER, MsgPortManagerClass))
11 #define MSGPORT_IS_MANAGER(obj)       (G_TYPE_CHECK_INSTANCE_TYPE((obj), MSGPORT_TYPE_MANAGER))
12 #define MSGPORT_IS_MANAGER_CLASS(kls) (G_TYPE_CHECK_CLASS_TYPE((kls), MSGPORT_TYPE_MANAGER)
13
14 typedef struct _MsgPortManager MsgPortManager;
15 typedef struct _MsgPortManagerClass MsgPortManagerClass;
16 typedef struct _MsgPortService MsgPortService;
17
18 G_BEGIN_DECLS
19
20 struct _MsgPortManagerClass
21 {
22     GObjectClass parent_class;
23 };
24
25 GType msgport_manager_get_type (void);
26
27 MsgPortManager *
28 msgport_manager_new ();
29
30 messageport_error_e
31 msgport_manager_register_service (MsgPortManager *manager, const gchar *port_name, gboolean is_trusted, messageport_message_cb cb, int *service_id_out);
32
33 messageport_error_e
34 msgport_manager_check_remote_service (MsgPortManager *manager, const gchar *remote_app_id, const gchar *port_name, gboolean is_trusted, guint *service_id_out);
35
36 messageport_error_e
37 msgport_manager_get_service_name (MsgPortManager *manager, int port_id, gchar **name_out);
38
39 messageport_error_e
40 msgport_manager_get_service_is_trusted (MsgPortManager *manager, int port_id, gboolean *is_trusted_out);
41
42 messageport_error_e
43 msgport_manager_unregister_service (MsgPortManager *manager, int service_id);
44
45 messageport_error_e
46 msgport_manager_send_message (MsgPortManager *manager, const gchar *remote_app_id, const gchar *port_name, gboolean is_trusted, GVariant *data);
47
48 messageport_error_e
49 msgport_manager_send_bidirectional_message (MsgPortManager *manager, int from_id, const gchar *remote_app_id, const gchar *port_name, gboolean is_trusted, GVariant *data);
50
51 G_END_DECLS
52
53 #endif /* __MSGPORT_MANAGER_PROXY_H */