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