• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2007 Holger Hans Peter Freyther
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef ChromeClientGtk_h
21 #define ChromeClientGtk_h
22 
23 #include "ChromeClient.h"
24 #include "KURL.h"
25 
26 typedef struct _WebKitWebView WebKitWebView;
27 
28 namespace WebKit {
29 
30     class ChromeClient : public WebCore::ChromeClient {
31     public:
32         ChromeClient(WebKitWebView*);
webView()33         WebKitWebView* webView() const { return m_webView; }
34 
35         virtual void chromeDestroyed();
36 
37         virtual void setWindowRect(const WebCore::FloatRect&);
38         virtual WebCore::FloatRect windowRect();
39 
40         virtual WebCore::FloatRect pageRect();
41 
42         virtual float scaleFactor();
43 
44         virtual void focus();
45         virtual void unfocus();
46 
47         virtual bool canTakeFocus(WebCore::FocusDirection);
48         virtual void takeFocus(WebCore::FocusDirection);
49 
50         virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&);
51         virtual void show();
52 
53         virtual bool canRunModal();
54         virtual void runModal();
55 
56         virtual void setToolbarsVisible(bool);
57         virtual bool toolbarsVisible();
58 
59         virtual void setStatusbarVisible(bool);
60         virtual bool statusbarVisible();
61 
62         virtual void setScrollbarsVisible(bool);
63         virtual bool scrollbarsVisible();
64 
65         virtual void setMenubarVisible(bool);
66         virtual bool menubarVisible();
67 
68         virtual void setResizable(bool);
69 
70         virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type,
71                                          WebCore::MessageLevel level, const WebCore::String& message,
72                                          unsigned int lineNumber, const WebCore::String& sourceID);
73 
74         virtual bool canRunBeforeUnloadConfirmPanel();
75         virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame);
76 
77         virtual void closeWindowSoon();
78 
79         virtual void runJavaScriptAlert(WebCore::Frame*, const WebCore::String&);
80         virtual bool runJavaScriptConfirm(WebCore::Frame*, const WebCore::String&);
81         virtual bool runJavaScriptPrompt(WebCore::Frame*, const WebCore::String& message, const WebCore::String& defaultValue, WebCore::String& result);
82         virtual void setStatusbarText(const WebCore::String&);
83         virtual bool shouldInterruptJavaScript();
84         virtual bool tabsToLinks() const;
85 
86         virtual WebCore::IntRect windowResizerRect() const;
87 
88         virtual void repaint(const WebCore::IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
89         virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, const WebCore::IntRect& clipRect);
90         virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const;
91         virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const;
92         virtual PlatformWidget platformWindow() const;
93         virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const;
94 
95         virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);
96 
97         virtual void setToolTip(const WebCore::String&, WebCore::TextDirection);
98 
99         virtual void print(WebCore::Frame*);
100 #if ENABLE(DATABASE)
101         virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String&);
102 #endif
103 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
104         virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
105 #endif
106         virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
107 
formStateDidChange(const WebCore::Node *)108         virtual void formStateDidChange(const WebCore::Node*) { }
109 
createHTMLParserQuirks()110         virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
111 
112         virtual bool setCursor(WebCore::PlatformCursorHandle);
113 
scrollRectIntoView(const WebCore::IntRect &,const WebCore::ScrollView *)114         virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const {}
115         virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
116 
117     private:
118         WebKitWebView* m_webView;
119         WebCore::KURL m_hoveredLinkURL;
120     };
121 }
122 
123 #endif // ChromeClient_h
124