53276b08993da354cebbd9f628db03b5a5662c91
[WebKit-https.git] / Source / WebKit2 / WebProcess / InjectedBundle / API / c / WKBundlePage.h
1 /*
2  * Copyright (C) 2010 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 WKBundlePage_h
27 #define WKBundlePage_h
28
29 #include <WebKit2/WKBase.h>
30 #include <WebKit2/WKEvent.h>
31 #include <WebKit2/WKFindOptions.h>
32 #include <WebKit2/WKImage.h>
33 #include <WebKit2/WKPageLoadTypes.h>
34
35 #ifndef __cplusplus
36 #include <stdbool.h>
37 #endif
38
39 #include <stdint.h>
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 enum {
46     kWKInsertActionTyped = 0,
47     kWKInsertActionPasted = 1,
48     kWKInsertActionDropped = 2
49 };
50 typedef uint32_t WKInsertActionType;
51
52 enum {
53     kWKAffinityUpstream,
54     kWKAffinityDownstream
55 };
56 typedef uint32_t WKAffinityType;
57
58 enum {
59     WKInputFieldActionTypeMoveUp,
60     WKInputFieldActionTypeMoveDown,
61     WKInputFieldActionTypeCancel,
62     WKInputFieldActionTypeInsertTab,
63     WKInputFieldActionTypeInsertBacktab,
64     WKInputFieldActionTypeInsertNewline,
65     WKInputFieldActionTypeInsertDelete
66 };
67 typedef uint32_t WKInputFieldActionType;
68
69 enum {
70     WKFullScreenNoKeyboard,
71     WKFullScreenKeyboard,
72 };
73 typedef uint32_t WKFullScreenKeyboardRequestType;
74
75 enum {
76     WKScrollDirectionLeft,
77     WKScrollDirectionRight
78 };
79 typedef uint32_t WKScrollDirection;
80
81 // Loader Client
82 typedef void (*WKBundlePageDidStartProvisionalLoadForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
83 typedef void (*WKBundlePageDidReceiveServerRedirectForProvisionalLoadForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
84 typedef void (*WKBundlePageDidFailProvisionalLoadWithErrorForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKErrorRef error, WKTypeRef* userData, const void *clientInfo);
85 typedef void (*WKBundlePageDidCommitLoadForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
86 typedef void (*WKBundlePageDidDocumentFinishLoadForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
87 typedef void (*WKBundlePageDidFinishLoadForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
88 typedef void (*WKBundlePageDidFinishDocumentLoadForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
89 typedef void (*WKBundlePageDidFailLoadWithErrorForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKErrorRef error, WKTypeRef* userData, const void *clientInfo);
90 typedef void (*WKBundlePageDidSameDocumentNavigationForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKSameDocumentNavigationType type, WKTypeRef* userData, const void *clientInfo);
91 typedef void (*WKBundlePageDidReceiveTitleForFrameCallback)(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
92 typedef void (*WKBundlePageDidRemoveFrameFromHierarchyCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
93 typedef void (*WKBundlePageDidDisplayInsecureContentForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
94 typedef void (*WKBundlePageDidRunInsecureContentForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
95 typedef void (*WKBundlePageDidDetectXSSForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
96 typedef void (*WKBundlePageDidFirstLayoutForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
97 typedef void (*WKBundlePageDidFirstVisuallyNonEmptyLayoutForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);
98 typedef void (*WKBundlePageDidLayoutForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo);
99 typedef void (*WKBundlePageDidClearWindowObjectForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleScriptWorldRef world, const void *clientInfo);
100 typedef void (*WKBundlePageDidCancelClientRedirectForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
101 typedef void (*WKBundlePageWillPerformClientRedirectForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKURLRef url, double delay, double date, const void *clientInfo);
102 typedef void (*WKBundlePageDidHandleOnloadEventsForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
103
104 struct WKBundlePageLoaderClient {
105     int                                                                 version;
106     const void *                                                        clientInfo;
107
108     // Version 0.
109     WKBundlePageDidStartProvisionalLoadForFrameCallback                 didStartProvisionalLoadForFrame;
110     WKBundlePageDidReceiveServerRedirectForProvisionalLoadForFrameCallback    didReceiveServerRedirectForProvisionalLoadForFrame;
111     WKBundlePageDidFailProvisionalLoadWithErrorForFrameCallback         didFailProvisionalLoadWithErrorForFrame;
112     WKBundlePageDidCommitLoadForFrameCallback                           didCommitLoadForFrame;
113     WKBundlePageDidFinishDocumentLoadForFrameCallback                   didFinishDocumentLoadForFrame;
114     WKBundlePageDidFinishLoadForFrameCallback                           didFinishLoadForFrame;
115     WKBundlePageDidFailLoadWithErrorForFrameCallback                    didFailLoadWithErrorForFrame;
116     WKBundlePageDidSameDocumentNavigationForFrameCallback               didSameDocumentNavigationForFrame;
117     WKBundlePageDidReceiveTitleForFrameCallback                         didReceiveTitleForFrame;
118     WKBundlePageDidFirstLayoutForFrameCallback                          didFirstLayoutForFrame;
119     WKBundlePageDidFirstVisuallyNonEmptyLayoutForFrameCallback          didFirstVisuallyNonEmptyLayoutForFrame;
120     WKBundlePageDidRemoveFrameFromHierarchyCallback                     didRemoveFrameFromHierarchy;
121     WKBundlePageDidDisplayInsecureContentForFrameCallback               didDisplayInsecureContentForFrame;
122     WKBundlePageDidRunInsecureContentForFrameCallback                   didRunInsecureContentForFrame;
123     WKBundlePageDidClearWindowObjectForFrameCallback                    didClearWindowObjectForFrame;
124     WKBundlePageDidCancelClientRedirectForFrameCallback                 didCancelClientRedirectForFrame;
125     WKBundlePageWillPerformClientRedirectForFrameCallback               willPerformClientRedirectForFrame;
126     WKBundlePageDidHandleOnloadEventsForFrameCallback                   didHandleOnloadEventsForFrame;
127
128     // Version 1.
129     WKBundlePageDidLayoutForFrameCallback                               didLayoutForFrame;
130     WKBundlePageDidDetectXSSForFrameCallback                            didDetectXSSForFrame;
131 };
132 typedef struct WKBundlePageLoaderClient WKBundlePageLoaderClient;
133
134 enum { kWKBundlePageLoaderClientCurrentVersion = 1 };
135
136 enum {
137     WKBundlePagePolicyActionPassThrough,
138     WKBundlePagePolicyActionUse
139 };
140 typedef uint32_t WKBundlePagePolicyAction;
141
142 // Policy Client
143 typedef WKBundlePagePolicyAction (*WKBundlePageDecidePolicyForNavigationActionCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleNavigationActionRef navigationAction, WKURLRequestRef request, WKTypeRef* userData, const void* clientInfo);
144 typedef WKBundlePagePolicyAction (*WKBundlePageDecidePolicyForNewWindowActionCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleNavigationActionRef navigationAction, WKURLRequestRef request, WKStringRef frameName, WKTypeRef* userData, const void* clientInfo);
145 typedef WKBundlePagePolicyAction (*WKBundlePageDecidePolicyForResponseCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKURLResponseRef response, WKURLRequestRef request, WKTypeRef* userData, const void* clientInfo);
146 typedef void (*WKBundlePageUnableToImplementPolicyCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKErrorRef error, WKTypeRef* userData, const void* clientInfo);
147
148 struct WKBundlePagePolicyClient {
149     int                                                                 version;
150     const void *                                                        clientInfo;
151     WKBundlePageDecidePolicyForNavigationActionCallback                 decidePolicyForNavigationAction;
152     WKBundlePageDecidePolicyForNewWindowActionCallback                  decidePolicyForNewWindowAction;
153     WKBundlePageDecidePolicyForResponseCallback                         decidePolicyForResponse;
154     WKBundlePageUnableToImplementPolicyCallback                         unableToImplementPolicy;
155 };
156 typedef struct WKBundlePagePolicyClient WKBundlePagePolicyClient;
157
158 enum { kWKBundlePagePolicyClientCurrentVersion = 0 };
159
160 // Resource Load Client
161 typedef void (*WKBundlePageDidInitiateLoadForResourceCallback)(WKBundlePageRef, WKBundleFrameRef, uint64_t resourceIdentifier, WKURLRequestRef, bool pageIsProvisionallyLoading, const void* clientInfo);
162 typedef WKURLRequestRef (*WKBundlePageWillSendRequestForFrameCallback)(WKBundlePageRef, WKBundleFrameRef, uint64_t resourceIdentifier, WKURLRequestRef, WKURLResponseRef redirectResponse, const void *clientInfo);
163 typedef void (*WKBundlePageDidReceiveResponseForResourceCallback)(WKBundlePageRef, WKBundleFrameRef, uint64_t resourceIdentifier, WKURLResponseRef, const void* clientInfo);
164 typedef void (*WKBundlePageDidReceiveContentLengthForResourceCallback)(WKBundlePageRef, WKBundleFrameRef, uint64_t resourceIdentifier, uint64_t contentLength, const void* clientInfo);
165 typedef void (*WKBundlePageDidFinishLoadForResourceCallback)(WKBundlePageRef, WKBundleFrameRef, uint64_t resourceIdentifier, const void* clientInfo);
166 typedef void (*WKBundlePageDidFailLoadForResourceCallback)(WKBundlePageRef, WKBundleFrameRef, uint64_t resourceIdentifier, WKErrorRef, const void* clientInfo);
167 typedef bool (*WKBundlePageShouldCacheResponseCallback)(WKBundlePageRef, WKBundleFrameRef, uint64_t resourceIdentifier, const void* clientInfo);
168 typedef bool (*WKBundlePageShouldUseCredentialStorageCallback)(WKBundlePageRef, WKBundleFrameRef, uint64_t resourceIdentifier, const void* clientInfo);
169
170 struct WKBundlePageResourceLoadClient {
171     int                                                                 version;
172     const void *                                                        clientInfo;
173
174     // Version 0.
175     WKBundlePageDidInitiateLoadForResourceCallback                      didInitiateLoadForResource;
176
177     // willSendRequestForFrame is supposed to return a retained reference to the URL request.
178     WKBundlePageWillSendRequestForFrameCallback                         willSendRequestForFrame;
179
180     WKBundlePageDidReceiveResponseForResourceCallback                   didReceiveResponseForResource;
181     WKBundlePageDidReceiveContentLengthForResourceCallback              didReceiveContentLengthForResource;
182     WKBundlePageDidFinishLoadForResourceCallback                        didFinishLoadForResource;
183     WKBundlePageDidFailLoadForResourceCallback                          didFailLoadForResource;
184
185     // Version 1.
186     WKBundlePageShouldCacheResponseCallback                             shouldCacheResponse;
187     WKBundlePageShouldUseCredentialStorageCallback                      shouldUseCredentialStorage;
188 };
189 typedef struct WKBundlePageResourceLoadClient WKBundlePageResourceLoadClient;
190
191 enum { kWKBundlePageResourceLoadClientCurrentVersion = 1 };
192
193 enum {
194     WKBundlePageUIElementVisibilityUnknown,
195     WKBundlePageUIElementVisible,
196     WKBundlePageUIElementHidden
197 };
198 typedef uint32_t WKBundlePageUIElementVisibility;
199     
200 // UI Client
201 typedef void (*WKBundlePageWillAddMessageToConsoleCallback)(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo);
202 typedef void (*WKBundlePageWillSetStatusbarTextCallback)(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo);
203 typedef void (*WKBundlePageWillRunJavaScriptAlertCallback)(WKBundlePageRef page, WKStringRef alertText, WKBundleFrameRef frame, const void *clientInfo);
204 typedef void (*WKBundlePageWillRunJavaScriptConfirmCallback)(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void *clientInfo);
205 typedef void (*WKBundlePageWillRunJavaScriptPromptCallback)(WKBundlePageRef page, WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef frame, const void *clientInfo);
206 typedef void (*WKBundlePageMouseDidMoveOverElementCallback)(WKBundlePageRef page, WKBundleHitTestResultRef hitTestResult, WKEventModifiers modifiers, WKTypeRef* userData, const void *clientInfo);
207 typedef void (*WKBundlePageDidScrollCallback)(WKBundlePageRef page, const void *clientInfo);
208 typedef void (*WKBundlePagePaintCustomOverhangAreaCallback)(WKBundlePageRef page, WKGraphicsContextRef graphicsContext, WKRect horizontalOverhang, WKRect verticalOverhang, WKRect dirtyRect, const void* clientInfo);
209 typedef WKStringRef (*WKBundlePageGenerateFileForUploadCallback)(WKBundlePageRef page, WKStringRef originalFilePath, const void* clientInfo);
210 typedef bool (*WKBundlePageShouldRubberBandInDirectionCallback)(WKBundlePageRef page, WKScrollDirection scrollDirection, const void* clientInfo);
211 typedef WKBundlePageUIElementVisibility (*WKBundlePageStatusBarIsVisibleCallback)(WKBundlePageRef page, const void *clientInfo);
212 typedef WKBundlePageUIElementVisibility (*WKBundlePageMenuBarIsVisibleCallback)(WKBundlePageRef page, const void *clientInfo);
213 typedef WKBundlePageUIElementVisibility (*WKBundlePageToolbarsAreVisibleCallback)(WKBundlePageRef page, const void *clientInfo);
214
215 struct WKBundlePageUIClient {
216     int                                                                 version;
217     const void *                                                        clientInfo;
218     WKBundlePageWillAddMessageToConsoleCallback                         willAddMessageToConsole;
219     WKBundlePageWillSetStatusbarTextCallback                            willSetStatusbarText;
220     WKBundlePageWillRunJavaScriptAlertCallback                          willRunJavaScriptAlert;
221     WKBundlePageWillRunJavaScriptConfirmCallback                        willRunJavaScriptConfirm;
222     WKBundlePageWillRunJavaScriptPromptCallback                         willRunJavaScriptPrompt;
223     WKBundlePageMouseDidMoveOverElementCallback                         mouseDidMoveOverElement;
224     WKBundlePageDidScrollCallback                                       pageDidScroll;
225     WKBundlePagePaintCustomOverhangAreaCallback                         paintCustomOverhangArea;
226     WKBundlePageGenerateFileForUploadCallback                           shouldGenerateFileForUpload;
227     WKBundlePageGenerateFileForUploadCallback                           generateFileForUpload;
228     WKBundlePageShouldRubberBandInDirectionCallback                     shouldRubberBandInDirection;
229     WKBundlePageStatusBarIsVisibleCallback                              statusBarIsVisible;
230     WKBundlePageMenuBarIsVisibleCallback                                menuBarIsVisible;
231     WKBundlePageToolbarsAreVisibleCallback                              toolbarsAreVisible;
232 };
233 typedef struct WKBundlePageUIClient WKBundlePageUIClient;
234
235 enum { kWKBundlePageUIClientCurrentVersion = 0 };
236
237 // Editor client
238 typedef bool (*WKBundlePageShouldBeginEditingCallback)(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo);
239 typedef bool (*WKBundlePageShouldEndEditingCallback)(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo);
240 typedef bool (*WKBundlePageShouldInsertNodeCallback)(WKBundlePageRef page, WKBundleNodeHandleRef node, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action, const void* clientInfo);
241 typedef bool (*WKBundlePageShouldInsertTextCallback)(WKBundlePageRef page, WKStringRef string, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action, const void* clientInfo);
242 typedef bool (*WKBundlePageShouldDeleteRangeCallback)(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo);
243 typedef bool (*WKBundlePageShouldChangeSelectedRange)(WKBundlePageRef page, WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType affinity, bool stillSelecting, const void* clientInfo);
244 typedef bool (*WKBundlePageShouldApplyStyle)(WKBundlePageRef page, WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range, const void* clientInfo);
245 typedef void (*WKBundlePageEditingNotification)(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo);
246
247 struct WKBundlePageEditorClient {
248     int                                                                 version;
249     const void *                                                        clientInfo;
250     WKBundlePageShouldBeginEditingCallback                              shouldBeginEditing;
251     WKBundlePageShouldEndEditingCallback                                shouldEndEditing;
252     WKBundlePageShouldInsertNodeCallback                                shouldInsertNode;
253     WKBundlePageShouldInsertTextCallback                                shouldInsertText;
254     WKBundlePageShouldDeleteRangeCallback                               shouldDeleteRange;
255     WKBundlePageShouldChangeSelectedRange                               shouldChangeSelectedRange;
256     WKBundlePageShouldApplyStyle                                        shouldApplyStyle;
257     WKBundlePageEditingNotification                                     didBeginEditing;
258     WKBundlePageEditingNotification                                     didEndEditing;
259     WKBundlePageEditingNotification                                     didChange;
260     WKBundlePageEditingNotification                                     didChangeSelection;
261 };
262 typedef struct WKBundlePageEditorClient WKBundlePageEditorClient;
263
264 enum { kWKBundlePageEditorClientCurrentVersion = 0 };
265
266 // Form client
267 typedef void (*WKBundlePageTextFieldDidBeginEditingCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKBundleFrameRef frame, const void* clientInfo);
268 typedef void (*WKBundlePageTextFieldDidEndEditingCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKBundleFrameRef frame, const void* clientInfo);
269 typedef void (*WKBundlePageTextDidChangeInTextFieldCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKBundleFrameRef frame, const void* clientInfo);
270 typedef void (*WKBundlePageTextDidChangeInTextAreaCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlTextAreaElementHandle, WKBundleFrameRef frame, const void* clientInfo);
271 typedef bool (*WKBundlePageShouldPerformActionInTextFieldCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKInputFieldActionType actionType, WKBundleFrameRef frame, const void* clientInfo);
272 typedef void (*WKBundlePageWillSubmitFormCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlFormElementHandle, WKBundleFrameRef frame, WKBundleFrameRef sourceFrame, WKDictionaryRef values, WKTypeRef* userData, const void* clientInfo);
273
274 struct WKBundlePageFormClient {
275     int                                                                 version;
276     const void *                                                        clientInfo;
277     WKBundlePageTextFieldDidBeginEditingCallback                        textFieldDidBeginEditing;
278     WKBundlePageTextFieldDidEndEditingCallback                          textFieldDidEndEditing;
279     WKBundlePageTextDidChangeInTextFieldCallback                        textDidChangeInTextField;
280     WKBundlePageTextDidChangeInTextAreaCallback                         textDidChangeInTextArea;
281     WKBundlePageShouldPerformActionInTextFieldCallback                  shouldPerformActionInTextField;
282     WKBundlePageWillSubmitFormCallback                                  willSubmitForm;
283 };
284 typedef struct WKBundlePageFormClient WKBundlePageFormClient;
285
286 enum { kWKBundlePageFormClientCurrentVersion = 0 };
287
288 // ContextMenu client
289 typedef void (*WKBundlePageGetContextMenuFromDefaultContextMenuCallback)(WKBundlePageRef page, WKBundleHitTestResultRef hitTestResult, WKArrayRef defaultMenu, WKArrayRef* newMenu, WKTypeRef* userData, const void* clientInfo);
290
291 struct WKBundlePageContextMenuClient {
292     int                                                                 version;
293     const void *                                                        clientInfo;
294     WKBundlePageGetContextMenuFromDefaultContextMenuCallback            getContextMenuFromDefaultMenu;
295 };
296 typedef struct WKBundlePageContextMenuClient WKBundlePageContextMenuClient;
297
298 enum { kWKBundlePageContextMenuClientCurrentVersion = 0 };
299
300 // Full Screen client
301 typedef bool (*WKBundlePageSupportsFullScreen)(WKBundlePageRef page, WKFullScreenKeyboardRequestType requestType);
302 typedef void (*WKBundlePageEnterFullScreenForElement)(WKBundlePageRef page, WKBundleNodeHandleRef element);
303 typedef void (*WKBundlePageExitFullScreenForElement)(WKBundlePageRef page, WKBundleNodeHandleRef element);
304
305 struct WKBundlePageFullScreenClient {
306     int                                                                 version;
307     const void *                                                        clientInfo;
308     WKBundlePageSupportsFullScreen                                      supportsFullScreen;
309     WKBundlePageEnterFullScreenForElement                               enterFullScreenForElement;
310     WKBundlePageExitFullScreenForElement                                exitFullScreenForElement;
311 };
312 typedef struct WKBundlePageFullScreenClient WKBundlePageFullScreenClient;
313
314 enum { kWKBundlePageFullScreenClientCurrentVersion = 0 };
315
316 WK_EXPORT void WKBundlePageWillEnterFullScreen(WKBundlePageRef page);
317 WK_EXPORT void WKBundlePageDidEnterFullScreen(WKBundlePageRef page);
318 WK_EXPORT void WKBundlePageWillExitFullScreen(WKBundlePageRef page);
319 WK_EXPORT void WKBundlePageDidExitFullScreen(WKBundlePageRef page);
320
321 WK_EXPORT WKTypeID WKBundlePageGetTypeID();
322
323 WK_EXPORT void WKBundlePageSetContextMenuClient(WKBundlePageRef page, WKBundlePageContextMenuClient* client);
324 WK_EXPORT void WKBundlePageSetEditorClient(WKBundlePageRef page, WKBundlePageEditorClient* client);
325 WK_EXPORT void WKBundlePageSetFormClient(WKBundlePageRef page, WKBundlePageFormClient* client);
326 WK_EXPORT void WKBundlePageSetPageLoaderClient(WKBundlePageRef page, WKBundlePageLoaderClient* client);
327 WK_EXPORT void WKBundlePageSetResourceLoadClient(WKBundlePageRef page, WKBundlePageResourceLoadClient* client);
328 WK_EXPORT void WKBundlePageSetPolicyClient(WKBundlePageRef page, WKBundlePagePolicyClient* client);
329 WK_EXPORT void WKBundlePageSetUIClient(WKBundlePageRef page, WKBundlePageUIClient* client);
330     
331 WK_EXPORT void WKBundlePageSetFullScreenClient(WKBundlePageRef page, WKBundlePageFullScreenClient* client);
332
333 WK_EXPORT WKBundlePageGroupRef WKBundlePageGetPageGroup(WKBundlePageRef page);
334 WK_EXPORT WKBundleFrameRef WKBundlePageGetMainFrame(WKBundlePageRef page);
335
336 WK_EXPORT WKBundleBackForwardListRef WKBundlePageGetBackForwardList(WKBundlePageRef page);
337
338 WK_EXPORT void WKBundlePageSetUnderlayPage(WKBundlePageRef page, WKBundlePageRef pageUnderlay);
339
340 WK_EXPORT void WKBundlePageInstallPageOverlay(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay);
341 WK_EXPORT void WKBundlePageUninstallPageOverlay(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay);
342
343 WK_EXPORT bool WKBundlePageHasLocalDataForURL(WKBundlePageRef page, WKURLRef url);
344 WK_EXPORT bool WKBundlePageCanHandleRequest(WKURLRequestRef request);
345
346 WK_EXPORT bool WKBundlePageFindString(WKBundlePageRef page, WKStringRef target, WKFindOptions findOptions);
347
348 WK_EXPORT WKImageRef WKBundlePageCreateSnapshotInViewCoordinates(WKBundlePageRef page, WKRect rect, WKImageOptions options);
349 WK_EXPORT WKImageRef WKBundlePageCreateSnapshotInDocumentCoordinates(WKBundlePageRef page, WKRect rect, WKImageOptions options);
350 WK_EXPORT WKImageRef WKBundlePageCreateScaledSnapshotInDocumentCoordinates(WKBundlePageRef page, WKRect rect, double scaleFactor, WKImageOptions options);
351
352 WK_EXPORT double WKBundlePageGetBackingScaleFactor(WKBundlePageRef page);
353
354 #if defined(ENABLE_INSPECTOR) && ENABLE_INSPECTOR
355 WK_EXPORT WKBundleInspectorRef WKBundlePageGetInspector(WKBundlePageRef page);
356 #endif
357
358 #ifdef __cplusplus
359 }
360 #endif
361
362 #endif /* WKBundlePage_h */