2 * Copyright (C) 2010 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
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.
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.
26 #ifndef WKPagePrivate_h
27 #define WKPagePrivate_h
29 #include <WebKit/WKBase.h>
30 #include <WebKit/WKPage.h>
36 typedef void (*WKPageRenderTreeExternalRepresentationFunction)(WKStringRef, WKErrorRef, void*);
37 WK_EXPORT void WKPageRenderTreeExternalRepresentation(WKPageRef page, void *context, WKPageRenderTreeExternalRepresentationFunction function);
40 kWKDebugFlashViewUpdates = 1 << 0,
41 kWKDebugFlashBackingStoreUpdates = 1 << 1
43 typedef unsigned WKPageDebugPaintFlags;
45 WK_EXPORT void WKPageSetDebugPaintFlags(WKPageDebugPaintFlags flags);
46 WK_EXPORT WKPageDebugPaintFlags WKPageGetDebugPaintFlags(void);
48 WK_EXPORT WKStringRef WKPageCopyStandardUserAgentWithApplicationName(WKStringRef);
51 kWKPaginationModeUnpaginated,
52 kWKPaginationModeLeftToRight,
53 kWKPaginationModeRightToLeft,
54 kWKPaginationModeTopToBottom,
55 kWKPaginationModeBottomToTop,
57 typedef uint32_t WKPaginationMode;
59 WK_EXPORT void WKPageSetPaginationMode(WKPageRef page, WKPaginationMode paginationMode);
60 WK_EXPORT WKPaginationMode WKPageGetPaginationMode(WKPageRef page);
61 WK_EXPORT void WKPageSetPaginationBehavesLikeColumns(WKPageRef page, bool behavesLikeColumns);
62 WK_EXPORT bool WKPageGetPaginationBehavesLikeColumns(WKPageRef page);
63 WK_EXPORT void WKPageSetPageLength(WKPageRef page, double pageLength);
64 WK_EXPORT double WKPageGetPageLength(WKPageRef page);
65 WK_EXPORT void WKPageSetGapBetweenPages(WKPageRef page, double gap);
66 WK_EXPORT double WKPageGetGapBetweenPages(WKPageRef page);
68 WK_EXPORT unsigned WKPageGetPageCount(WKPageRef page);
71 float pageSetupScaleFactor;
72 float availablePaperWidth;
73 float availablePaperHeight;
75 typedef struct WKPrintInfo WKPrintInfo;
77 typedef void (*WKPageComputePagesForPrintingFunction)(WKRect* pageRects, uint32_t pageCount, double resultPageScaleFactor, WKErrorRef error, void* functionContext);
78 WK_EXPORT void WKPageComputePagesForPrinting(WKPageRef page, WKFrameRef frame, WKPrintInfo, WKPageComputePagesForPrintingFunction, void* context);
80 typedef void (*WKPageDrawToPDFFunction)(WKDataRef data, WKErrorRef error, void* functionContext);
81 WK_EXPORT void WKPageBeginPrinting(WKPageRef page, WKFrameRef frame, WKPrintInfo printInfo);
82 WK_EXPORT void WKPageDrawPagesToPDF(WKPageRef page, WKFrameRef frame, WKPrintInfo printInfo, uint32_t first, uint32_t count, WKPageDrawToPDFFunction callback, void* context);
83 WK_EXPORT void WKPageEndPrinting(WKPageRef page);
85 WK_EXPORT void WKPageSetShouldSendEventsSynchronously(WKPageRef page, bool sync);
87 WK_EXPORT bool WKPageGetAllowsRemoteInspection(WKPageRef page);
88 WK_EXPORT void WKPageSetAllowsRemoteInspection(WKPageRef page, bool allow);
90 WK_EXPORT void WKPageSetMediaVolume(WKPageRef page, float volume);
91 WK_EXPORT void WKPageSetMayStartMediaWhenInWindow(WKPageRef page, bool mayStartMedia);
93 typedef void (*WKPageGetBytecodeProfileFunction)(WKStringRef, WKErrorRef, void*);
94 WK_EXPORT void WKPageGetBytecodeProfile(WKPageRef page, void* context, WKPageGetBytecodeProfileFunction function);
96 WK_EXPORT WKArrayRef WKPageCopyRelatedPages(WKPageRef page);
99 kWKScrollPinningBehaviorDoNotPin,
100 kWKScrollPinningBehaviorPinToTop,
101 kWKScrollPinningBehaviorPinToBottom
103 typedef uint32_t WKScrollPinningBehavior;
105 WK_EXPORT WKScrollPinningBehavior WKPageGetScrollPinningBehavior(WKPageRef page);
106 WK_EXPORT void WKPageSetScrollPinningBehavior(WKPageRef page, WKScrollPinningBehavior pinning);
108 WK_EXPORT bool WKPageGetAddsVisitedLinks(WKPageRef page);
109 WK_EXPORT void WKPageSetAddsVisitedLinks(WKPageRef page, bool visitedLinks);
111 WK_EXPORT bool WKPageIsPlayingAudio(WKPageRef page);
112 WK_EXPORT void WKPageSetMuted(WKPageRef page, bool muted);
114 WK_EXPORT void WKPageLoadURLWithShouldOpenExternalURLsPolicy(WKPageRef page, WKURLRef url, bool shouldOpenExternalURLs);
120 #endif /* WKPagePrivate_h */