2 * Copyright (C) 2010, 2011 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.
29 #include "APIClient.h"
32 #include "WebHitTestResult.h"
33 #include "WebOpenPanelParameters.h"
34 #include <wtf/Forward.h>
35 #include <wtf/PassRefPtr.h>
40 class ResourceRequest;
41 struct WindowFeatures;
47 class GeolocationPermissionRequestProxy;
48 class NativeWebKeyboardEvent;
49 class NativeWebWheelEvent;
50 class NotificationPermissionRequest;
51 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
52 class WebColorPickerResultListenerProxy;
57 class WebSecurityOrigin;
58 class WebOpenPanelResultListenerProxy;
60 class WebUIClient : public APIClient<WKPageUIClient, kWKPageUIClientCurrentVersion> {
62 PassRefPtr<WebPageProxy> createNewPage(WebPageProxy*, const WebCore::ResourceRequest&, const WebCore::WindowFeatures&, WebEvent::Modifiers, WebMouseEvent::Button);
63 void showPage(WebPageProxy*);
64 void close(WebPageProxy*);
66 void takeFocus(WebPageProxy*, WKFocusDirection);
67 void focus(WebPageProxy*);
68 void unfocus(WebPageProxy*);
71 bool runJavaScriptAlert(WebPageProxy*, const String&, WebFrameProxy*);
72 bool runJavaScriptConfirm(WebPageProxy*, const String&, WebFrameProxy*);
73 bool runJavaScriptPrompt(WebPageProxy*, const String&, const String&, WebFrameProxy*);
75 void runJavaScriptAlert(WebPageProxy*, const String&, WebFrameProxy*);
76 bool runJavaScriptConfirm(WebPageProxy*, const String&, WebFrameProxy*);
77 String runJavaScriptPrompt(WebPageProxy*, const String&, const String&, WebFrameProxy*);
80 void setStatusText(WebPageProxy*, const String&);
81 void mouseDidMoveOverElement(WebPageProxy*, const WebHitTestResult::Data&, WebEvent::Modifiers, APIObject*);
82 void unavailablePluginButtonClicked(WebPageProxy*, WKPluginUnavailabilityReason, const String& mimeType, const String& url, const String& pluginsPageURL);
84 bool implementsDidNotHandleKeyEvent() const;
85 void didNotHandleKeyEvent(WebPageProxy*, const NativeWebKeyboardEvent&);
87 bool implementsDidNotHandleWheelEvent() const;
88 void didNotHandleWheelEvent(WebPageProxy*, const NativeWebWheelEvent&);
90 bool toolbarsAreVisible(WebPageProxy*);
91 void setToolbarsAreVisible(WebPageProxy*, bool);
92 bool menuBarIsVisible(WebPageProxy*);
93 void setMenuBarIsVisible(WebPageProxy*, bool);
94 bool statusBarIsVisible(WebPageProxy*);
95 void setStatusBarIsVisible(WebPageProxy*, bool);
96 bool isResizable(WebPageProxy*);
97 void setIsResizable(WebPageProxy*, bool);
99 void setWindowFrame(WebPageProxy*, const WebCore::FloatRect&);
100 WebCore::FloatRect windowFrame(WebPageProxy*);
102 bool canRunBeforeUnloadConfirmPanel() const;
103 bool runBeforeUnloadConfirmPanel(WebPageProxy*, const String&, WebFrameProxy*);
105 void didDraw(WebPageProxy*);
106 void pageDidScroll(WebPageProxy*);
108 #if ENABLE(TIZEN_SQL_DATABASE)
109 bool exceededDatabaseQuota(WebPageProxy*, WebFrameProxy*, WebSecurityOrigin*, const String& databaseDisplayName, unsigned long long expectedUsage);
111 unsigned long long exceededDatabaseQuota(WebPageProxy*, WebFrameProxy*, WebSecurityOrigin*, const String& databaseName, const String& databaseDisplayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage);
114 bool runOpenPanel(WebPageProxy*, WebFrameProxy*, WebOpenPanelParameters*, WebOpenPanelResultListenerProxy*);
115 bool decidePolicyForGeolocationPermissionRequest(WebPageProxy*, WebFrameProxy*, WebSecurityOrigin*, GeolocationPermissionRequestProxy*);
116 bool decidePolicyForNotificationPermissionRequest(WebPageProxy*, WebSecurityOrigin*, NotificationPermissionRequest*);
119 float headerHeight(WebPageProxy*, WebFrameProxy*);
120 float footerHeight(WebPageProxy*, WebFrameProxy*);
121 void drawHeader(WebPageProxy*, WebFrameProxy*, const WebCore::FloatRect&);
122 void drawFooter(WebPageProxy*, WebFrameProxy*, const WebCore::FloatRect&);
123 void printFrame(WebPageProxy*, WebFrameProxy*);
125 bool canRunModal() const;
126 void runModal(WebPageProxy*);
128 void saveDataToFileInDownloadsFolder(WebPageProxy*, const String& suggestedFilename, const String& mimeType, const String& originatingURLString, WebData*);
130 bool shouldInterruptJavaScript(WebPageProxy*);
132 #if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
133 #if ENABLE(INPUT_TYPE_COLOR)
134 bool showColorPicker(WebPageProxy*, const String&, WebColorPickerResultListenerProxy*);
135 bool hideColorPicker(WebPageProxy*);
140 } // namespace WebKit
142 #endif // WebUIClient_h