Remove unused support for long presses from WebKit
[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 (*WKPageIsPlayingAudioDidChangeCallback)(WKPageRef page, const void* clientInfo);
89 typedef void (*WKPageDecidePolicyForUserMediaPermissionRequestCallback)(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef origin, WKUserMediaPermissionRequestRef permissionRequest, const void* clientInfo);
90 typedef void (*WKPageDidClickAutoFillButtonCallback)(WKPageRef page, WKTypeRef userData, const void *clientInfo);
91 typedef void (*WKPageMediaSessionMetadataDidChangeCallback)(WKPageRef page, WKMediaSessionMetadataRef metadata, const void* clientInfo);
92
93 // Deprecated
94 typedef WKPageRef (*WKPageCreateNewPageCallback_deprecatedForUseWithV0)(WKPageRef page, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo);
95 typedef void      (*WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0)(WKPageRef page, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo);
96 typedef void (*WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
97 typedef void (*WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1)(WKPageRef page, WKPluginUnavailabilityReason pluginUnavailabilityReason, WKStringRef mimeType, WKStringRef url, WKStringRef pluginsPageURL, const void* clientInfo);
98 typedef void (*WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void *clientInfo);
99 typedef bool (*WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo);
100 typedef WKStringRef (*WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void *clientInfo);
101 typedef WKPageRef (*WKPageCreateNewPageCallback_deprecatedForUseWithV1)(WKPageRef page, WKURLRequestRef urlRequest, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo);
102
103 typedef struct WKPageUIClientBase {
104     int                                                                 version;
105     const void *                                                        clientInfo;
106 } WKPageUIClientBase;
107
108 typedef struct WKPageUIClientV0 {
109     WKPageUIClientBase                                                  base;
110
111     // Version 0.
112     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
113     WKPageUIClientCallback                                              showPage;
114     WKPageUIClientCallback                                              close;
115     WKPageTakeFocusCallback                                             takeFocus;
116     WKPageFocusCallback                                                 focus;
117     WKPageUnfocusCallback                                               unfocus;
118     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert;
119     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm;
120     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt;
121     WKPageSetStatusTextCallback                                         setStatusText;
122     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
123     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
124     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
125     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
126     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
127     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
128     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
129     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
130     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
131     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
132     WKPageGetIsResizableCallback                                        isResizable;
133     WKPageSetIsResizableCallback                                        setIsResizable;
134     WKPageGetWindowFrameCallback                                        getWindowFrame;
135     WKPageSetWindowFrameCallback                                        setWindowFrame;
136     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
137     WKPageUIClientCallback                                              didDraw;
138     WKPageUIClientCallback                                              pageDidScroll;
139     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
140     WKPageRunOpenPanelCallback                                          runOpenPanel;
141     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
142     WKPageHeaderHeightCallback                                          headerHeight;
143     WKPageFooterHeightCallback                                          footerHeight;
144     WKPageDrawHeaderCallback                                            drawHeader;
145     WKPageDrawFooterCallback                                            drawFooter;
146     WKPagePrintFrameCallback                                            printFrame;
147     WKPageUIClientCallback                                              runModal;
148     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
149     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
150     void*                                                               shouldInterruptJavaScript_unavailable;
151 } WKPageUIClientV0;
152
153 typedef struct WKPageUIClientV1 {
154     WKPageUIClientBase                                                  base;
155
156     // Version 0.
157     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
158     WKPageUIClientCallback                                              showPage;
159     WKPageUIClientCallback                                              close;
160     WKPageTakeFocusCallback                                             takeFocus;
161     WKPageFocusCallback                                                 focus;
162     WKPageUnfocusCallback                                               unfocus;
163     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert;
164     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm;
165     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt;
166     WKPageSetStatusTextCallback                                         setStatusText;
167     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
168     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
169     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
170     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
171     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
172     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
173     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
174     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
175     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
176     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
177     WKPageGetIsResizableCallback                                        isResizable;
178     WKPageSetIsResizableCallback                                        setIsResizable;
179     WKPageGetWindowFrameCallback                                        getWindowFrame;
180     WKPageSetWindowFrameCallback                                        setWindowFrame;
181     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
182     WKPageUIClientCallback                                              didDraw;
183     WKPageUIClientCallback                                              pageDidScroll;
184     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
185     WKPageRunOpenPanelCallback                                          runOpenPanel;
186     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
187     WKPageHeaderHeightCallback                                          headerHeight;
188     WKPageFooterHeightCallback                                          footerHeight;
189     WKPageDrawHeaderCallback                                            drawHeader;
190     WKPageDrawFooterCallback                                            drawFooter;
191     WKPagePrintFrameCallback                                            printFrame;
192     WKPageUIClientCallback                                              runModal;
193     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
194     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
195     void*                                                               shouldInterruptJavaScript_unavailable;
196
197     // Version 1.
198     WKPageCreateNewPageCallback_deprecatedForUseWithV1                  createNewPage;
199     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
200     WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
201     WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
202 } WKPageUIClientV1;
203
204 typedef struct WKPageUIClientV2 {
205     WKPageUIClientBase                                                  base;
206
207     // Version 0.
208     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
209     WKPageUIClientCallback                                              showPage;
210     WKPageUIClientCallback                                              close;
211     WKPageTakeFocusCallback                                             takeFocus;
212     WKPageFocusCallback                                                 focus;
213     WKPageUnfocusCallback                                               unfocus;
214     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert;
215     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm;
216     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt;
217     WKPageSetStatusTextCallback                                         setStatusText;
218     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
219     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
220     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
221     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
222     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
223     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
224     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
225     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
226     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
227     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
228     WKPageGetIsResizableCallback                                        isResizable;
229     WKPageSetIsResizableCallback                                        setIsResizable;
230     WKPageGetWindowFrameCallback                                        getWindowFrame;
231     WKPageSetWindowFrameCallback                                        setWindowFrame;
232     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
233     WKPageUIClientCallback                                              didDraw;
234     WKPageUIClientCallback                                              pageDidScroll;
235     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
236     WKPageRunOpenPanelCallback                                          runOpenPanel;
237     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
238     WKPageHeaderHeightCallback                                          headerHeight;
239     WKPageFooterHeightCallback                                          footerHeight;
240     WKPageDrawHeaderCallback                                            drawHeader;
241     WKPageDrawFooterCallback                                            drawFooter;
242     WKPagePrintFrameCallback                                            printFrame;
243     WKPageUIClientCallback                                              runModal;
244     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
245     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
246     void*                                                               shouldInterruptJavaScript_unavailable;
247
248     // Version 1.
249     WKPageCreateNewPageCallback_deprecatedForUseWithV1                  createNewPage;
250     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
251     WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
252     WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
253
254     // Version 2.
255     WKPageShowColorPickerCallback                                       showColorPicker;
256     WKPageHideColorPickerCallback                                       hideColorPicker;
257     WKPageUnavailablePluginButtonClickedCallback                        unavailablePluginButtonClicked;
258 } WKPageUIClientV2;
259
260 typedef struct WKPageUIClientV3 {
261     WKPageUIClientBase                                                  base;
262
263     // Version 0.
264     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
265     WKPageUIClientCallback                                              showPage;
266     WKPageUIClientCallback                                              close;
267     WKPageTakeFocusCallback                                             takeFocus;
268     WKPageFocusCallback                                                 focus;
269     WKPageUnfocusCallback                                               unfocus;
270     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert;
271     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm;
272     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt;
273     WKPageSetStatusTextCallback                                         setStatusText;
274     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
275     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
276     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
277     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
278     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
279     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
280     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
281     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
282     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
283     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
284     WKPageGetIsResizableCallback                                        isResizable;
285     WKPageSetIsResizableCallback                                        setIsResizable;
286     WKPageGetWindowFrameCallback                                        getWindowFrame;
287     WKPageSetWindowFrameCallback                                        setWindowFrame;
288     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
289     WKPageUIClientCallback                                              didDraw;
290     WKPageUIClientCallback                                              pageDidScroll;
291     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
292     WKPageRunOpenPanelCallback                                          runOpenPanel;
293     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
294     WKPageHeaderHeightCallback                                          headerHeight;
295     WKPageFooterHeightCallback                                          footerHeight;
296     WKPageDrawHeaderCallback                                            drawHeader;
297     WKPageDrawFooterCallback                                            drawFooter;
298     WKPagePrintFrameCallback                                            printFrame;
299     WKPageUIClientCallback                                              runModal;
300     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
301     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
302     void*                                                               shouldInterruptJavaScript_unavailable;
303
304     // Version 1.
305     WKPageCreateNewPageCallback_deprecatedForUseWithV1                  createNewPage;
306     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
307     WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
308     WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
309
310     // Version 2.
311     WKPageShowColorPickerCallback                                       showColorPicker;
312     WKPageHideColorPickerCallback                                       hideColorPicker;
313     WKPageUnavailablePluginButtonClickedCallback                        unavailablePluginButtonClicked;
314
315     // Version 3.
316     WKPagePinnedStateDidChangeCallback                                  pinnedStateDidChange;
317 } WKPageUIClientV3;
318
319 typedef struct WKPageUIClientV4 {
320     WKPageUIClientBase                                                  base;
321
322     // Version 0.
323     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
324     WKPageUIClientCallback                                              showPage;
325     WKPageUIClientCallback                                              close;
326     WKPageTakeFocusCallback                                             takeFocus;
327     WKPageFocusCallback                                                 focus;
328     WKPageUnfocusCallback                                               unfocus;
329     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert;
330     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm;
331     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt;
332     WKPageSetStatusTextCallback                                         setStatusText;
333     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
334     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
335     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
336     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
337     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
338     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
339     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
340     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
341     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
342     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
343     WKPageGetIsResizableCallback                                        isResizable;
344     WKPageSetIsResizableCallback                                        setIsResizable;
345     WKPageGetWindowFrameCallback                                        getWindowFrame;
346     WKPageSetWindowFrameCallback                                        setWindowFrame;
347     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
348     WKPageUIClientCallback                                              didDraw;
349     WKPageUIClientCallback                                              pageDidScroll;
350     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
351     WKPageRunOpenPanelCallback                                          runOpenPanel;
352     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
353     WKPageHeaderHeightCallback                                          headerHeight;
354     WKPageFooterHeightCallback                                          footerHeight;
355     WKPageDrawHeaderCallback                                            drawHeader;
356     WKPageDrawFooterCallback                                            drawFooter;
357     WKPagePrintFrameCallback                                            printFrame;
358     WKPageUIClientCallback                                              runModal;
359     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame.
360     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
361     void*                                                               shouldInterruptJavaScript_unavailable;
362
363     // Version 1.
364     WKPageCreateNewPageCallback_deprecatedForUseWithV1                  createNewPage;
365     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
366     WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
367     WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
368
369     // Version 2.
370     WKPageShowColorPickerCallback                                       showColorPicker;
371     WKPageHideColorPickerCallback                                       hideColorPicker;
372     WKPageUnavailablePluginButtonClickedCallback                        unavailablePluginButtonClicked;
373     
374     // Version 3.
375     WKPagePinnedStateDidChangeCallback                                  pinnedStateDidChange;
376
377     // Version 4.
378     void*                                                               unused2; // Used to be didBeginTrackingPotentialLongMousePress.
379     void*                                                               unused3; // Used to be didRecognizeLongMousePress.
380     void*                                                               unused4; // Used to be didCancelTrackingPotentialLongMousePress.
381     WKPageIsPlayingAudioDidChangeCallback                               isPlayingAudioDidChange;
382 } WKPageUIClientV4;
383
384 typedef struct WKPageUIClientV5 {
385     WKPageUIClientBase                                                  base;
386
387     // Version 0.
388     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
389     WKPageUIClientCallback                                              showPage;
390     WKPageUIClientCallback                                              close;
391     WKPageTakeFocusCallback                                             takeFocus;
392     WKPageFocusCallback                                                 focus;
393     WKPageUnfocusCallback                                               unfocus;
394     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert_deprecatedForUseWithV0;
395     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm_deprecatedForUseWithV0;
396     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt_deprecatedForUseWithV0;
397     WKPageSetStatusTextCallback                                         setStatusText;
398     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
399     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
400     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
401     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
402     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
403     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
404     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
405     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
406     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
407     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
408     WKPageGetIsResizableCallback                                        isResizable;
409     WKPageSetIsResizableCallback                                        setIsResizable;
410     WKPageGetWindowFrameCallback                                        getWindowFrame;
411     WKPageSetWindowFrameCallback                                        setWindowFrame;
412     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
413     WKPageUIClientCallback                                              didDraw;
414     WKPageUIClientCallback                                              pageDidScroll;
415     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
416     WKPageRunOpenPanelCallback                                          runOpenPanel;
417     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
418     WKPageHeaderHeightCallback                                          headerHeight;
419     WKPageFooterHeightCallback                                          footerHeight;
420     WKPageDrawHeaderCallback                                            drawHeader;
421     WKPageDrawFooterCallback                                            drawFooter;
422     WKPagePrintFrameCallback                                            printFrame;
423     WKPageUIClientCallback                                              runModal;
424     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
425     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
426     void*                                                               shouldInterruptJavaScript_unavailable;
427
428     // Version 1.
429     WKPageCreateNewPageCallback_deprecatedForUseWithV1                  createNewPage;
430     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
431     WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
432     WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
433
434     // Version 2.
435     WKPageShowColorPickerCallback                                       showColorPicker;
436     WKPageHideColorPickerCallback                                       hideColorPicker;
437     WKPageUnavailablePluginButtonClickedCallback                        unavailablePluginButtonClicked;
438     
439     // Version 3.
440     WKPagePinnedStateDidChangeCallback                                  pinnedStateDidChange;
441
442     // Version 4.
443     void*                                                               unused2; // Used to be didBeginTrackingPotentialLongMousePress.
444     void*                                                               unused3; // Used to be didRecognizeLongMousePress.
445     void*                                                               unused4; // Used to be didCancelTrackingPotentialLongMousePress.
446     WKPageIsPlayingAudioDidChangeCallback                               isPlayingAudioDidChange;
447
448     // Version 5.
449     WKPageDecidePolicyForUserMediaPermissionRequestCallback             decidePolicyForUserMediaPermissionRequest;
450     WKPageDidClickAutoFillButtonCallback                                didClickAutoFillButton;
451     WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
452     WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
453     WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
454     WKPageMediaSessionMetadataDidChangeCallback                         mediaSessionMetadataDidChange;
455 } WKPageUIClientV5;
456
457 typedef struct WKPageUIClientV6 {
458     WKPageUIClientBase                                                  base;
459
460     // Version 0.
461     WKPageCreateNewPageCallback_deprecatedForUseWithV0                  createNewPage_deprecatedForUseWithV0;
462     WKPageUIClientCallback                                              showPage;
463     WKPageUIClientCallback                                              close;
464     WKPageTakeFocusCallback                                             takeFocus;
465     WKPageFocusCallback                                                 focus;
466     WKPageUnfocusCallback                                               unfocus;
467     WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0             runJavaScriptAlert_deprecatedForUseWithV0;
468     WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0           runJavaScriptConfirm_deprecatedForUseWithV0;
469     WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0            runJavaScriptPrompt_deprecatedForUseWithV0;
470     WKPageSetStatusTextCallback                                         setStatusText;
471     WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0        mouseDidMoveOverElement_deprecatedForUseWithV0;
472     WKPageMissingPluginButtonClickedCallback_deprecatedForUseWithV0     missingPluginButtonClicked_deprecatedForUseWithV0;
473     WKPageDidNotHandleKeyEventCallback                                  didNotHandleKeyEvent;
474     WKPageDidNotHandleWheelEventCallback                                didNotHandleWheelEvent;
475     WKPageGetToolbarsAreVisibleCallback                                 toolbarsAreVisible;
476     WKPageSetToolbarsAreVisibleCallback                                 setToolbarsAreVisible;
477     WKPageGetMenuBarIsVisibleCallback                                   menuBarIsVisible;
478     WKPageSetMenuBarIsVisibleCallback                                   setMenuBarIsVisible;
479     WKPageGetStatusBarIsVisibleCallback                                 statusBarIsVisible;
480     WKPageSetStatusBarIsVisibleCallback                                 setStatusBarIsVisible;
481     WKPageGetIsResizableCallback                                        isResizable;
482     WKPageSetIsResizableCallback                                        setIsResizable;
483     WKPageGetWindowFrameCallback                                        getWindowFrame;
484     WKPageSetWindowFrameCallback                                        setWindowFrame;
485     WKPageRunBeforeUnloadConfirmPanelCallback                           runBeforeUnloadConfirmPanel;
486     WKPageUIClientCallback                                              didDraw;
487     WKPageUIClientCallback                                              pageDidScroll;
488     WKPageExceededDatabaseQuotaCallback                                 exceededDatabaseQuota;
489     WKPageRunOpenPanelCallback                                          runOpenPanel;
490     WKPageDecidePolicyForGeolocationPermissionRequestCallback           decidePolicyForGeolocationPermissionRequest;
491     WKPageHeaderHeightCallback                                          headerHeight;
492     WKPageFooterHeightCallback                                          footerHeight;
493     WKPageDrawHeaderCallback                                            drawHeader;
494     WKPageDrawFooterCallback                                            drawFooter;
495     WKPagePrintFrameCallback                                            printFrame;
496     WKPageUIClientCallback                                              runModal;
497     void*                                                               unused1; // Used to be didCompleteRubberBandForMainFrame
498     WKPageSaveDataToFileInDownloadsFolderCallback                       saveDataToFileInDownloadsFolder;
499     void*                                                               shouldInterruptJavaScript_unavailable;
500
501     // Version 1.
502     WKPageCreateNewPageCallback_deprecatedForUseWithV1                  createNewPage_deprecatedForUseWithV1;
503     WKPageMouseDidMoveOverElementCallback                               mouseDidMoveOverElement;
504     WKPageDecidePolicyForNotificationPermissionRequestCallback          decidePolicyForNotificationPermissionRequest;
505     WKPageUnavailablePluginButtonClickedCallback_deprecatedForUseWithV1 unavailablePluginButtonClicked_deprecatedForUseWithV1;
506
507     // Version 2.
508     WKPageShowColorPickerCallback                                       showColorPicker;
509     WKPageHideColorPickerCallback                                       hideColorPicker;
510     WKPageUnavailablePluginButtonClickedCallback                        unavailablePluginButtonClicked;
511
512     // Version 3.
513     WKPagePinnedStateDidChangeCallback                                  pinnedStateDidChange;
514
515     // Version 4.
516     void*                                                               unused2; // Used to be didBeginTrackingPotentialLongMousePress.
517     void*                                                               unused3; // Used to be didRecognizeLongMousePress.
518     void*                                                               unused4; // Used to be didCancelTrackingPotentialLongMousePress.
519     WKPageIsPlayingAudioDidChangeCallback                               isPlayingAudioDidChange;
520
521     // Version 5.
522     WKPageDecidePolicyForUserMediaPermissionRequestCallback             decidePolicyForUserMediaPermissionRequest;
523     WKPageDidClickAutoFillButtonCallback                                didClickAutoFillButton;
524     WKPageRunJavaScriptAlertCallback                                    runJavaScriptAlert;
525     WKPageRunJavaScriptConfirmCallback                                  runJavaScriptConfirm;
526     WKPageRunJavaScriptPromptCallback                                   runJavaScriptPrompt;
527     WKPageMediaSessionMetadataDidChangeCallback                         mediaSessionMetadataDidChange;
528
529     // Version 6.
530     WKPageCreateNewPageCallback                                         createNewPage;
531
532 } WKPageUIClientV6;
533
534 #ifdef __cplusplus
535 }
536 #endif
537
538 #endif // WKPageUIClient_h