Move away from AsyncHitTest messages to handle tap
[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/print_pages_params.h"
9 #include "common/hit_test_params.h"
10 #include "common/error_params.h"
11 #include "common/cache_params_efl.h"
12 #include "common/navigation_policy_params.h"
13 #include "common/web_view_settings.h"
14 #include "ipc/ipc_message_macros.h"
15 #include "ipc/ipc_channel_handle.h"
16 #include "private/ewk_hit_test_private.h"
17 #include "private/ewk_text_style_private.h"
18 #include "private/ewk_wrt_private.h"
19 #include "public/ewk_hit_test.h"
20 #include "public/ewk_view.h"
21 #include "third_party/WebKit/public/web/WebNavigationPolicy.h"
22 #include "third_party/WebKit/public/web/WebNavigationType.h"
23 #include "third_party/WebKit/public/web/WebViewModeEnums.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(WebViewSettings)
38   IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows)
39   IPC_STRUCT_TRAITS_MEMBER(link_effect_enabled)
40 IPC_STRUCT_TRAITS_END()
41
42 IPC_STRUCT_TRAITS_BEGIN(ErrorParams)
43   IPC_STRUCT_TRAITS_MEMBER(url)
44   IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
45   IPC_STRUCT_TRAITS_MEMBER(code)
46   IPC_STRUCT_TRAITS_MEMBER(description)
47   IPC_STRUCT_TRAITS_MEMBER(domain)
48 IPC_STRUCT_TRAITS_END()
49
50 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Node_Data)
51   IPC_STRUCT_TRAITS_MEMBER(tagName)
52   IPC_STRUCT_TRAITS_MEMBER(nodeValue)
53   IPC_STRUCT_TRAITS_MEMBER(attributes)
54 IPC_STRUCT_TRAITS_END()
55
56 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Image_Data)
57   IPC_STRUCT_TRAITS_MEMBER(fileNameExtension)
58   IPC_STRUCT_TRAITS_MEMBER(imageBitmap)
59 IPC_STRUCT_TRAITS_END()
60
61 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params)
62   IPC_STRUCT_TRAITS_MEMBER(context)
63   IPC_STRUCT_TRAITS_MEMBER(linkURI)
64   IPC_STRUCT_TRAITS_MEMBER(linkTitle)
65   IPC_STRUCT_TRAITS_MEMBER(linkLabel)
66   IPC_STRUCT_TRAITS_MEMBER(imageURI)
67   IPC_STRUCT_TRAITS_MEMBER(mediaURI)
68   IPC_STRUCT_TRAITS_MEMBER(isEditable)
69   IPC_STRUCT_TRAITS_MEMBER(mode)
70   IPC_STRUCT_TRAITS_MEMBER(nodeData)
71   IPC_STRUCT_TRAITS_MEMBER(imageData)
72 IPC_STRUCT_TRAITS_END()
73
74 IPC_ENUM_TRAITS(Ewk_CSP_Header_Type)
75
76 IPC_ENUM_TRAITS(Ewk_Hit_Test_Mode)
77
78 IPC_STRUCT_TRAITS_BEGIN(DidPrintPagesParams)
79   IPC_STRUCT_TRAITS_MEMBER(metafile_data_handle)
80   IPC_STRUCT_TRAITS_MEMBER(data_size)
81   IPC_STRUCT_TRAITS_MEMBER(document_cookie)
82   IPC_STRUCT_TRAITS_MEMBER(filename)
83 IPC_STRUCT_TRAITS_END()
84
85 IPC_STRUCT_TRAITS_BEGIN(CacheParamsEfl)
86   IPC_STRUCT_TRAITS_MEMBER(cache_total_capacity)
87   IPC_STRUCT_TRAITS_MEMBER(cache_min_dead_capacity)
88   IPC_STRUCT_TRAITS_MEMBER(cache_max_dead_capacity)
89 IPC_STRUCT_TRAITS_END()
90
91 IPC_STRUCT_TRAITS_BEGIN(SelectionStylePrams)
92   IPC_STRUCT_TRAITS_MEMBER(underline_state)
93   IPC_STRUCT_TRAITS_MEMBER(italic_state)
94   IPC_STRUCT_TRAITS_MEMBER(bold_state)
95   IPC_STRUCT_TRAITS_MEMBER(bg_color)
96   IPC_STRUCT_TRAITS_MEMBER(color)
97   IPC_STRUCT_TRAITS_MEMBER(font_size)
98   IPC_STRUCT_TRAITS_MEMBER(order_list_state)
99   IPC_STRUCT_TRAITS_MEMBER(un_order_list_state)
100   IPC_STRUCT_TRAITS_MEMBER(text_align_center_state)
101   IPC_STRUCT_TRAITS_MEMBER(text_align_left_state)
102   IPC_STRUCT_TRAITS_MEMBER(text_align_right_state)
103   IPC_STRUCT_TRAITS_MEMBER(text_align_full_state)
104   IPC_STRUCT_TRAITS_MEMBER(has_composition)
105 IPC_STRUCT_TRAITS_END()
106
107 IPC_STRUCT_TRAITS_BEGIN(SelectionColor)
108   IPC_STRUCT_TRAITS_MEMBER(r)
109   IPC_STRUCT_TRAITS_MEMBER(g)
110   IPC_STRUCT_TRAITS_MEMBER(b)
111   IPC_STRUCT_TRAITS_MEMBER(a)
112 IPC_STRUCT_TRAITS_END()
113
114 IPC_ENUM_TRAITS(blink::WebNavigationPolicy)
115 IPC_ENUM_TRAITS(blink::WebNavigationType)
116
117 IPC_STRUCT_TRAITS_BEGIN(NavigationPolicyParams)
118   IPC_STRUCT_TRAITS_MEMBER(render_view_id)
119   IPC_STRUCT_TRAITS_MEMBER(cookie)
120   IPC_STRUCT_TRAITS_MEMBER(url)
121   IPC_STRUCT_TRAITS_MEMBER(httpMethod)
122   IPC_STRUCT_TRAITS_MEMBER(referrer)
123   IPC_STRUCT_TRAITS_MEMBER(policy)
124   IPC_STRUCT_TRAITS_MEMBER(type)
125   IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry)
126   IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
127   IPC_STRUCT_TRAITS_MEMBER(is_redirect)
128 IPC_STRUCT_TRAITS_END()
129
130 IPC_ENUM_TRAITS(blink::WebViewMode)
131
132
133 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrl,
134                      int,            // result: request_id
135                      GURL)           // result: url
136
137 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrlResponse,
138                      int,            // result: request_id
139                      GURL)           // result: url
140
141 IPC_MESSAGE_CONTROL1(WrtMsg_SendWrtMessage,
142                      Ewk_Wrt_Message_Data /* data */);
143
144 IPC_SYNC_MESSAGE_ROUTED1_1(EwkHostMsg_WrtSyncMessage,
145                            Ewk_Wrt_Message_Data /* data */,
146                            std::string /*result*/);
147
148 IPC_MESSAGE_ROUTED1(EwkHostMsg_WrtMessage,
149                     Ewk_Wrt_Message_Data /* data */);
150
151 IPC_MESSAGE_CONTROL2(EwkViewHostMsg_HitTestReply,
152                     int, /* render_view_id */
153                     Hit_Test_Params);
154
155 IPC_MESSAGE_CONTROL3(EwkViewHostMsg_HitTestAsyncReply,
156                     int, /* render_view_id */
157                     Hit_Test_Params,
158                     int64_t /* request id */)
159
160 IPC_MESSAGE_ROUTED1(EwkViewMsg_DidFailLoadWithError,
161                     ErrorParams /* error */)
162
163 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetCSP,
164                     std::string, /* policy */
165                     Ewk_CSP_Header_Type /* header type */)
166
167 IPC_SYNC_MESSAGE_ROUTED0_2(EwkHostMsg_GetContentSecurityPolicy,
168                            std::string, /* policy */
169                            Ewk_CSP_Header_Type /* header type */)
170
171 IPC_MESSAGE_ROUTED3(EwkViewMsg_Scale,
172                     double, /* scale factor */
173                     int, /* center x */
174                     int /* center y */)
175
176 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidPrintPagesToPdf,
177                     DidPrintPagesParams /* pdf document parameters */)
178
179 IPC_MESSAGE_CONTROL0(EflViewMsg_ClearCache)
180 IPC_MESSAGE_CONTROL1(EflViewMsg_SetCache,
181                      CacheParamsEfl)
182
183 // Tells the renderer to dump as much memory as it can, perhaps because we
184 // have memory pressure or the renderer is (or will be) paged out.  This
185 // should only result in purging objects we can recalculate, e.g. caches or
186 // JS garbage, not in purging irreplaceable objects.
187 IPC_MESSAGE_CONTROL0(EwkViewMsg_PurgeMemory)
188
189 IPC_MESSAGE_ROUTED3(EwkViewMsg_PrintToPdf,
190                     int, /* width */
191                     int, /* height */
192                     base::FilePath /* file name to save pdf*/)
193
194 IPC_MESSAGE_ROUTED1(EwkViewMsg_GetMHTMLData,
195                     int /* callback id */)
196
197 IPC_MESSAGE_ROUTED3(EwkViewMsg_DoHitTest,
198                     int, /* horizontal position */
199                     int, /* vertical position */
200                     Ewk_Hit_Test_Mode /* mode */)
201
202 IPC_MESSAGE_ROUTED4(EwkViewMsg_DoHitTestAsync,
203                     int, /* horizontal position */
204                     int, /* vertical position */
205                     Ewk_Hit_Test_Mode, /* mode */
206                     int64_t /* request id */)
207
208 // Tells the renderer to clear the cache.
209 IPC_MESSAGE_ROUTED0(EwkViewMsg_UseSettingsFont)
210 IPC_MESSAGE_ROUTED0(EwkViewMsg_SetBrowserFont)
211 IPC_MESSAGE_ROUTED0(EwkViewMsg_SuspendScheduledTask)
212 IPC_MESSAGE_ROUTED0(EwkViewMsg_ResumeScheduledTasks)
213
214 IPC_MESSAGE_ROUTED0(EwkViewMsg_GetSelectionStyle)
215
216 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetScroll,
217                     int, /* horizontal position */
218                     int /* vertical position */)
219
220 IPC_MESSAGE_ROUTED1(EwkViewMsg_PlainTextGet,
221                     int /* callback id */)
222
223 IPC_MESSAGE_ROUTED1(EwkViewMsg_SelectionTextStyleState,
224                     SelectionStylePrams /* params */)
225
226 IPC_MESSAGE_ROUTED1(EflViewMsg_UpdateSettings, WebViewSettings)
227
228 IPC_MESSAGE_ROUTED2(EwkHostMsg_HandleTapGestureWithContext,
229                     bool /* is_link */,
230                     bool /* is_editable_content */)
231
232 IPC_MESSAGE_ROUTED2(EwkHostMsg_PlainTextGetContents,
233                     std::string, /* contentText */
234                     int /* callback id */)
235
236 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeContentsSize,
237                     int, /* width */
238                     int /* height */)
239
240 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeMaxScrollOffset,
241                     int, /*max scrollX*/
242                     int  /*max scrollY*/)
243
244 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeScrollOffset,
245                     int, /*scrollX*/
246                     int  /*scrollY*/)
247
248 IPC_MESSAGE_ROUTED2(EwkHostMsg_ReadMHTMLData,
249                     std::string, /* Mhtml text */
250                     int /* callback id */)
251
252 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidChangePageScaleFactor,
253                     double /* page scale factor */)
254
255 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangePageScaleRange,
256                     double, /* minimum page scale factor */
257                     double  /* maximum page scale factor */)
258
259 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetDrawsTransparentBackground,
260                     bool /* enabled */)
261
262 // Notifies the browser to form submit
263 IPC_MESSAGE_ROUTED1(EwkHostMsg_FormSubmit, GURL)
264
265 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlGet,
266                     int /* callback id */)
267
268 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlGet,
269                     std::string, /* icon url */
270                     int /* callback id */)
271
272 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlsGet,
273                     int /* callback id */)
274
275 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlsGet,
276                     StringMap, /* icon urls */
277                     int /* callback id */)
278
279 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppCapableGet,
280                     int /* calback id */)
281
282 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppCapableGet,
283                     bool, /* capable */
284                     int /* calback id */)
285
286 IPC_SYNC_MESSAGE_CONTROL1_1(EwkHostMsg_DecideNavigationPolicy,
287                             NavigationPolicyParams,
288                             bool /*handled*/)
289
290 IPC_MESSAGE_ROUTED1(ViewMsg_SetViewMode,
291                     blink::WebViewMode /* view_mode */)
292
293 IPC_MESSAGE_ROUTED1(EwkFrameMsg_LoadNotFoundErrorPage,
294                     std::string /* error url */)
295
296 IPC_MESSAGE_ROUTED1(EwkFrameMsg_MoveToNextOrPreviousSelectElement,
297                     bool /* next */)
298 IPC_MESSAGE_ROUTED0(EwkFrameMsg_RequestSelectCollectionInformation);
299 IPC_MESSAGE_ROUTED4(EwkHostMsg_RequestSelectCollectionInformationUpdateACK,
300                     int /* formElementCount */,
301                     int /* currentNodeIndex */,
302                     bool /* prevState */,
303                     bool /* nextState */)