[M67 Dev][EFL] Format chromium-efl according to Chromium style
[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.h"
19 #include "public/ewk_view.h"
20 #include "third_party/blink/public/web/web_navigation_policy.h"
21 #include "third_party/blink/public/web/web_navigation_type.h"
22 //#include "third_party/blink/public/web/WebViewModeEnums.h"
23 #include "ipc_message_start_ewk.h"
24
25 typedef std::map<std::string, std::string> StringMap;
26
27 #define IPC_MESSAGE_START EwkMsgStart
28
29 IPC_STRUCT_TRAITS_BEGIN(Ewk_Wrt_Message_Data)
30   IPC_STRUCT_TRAITS_MEMBER(type)
31   IPC_STRUCT_TRAITS_MEMBER(value)
32   IPC_STRUCT_TRAITS_MEMBER(id)
33   IPC_STRUCT_TRAITS_MEMBER(reference_id)
34 IPC_STRUCT_TRAITS_END()
35
36 IPC_STRUCT_TRAITS_BEGIN(WebPreferencesEfl)
37   IPC_STRUCT_TRAITS_MEMBER(shrinks_viewport_content_to_fit)
38   IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows_automatically_ewk)
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_STRUCT_TRAITS_BEGIN(CacheParamsEfl)
76   IPC_STRUCT_TRAITS_MEMBER(cache_total_capacity)
77   IPC_STRUCT_TRAITS_MEMBER(cache_min_dead_capacity)
78   IPC_STRUCT_TRAITS_MEMBER(cache_max_dead_capacity)
79 IPC_STRUCT_TRAITS_END()
80
81 IPC_STRUCT_TRAITS_BEGIN(SelectionStylePrams)
82   IPC_STRUCT_TRAITS_MEMBER(underline_state)
83   IPC_STRUCT_TRAITS_MEMBER(italic_state)
84   IPC_STRUCT_TRAITS_MEMBER(bold_state)
85   IPC_STRUCT_TRAITS_MEMBER(bg_color)
86   IPC_STRUCT_TRAITS_MEMBER(color)
87   IPC_STRUCT_TRAITS_MEMBER(font_size)
88   IPC_STRUCT_TRAITS_MEMBER(order_list_state)
89   IPC_STRUCT_TRAITS_MEMBER(un_order_list_state)
90   IPC_STRUCT_TRAITS_MEMBER(text_align_center_state)
91   IPC_STRUCT_TRAITS_MEMBER(text_align_left_state)
92   IPC_STRUCT_TRAITS_MEMBER(text_align_right_state)
93   IPC_STRUCT_TRAITS_MEMBER(text_align_full_state)
94   IPC_STRUCT_TRAITS_MEMBER(has_composition)
95 IPC_STRUCT_TRAITS_END()
96
97 IPC_STRUCT_TRAITS_BEGIN(SelectionColor)
98   IPC_STRUCT_TRAITS_MEMBER(r)
99   IPC_STRUCT_TRAITS_MEMBER(g)
100   IPC_STRUCT_TRAITS_MEMBER(b)
101   IPC_STRUCT_TRAITS_MEMBER(a)
102 IPC_STRUCT_TRAITS_END()
103
104 IPC_ENUM_TRAITS(blink::WebNavigationPolicy)
105 IPC_ENUM_TRAITS(blink::WebNavigationType)
106
107 IPC_STRUCT_TRAITS_BEGIN(NavigationPolicyParams)
108   IPC_STRUCT_TRAITS_MEMBER(render_view_id)
109   IPC_STRUCT_TRAITS_MEMBER(cookie)
110   IPC_STRUCT_TRAITS_MEMBER(url)
111   IPC_STRUCT_TRAITS_MEMBER(httpMethod)
112   IPC_STRUCT_TRAITS_MEMBER(referrer)
113   IPC_STRUCT_TRAITS_MEMBER(policy)
114   IPC_STRUCT_TRAITS_MEMBER(type)
115   IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry)
116   IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
117   IPC_STRUCT_TRAITS_MEMBER(is_redirect)
118 IPC_STRUCT_TRAITS_END()
119 #if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
120 IPC_ENUM_TRAITS(blink::WebViewMode)
121 #endif
122
123 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrl,
124                      int,            // result: request_id
125                      GURL)           // result: url
126
127 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrlResponse,
128                      int,            // result: request_id
129                      GURL)           // result: url
130
131 IPC_MESSAGE_CONTROL1(WrtMsg_SendWrtMessage,
132                      Ewk_Wrt_Message_Data /* data */);
133
134 IPC_SYNC_MESSAGE_ROUTED1_1(EwkHostMsg_WrtSyncMessage,
135                            Ewk_Wrt_Message_Data /* data */,
136                            std::string /*result*/);
137
138 IPC_MESSAGE_ROUTED1(EwkHostMsg_WrtMessage,
139                     Ewk_Wrt_Message_Data /* data */);
140
141 IPC_MESSAGE_CONTROL2(EwkViewHostMsg_HitTestReply,
142                     int, /* render_view_id */
143                     Hit_Test_Params);
144
145 IPC_MESSAGE_CONTROL3(EwkViewHostMsg_HitTestAsyncReply,
146                     int, /* render_view_id */
147                     Hit_Test_Params,
148                     int64_t /* request id */)
149
150 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetCSP,
151                     std::string, /* policy */
152                     Ewk_CSP_Header_Type /* header type */)
153
154 IPC_SYNC_MESSAGE_ROUTED0_2(EwkHostMsg_GetContentSecurityPolicy,
155                            std::string, /* policy */
156                            Ewk_CSP_Header_Type /* header type */)
157
158 IPC_MESSAGE_ROUTED3(EwkViewMsg_Scale,
159                     double, /* scale factor */
160                     int, /* center x */
161                     int /* center y */)
162
163 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidPrintPagesToPdf,
164                     DidPrintPagesParams /* pdf document parameters */)
165
166 IPC_MESSAGE_CONTROL0(EflViewMsg_ClearCache)
167 IPC_MESSAGE_CONTROL1(EflViewMsg_SetCache,
168                      CacheParamsEfl)
169
170 IPC_MESSAGE_ROUTED3(EwkViewMsg_PrintToPdf,
171                     int, /* width */
172                     int, /* height */
173                     base::FilePath /* file name to save pdf*/)
174
175 IPC_MESSAGE_ROUTED1(EwkViewMsg_GetMHTMLData,
176                     int /* callback id */)
177
178 IPC_MESSAGE_ROUTED3(EwkViewMsg_DoHitTest,
179                     int, /* horizontal position */
180                     int, /* vertical position */
181                     Ewk_Hit_Test_Mode /* mode */)
182
183 IPC_MESSAGE_ROUTED4(EwkViewMsg_DoHitTestAsync,
184                     int, /* horizontal position */
185                     int, /* vertical position */
186                     Ewk_Hit_Test_Mode, /* mode */
187                     int64_t /* request id */)
188
189 // Tells the renderer to clear the cache.
190 IPC_MESSAGE_ROUTED0(EwkViewMsg_UseSettingsFont)
191 IPC_MESSAGE_ROUTED0(EwkViewMsg_SetBrowserFont)
192 IPC_MESSAGE_ROUTED0(EwkViewMsg_SuspendScheduledTask)
193 IPC_MESSAGE_ROUTED0(EwkViewMsg_ResumeScheduledTasks)
194
195 IPC_MESSAGE_ROUTED0(EwkViewMsg_GetSelectionStyle)
196
197 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetScroll,
198                     int, /* horizontal position */
199                     int /* vertical position */)
200
201 IPC_MESSAGE_ROUTED1(EwkViewMsg_PlainTextGet,
202                     int /* callback id */)
203
204 IPC_MESSAGE_ROUTED1(EwkViewMsg_SelectionTextStyleState,
205                     SelectionStylePrams /* params */)
206
207 IPC_MESSAGE_ROUTED1(EwkSettingsMsg_UpdateWebKitPreferencesEfl, WebPreferencesEfl)
208
209 IPC_MESSAGE_ROUTED2(EwkHostMsg_HandleTapGestureWithContext,
210                     bool /* is_link */,
211                     bool /* is_editable_content */)
212
213 IPC_MESSAGE_ROUTED2(EwkHostMsg_PlainTextGetContents,
214                     std::string, /* contentText */
215                     int /* callback id */)
216
217 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeContentsSize,
218                     int, /* width */
219                     int /* height */)
220
221 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeMaxScrollOffset,
222                     int, /*max scrollX*/
223                     int  /*max scrollY*/)
224
225 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeScrollOffset,
226                     int, /*scrollX*/
227                     int  /*scrollY*/)
228
229 IPC_MESSAGE_ROUTED2(EwkHostMsg_ReadMHTMLData,
230                     std::string, /* Mhtml text */
231                     int /* callback id */)
232
233 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidChangePageScaleFactor,
234                     double /* page scale factor */)
235
236 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetDrawsTransparentBackground,
237                     bool /* enabled */)
238
239 // Notifies the browser to form submit
240 IPC_MESSAGE_ROUTED1(EwkHostMsg_FormSubmit, GURL)
241
242 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlGet,
243                     int /* callback id */)
244
245 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlGet,
246                     std::string, /* icon url */
247                     int /* callback id */)
248
249 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlsGet,
250                     int /* callback id */)
251
252 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlsGet,
253                     StringMap, /* icon urls */
254                     int /* callback id */)
255
256 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppCapableGet,
257                     int /* calback id */)
258
259 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppCapableGet,
260                     bool, /* capable */
261                     int /* calback id */)
262
263 IPC_SYNC_MESSAGE_CONTROL1_1(EwkHostMsg_DecideNavigationPolicy,
264                             NavigationPolicyParams,
265                             bool /*handled*/)
266
267 // FIXME: error: ‘WebNavigationTypeOther’ is not a member of ‘blink’
268 #if !defined(EWK_BRINGUP)  // FIXME: m67 bringup
269 IPC_MESSAGE_ROUTED1(ViewMsg_SetViewMode,
270                     blink::WebViewMode /* view_mode */)
271 #endif
272
273 IPC_MESSAGE_ROUTED1(ViewMsg_SetTextZoomFactor,
274                     float /*font zoom factor*/)
275
276 IPC_MESSAGE_ROUTED1(EwkFrameMsg_LoadNotFoundErrorPage,
277                     std::string /* error url */)
278
279 IPC_MESSAGE_ROUTED1(EwkFrameMsg_MoveToNextOrPreviousSelectElement,
280                     bool /* next */)
281 IPC_MESSAGE_ROUTED0(EwkFrameMsg_RequestSelectCollectionInformation);
282 IPC_MESSAGE_ROUTED4(EwkHostMsg_RequestSelectCollectionInformationUpdateACK,
283                     int /* formElementCount */,
284                     int /* currentNodeIndex */,
285                     bool /* prevState */,
286                     bool /* nextState */)