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