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 <JavaScriptCore/JavaScript.h> 30#include <WebKit/WKBase.h> 31#include <WebKit/WKBundlePageContextMenuClient.h> 32#include <WebKit/WKBundlePageDiagnosticLoggingClient.h> 33#include <WebKit/WKBundlePageEditorClient.h> 34#include <WebKit/WKBundlePageFormClient.h> 35#include <WebKit/WKBundlePageFullScreenClient.h> 36#include <WebKit/WKBundlePageLoaderClient.h> 37#include <WebKit/WKBundlePagePolicyClient.h> 38#include <WebKit/WKBundlePageResourceLoadClient.h> 39#include <WebKit/WKBundlePageUIClient.h> 40#include <WebKit/WKFindOptions.h> 41#include <WebKit/WKImage.h> 42 43#ifndef __cplusplus 44#include <stdbool.h> 45#endif 46 47#include <stdint.h> 48 49#ifdef __cplusplus 50extern "C" { 51#endif 52 53WK_EXPORT void WKBundlePageWillEnterFullScreen(WKBundlePageRef page); 54WK_EXPORT void WKBundlePageDidEnterFullScreen(WKBundlePageRef page); 55WK_EXPORT void WKBundlePageWillExitFullScreen(WKBundlePageRef page); 56WK_EXPORT void WKBundlePageDidExitFullScreen(WKBundlePageRef page); 57 58WK_EXPORT WKTypeID WKBundlePageGetTypeID(); 59 60WK_EXPORT void WKBundlePageSetContextMenuClient(WKBundlePageRef page, WKBundlePageContextMenuClientBase* client); 61WK_EXPORT void WKBundlePageSetEditorClient(WKBundlePageRef page, WKBundlePageEditorClientBase* client); 62WK_EXPORT void WKBundlePageSetFormClient(WKBundlePageRef page, WKBundlePageFormClientBase* client); 63WK_EXPORT void WKBundlePageSetPageLoaderClient(WKBundlePageRef page, WKBundlePageLoaderClientBase* client); 64WK_EXPORT void WKBundlePageSetResourceLoadClient(WKBundlePageRef page, WKBundlePageResourceLoadClientBase* client); 65WK_EXPORT void WKBundlePageSetPolicyClient(WKBundlePageRef page, WKBundlePagePolicyClientBase* client); 66WK_EXPORT void WKBundlePageSetUIClient(WKBundlePageRef page, WKBundlePageUIClientBase* client); 67WK_EXPORT void WKBundlePageSetFullScreenClient(WKBundlePageRef page, WKBundlePageFullScreenClientBase* client); 68WK_EXPORT void WKBundlePageSetDiagnosticLoggingClient(WKBundlePageRef page, WKBundlePageDiagnosticLoggingClientBase* client); 69 70WK_EXPORT WKBundlePageGroupRef WKBundlePageGetPageGroup(WKBundlePageRef page); 71WK_EXPORT WKBundleFrameRef WKBundlePageGetMainFrame(WKBundlePageRef page); 72 73WK_EXPORT WKBundleBackForwardListRef WKBundlePageGetBackForwardList(WKBundlePageRef page); 74 75WK_EXPORT void WKBundlePageInstallPageOverlay(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay); 76WK_EXPORT void WKBundlePageUninstallPageOverlay(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay); 77 78WK_EXPORT void WKBundlePageInstallPageOverlayWithAnimation(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay); 79WK_EXPORT void WKBundlePageUninstallPageOverlayWithAnimation(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay); 80 81WK_EXPORT void WKBundlePageSetTopOverhangImage(WKBundlePageRef page, WKImageRef image); 82WK_EXPORT void WKBundlePageSetBottomOverhangImage(WKBundlePageRef page, WKImageRef image); 83 84#if !defined(TARGET_OS_IPHONE) || !TARGET_OS_IPHONE 85WK_EXPORT void WKBundlePageSetHeaderBanner(WKBundlePageRef page, WKBundlePageBannerRef banner); 86WK_EXPORT void WKBundlePageSetFooterBanner(WKBundlePageRef page, WKBundlePageBannerRef banner); 87#endif // !TARGET_OS_IPHONE 88 89WK_EXPORT bool WKBundlePageHasLocalDataForURL(WKBundlePageRef page, WKURLRef url); 90WK_EXPORT bool WKBundlePageCanHandleRequest(WKURLRequestRef request); 91 92WK_EXPORT bool WKBundlePageFindString(WKBundlePageRef page, WKStringRef target, WKFindOptions findOptions); 93 94WK_EXPORT WKImageRef WKBundlePageCreateSnapshotWithOptions(WKBundlePageRef page, WKRect rect, WKSnapshotOptions options); 95 96// We should deprecate these functions in favor of just using WKBundlePageCreateSnapshotWithOptions. 97WK_EXPORT WKImageRef WKBundlePageCreateSnapshotInViewCoordinates(WKBundlePageRef page, WKRect rect, WKImageOptions options); 98WK_EXPORT WKImageRef WKBundlePageCreateSnapshotInDocumentCoordinates(WKBundlePageRef page, WKRect rect, WKImageOptions options); 99 100// We should keep this function since it allows passing a scale factor, but we should re-name it to 101// WKBundlePageCreateScaledSnapshotWithOptions. 102WK_EXPORT WKImageRef WKBundlePageCreateScaledSnapshotInDocumentCoordinates(WKBundlePageRef page, WKRect rect, double scaleFactor, WKImageOptions options); 103 104WK_EXPORT double WKBundlePageGetBackingScaleFactor(WKBundlePageRef page); 105 106WK_EXPORT void WKBundlePageListenForLayoutMilestones(WKBundlePageRef page, WKLayoutMilestones milestones); 107 108WK_EXPORT WKBundleInspectorRef WKBundlePageGetInspector(WKBundlePageRef page); 109 110WK_EXPORT bool WKBundlePageIsUsingEphemeralSession(WKBundlePageRef page); 111 112#ifdef __cplusplus 113} 114#endif 115 116#endif /* WKBundlePage_h */ 117