430ffe83c56910bc7c1033b4b2597025b8abda84
[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
169 struct WKBundlePageResourceLoadClient {
170     int                                                                 version;
171     const void *                                                        clientInfo;
172
173     // Version 0.
174     WKBundlePageDidInitiateLoadForResourceCallback                      didInitiateLoadForResource;
175
176     // willSendRequestForFrame is supposed to return a retained reference to the URL request.
177     WKBundlePageWillSendRequestForFrameCallback                         willSendRequestForFrame;
178
179     WKBundlePageDidReceiveResponseForResourceCallback                   didReceiveResponseForResource;
180     WKBundlePageDidReceiveContentLengthForResourceCallback              didReceiveContentLengthForResource;
181     WKBundlePageDidFinishLoadForResourceCallback                        didFinishLoadForResource;
182     WKBundlePageDidFailLoadForResourceCallback                          didFailLoadForResource;
183
184     // Version 1.
185     WKBundlePageShouldCacheResponseCallback                             shouldCacheResponse;
186 };
187 typedef struct WKBundlePageResourceLoadClient WKBundlePageResourceLoadClient;
188
189 enum { kWKBundlePageResourceLoadClientCurrentVersion = 1 };
190
191 enum {
192     WKBundlePageUIElementVisibilityUnknown,
193     WKBundlePageUIElementVisible,
194     WKBundlePageUIElementHidden
195 };
196 typedef uint32_t WKBundlePageUIElementVisibility;
197     
198 // UI Client
199 typedef void (*WKBundlePageWillAddMessageToConsoleCallback)(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo);
200 typedef void (*WKBundlePageWillSetStatusbarTextCallback)(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo);
201 typedef void (*WKBundlePageWillRunJavaScriptAlertCallback)(WKBundlePageRef page, WKStringRef alertText, WKBundleFrameRef frame, const void *clientInfo);
202 typedef void (*WKBundlePageWillRunJavaScriptConfirmCallback)(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void *clientInfo);
203 typedef void (*WKBundlePageWillRunJavaScriptPromptCallback)(WKBundlePageRef page, WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef frame, const void *clientInfo);
204 typedef void (*WKBundlePageMouseDidMoveOverElementCallback)(WKBundlePageRef page, WKBundleHitTestResultRef hitTestResult, WKEventModifiers modifiers, WKTypeRef* userData, const void *clientInfo);
205 typedef void (*WKBundlePageDidScrollCallback)(WKBundlePageRef page, const void *clientInfo);
206 typedef void (*WKBundlePagePaintCustomOverhangAreaCallback)(WKBundlePageRef page, WKGraphicsContextRef graphicsContext, WKRect horizontalOverhang, WKRect verticalOverhang, WKRect dirtyRect, const void* clientInfo);
207 typedef WKStringRef (*WKBundlePageGenerateFileForUploadCallback)(WKBundlePageRef page, WKStringRef originalFilePath, const void* clientInfo);
208 typedef bool (*WKBundlePageShouldRubberBandInDirectionCallback)(WKBundlePageRef page, WKScrollDirection scrollDirection, const void* clientInfo);
209 typedef WKBundlePageUIElementVisibility (*WKBundlePageStatusBarIsVisibleCallback)(WKBundlePageRef page, const void *clientInfo);
210 typedef WKBundlePageUIElementVisibility (*WKBundlePageMenuBarIsVisibleCallback)(WKBundlePageRef page, const void *clientInfo);
211 typedef WKBundlePageUIElementVisibility (*WKBundlePageToolbarsAreVisibleCallback)(WKBundlePageRef page, const void *clientInfo);
212
213 struct WKBundlePageUIClient {
214     int                                                                 version;
215     const void *                                                        clientInfo;
216     WKBundlePageWillAddMessageToConsoleCallback                         willAddMessageToConsole;
217     WKBundlePageWillSetStatusbarTextCallback                            willSetStatusbarText;
218     WKBundlePageWillRunJavaScriptAlertCallback                          willRunJavaScriptAlert;
219     WKBundlePageWillRunJavaScriptConfirmCallback                        willRunJavaScriptConfirm;
220     WKBundlePageWillRunJavaScriptPromptCallback                         willRunJavaScriptPrompt;
221     WKBundlePageMouseDidMoveOverElementCallback                         mouseDidMoveOverElement;
222     WKBundlePageDidScrollCallback                                       pageDidScroll;
223     WKBundlePagePaintCustomOverhangAreaCallback                         paintCustomOverhangArea;
224     WKBundlePageGenerateFileForUploadCallback                           shouldGenerateFileForUpload;
225     WKBundlePageGenerateFileForUploadCallback                           generateFileForUpload;
226     WKBundlePageShouldRubberBandInDirectionCallback                     shouldRubberBandInDirection;
227     WKBundlePageStatusBarIsVisibleCallback                              statusBarIsVisible;
228     WKBundlePageMenuBarIsVisibleCallback                                menuBarIsVisible;
229     WKBundlePageToolbarsAreVisibleCallback                              toolbarsAreVisible;
230 };
231 typedef struct WKBundlePageUIClient WKBundlePageUIClient;
232
233 enum { kWKBundlePageUIClientCurrentVersion = 0 };
234
235 // Editor client
236 typedef bool (*WKBundlePageShouldBeginEditingCallback)(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo);
237 typedef bool (*WKBundlePageShouldEndEditingCallback)(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo);
238 typedef bool (*WKBundlePageShouldInsertNodeCallback)(WKBundlePageRef page, WKBundleNodeHandleRef node, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action, const void* clientInfo);
239 typedef bool (*WKBundlePageShouldInsertTextCallback)(WKBundlePageRef page, WKStringRef string, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action, const void* clientInfo);
240 typedef bool (*WKBundlePageShouldDeleteRangeCallback)(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo);
241 typedef bool (*WKBundlePageShouldChangeSelectedRange)(WKBundlePageRef page, WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType affinity, bool stillSelecting, const void* clientInfo);
242 typedef bool (*WKBundlePageShouldApplyStyle)(WKBundlePageRef page, WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range, const void* clientInfo);
243 typedef void (*WKBundlePageEditingNotification)(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo);
244
245 struct WKBundlePageEditorClient {
246     int                                                                 version;
247     const void *                                                        clientInfo;
248     WKBundlePageShouldBeginEditingCallback                              shouldBeginEditing;
249     WKBundlePageShouldEndEditingCallback                                shouldEndEditing;
250     WKBundlePageShouldInsertNodeCallback                                shouldInsertNode;
251     WKBundlePageShouldInsertTextCallback                                shouldInsertText;
252     WKBundlePageShouldDeleteRangeCallback                               shouldDeleteRange;
253     WKBundlePageShouldChangeSelectedRange                               shouldChangeSelectedRange;
254     WKBundlePageShouldApplyStyle                                        shouldApplyStyle;
255     WKBundlePageEditingNotification                                     didBeginEditing;
256     WKBundlePageEditingNotification                                     didEndEditing;
257     WKBundlePageEditingNotification                                     didChange;
258     WKBundlePageEditingNotification                                     didChangeSelection;
259 };
260 typedef struct WKBundlePageEditorClient WKBundlePageEditorClient;
261
262 enum { kWKBundlePageEditorClientCurrentVersion = 0 };
263
264 // Form client
265 typedef void (*WKBundlePageTextFieldDidBeginEditingCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKBundleFrameRef frame, const void* clientInfo);
266 typedef void (*WKBundlePageTextFieldDidEndEditingCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKBundleFrameRef frame, const void* clientInfo);
267 typedef void (*WKBundlePageTextDidChangeInTextFieldCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKBundleFrameRef frame, const void* clientInfo);
268 typedef void (*WKBundlePageTextDidChangeInTextAreaCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlTextAreaElementHandle, WKBundleFrameRef frame, const void* clientInfo);
269 typedef bool (*WKBundlePageShouldPerformActionInTextFieldCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlInputElementHandle, WKInputFieldActionType actionType, WKBundleFrameRef frame, const void* clientInfo);
270 typedef void (*WKBundlePageWillSubmitFormCallback)(WKBundlePageRef page, WKBundleNodeHandleRef htmlFormElementHandle, WKBundleFrameRef frame, WKBundleFrameRef sourceFrame, WKDictionaryRef values, WKTypeRef* userData, const void* clientInfo);
271
272 struct WKBundlePageFormClient {
273     int                                                                 version;
274     const void *                                                        clientInfo;
275     WKBundlePageTextFieldDidBeginEditingCallback                        textFieldDidBeginEditing;
276     WKBundlePageTextFieldDidEndEditingCallback                          textFieldDidEndEditing;
277     WKBundlePageTextDidChangeInTextFieldCallback                        textDidChangeInTextField;
278     WKBundlePageTextDidChangeInTextAreaCallback                         textDidChangeInTextArea;
279     WKBundlePageShouldPerformActionInTextFieldCallback                  shouldPerformActionInTextField;
280     WKBundlePageWillSubmitFormCallback                                  willSubmitForm;
281 };
282 typedef struct WKBundlePageFormClient WKBundlePageFormClient;
283
284 enum { kWKBundlePageFormClientCurrentVersion = 0 };
285
286 // ContextMenu client
287 typedef void (*WKBundlePageGetContextMenuFromDefaultContextMenuCallback)(WKBundlePageRef page, WKBundleHitTestResultRef hitTestResult, WKArrayRef defaultMenu, WKArrayRef* newMenu, WKTypeRef* userData, const void* clientInfo);
288
289 struct WKBundlePageContextMenuClient {
290     int                                                                 version;
291     const void *                                                        clientInfo;
292     WKBundlePageGetContextMenuFromDefaultContextMenuCallback            getContextMenuFromDefaultMenu;
293 };
294 typedef struct WKBundlePageContextMenuClient WKBundlePageContextMenuClient;
295
296 enum { kWKBundlePageContextMenuClientCurrentVersion = 0 };
297
298 // Full Screen client
299 typedef bool (*WKBundlePageSupportsFullScreen)(WKBundlePageRef page, WKFullScreenKeyboardRequestType requestType);
300 typedef void (*WKBundlePageEnterFullScreenForElement)(WKBundlePageRef page, WKBundleNodeHandleRef element);
301 typedef void (*WKBundlePageExitFullScreenForElement)(WKBundlePageRef page, WKBundleNodeHandleRef element);
302
303 struct WKBundlePageFullScreenClient {
304     int                                                                 version;
305     const void *                                                        clientInfo;
306     WKBundlePageSupportsFullScreen                                      supportsFullScreen;
307     WKBundlePageEnterFullScreenForElement                               enterFullScreenForElement;
308     WKBundlePageExitFullScreenForElement                                exitFullScreenForElement;
309 };
310 typedef struct WKBundlePageFullScreenClient WKBundlePageFullScreenClient;
311
312 enum { kWKBundlePageFullScreenClientCurrentVersion = 0 };
313
314 WK_EXPORT void WKBundlePageWillEnterFullScreen(WKBundlePageRef page);
315 WK_EXPORT void WKBundlePageDidEnterFullScreen(WKBundlePageRef page);
316 WK_EXPORT void WKBundlePageWillExitFullScreen(WKBundlePageRef page);
317 WK_EXPORT void WKBundlePageDidExitFullScreen(WKBundlePageRef page);
318
319 WK_EXPORT WKTypeID WKBundlePageGetTypeID();
320
321 WK_EXPORT void WKBundlePageSetContextMenuClient(WKBundlePageRef page, WKBundlePageContextMenuClient* client);
322 WK_EXPORT void WKBundlePageSetEditorClient(WKBundlePageRef page, WKBundlePageEditorClient* client);
323 WK_EXPORT void WKBundlePageSetFormClient(WKBundlePageRef page, WKBundlePageFormClient* client);
324 WK_EXPORT void WKBundlePageSetPageLoaderClient(WKBundlePageRef page, WKBundlePageLoaderClient* client);
325 WK_EXPORT void WKBundlePageSetResourceLoadClient(WKBundlePageRef page, WKBundlePageResourceLoadClient* client);
326 WK_EXPORT void WKBundlePageSetPolicyClient(WKBundlePageRef page, WKBundlePagePolicyClient* client);
327 WK_EXPORT void WKBundlePageSetUIClient(WKBundlePageRef page, WKBundlePageUIClient* client);
328     
329 WK_EXPORT void WKBundlePageSetFullScreenClient(WKBundlePageRef page, WKBundlePageFullScreenClient* client);
330
331 WK_EXPORT WKBundlePageGroupRef WKBundlePageGetPageGroup(WKBundlePageRef page);
332 WK_EXPORT WKBundleFrameRef WKBundlePageGetMainFrame(WKBundlePageRef page);
333
334 WK_EXPORT WKBundleBackForwardListRef WKBundlePageGetBackForwardList(WKBundlePageRef page);
335
336 WK_EXPORT void WKBundlePageSetUnderlayPage(WKBundlePageRef page, WKBundlePageRef pageUnderlay);
337
338 WK_EXPORT void WKBundlePageInstallPageOverlay(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay);
339 WK_EXPORT void WKBundlePageUninstallPageOverlay(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay);
340
341 WK_EXPORT bool WKBundlePageHasLocalDataForURL(WKBundlePageRef page, WKURLRef url);
342 WK_EXPORT bool WKBundlePageCanHandleRequest(WKURLRequestRef request);
343
344 WK_EXPORT bool WKBundlePageFindString(WKBundlePageRef page, WKStringRef target, WKFindOptions findOptions);
345
346 WK_EXPORT WKImageRef WKBundlePageCreateSnapshotInViewCoordinates(WKBundlePageRef page, WKRect rect, WKImageOptions options);
347 WK_EXPORT WKImageRef WKBundlePageCreateSnapshotInDocumentCoordinates(WKBundlePageRef page, WKRect rect, WKImageOptions options);
348 WK_EXPORT WKImageRef WKBundlePageCreateScaledSnapshotInDocumentCoordinates(WKBundlePageRef page, WKRect rect, double scaleFactor, WKImageOptions options);
349
350 WK_EXPORT double WKBundlePageGetBackingScaleFactor(WKBundlePageRef page);
351
352 #if defined(ENABLE_INSPECTOR) && ENABLE_INSPECTOR
353 WK_EXPORT WKBundleInspectorRef WKBundlePageGetInspector(WKBundlePageRef page);
354 #endif
355
356 #ifdef __cplusplus
357 }
358 #endif
359
360 #endif /* WKBundlePage_h */