[M85 Migration][Callback] Implement new smart callback, 'did,not,allow,script'
[platform/framework/web/chromium-efl.git] / tizen_src / ewk / efl_integration / common / render_messages_ewk.h
1 // Copyright 2015 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 // Multiply-included file, no traditional include guard.
6
7 #include "base/values.h"
8 #include "common/cache_params_efl.h"
9 #include "common/hit_test_params.h"
10 #include "common/navigation_policy_params.h"
11 #include "common/print_pages_params.h"
12 #include "common/web_preferences_efl.h"
13 #include "ipc/ipc_channel_handle.h"
14 #include "ipc/ipc_message_macros.h"
15 #include "private/ewk_hit_test_private.h"
16 #include "private/ewk_text_style_private.h"
17 #include "private/ewk_wrt_private.h"
18 #include "public/ewk_hit_test_internal.h"
19 #include "public/ewk_view_internal.h"
20 #include "public/ewk_hit_test_internal.h"
21 #include "public/ewk_view.h"
22 #include "third_party/blink/public/web/web_navigation_policy.h"
23 #include "third_party/blink/public/web/web_navigation_type.h"
24 #include "ipc_message_start_ewk.h"
25
26 typedef std::map<std::string, std::string> StringMap;
27
28 #define IPC_MESSAGE_START EwkMsgStart
29
30 IPC_STRUCT_TRAITS_BEGIN(Ewk_Wrt_Message_Data)
31   IPC_STRUCT_TRAITS_MEMBER(type)
32   IPC_STRUCT_TRAITS_MEMBER(value)
33   IPC_STRUCT_TRAITS_MEMBER(id)
34   IPC_STRUCT_TRAITS_MEMBER(reference_id)
35 IPC_STRUCT_TRAITS_END()
36
37 IPC_STRUCT_TRAITS_BEGIN(WebPreferencesEfl)
38   IPC_STRUCT_TRAITS_MEMBER(shrinks_viewport_content_to_fit)
39   IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows_automatically_ewk)
40 IPC_STRUCT_TRAITS_END()
41
42 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Node_Data)
43   IPC_STRUCT_TRAITS_MEMBER(tagName)
44   IPC_STRUCT_TRAITS_MEMBER(nodeValue)
45   IPC_STRUCT_TRAITS_MEMBER(attributes)
46 IPC_STRUCT_TRAITS_END()
47
48 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Image_Data)
49   IPC_STRUCT_TRAITS_MEMBER(fileNameExtension)
50   IPC_STRUCT_TRAITS_MEMBER(imageBitmap)
51 IPC_STRUCT_TRAITS_END()
52
53 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params)
54   IPC_STRUCT_TRAITS_MEMBER(context)
55   IPC_STRUCT_TRAITS_MEMBER(linkURI)
56   IPC_STRUCT_TRAITS_MEMBER(linkTitle)
57   IPC_STRUCT_TRAITS_MEMBER(linkLabel)
58   IPC_STRUCT_TRAITS_MEMBER(imageURI)
59   IPC_STRUCT_TRAITS_MEMBER(isEditable)
60   IPC_STRUCT_TRAITS_MEMBER(mode)
61   IPC_STRUCT_TRAITS_MEMBER(nodeData)
62   IPC_STRUCT_TRAITS_MEMBER(imageData)
63 IPC_STRUCT_TRAITS_END()
64
65 IPC_ENUM_TRAITS(Ewk_CSP_Header_Type)
66
67 IPC_ENUM_TRAITS(Ewk_Hit_Test_Mode)
68
69 IPC_STRUCT_TRAITS_BEGIN(DidPrintPagesParams)
70 #if !defined(EWK_BRINGUP)  // FIXME: m85 bringup
71   IPC_STRUCT_TRAITS_MEMBER(metafile_data_handle)
72 #endif
73   IPC_STRUCT_TRAITS_MEMBER(data_size)
74   IPC_STRUCT_TRAITS_MEMBER(document_cookie)
75   IPC_STRUCT_TRAITS_MEMBER(filename)
76 IPC_STRUCT_TRAITS_END()
77
78 IPC_STRUCT_TRAITS_BEGIN(CacheParamsEfl)
79   IPC_STRUCT_TRAITS_MEMBER(cache_total_capacity)
80   IPC_STRUCT_TRAITS_MEMBER(cache_min_dead_capacity)
81   IPC_STRUCT_TRAITS_MEMBER(cache_max_dead_capacity)
82 IPC_STRUCT_TRAITS_END()
83
84 IPC_STRUCT_TRAITS_BEGIN(SelectionStylePrams)
85   IPC_STRUCT_TRAITS_MEMBER(underline_state)
86   IPC_STRUCT_TRAITS_MEMBER(italic_state)
87   IPC_STRUCT_TRAITS_MEMBER(bold_state)
88   IPC_STRUCT_TRAITS_MEMBER(bg_color)
89   IPC_STRUCT_TRAITS_MEMBER(color)
90   IPC_STRUCT_TRAITS_MEMBER(font_size)
91   IPC_STRUCT_TRAITS_MEMBER(order_list_state)
92   IPC_STRUCT_TRAITS_MEMBER(un_order_list_state)
93   IPC_STRUCT_TRAITS_MEMBER(text_align_center_state)
94   IPC_STRUCT_TRAITS_MEMBER(text_align_left_state)
95   IPC_STRUCT_TRAITS_MEMBER(text_align_right_state)
96   IPC_STRUCT_TRAITS_MEMBER(text_align_full_state)
97   IPC_STRUCT_TRAITS_MEMBER(has_composition)
98 IPC_STRUCT_TRAITS_END()
99
100 IPC_STRUCT_TRAITS_BEGIN(SelectionColor)
101   IPC_STRUCT_TRAITS_MEMBER(r)
102   IPC_STRUCT_TRAITS_MEMBER(g)
103   IPC_STRUCT_TRAITS_MEMBER(b)
104   IPC_STRUCT_TRAITS_MEMBER(a)
105 IPC_STRUCT_TRAITS_END()
106
107 IPC_ENUM_TRAITS(blink::WebNavigationPolicy)
108 IPC_ENUM_TRAITS(blink::WebNavigationType)
109
110 IPC_STRUCT_TRAITS_BEGIN(NavigationPolicyParams)
111   IPC_STRUCT_TRAITS_MEMBER(render_view_id)
112   IPC_STRUCT_TRAITS_MEMBER(cookie)
113   IPC_STRUCT_TRAITS_MEMBER(url)
114   IPC_STRUCT_TRAITS_MEMBER(httpMethod)
115   IPC_STRUCT_TRAITS_MEMBER(referrer)
116   IPC_STRUCT_TRAITS_MEMBER(policy)
117   IPC_STRUCT_TRAITS_MEMBER(type)
118   IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry)
119   IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
120   IPC_STRUCT_TRAITS_MEMBER(is_redirect)
121 IPC_STRUCT_TRAITS_END()
122 #if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
123 IPC_ENUM_TRAITS(blink::WebViewMode)
124 #endif
125
126 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrl,
127                      int,            // result: request_id
128                      GURL)           // result: url
129
130 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrlResponse,
131                      int,            // result: request_id
132                      GURL)           // result: url
133
134 IPC_MESSAGE_CONTROL1(WrtMsg_SendWrtMessage,
135                      Ewk_Wrt_Message_Data /* data */)
136
137 IPC_SYNC_MESSAGE_ROUTED1_1(EwkHostMsg_WrtSyncMessage,
138                            Ewk_Wrt_Message_Data /* data */,
139                            std::string /*result*/)
140
141 IPC_MESSAGE_ROUTED1(EwkHostMsg_WrtMessage,
142                     Ewk_Wrt_Message_Data /* data */)
143
144 IPC_MESSAGE_CONTROL2(EwkViewHostMsg_HitTestReply,
145                     int, /* render_view_id */
146                     Hit_Test_Params);
147
148 IPC_MESSAGE_CONTROL3(EwkViewHostMsg_HitTestAsyncReply,
149                     int, /* render_view_id */
150                     Hit_Test_Params,
151                     int64_t /* request id */)
152
153 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetCSP,
154                     std::string, /* policy */
155                     Ewk_CSP_Header_Type /* header type */)
156
157 IPC_SYNC_MESSAGE_ROUTED0_2(EwkHostMsg_GetContentSecurityPolicy,
158                            std::string, /* policy */
159                            Ewk_CSP_Header_Type /* header type */)
160
161 IPC_MESSAGE_ROUTED3(EwkViewMsg_Scale,
162                     double, /* scale factor */
163                     int, /* center x */
164                     int /* center y */)
165
166 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidPrintPagesToPdf,
167                     DidPrintPagesParams /* pdf document parameters */)
168
169 IPC_MESSAGE_CONTROL0(EflViewMsg_ClearCache)
170 IPC_MESSAGE_CONTROL1(EflViewMsg_SetCache,
171                      CacheParamsEfl)
172
173 IPC_MESSAGE_ROUTED3(EwkViewMsg_PrintToPdf,
174                     int, /* width */
175                     int, /* height */
176                     base::FilePath /* file name to save pdf*/)
177
178 IPC_MESSAGE_ROUTED1(EwkViewMsg_GetMHTMLData,
179                     int /* callback id */)
180
181 IPC_MESSAGE_ROUTED3(EwkViewMsg_DoHitTest,
182                     int, /* horizontal position */
183                     int, /* vertical position */
184                     Ewk_Hit_Test_Mode /* mode */)
185
186 IPC_MESSAGE_ROUTED4(EwkViewMsg_DoHitTestAsync,
187                     int, /* horizontal position */
188                     int, /* vertical position */
189                     Ewk_Hit_Test_Mode, /* mode */
190                     int64_t /* request id */)
191
192 // Tells the renderer to clear the cache.
193 IPC_MESSAGE_ROUTED0(EwkViewMsg_UseSettingsFont)
194 IPC_MESSAGE_ROUTED0(EwkViewMsg_SetBrowserFont)
195 IPC_MESSAGE_ROUTED0(EwkViewMsg_SuspendScheduledTask)
196 IPC_MESSAGE_ROUTED0(EwkViewMsg_ResumeScheduledTasks)
197
198 IPC_MESSAGE_ROUTED0(EwkViewMsg_GetSelectionStyle)
199
200 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetScroll,
201                     int, /* horizontal position */
202                     int /* vertical position */)
203
204 IPC_MESSAGE_ROUTED1(EwkViewMsg_PlainTextGet,
205                     int /* callback id */)
206
207 IPC_MESSAGE_ROUTED1(EwkViewMsg_SelectionTextStyleState,
208                     SelectionStylePrams /* params */)
209
210 IPC_MESSAGE_ROUTED1(EwkSettingsMsg_UpdateWebKitPreferencesEfl, WebPreferencesEfl)
211
212 IPC_MESSAGE_ROUTED2(EwkHostMsg_HandleTapGestureWithContext,
213                     bool /* is_link */,
214                     bool /* is_editable_content */)
215
216 IPC_MESSAGE_ROUTED2(EwkHostMsg_PlainTextGetContents,
217                     std::string, /* contentText */
218                     int /* callback id */)
219
220 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeContentsSize,
221                     int, /* width */
222                     int /* height */)
223
224 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeMaxScrollOffset,
225                     int, /*max scrollX*/
226                     int  /*max scrollY*/)
227
228 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeScrollOffset,
229                     int, /*scrollX*/
230                     int  /*scrollY*/)
231
232 IPC_MESSAGE_ROUTED2(EwkHostMsg_ReadMHTMLData,
233                     std::string, /* Mhtml text */
234                     int /* callback id */)
235
236 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidChangePageScaleFactor,
237                     double /* page scale factor */)
238
239 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetDrawsTransparentBackground,
240                     bool /* enabled */)
241
242 // Notifies the browser to form submit
243 IPC_MESSAGE_ROUTED1(EwkHostMsg_FormSubmit, GURL)
244
245 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlGet,
246                     int /* callback id */)
247
248 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlGet,
249                     std::string, /* icon url */
250                     int /* callback id */)
251
252 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlsGet,
253                     int /* callback id */)
254
255 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlsGet,
256                     StringMap, /* icon urls */
257                     int /* callback id */)
258
259 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppCapableGet,
260                     int /* calback id */)
261
262 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppCapableGet,
263                     bool, /* capable */
264                     int /* calback id */)
265
266 IPC_SYNC_MESSAGE_CONTROL1_1(EwkHostMsg_DecideNavigationPolicy,
267                             NavigationPolicyParams,
268                             bool /*handled*/)
269
270 // FIXME: error: ‘WebNavigationTypeOther’ is not a member of ‘blink’
271 #if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
272 IPC_MESSAGE_ROUTED1(ViewMsg_SetViewMode,
273                     blink::WebViewMode /* view_mode */)
274 #endif
275
276 IPC_MESSAGE_ROUTED1(ViewMsg_SetTextZoomFactor,
277                     float /*font zoom factor*/)
278
279 IPC_MESSAGE_ROUTED1(EwkFrameMsg_LoadNotFoundErrorPage,
280                     std::string /* error url */)
281
282 IPC_MESSAGE_ROUTED1(EwkFrameMsg_MoveToNextOrPreviousSelectElement,
283                     bool /* next */)
284 IPC_MESSAGE_ROUTED0(EwkFrameMsg_RequestSelectCollectionInformation)
285 IPC_MESSAGE_ROUTED4(EwkHostMsg_RequestSelectCollectionInformationUpdateACK,
286                     int /* formElementCount */,
287                     int /* currentNodeIndex */,
288                     bool /* prevState */,
289                     bool /* nextState */)
290
291 IPC_MESSAGE_ROUTED0(EwkHostMsg_DidNotAllowScript)