[M67 Dev][EWK] Classify EWK APIs by public, internal, or product
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / public / ewk_ipc_message_internal.h
1 // Copyright 2013 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6  * @file    ewk_ipc_message_internal.h
7  * @brief   Custom support for ipc messages
8  */
9
10 #ifndef ewk_ipc_message_internal_h
11 #define ewk_ipc_message_internal_h
12
13 #include <Eina.h>
14 #include <tizen.h>
15 #include "ewk_context_internal.h"
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 typedef struct Ewk_Wrt_Message_Data Ewk_IPC_Wrt_Message_Data;
22
23 /*
24  * Create new Ewk_Wrt_Message_Data object. It has to freed by the caller
25  * using ewk_ipc_wrt_message_data_del()
26  */
27 EXPORT_API Ewk_IPC_Wrt_Message_Data* ewk_ipc_wrt_message_data_new();
28
29 /*
30  * Delete the Ewk_Wrt_Message_Object passed by the caller.
31  */
32 EXPORT_API void ewk_ipc_wrt_message_data_del(Ewk_IPC_Wrt_Message_Data* data);
33
34 /*
35  * Set message type
36  *
37  * @return false if NULL string was provided, true otherwise
38  */
39 EXPORT_API Eina_Bool ewk_ipc_wrt_message_data_type_set(Ewk_IPC_Wrt_Message_Data *data, const char *type);
40
41 /*
42  * Get the type of given message. The string should be released with eina_stringshare_del()
43  *
44  * @return true on success, false in case provided data structure is NULL
45  */
46 EXPORT_API Eina_Stringshare* ewk_ipc_wrt_message_data_type_get(const Ewk_IPC_Wrt_Message_Data *data);
47
48 /*
49  * Set message value
50  *
51  * @return false if NULL string was provided, true otherwise
52  */
53 EXPORT_API Eina_Bool ewk_ipc_wrt_message_data_value_set(Ewk_IPC_Wrt_Message_Data *data, const char *value);
54
55 /*
56  * Get message value. The string should be released with eina_stringshare_del()
57  *
58  * @return true on success, false in case provided data structure is NULL
59  */
60 EXPORT_API Eina_Stringshare* ewk_ipc_wrt_message_data_value_get(const Ewk_IPC_Wrt_Message_Data *data);
61
62 /*
63  * Set message ID
64  *
65  * @return false if NULL string was provided, true otherwise
66  */
67 EXPORT_API Eina_Bool ewk_ipc_wrt_message_data_id_set(Ewk_IPC_Wrt_Message_Data *data, const char *id);
68
69 /*
70  * Get message ID. The string should be released with eina_stringshare_del()
71  *
72  * @return true on success, false in case provided data structure is NULL
73  */
74 EXPORT_API Eina_Stringshare* ewk_ipc_wrt_message_data_id_get(const Ewk_IPC_Wrt_Message_Data *data);
75
76 /*
77  * Get message reference ID
78  *
79  * @return false if NULL string was provided, true otherwise
80  */
81 EXPORT_API Eina_Bool ewk_ipc_wrt_message_data_reference_id_set(Ewk_IPC_Wrt_Message_Data *data, const char *reference_id);
82
83 /*
84  * Set message reference ID. The string should be released with eina_stringshare_del()
85  *
86  * @return true on success, false in case provided data structure is NULL
87  */
88 EXPORT_API Eina_Stringshare* ewk_ipc_wrt_message_data_reference_id_get(const Ewk_IPC_Wrt_Message_Data *data);
89
90 /**
91  *  Send IPC message to Wrt
92  *
93  *  Plugins -> Wrt (Renderer->Browser)
94  */
95 EXPORT_API Eina_Bool ewk_ipc_plugins_message_send(int routingId, const Ewk_IPC_Wrt_Message_Data* data);
96
97 /**
98  *   Send IPC message to Plugins
99  *
100  *   Wrt -> Plugins (Browser->Renderer)
101  *   //TODO - it is always send to all rendereres - it need to be modified
102  */
103 EXPORT_API Eina_Bool ewk_ipc_wrt_message_send(Ewk_Context* context, const Ewk_IPC_Wrt_Message_Data* data);
104
105
106 /**
107  *  Send Synchronous IPC message to Wrt
108  *
109  *  Plugins -> Wrt (answer: -> Plugins) (Renderer->Browser -> Renderer)
110  *
111  *  If success the value member will be set by the handler
112  */
113 EXPORT_API Eina_Bool ewk_ipc_plugins_sync_message_send(int routingId, Ewk_IPC_Wrt_Message_Data* data);
114
115 #ifdef __cplusplus
116 }
117 #endif
118
119 #endif // ewk_ipc_message_internal_h