Bringup ewk_view_not_found_error_page_load
[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 "ipc/ipc_message_macros.h"
14 #include "ipc/ipc_channel_handle.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.h"
19 #include "public/ewk_view.h"
20 #include "tizen_webview/public/tw_settings.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(tizen_webview::Settings)
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_CONTROL4(WrtMsg_SetWidgetInfo,
134                      int,            // result: widgetHandle
135                      double,         // result: scale
136                      std::string,    // result: theme
137                      std::string)    // result: encodedBundle
138
139 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrl,
140                      int,            // result: request_id
141                      GURL)           // result: url
142
143 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrlResponse,
144                      int,            // result: request_id
145                      GURL)           // result: url
146
147 IPC_MESSAGE_CONTROL1(WrtMsg_SendWrtMessage,
148                      Ewk_Wrt_Message_Data /* data */);
149
150 IPC_SYNC_MESSAGE_ROUTED1_1(EwkHostMsg_WrtSyncMessage,
151                            Ewk_Wrt_Message_Data /* data */,
152                            std::string /*result*/);
153
154 IPC_MESSAGE_ROUTED1(EwkHostMsg_WrtMessage,
155                     Ewk_Wrt_Message_Data /* data */);
156
157 IPC_MESSAGE_CONTROL2(EwkViewHostMsg_HitTestReply,
158                     int, /* render_view_id */
159                     Hit_Test_Params);
160
161 IPC_MESSAGE_CONTROL3(EwkViewHostMsg_HitTestAsyncReply,
162                     int, /* render_view_id */
163                     Hit_Test_Params,
164                     int64_t /* request id */)
165
166 IPC_MESSAGE_ROUTED1(EwkViewMsg_DidFailLoadWithError,
167                     ErrorParams /* error */)
168
169 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetCSP,
170                     std::string, /* policy */
171                     Ewk_CSP_Header_Type /* header type */)
172
173 IPC_SYNC_MESSAGE_ROUTED0_2(EwkHostMsg_GetContentSecurityPolicy,
174                            std::string, /* policy */
175                            Ewk_CSP_Header_Type /* header type */)
176
177 IPC_MESSAGE_ROUTED3(EwkViewMsg_Scale,
178                     double, /* scale factor */
179                     int, /* center x */
180                     int /* center y */)
181
182 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidPrintPagesToPdf,
183                     DidPrintPagesParams /* pdf document parameters */)
184
185 IPC_MESSAGE_CONTROL0(EflViewMsg_ClearCache)
186 IPC_MESSAGE_CONTROL1(EflViewMsg_SetCache,
187                      CacheParamsEfl)
188
189 // Tells the renderer to dump as much memory as it can, perhaps because we
190 // have memory pressure or the renderer is (or will be) paged out.  This
191 // should only result in purging objects we can recalculate, e.g. caches or
192 // JS garbage, not in purging irreplaceable objects.
193 IPC_MESSAGE_CONTROL0(EwkViewMsg_PurgeMemory)
194
195 IPC_MESSAGE_ROUTED3(EwkViewMsg_PrintToPdf,
196                     int, /* width */
197                     int, /* height */
198                     base::FilePath /* file name to save pdf*/)
199
200 IPC_MESSAGE_ROUTED1(EwkViewMsg_GetMHTMLData,
201                     int /* callback id */)
202
203 IPC_MESSAGE_ROUTED3(EwkViewMsg_DoHitTest,
204                     int, /* horizontal position */
205                     int, /* vertical position */
206                     Ewk_Hit_Test_Mode /* mode */)
207
208 IPC_MESSAGE_ROUTED4(EwkViewMsg_DoHitTestAsync,
209                     int, /* horizontal position */
210                     int, /* vertical position */
211                     Ewk_Hit_Test_Mode, /* mode */
212                     int64_t /* request id */)
213
214 // Tells the renderer to clear the cache.
215 IPC_MESSAGE_ROUTED0(EwkViewMsg_UseSettingsFont)
216 IPC_MESSAGE_ROUTED0(EwkViewMsg_SetBrowserFont)
217 IPC_MESSAGE_ROUTED0(EwkViewMsg_SuspendScheduledTask)
218 IPC_MESSAGE_ROUTED0(EwkViewMsg_ResumeScheduledTasks)
219
220 IPC_MESSAGE_ROUTED0(EwkViewMsg_GetSelectionStyle)
221
222 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetScroll,
223                     int, /* horizontal position */
224                     int /* vertical position */)
225
226 IPC_MESSAGE_ROUTED1(EwkViewMsg_PlainTextGet,
227                     int /* callback id */)
228
229 IPC_MESSAGE_ROUTED1(EwkViewMsg_SelectionTextStyleState,
230                     SelectionStylePrams /* params */)
231
232 IPC_MESSAGE_ROUTED1(EflViewMsg_UpdateSettings, tizen_webview::Settings)
233
234 IPC_MESSAGE_ROUTED0(EwkHostMsg_PlayLinkEffect)
235
236 IPC_MESSAGE_ROUTED2(EwkHostMsg_PlainTextGetContents,
237                     std::string, /* contentText */
238                     int /* callback id */)
239
240 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeContentsSize,
241                     int, /* width */
242                     int /* height */)
243
244 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeMaxScrollOffset,
245                     int, /*max scrollX*/
246                     int  /*max scrollY*/)
247
248 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeScrollOffset,
249                     int, /*scrollX*/
250                     int  /*scrollY*/)
251
252 IPC_MESSAGE_ROUTED2(EwkHostMsg_ReadMHTMLData,
253                     std::string, /* Mhtml text */
254                     int /* callback id */)
255
256 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidChangePageScaleFactor,
257                     double /* page scale factor */)
258
259 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangePageScaleRange,
260                     double, /* minimum page scale factor */
261                     double  /* maximum page scale factor */)
262
263 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetDrawsTransparentBackground,
264                     bool /* enabled */)
265
266 // Notifies the browser to form submit
267 IPC_MESSAGE_ROUTED1(EwkHostMsg_FormSubmit, GURL)
268
269 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlGet,
270                     int /* callback id */)
271
272 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlGet,
273                     std::string, /* icon url */
274                     int /* callback id */)
275
276 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlsGet,
277                     int /* callback id */)
278
279 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlsGet,
280                     StringMap, /* icon urls */
281                     int /* callback id */)
282
283 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppCapableGet,
284                     int /* calback id */)
285
286 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppCapableGet,
287                     bool, /* capable */
288                     int /* calback id */)
289
290 IPC_SYNC_MESSAGE_CONTROL1_1(EwkHostMsg_DecideNavigationPolicy,
291                             NavigationPolicyParams,
292                             bool /*handled*/)
293
294 IPC_MESSAGE_ROUTED1(ViewMsg_SetViewMode,
295                     blink::WebViewMode /* view_mode */)
296
297 IPC_MESSAGE_ROUTED1(EwkFrameMsg_LoadNotFoundErrorPage,
298                     std::string /* error url */)