OSDN Git Service

be9f6432abc2fd906bba5c2b1c8d31ea95526aa3
[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
55     // The Frame pointer provides the ChromeClient with context about which
56     // Frame wants to create the new Page.  Also, the newly created window
57     // should not be shown to the user until the ChromeClient of the newly
58     // created Page has its show method called.
59     virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&);
60     virtual void show();
61
62     virtual bool canRunModal();
63     virtual void runModal();
64
65     virtual void setToolbarsVisible(bool);
66     virtual bool toolbarsVisible();
67
68     virtual void setStatusbarVisible(bool);
69     virtual bool statusbarVisible();
70
71     virtual void setScrollbarsVisible(bool);
72     virtual bool scrollbarsVisible();
73
74     virtual void setMenubarVisible(bool);
75     virtual bool menubarVisible();
76
77     virtual void setResizable(bool);
78
79     virtual void addMessageToConsole(WebCore::MessageSource, WebCore::MessageType, WebCore::MessageLevel, const WTF::String& message, unsigned int lineNumber, const WTF::String& sourceID);
80
81     virtual bool canRunBeforeUnloadConfirmPanel();
82     virtual bool runBeforeUnloadConfirmPanel(const WTF::String& message, WebCore::Frame* frame);
83
84     virtual void closeWindowSoon();
85
86     virtual void runJavaScriptAlert(WebCore::Frame*, const WTF::String&);
87     virtual bool runJavaScriptConfirm(WebCore::Frame*, const WTF::String&);
88     virtual bool runJavaScriptPrompt(WebCore::Frame*, const WTF::String& message, const WTF::String& defaultValue, WTF::String& result);
89     virtual void setStatusbarText(const WTF::String&);
90     virtual bool shouldInterruptJavaScript();
91     virtual bool tabsToLinks() const;
92
93     virtual WebCore::IntRect windowResizerRect() const;
94
95     // Methods used by HostWindow.
96     virtual void invalidateWindow(const WebCore::IntRect&, bool);
97     virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
98     virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
99     virtual void scroll(const WebCore::IntSize&, const WebCore::IntRect&, const WebCore::IntRect&);
100     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const;
101     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const;
102     virtual PlatformPageClient platformPageClient() const;
103     virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const;
104     virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const; // Currently only Mac has a non empty implementation.
105     virtual void scrollbarsModeDidChange() const;
106     virtual void setCursor(const WebCore::Cursor&);
107     // End methods used by HostWindow.
108
109     virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);
110
111     virtual void setToolTip(const WTF::String&, WebCore::TextDirection);
112
113     virtual void print(WebCore::Frame*);
114
115 #if ENABLE(DATABASE)
116     virtual void exceededDatabaseQuota(WebCore::Frame*, const WTF::String& databaseName) = 0;
117 #endif
118
119 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
120     // Callback invoked when the application cache fails to save a cache object
121     // because storing it would grow the database file past its defined maximum
122     // size or past the amount of free space on the device.
123     // The chrome client would need to take some action such as evicting some
124     // old caches.
125     virtual void reachedMaxAppCacheSize(int64_t spaceNeeded) = 0;
126 #endif
127
128 #if ENABLE(NOTIFICATIONS)
129     virtual WebCore::NotificationPresenter* notificationPresenter() const = 0;
130 #endif
131
132     // This can be either a synchronous or asynchronous call. The ChromeClient can display UI asking the user for permission
133     // to use Geolocation.
134     virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
135     virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*);
136
137     virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
138     // Asynchronous request to load an icon for specified filenames.
139     virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*);
140
141     // Notification that the given form element has changed. This function
142     // will be called frequently, so handling should be very fast.
143     virtual void formStateDidChange(const WebCore::Node*);
144
145     virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks();
146
147 #if USE(ACCELERATED_COMPOSITING)
148     // Pass 0 as the GraphicsLayer to detatch the root layer.
149     virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*);
150     // Sets a flag to specify that the next time content is drawn to the window,
151     // the changes appear on the screen in synchrony with updates to GraphicsLayers.
152     virtual void setNeedsOneShotDrawingSynchronization();
153     // Sets a flag to specify that the view needs to be updated, so we need
154     // to do an eager layout before the drawing.
155     virtual void scheduleCompositingLayerSync();
156 #endif
157
158     virtual void setLastSetCursorToCurrentCursor();
159
160 #if ENABLE(TOUCH_EVENTS)
161     virtual void needTouchEvents(bool);
162 #endif
163
164     virtual bool selectItemWritingDirectionIsNatural();
165     virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const;
166     virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const;
167
168 private:
169     WebView* m_webView;
170 };
171
172 } // namespace WebKit
173
174 #endif // ChromeClientWinCE_h