eed7bb1ff91c7324aed0012b7aaab42259e95d07
[WebKit-https.git] / Source / WebKit2 / UIProcess / API / C / WKPageUIClient.h
1 /*
2  * Copyright (C) 2013 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #ifndef WKPageUIClient_h
27 #define WKPageUIClient_h
28
29 #include <WebKit/WKBase.h>
30 #include <WebKit/WKEvent.h>
31 #include <WebKit/WKGeometry.h>
32 #include <WebKit/WKNativeEvent.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 enum {
39     kWKFocusDirectionBackward = 0,
40     kWKFocusDirectionForward = 1
41 };
42 typedef uint32_t WKFocusDirection;
43
44 enum {
45     kWKPluginUnavailabilityReasonPluginMissing,
46     kWKPluginUnavailabilityReasonPluginCrashed,
47     kWKPluginUnavailabilityReasonInsecurePluginVersion
48 };
49 typedef uint32_t WKPluginUnavailabilityReason;
50
51 typedef void (*WKPageUIClientCallback)(WKPageRef page, const void* clientInfo);
52 typedef WKPageRef (*WKPageCreateNewPageCallback)(WKPageRef page, WKPageConfigurationRef configuration, WKNavigationActionRef navigationAction, WKWindowFeaturesRef windowFeatures, const void *clientInfo);
53 typedef void (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo);
54 typedef bool (*WKPageRunJavaScriptConfirmCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo);
55 typedef WKStringRef (*WKPageRunJavaScriptPromptCallback)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo);
56 typedef void (*WKPageTakeFocusCallback)(WKPageRef page, WKFocusDirection direction, const void *clientInfo);
57 typedef void (*WKPageFocusCallback)(WKPageRef page, const void *clientInfo);
58 typedef void (*WKPageUnfocusCallback)(WKPageRef page, const void *clientInfo);
59 typedef void (*WKPageSetStatusTextCallback)(WKPageRef page, WKStringRef text, const void *clientInfo);
60 typedef void (*WKPageMouseDidMoveOverElementCallback)(WKPageRef page, WKHitTestResultRef hitTestResult, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo);
61 typedef void (*WKPageDidNotHandleKeyEventCallback)(WKPageRef page, WKNativeEventPtr event, const void *clientInfo);
62 typedef void (*WKPageDidNotHandleWheelEventCallback)(WKPageRef page, WKNativeEventPtr event, const void *clientInfo);
63 typedef bool (*WKPageGetToolbarsAreVisibleCallback)(WKPageRef page, const void *clientInfo);
64 typedef void (*WKPageSetToolbarsAreVisibleCallback)(WKPageRef page, bool toolbarsVisible, const void *clientInfo);
65 typedef bool (*WKPageGetMenuBarIsVisibleCallback)(WKPageRef page, const void *clientInfo);
66 typedef void (*WKPageSetMenuBarIsVisibleCallback)(WKPageRef page, bool menuBarVisible, const void *clientInfo);
67 typedef bool (*WKPageGetStatusBarIsVisibleCallback)(WKPageRef page, const void *clientInfo);
68 typedef void (*WKPageSetStatusBarIsVisibleCallback)(WKPageRef page, bool statusBarVisible, const void *clientInfo);
69 typedef bool (*WKPageGetIsResizableCallback)(WKPageRef page, const void *clientInfo);
70 typedef void (*WKPageSetIsResizableCallback)(WKPageRef page, bool resizable, const void *clientInfo);
71 typedef WKRect (*WKPageGetWindowFrameCallback)(WKPageRef page, const void *clientInfo);
72 typedef void (*WKPageSetWindowFrameCallback)(WKPageRef page, WKRect frame, const void *clientInfo);
73 typedef bool (*WKPageRunBeforeUnloadConfirmPanelCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
74 typedef unsigned long long (*WKPageExceededDatabaseQuotaCallback)(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef origin, WKStringRef databaseName, WKStringRef displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage, const void *clientInfo);
75 typedef void (*WKPageRunOpenPanelCallback)(WKPageRef page, WKFrameRef frame, WKOpenPanelParametersRef parameters, WKOpenPanelResultListenerRef listener, const void *clientInfo);
76 typedef void (*WKPageDecidePolicyForGeolocationPermissionRequestCallback)(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef origin, WKGeolocationPermissionRequestRef permissionRequest, const void* clientInfo);
77 typedef float (*WKPageHeaderHeightCallback)(WKPageRef page, WKFrameRef frame, const void* clientInfo);
78 typedef float (*WKPageFooterHeightCallback)(WKPageRef page, WKFrameRef frame, const void* clientInfo);
79 typedef void (*WKPageDrawHeaderCallback)(WKPageRef page, WKFrameRef frame, WKRect rect, const void* clientInfo);
80 typedef void (*WKPageDrawFooterCallback)(WKPageRef page, WKFrameRef frame, WKRect rect, const void* clientInfo);
81 typedef void (*WKPagePrintFrameCallback)(WKPageRef page, WKFrameRef frame, const void* clientInfo);
82 typedef void (*WKPageSaveDataToFileInDownloadsFolderCallback)(WKPageRef page, WKStringRef suggestedFilename, WKStringRef mimeType, WKURLRef originatingURL, WKDataRef data, const void* clientInfo);
83 typedef void (*WKPageDecidePolicyForNotificationPermissionRequestCallback)(WKPageRef page, WKSecurityOriginRef origin, WKNotificationPermissionRequestRef permissionRequest, const void *clientInfo);
84 typedef void (*WKPageShowColorPickerCallback)(WKPageRef page, WKStringRef initialColor, WKColorPickerResultListenerRef listener, const void* clientInfo);
85 typedef void (*WKPageHideColorPickerCallback)(WKPageRef page, const void* clientInfo);
86 typedef void (*WKPageUnavailablePluginButtonClickedCallback)(WKPageRef page, WKPluginUnavailabilityReason pluginUnavailabilityReason, WKDictionaryRef pluginInfoDictionary, const void* clientInfo);
87 typedef void (*WKPagePinnedStateDidChangeCallback)(WKPageRef page, const void* clientInfo);
88 typedef void (*WKPageDidBeginTrackingPotentialLongMousePressCallback)(WKPageRef page, WKPoint mouseDownPosition, WKHitTestResultRef hitTestResult, WKTypeRef userData, const void *clientInfo);
89 typedef void (*WKPageDidRecognizeLongMousePressCallback)(WKPageRef page, WKTypeRef userData, const void *clientInfo);
90 typedef void (*WKPageDidCancelTrackingPotentialLongMousePressCallback)(WKPageRef page, WKTypeRef userData, const void *clientInfo);
91 typedef void (*WKPageIsPlayingAudioDidChangeCallback)(WKPageRef page, const void* clientInfo);
92 typedef void (*WKPageDecidePolicyForUserMediaPermissionRequestCallback)(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef origin, WKUserMediaPermissionRequestRef permissionRequest, const void* clientInfo);
93 typedef void (*WKPageDidClickAutoFillButtonCallback)(WKPageRef page, WKTypeRef userData, const void *clientInfo);
94 typedef void (*WKPageMediaSessionMetadataDidChangeCallback)(WKPageRef page, WKMediaSessionMetadataRef metadata, const void* clientInfo);
95
96 // Deprecated
97 typedef WKPageRef (*WKPageCreateNewPageCallback_deprecatedForUseWithV0)(WKPageRef page, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo);
98 typedef void      (*WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0)(WKPageRef page, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo);
99 typedef void (*WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
100 typedef void (*WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1)(WKPageRef page, WKPluginUnavailabilityReason pluginUnavailabilityReason, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
101 typedef void (*WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void *clientInfo);
102 typedef bool (*WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
103 typedef WKStringRef (*WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void *clientInfo);
104 typedef WKPageRef (*WKPageCreateNewPageCallback_deprecatedForUseWithV1)(WKPageRef page, WKURLRequestRef urlRequest, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo);
105
106 typedef struct WKPageUIClientBase {
107     int                                                                 version;
108     const void *                                                        clientInfo;
109 } WKPageUIClientBase;
110
111 typedef struct WKPageUIClientV0 {
112     WKPageUIClientBase                                                  base;
113
114     // Version 0.
115     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
116     WKPageUIClientCallback                                              showPage;
117     WKPageUIClientCallback                                              close;
118     WKPageTakeFocusCallback                                             takeFocus;
119     WKPageFocusCallback                                                 focus;
120     WKPageUnfocusCallback                                               unfocus;
121     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert;
122     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm;
123     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt;
124     WKPageSetStatusTextCallback                                         setStatusText;
125     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
126     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
127     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
128     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
129     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
130     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
131     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
132     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
133     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
134     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
135     WKPageGetIsResizableCallback                                        isResizable;
136     WKPageSetIsResizableCallback                                        setIsResizable;
137     WKPageGetWindowFrameCallback                                        getWindowFrame;
138     WKPageSetWindowFrameCallback                                        setWindowFrame;
139     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
140     WKPageUIClientCallback                                              didDraw;
141     WKPageUIClientCallback                                              pageDidScroll;
142     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
143     WKPageRunOpenPanelCallback                                          runOpenPanel;
144     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
145     WKPageHeaderHeightCallback                                          headerHeight;
146     WKPageFooterHeightCallback                                          footerHeight;
147     WKPageDrawHeaderCallback                                            drawHeader;
148     WKPageDrawFooterCallback                                            drawFooter;
149     WKPagePrintFrameCallback                                            printFrame;
150     WKPageUIClientCallback                                              runModal;
151     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
152     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
153     void*                                                               shouldInterruptJavaScript_unavailable;
154 } WKPageUIClientV0;
155
156 typedef struct WKPageUIClientV1 {
157     WKPageUIClientBase                                                  base;
158
159     // Version 0.
160     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
161     WKPageUIClientCallback                                              showPage;
162     WKPageUIClientCallback                                              close;
163     WKPageTakeFocusCallback                                             takeFocus;
164     WKPageFocusCallback                                                 focus;
165     WKPageUnfocusCallback                                               unfocus;
166     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert;
167     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm;
168     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt;
169     WKPageSetStatusTextCallback                                         setStatusText;
170     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
171     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
172     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
173     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
174     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
175     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
176     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
177     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
178     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
179     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
180     WKPageGetIsResizableCallback                                        isResizable;
181     WKPageSetIsResizableCallback                                        setIsResizable;
182     WKPageGetWindowFrameCallback                                        getWindowFrame;
183     WKPageSetWindowFrameCallback                                        setWindowFrame;
184     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
185     WKPageUIClientCallback                                              didDraw;
186     WKPageUIClientCallback                                              pageDidScroll;
187     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
188     WKPageRunOpenPanelCallback                                          runOpenPanel;
189     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
190     WKPageHeaderHeightCallback                                          headerHeight;
191     WKPageFooterHeightCallback                                          footerHeight;
192     WKPageDrawHeaderCallback                                            drawHeader;
193     WKPageDrawFooterCallback                                            drawFooter;
194     WKPagePrintFrameCallback                                            printFrame;
195     WKPageUIClientCallback                                              runModal;
196     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
197     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
198     void*                                                               shouldInterruptJavaScript_unavailable;
199
200     // Version 1.
201     WKPageCreateNewPageCallback_deprecatedForUseWithV1                  createNewPage;
202     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
203     WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
204     WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
205 } WKPageUIClientV1;
206
207 typedef struct WKPageUIClientV2 {
208     WKPageUIClientBase                                                  base;
209
210     // Version 0.
211     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
212     WKPageUIClientCallback                                              showPage;
213     WKPageUIClientCallback                                              close;
214     WKPageTakeFocusCallback                                             takeFocus;
215     WKPageFocusCallback                                                 focus;
216     WKPageUnfocusCallback                                               unfocus;
217     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert;
218     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm;
219     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt;
220     WKPageSetStatusTextCallback                                         setStatusText;
221     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
222     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
223     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
224     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
225     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
226     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
227     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
228     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
229     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
230     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
231     WKPageGetIsResizableCallback                                        isResizable;
232     WKPageSetIsResizableCallback                                        setIsResizable;
233     WKPageGetWindowFrameCallback                                        getWindowFrame;
234     WKPageSetWindowFrameCallback                                        setWindowFrame;
235     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
236     WKPageUIClientCallback                                              didDraw;
237     WKPageUIClientCallback                                              pageDidScroll;
238     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
239     WKPageRunOpenPanelCallback                                          runOpenPanel;
240     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
241     WKPageHeaderHeightCallback                                          headerHeight;
242     WKPageFooterHeightCallback                                          footerHeight;
243     WKPageDrawHeaderCallback                                            drawHeader;
244     WKPageDrawFooterCallback                                            drawFooter;
245     WKPagePrintFrameCallback                                            printFrame;
246     WKPageUIClientCallback                                              runModal;
247     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
248     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
249     void*                                                               shouldInterruptJavaScript_unavailable;
250
251     // Version 1.
252     WKPageCreateNewPageCallback_deprecatedForUseWithV1                  createNewPage;
253     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
254     WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
255     WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
256
257     // Version 2.
258     WKPageShowColorPickerCallback                                       showColorPicker;
259     WKPageHideColorPickerCallback                                       hideColorPicker;
260     WKPageUnavailablePluginButtonClickedCallback                        unavailablePluginButtonClicked;
261 } WKPageUIClientV2;
262
263 typedef struct WKPageUIClientV3 {
264     WKPageUIClientBase                                                  base;
265
266     // Version 0.
267     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
268     WKPageUIClientCallback                                              showPage;
269     WKPageUIClientCallback                                              close;
270     WKPageTakeFocusCallback                                             takeFocus;
271     WKPageFocusCallback                                                 focus;
272     WKPageUnfocusCallback                                               unfocus;
273     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert;
274     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm;
275     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt;
276     WKPageSetStatusTextCallback                                         setStatusText;
277     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
278     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
279     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
280     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
281     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
282     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
283     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
284     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
285     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
286     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
287     WKPageGetIsResizableCallback                                        isResizable;
288     WKPageSetIsResizableCallback                                        setIsResizable;
289     WKPageGetWindowFrameCallback                                        getWindowFrame;
290     WKPageSetWindowFrameCallback                                        setWindowFrame;
291     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
292     WKPageUIClientCallback                                              didDraw;
293     WKPageUIClientCallback                                              pageDidScroll;
294     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
295     WKPageRunOpenPanelCallback                                          runOpenPanel;
296     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
297     WKPageHeaderHeightCallback                                          headerHeight;
298     WKPageFooterHeightCallback                                          footerHeight;
299     WKPageDrawHeaderCallback                                            drawHeader;
300     WKPageDrawFooterCallback                                            drawFooter;
301     WKPagePrintFrameCallback                                            printFrame;
302     WKPageUIClientCallback                                              runModal;
303     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
304     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
305     void*                                                               shouldInterruptJavaScript_unavailable;
306
307     // Version 1.
308     WKPageCreateNewPageCallback_deprecatedForUseWithV1                  createNewPage;
309     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
310     WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
311     WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
312
313     // Version 2.
314     WKPageShowColorPickerCallback                                       showColorPicker;
315     WKPageHideColorPickerCallback                                       hideColorPicker;
316     WKPageUnavailablePluginButtonClickedCallback                        unavailablePluginButtonClicked;
317
318     // Version 3.
319     WKPagePinnedStateDidChangeCallback                                  pinnedStateDidChange;
320 } WKPageUIClientV3;
321
322 typedef struct WKPageUIClientV4 {
323     WKPageUIClientBase                                                  base;
324
325     // Version 0.
326     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
327     WKPageUIClientCallback                                              showPage;
328     WKPageUIClientCallback                                              close;
329     WKPageTakeFocusCallback                                             takeFocus;
330     WKPageFocusCallback                                                 focus;
331     WKPageUnfocusCallback                                               unfocus;
332     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert;
333     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm;
334     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt;
335     WKPageSetStatusTextCallback                                         setStatusText;
336     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
337     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
338     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
339     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
340     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
341     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
342     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
343     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
344     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
345     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
346     WKPageGetIsResizableCallback                                        isResizable;
347     WKPageSetIsResizableCallback                                        setIsResizable;
348     WKPageGetWindowFrameCallback                                        getWindowFrame;
349     WKPageSetWindowFrameCallback                                        setWindowFrame;
350     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
351     WKPageUIClientCallback                                              didDraw;
352     WKPageUIClientCallback                                              pageDidScroll;
353     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
354     WKPageRunOpenPanelCallback                                          runOpenPanel;
355     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
356     WKPageHeaderHeightCallback                                          headerHeight;
357     WKPageFooterHeightCallback                                          footerHeight;
358     WKPageDrawHeaderCallback                                            drawHeader;
359     WKPageDrawFooterCallback                                            drawFooter;
360     WKPagePrintFrameCallback                                            printFrame;
361     WKPageUIClientCallback                                              runModal;
362     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
363     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
364     void*                                                               shouldInterruptJavaScript_unavailable;
365
366     // Version 1.
367     WKPageCreateNewPageCallback_deprecatedForUseWithV1                  createNewPage;
368     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
369     WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
370     WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
371
372     // Version 2.
373     WKPageShowColorPickerCallback                                       showColorPicker;
374     WKPageHideColorPickerCallback                                       hideColorPicker;
375     WKPageUnavailablePluginButtonClickedCallback                        unavailablePluginButtonClicked;
376     
377     // Version 3.
378     WKPagePinnedStateDidChangeCallback                                  pinnedStateDidChange;
379
380     // Version 4.
381     WKPageDidBeginTrackingPotentialLongMousePressCallback               didBeginTrackingPotentialLongMousePress;
382     WKPageDidRecognizeLongMousePressCallback                            didRecognizeLongMousePress;
383     WKPageDidCancelTrackingPotentialLongMousePressCallback              didCancelTrackingPotentialLongMousePress;
384     WKPageIsPlayingAudioDidChangeCallback                               isPlayingAudioDidChange;
385 } WKPageUIClientV4;
386
387 typedef struct WKPageUIClientV5 {
388     WKPageUIClientBase                                                  base;
389
390     // Version 0.
391     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
392     WKPageUIClientCallback                                              showPage;
393     WKPageUIClientCallback                                              close;
394     WKPageTakeFocusCallback                                             takeFocus;
395     WKPageFocusCallback                                                 focus;
396     WKPageUnfocusCallback                                               unfocus;
397     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert_deprecatedForUseWithV0;
398     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm_deprecatedForUseWithV0;
399     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt_deprecatedForUseWithV0;
400     WKPageSetStatusTextCallback                                         setStatusText;
401     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
402     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
403     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
404     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
405     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
406     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
407     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
408     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
409     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
410     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
411     WKPageGetIsResizableCallback                                        isResizable;
412     WKPageSetIsResizableCallback                                        setIsResizable;
413     WKPageGetWindowFrameCallback                                        getWindowFrame;
414     WKPageSetWindowFrameCallback                                        setWindowFrame;
415     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
416     WKPageUIClientCallback                                              didDraw;
417     WKPageUIClientCallback                                              pageDidScroll;
418     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
419     WKPageRunOpenPanelCallback                                          runOpenPanel;
420     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
421     WKPageHeaderHeightCallback                                          headerHeight;
422     WKPageFooterHeightCallback                                          footerHeight;
423     WKPageDrawHeaderCallback                                            drawHeader;
424     WKPageDrawFooterCallback                                            drawFooter;
425     WKPagePrintFrameCallback                                            printFrame;
426     WKPageUIClientCallback                                              runModal;
427     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
428     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
429     void*                                                               shouldInterruptJavaScript_unavailable;
430
431     // Version 1.
432     WKPageCreateNewPageCallback_deprecatedForUseWithV1                  createNewPage;
433     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
434     WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
435     WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
436
437     // Version 2.
438     WKPageShowColorPickerCallback                                       showColorPicker;
439     WKPageHideColorPickerCallback                                       hideColorPicker;
440     WKPageUnavailablePluginButtonClickedCallback                        unavailablePluginButtonClicked;
441     
442     // Version 3.
443     WKPagePinnedStateDidChangeCallback                                  pinnedStateDidChange;
444
445     // Version 4.
446     WKPageDidBeginTrackingPotentialLongMousePressCallback               didBeginTrackingPotentialLongMousePress;
447     WKPageDidRecognizeLongMousePressCallback                            didRecognizeLongMousePress;
448     WKPageDidCancelTrackingPotentialLongMousePressCallback              didCancelTrackingPotentialLongMousePress;
449     WKPageIsPlayingAudioDidChangeCallback                               isPlayingAudioDidChange;
450
451     // Version 5.
452     WKPageDecidePolicyForUserMediaPermissionRequestCallback             decidePolicyForUserMediaPermissionRequest;
453     WKPageDidClickAutoFillButtonCallback                                didClickAutoFillButton;
454     WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
455     WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
456     WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
457     WKPageMediaSessionMetadataDidChangeCallback                         mediaSessionMetadataDidChange;
458 } WKPageUIClientV5;
459
460 typedef struct WKPageUIClientV6 {
461     WKPageUIClientBase                                                  base;
462
463     // Version 0.
464     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
465     WKPageUIClientCallback                                              showPage;
466     WKPageUIClientCallback                                              close;
467     WKPageTakeFocusCallback                                             takeFocus;
468     WKPageFocusCallback                                                 focus;
469     WKPageUnfocusCallback                                               unfocus;
470     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert_deprecatedForUseWithV0;
471     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm_deprecatedForUseWithV0;
472     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt_deprecatedForUseWithV0;
473     WKPageSetStatusTextCallback                                         setStatusText;
474     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
475     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
476     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
477     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
478     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
479     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
480     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
481     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
482     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
483     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
484     WKPageGetIsResizableCallback                                        isResizable;
485     WKPageSetIsResizableCallback                                        setIsResizable;
486     WKPageGetWindowFrameCallback                                        getWindowFrame;
487     WKPageSetWindowFrameCallback                                        setWindowFrame;
488     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
489     WKPageUIClientCallback                                              didDraw;
490     WKPageUIClientCallback                                              pageDidScroll;
491     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
492     WKPageRunOpenPanelCallback                                          runOpenPanel;
493     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
494     WKPageHeaderHeightCallback                                          headerHeight;
495     WKPageFooterHeightCallback                                          footerHeight;
496     WKPageDrawHeaderCallback                                            drawHeader;
497     WKPageDrawFooterCallback                                            drawFooter;
498     WKPagePrintFrameCallback                                            printFrame;
499     WKPageUIClientCallback                                              runModal;
500     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
501     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
502     void*                                                               shouldInterruptJavaScript_unavailable;
503
504     // Version 1.
505     WKPageCreateNewPageCallback_deprecatedForUseWithV1                  createNewPage_deprecatedForUseWithV1;
506     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
507     WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
508     WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
509
510     // Version 2.
511     WKPageShowColorPickerCallback                                       showColorPicker;
512     WKPageHideColorPickerCallback                                       hideColorPicker;
513     WKPageUnavailablePluginButtonClickedCallback                        unavailablePluginButtonClicked;
514
515     // Version 3.
516     WKPagePinnedStateDidChangeCallback                                  pinnedStateDidChange;
517
518     // Version 4.
519     WKPageDidBeginTrackingPotentialLongMousePressCallback               didBeginTrackingPotentialLongMousePress;
520     WKPageDidRecognizeLongMousePressCallback                            didRecognizeLongMousePress;
521     WKPageDidCancelTrackingPotentialLongMousePressCallback              didCancelTrackingPotentialLongMousePress;
522     WKPageIsPlayingAudioDidChangeCallback                               isPlayingAudioDidChange;
523
524     // Version 5.
525     WKPageDecidePolicyForUserMediaPermissionRequestCallback             decidePolicyForUserMediaPermissionRequest;
526     WKPageDidClickAutoFillButtonCallback                                didClickAutoFillButton;
527     WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
528     WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
529     WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
530     WKPageMediaSessionMetadataDidChangeCallback                         mediaSessionMetadataDidChange;
531
532     // Version 6.
533     WKPageCreateNewPageCallback                                         createNewPage;
534
535 } WKPageUIClientV6;
536
537 #ifdef __cplusplus
538 }
539 #endif
540
541 #endif // WKPageUIClient_h