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(const WebCore::String& message, unsigned int lineNumber, 71 const WebCore::String& sourceID); 72 73 virtual bool canRunBeforeUnloadConfirmPanel(); 74 virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame); 75 76 virtual void closeWindowSoon(); 77 78 virtual void runJavaScriptAlert(WebCore::Frame*, const WebCore::String&); 79 virtual bool runJavaScriptConfirm(WebCore::Frame*, const WebCore::String&); 80 virtual bool runJavaScriptPrompt(WebCore::Frame*, const WebCore::String& message, const WebCore::String& defaultValue, WebCore::String& result); 81 virtual void setStatusbarText(const WebCore::String&); 82 virtual bool shouldInterruptJavaScript(); 83 virtual bool tabsToLinks() const; 84 85 virtual WebCore::IntRect windowResizerRect() const; 86 87 virtual void repaint(const WebCore::IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false); 88 virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, const WebCore::IntRect& clipRect); 89 virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const; 90 virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const; 91 virtual PlatformWidget platformWindow() const; 92 virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const; 93 94 virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags); 95 96 virtual void setToolTip(const WebCore::String&); 97 98 virtual void print(WebCore::Frame*); 99 100 virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String&); 101 102 virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); 103 formStateDidChange(const WebCore::Node *)104 virtual void formStateDidChange(const WebCore::Node*) { } 105 106 private: 107 WebKitWebView* m_webView; 108 WebCore::KURL m_hoveredLinkURL; 109 }; 110 } 111 112 #endif // ChromeClient_h 113