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