| 1 | /* |
| 2 | * Copyright (C) 2011, 2017 Igalia S.L. |
| 3 | * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * 1. Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer in the |
| 12 | * documentation and/or other materials provided with the distribution. |
| 13 | * |
| 14 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' |
| 15 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 16 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 17 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
| 18 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 19 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 20 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 21 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 22 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 23 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 24 | * THE POSSIBILITY OF SUCH DAMAGE. |
| 25 | */ |
| 26 | |
| 27 | #pragma once |
| 28 | |
| 29 | #include "APIPageConfiguration.h" |
| 30 | #include "InstallMissingMediaPluginsPermissionRequest.h" |
| 31 | #include "WebContextMenuItemData.h" |
| 32 | #include "WebEvent.h" |
| 33 | #include "WebHitTestResultData.h" |
| 34 | #include "WebImage.h" |
| 35 | #include "WebKitWebView.h" |
| 36 | #include "WebPageProxy.h" |
| 37 | #include <WebCore/IntRect.h> |
| 38 | #include <WebCore/LinkIcon.h> |
| 39 | #include <wtf/CompletionHandler.h> |
| 40 | #include <wtf/text/CString.h> |
| 41 | |
| 42 | void webkitWebViewCreatePage(WebKitWebView*, Ref<API::PageConfiguration>&&); |
| 43 | WebKit::WebPageProxy& webkitWebViewGetPage(WebKitWebView*); |
| 44 | void webkitWebViewWillStartLoad(WebKitWebView*); |
| 45 | void webkitWebViewLoadChanged(WebKitWebView*, WebKitLoadEvent); |
| 46 | void webkitWebViewLoadFailed(WebKitWebView*, WebKitLoadEvent, const char* failingURI, GError*); |
| 47 | void webkitWebViewLoadFailedWithTLSErrors(WebKitWebView*, const char* failingURI, GError*, GTlsCertificateFlags, GTlsCertificate*); |
| 48 | #if PLATFORM(GTK) |
| 49 | void webkitWebViewGetLoadDecisionForIcon(WebKitWebView*, const WebCore::LinkIcon&, Function<void(bool)>&&); |
| 50 | void webkitWebViewSetIcon(WebKitWebView*, const WebCore::LinkIcon&, API::Data&); |
| 51 | #endif |
| 52 | WebKit::WebPageProxy* webkitWebViewCreateNewPage(WebKitWebView*, const WebCore::WindowFeatures&, WebKitNavigationAction*); |
| 53 | void webkitWebViewReadyToShowPage(WebKitWebView*); |
| 54 | void webkitWebViewRunAsModal(WebKitWebView*); |
| 55 | void webkitWebViewClosePage(WebKitWebView*); |
| 56 | void webkitWebViewRunJavaScriptAlert(WebKitWebView*, const CString& message, Function<void()>&& completionHandler); |
| 57 | void webkitWebViewRunJavaScriptConfirm(WebKitWebView*, const CString& message, Function<void(bool)>&& completionHandler); |
| 58 | void webkitWebViewRunJavaScriptPrompt(WebKitWebView*, const CString& message, const CString& defaultText, Function<void(const String&)>&& completionHandler); |
| 59 | void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView*, const CString& message, Function<void(bool)>&& completionHandler); |
| 60 | bool webkitWebViewIsShowingScriptDialog(WebKitWebView*); |
| 61 | bool webkitWebViewIsScriptDialogRunning(WebKitWebView*, WebKitScriptDialog*); |
| 62 | String webkitWebViewGetCurrentScriptDialogMessage(WebKitWebView*); |
| 63 | void webkitWebViewSetCurrentScriptDialogUserInput(WebKitWebView*, const String&); |
| 64 | void webkitWebViewAcceptCurrentScriptDialog(WebKitWebView*); |
| 65 | void webkitWebViewDismissCurrentScriptDialog(WebKitWebView*); |
| 66 | Optional<WebKitScriptDialogType> webkitWebViewGetCurrentScriptDialogType(WebKitWebView*); |
| 67 | void webkitWebViewMakePermissionRequest(WebKitWebView*, WebKitPermissionRequest*); |
| 68 | void webkitWebViewMakePolicyDecision(WebKitWebView*, WebKitPolicyDecisionType, WebKitPolicyDecision*); |
| 69 | void webkitWebViewMouseTargetChanged(WebKitWebView*, const WebKit::WebHitTestResultData&, OptionSet<WebKit::WebEvent::Modifier>); |
| 70 | void webkitWebViewHandleDownloadRequest(WebKitWebView*, WebKit::DownloadProxy*); |
| 71 | void webkitWebViewPrintFrame(WebKitWebView*, WebKit::WebFrameProxy*); |
| 72 | void webkitWebViewResourceLoadStarted(WebKitWebView*, WebKit::WebFrameProxy*, uint64_t resourceIdentifier, WebKitURIRequest*); |
| 73 | void webkitWebViewRunFileChooserRequest(WebKitWebView*, WebKitFileChooserRequest*); |
| 74 | WebKitWebResource* webkitWebViewGetLoadingWebResource(WebKitWebView*, uint64_t resourceIdentifier); |
| 75 | #if PLATFORM(GTK) |
| 76 | void webKitWebViewDidReceiveSnapshot(WebKitWebView*, uint64_t callbackID, WebKit::WebImage*); |
| 77 | #endif |
| 78 | void webkitWebViewRemoveLoadingWebResource(WebKitWebView*, uint64_t resourceIdentifier); |
| 79 | void webkitWebViewMaximizeWindow(WebKitWebView*, CompletionHandler<void()>&&); |
| 80 | void webkitWebViewMinimizeWindow(WebKitWebView*, CompletionHandler<void()>&&); |
| 81 | void webkitWebViewRestoreWindow(WebKitWebView*, CompletionHandler<void()>&&); |
| 82 | void webkitWebViewEnterFullScreen(WebKitWebView*); |
| 83 | void webkitWebViewExitFullScreen(WebKitWebView*); |
| 84 | void (WebKitWebView*, const Vector<WebKit::WebContextMenuItemData>& , const WebKit::WebHitTestResultData&, GVariant*); |
| 85 | void webkitWebViewSubmitFormRequest(WebKitWebView*, WebKitFormSubmissionRequest*); |
| 86 | void webkitWebViewHandleAuthenticationChallenge(WebKitWebView*, WebKit::AuthenticationChallengeProxy*); |
| 87 | void webkitWebViewInsecureContentDetected(WebKitWebView*, WebKitInsecureContentEvent); |
| 88 | bool webkitWebViewEmitShowNotification(WebKitWebView*, WebKitNotification*); |
| 89 | void webkitWebViewWebProcessTerminated(WebKitWebView*, WebKitWebProcessTerminationReason); |
| 90 | void webkitWebViewIsPlayingAudioChanged(WebKitWebView*); |
| 91 | void webkitWebViewSelectionDidChange(WebKitWebView*); |
| 92 | void webkitWebViewRequestInstallMissingMediaPlugins(WebKitWebView*, WebKit::InstallMissingMediaPluginsPermissionRequest&); |
| 93 | WebKitWebsiteDataManager* webkitWebViewGetWebsiteDataManager(WebKitWebView*); |
| 94 | |
| 95 | #if PLATFORM(GTK) |
| 96 | bool webkitWebViewEmitRunColorChooser(WebKitWebView*, WebKitColorChooserRequest*); |
| 97 | bool (WebKitWebView*, const WebCore::IntRect&, WebKitOptionMenu*, const GdkEvent*); |
| 98 | #endif |
| 99 | |
| 100 | gboolean webkitWebViewAuthenticate(WebKitWebView*, WebKitAuthenticationRequest*); |
| 101 | gboolean webkitWebViewScriptDialog(WebKitWebView*, WebKitScriptDialog*); |
| 102 | gboolean webkitWebViewRunFileChooser(WebKitWebView*, WebKitFileChooserRequest*); |
| 103 | |