OSDN Git Service

Merge WebKit at r71558: Initial merge by git.
[android-x86/external-webkit.git] / WebKit / wince / WebCoreSupport / ChromeClientWinCE.h
1 /*
2  * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
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 AND ITS CONTRIBUTORS "AS IS" AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16  * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
17  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  */
24
25 #ifndef ChromeClientWinCE_h
26 #define ChromeClientWinCE_h
27
28 #include "ChromeClient.h"
29
30 class WebView;
31
32 namespace WebKit {
33
34 class ChromeClientWinCE : public WebCore::ChromeClient {
35 public:
36     ChromeClientWinCE(WebView* webView);
37
38     virtual void chromeDestroyed();
39
40     virtual void setWindowRect(const WebCore::FloatRect&);
41     virtual WebCore::FloatRect windowRect();
42
43     virtual WebCore::FloatRect pageRect();
44
45     virtual float scaleFactor();
46
47     virtual void focus();
48     virtual void unfocus();
49
50     virtual bool canTakeFocus(WebCore::FocusDirection);
51     virtual void takeFocus(WebCore::FocusDirection);
52
53     virtual void focusedNodeChanged(WebCore::Node*);
54     virtual void focusedFrameChanged(Frame*);
55
56     // The Frame pointer provides the ChromeClient with context about which
57     // Frame wants to create the new Page.  Also, the newly created window
58     // should not be shown to the user until the ChromeClient of the newly
59     // created Page has its show method called.
60     virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&);
61     virtual void show();
62
63     virtual bool canRunModal();
64     virtual void runModal();
65
66     virtual void setToolbarsVisible(bool);
67     virtual bool toolbarsVisible();
68
69     virtual void setStatusbarVisible(bool);
70     virtual bool statusbarVisible();
71
72     virtual void setScrollbarsVisible(bool);
73     virtual bool scrollbarsVisible();
74
75     virtual void setMenubarVisible(bool);
76     virtual bool menubarVisible();
77
78     virtual void setResizable(bool);
79
80     virtual void addMessageToConsole(WebCore::MessageSource, WebCore::MessageType, WebCore::MessageLevel, const WTF::String& message, unsigned int lineNumber, const WTF::String& sourceID);
81
82     virtual bool canRunBeforeUnloadConfirmPanel();
83     virtual bool runBeforeUnloadConfirmPanel(const WTF::String& message, WebCore::Frame* frame);
84
85     virtual void closeWindowSoon();
86
87     virtual void runJavaScriptAlert(WebCore::Frame*, const WTF::String&);
88     virtual bool runJavaScriptConfirm(WebCore::Frame*, const WTF::String&);
89     virtual bool runJavaScriptPrompt(WebCore::Frame*, const WTF::String& message, const WTF::String& defaultValue, WTF::String& result);
90     virtual void setStatusbarText(const WTF::String&);
91     virtual bool shouldInterruptJavaScript();
92     virtual bool tabsToLinks() const;
93
94     virtual WebCore::IntRect windowResizerRect() const;
95
96     // Methods used by HostWindow.
97     virtual void invalidateWindow(const WebCore::IntRect&, bool);
98     virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
99     virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
100     virtual void scroll(const WebCore::IntSize&, const WebCore::IntRect&, const WebCore::IntRect&);
101     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const;
102     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const;
103     virtual PlatformPageClient platformPageClient() const;
104     virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const;
105     virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const; // Currently only Mac has a non empty implementation.
106     virtual void scrollbarsModeDidChange() const;
107     virtual void setCursor(const WebCore::Cursor&);
108     // End methods used by HostWindow.
109
110     virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);
111
112     virtual void setToolTip(const WTF::String&, WebCore::TextDirection);
113
114     virtual void print(WebCore::Frame*);
115
116 #if ENABLE(DATABASE)
117     virtual void exceededDatabaseQuota(WebCore::Frame*, const WTF::String& databaseName) = 0;
118 #endif
119
120 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
121     // Callback invoked when the application cache fails to save a cache object
122     // because storing it would grow the database file past its defined maximum
123     // size or past the amount of free space on the device.
124     // The chrome client would need to take some action such as evicting some
125     // old caches.
126     virtual void reachedMaxAppCacheSize(int64_t spaceNeeded) = 0;
127 #endif
128
129 #if ENABLE(CONTEXT_MENUS)
130     virtual void showContextMenu() { }
131 #endif
132
133 #if ENABLE(NOTIFICATIONS)
134     virtual WebCore::NotificationPresenter* notificationPresenter() const = 0;
135 #endif
136
137     // This can be either a synchronous or asynchronous call. The ChromeClient can display UI asking the user for permission
138     // to use Geolocation.
139     virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
140     virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*);
141
142     virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
143     // Asynchronous request to load an icon for specified filenames.
144     virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*);
145
146     // Notification that the given form element has changed. This function
147     // will be called frequently, so handling should be very fast.
148     virtual void formStateDidChange(const WebCore::Node*);
149
150     virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks();
151
152 #if USE(ACCELERATED_COMPOSITING)
153     // Pass 0 as the GraphicsLayer to detatch the root layer.
154     virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*);
155     // Sets a flag to specify that the next time content is drawn to the window,
156     // the changes appear on the screen in synchrony with updates to GraphicsLayers.
157     virtual void setNeedsOneShotDrawingSynchronization();
158     // Sets a flag to specify that the view needs to be updated, so we need
159     // to do an eager layout before the drawing.
160     virtual void scheduleCompositingLayerSync();
161 #endif
162
163     virtual void setLastSetCursorToCurrentCursor();
164
165 #if ENABLE(TOUCH_EVENTS)
166     virtual void needTouchEvents(bool);
167 #endif
168
169     virtual bool selectItemWritingDirectionIsNatural();
170     virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const;
171     virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const;
172
173 private:
174     WebView* m_webView;
175 };
176
177 } // namespace WebKit
178
179 #endif // ChromeClientWinCE_h