Home | History | Annotate | Download | only in WebCoreSupport
      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*);
     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 void focusedNodeChanged(WebCore::Node*);
     51 
     52         virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&);
     53         virtual void show();
     54 
     55         virtual bool canRunModal();
     56         virtual void runModal();
     57 
     58         virtual void setToolbarsVisible(bool);
     59         virtual bool toolbarsVisible();
     60 
     61         virtual void setStatusbarVisible(bool);
     62         virtual bool statusbarVisible();
     63 
     64         virtual void setScrollbarsVisible(bool);
     65         virtual bool scrollbarsVisible();
     66 
     67         virtual void setMenubarVisible(bool);
     68         virtual bool menubarVisible();
     69 
     70         virtual void setResizable(bool);
     71 
     72         virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type,
     73                                          WebCore::MessageLevel level, const WebCore::String& message,
     74                                          unsigned int lineNumber, const WebCore::String& sourceID);
     75 
     76         virtual bool canRunBeforeUnloadConfirmPanel();
     77         virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame);
     78 
     79         virtual void closeWindowSoon();
     80 
     81         virtual void runJavaScriptAlert(WebCore::Frame*, const WebCore::String&);
     82         virtual bool runJavaScriptConfirm(WebCore::Frame*, const WebCore::String&);
     83         virtual bool runJavaScriptPrompt(WebCore::Frame*, const WebCore::String& message, const WebCore::String& defaultValue, WebCore::String& result);
     84         virtual void setStatusbarText(const WebCore::String&);
     85         virtual bool shouldInterruptJavaScript();
     86         virtual bool tabsToLinks() const;
     87 
     88         virtual WebCore::IntRect windowResizerRect() const;
     89 
     90         virtual void repaint(const WebCore::IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
     91         virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, const WebCore::IntRect& clipRect);
     92         virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const;
     93         virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const;
     94         virtual PlatformPageClient platformPageClient() const;
     95         virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const;
     96 
     97         virtual void scrollbarsModeDidChange() const;
     98         virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags);
     99 
    100         virtual void setToolTip(const WebCore::String&, WebCore::TextDirection);
    101 
    102         virtual void print(WebCore::Frame*);
    103 #if ENABLE(DATABASE)
    104         virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String&);
    105 #endif
    106 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
    107         virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
    108 #endif
    109         virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
    110 
    111         virtual void formStateDidChange(const WebCore::Node*) { }
    112 
    113         virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks() { return 0; }
    114 
    115         virtual bool setCursor(WebCore::PlatformCursorHandle);
    116 
    117         virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const {}
    118         virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
    119 
    120     private:
    121         WebKitWebView* m_webView;
    122         WebCore::KURL m_hoveredLinkURL;
    123     };
    124 }
    125 
    126 #endif // ChromeClient_h
    127