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
42void webkitWebViewCreatePage(WebKitWebView*, Ref<API::PageConfiguration>&&);
43WebKit::WebPageProxy& webkitWebViewGetPage(WebKitWebView*);
44void webkitWebViewWillStartLoad(WebKitWebView*);
45void webkitWebViewLoadChanged(WebKitWebView*, WebKitLoadEvent);
46void webkitWebViewLoadFailed(WebKitWebView*, WebKitLoadEvent, const char* failingURI, GError*);
47void webkitWebViewLoadFailedWithTLSErrors(WebKitWebView*, const char* failingURI, GError*, GTlsCertificateFlags, GTlsCertificate*);
48#if PLATFORM(GTK)
49void webkitWebViewGetLoadDecisionForIcon(WebKitWebView*, const WebCore::LinkIcon&, Function<void(bool)>&&);
50void webkitWebViewSetIcon(WebKitWebView*, const WebCore::LinkIcon&, API::Data&);
51#endif
52WebKit::WebPageProxy* webkitWebViewCreateNewPage(WebKitWebView*, const WebCore::WindowFeatures&, WebKitNavigationAction*);
53void webkitWebViewReadyToShowPage(WebKitWebView*);
54void webkitWebViewRunAsModal(WebKitWebView*);
55void webkitWebViewClosePage(WebKitWebView*);
56void webkitWebViewRunJavaScriptAlert(WebKitWebView*, const CString& message, Function<void()>&& completionHandler);
57void webkitWebViewRunJavaScriptConfirm(WebKitWebView*, const CString& message, Function<void(bool)>&& completionHandler);
58void webkitWebViewRunJavaScriptPrompt(WebKitWebView*, const CString& message, const CString& defaultText, Function<void(const String&)>&& completionHandler);
59void webkitWebViewRunJavaScriptBeforeUnloadConfirm(WebKitWebView*, const CString& message, Function<void(bool)>&& completionHandler);
60bool webkitWebViewIsShowingScriptDialog(WebKitWebView*);
61bool webkitWebViewIsScriptDialogRunning(WebKitWebView*, WebKitScriptDialog*);
62String webkitWebViewGetCurrentScriptDialogMessage(WebKitWebView*);
63void webkitWebViewSetCurrentScriptDialogUserInput(WebKitWebView*, const String&);
64void webkitWebViewAcceptCurrentScriptDialog(WebKitWebView*);
65void webkitWebViewDismissCurrentScriptDialog(WebKitWebView*);
66Optional<WebKitScriptDialogType> webkitWebViewGetCurrentScriptDialogType(WebKitWebView*);
67void webkitWebViewMakePermissionRequest(WebKitWebView*, WebKitPermissionRequest*);
68void webkitWebViewMakePolicyDecision(WebKitWebView*, WebKitPolicyDecisionType, WebKitPolicyDecision*);
69void webkitWebViewMouseTargetChanged(WebKitWebView*, const WebKit::WebHitTestResultData&, OptionSet<WebKit::WebEvent::Modifier>);
70void webkitWebViewHandleDownloadRequest(WebKitWebView*, WebKit::DownloadProxy*);
71void webkitWebViewPrintFrame(WebKitWebView*, WebKit::WebFrameProxy*);
72void webkitWebViewResourceLoadStarted(WebKitWebView*, WebKit::WebFrameProxy*, uint64_t resourceIdentifier, WebKitURIRequest*);
73void webkitWebViewRunFileChooserRequest(WebKitWebView*, WebKitFileChooserRequest*);
74WebKitWebResource* webkitWebViewGetLoadingWebResource(WebKitWebView*, uint64_t resourceIdentifier);
75#if PLATFORM(GTK)
76void webKitWebViewDidReceiveSnapshot(WebKitWebView*, uint64_t callbackID, WebKit::WebImage*);
77#endif
78void webkitWebViewRemoveLoadingWebResource(WebKitWebView*, uint64_t resourceIdentifier);
79void webkitWebViewMaximizeWindow(WebKitWebView*, CompletionHandler<void()>&&);
80void webkitWebViewMinimizeWindow(WebKitWebView*, CompletionHandler<void()>&&);
81void webkitWebViewRestoreWindow(WebKitWebView*, CompletionHandler<void()>&&);
82void webkitWebViewEnterFullScreen(WebKitWebView*);
83void webkitWebViewExitFullScreen(WebKitWebView*);
84void webkitWebViewPopulateContextMenu(WebKitWebView*, const Vector<WebKit::WebContextMenuItemData>& proposedMenu, const WebKit::WebHitTestResultData&, GVariant*);
85void webkitWebViewSubmitFormRequest(WebKitWebView*, WebKitFormSubmissionRequest*);
86void webkitWebViewHandleAuthenticationChallenge(WebKitWebView*, WebKit::AuthenticationChallengeProxy*);
87void webkitWebViewInsecureContentDetected(WebKitWebView*, WebKitInsecureContentEvent);
88bool webkitWebViewEmitShowNotification(WebKitWebView*, WebKitNotification*);
89void webkitWebViewWebProcessTerminated(WebKitWebView*, WebKitWebProcessTerminationReason);
90void webkitWebViewIsPlayingAudioChanged(WebKitWebView*);
91void webkitWebViewSelectionDidChange(WebKitWebView*);
92void webkitWebViewRequestInstallMissingMediaPlugins(WebKitWebView*, WebKit::InstallMissingMediaPluginsPermissionRequest&);
93WebKitWebsiteDataManager* webkitWebViewGetWebsiteDataManager(WebKitWebView*);
94
95#if PLATFORM(GTK)
96bool webkitWebViewEmitRunColorChooser(WebKitWebView*, WebKitColorChooserRequest*);
97bool webkitWebViewShowOptionMenu(WebKitWebView*, const WebCore::IntRect&, WebKitOptionMenu*, const GdkEvent*);
98#endif
99
100gboolean webkitWebViewAuthenticate(WebKitWebView*, WebKitAuthenticationRequest*);
101gboolean webkitWebViewScriptDialog(WebKitWebView*, WebKitScriptDialog*);
102gboolean webkitWebViewRunFileChooser(WebKitWebView*, WebKitFileChooserRequest*);
103