Home | History | Annotate | Download | only in WebCoreSupport
      1 /*
      2  * Copyright (C) 2006 Zack Rusin <zack (at) kde.org>
      3  * Copyright (C) 2007 Ryan Leavengood <leavengood (at) gmail.com> All rights reserved.
      4  *
      5  *
      6  * Redistribution and use in source and binary forms, with or without
      7  * modification, are permitted provided that the following conditions
      8  * are met:
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  * 2. Redistributions in binary form must reproduce the above copyright
     12  *    notice, this list of conditions and the following disclaimer in the
     13  *    documentation and/or other materials provided with the distribution.
     14  *
     15  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
     16  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     18  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
     19  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     20  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     21  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
     22  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
     23  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     25  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26  */
     27 
     28 #ifndef ChromeClientHaiku_h
     29 #define ChromeClientHaiku_h
     30 
     31 #include "ChromeClient.h"
     32 #include "FloatRect.h"
     33 #include "RefCounted.h"
     34 
     35 namespace WebCore {
     36 
     37     class FloatRect;
     38     class Page;
     39     struct FrameLoadRequest;
     40 
     41     class ChromeClientHaiku : public ChromeClient {
     42     public:
     43         ChromeClientHaiku();
     44         virtual ~ChromeClientHaiku();
     45         void chromeDestroyed();
     46 
     47         void setWindowRect(const FloatRect&);
     48         FloatRect windowRect();
     49 
     50         FloatRect pageRect();
     51 
     52         float scaleFactor();
     53 
     54         void focus();
     55         void unfocus();
     56 
     57         bool canTakeFocus(FocusDirection);
     58         void takeFocus(FocusDirection);
     59 
     60         void focusedNodeChanged(Node*);
     61 
     62         Page* createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&);
     63         Page* createModalDialog(Frame*, const FrameLoadRequest&);
     64         void show();
     65 
     66         bool canRunModal();
     67         void runModal();
     68 
     69         void setToolbarsVisible(bool);
     70         bool toolbarsVisible();
     71 
     72         void setStatusbarVisible(bool);
     73         bool statusbarVisible();
     74 
     75         void setScrollbarsVisible(bool);
     76         bool scrollbarsVisible();
     77 
     78         void setMenubarVisible(bool);
     79         bool menubarVisible();
     80 
     81         void setResizable(bool);
     82 
     83         void addMessageToConsole(const String& message, unsigned int lineNumber,
     84                                  const String& sourceID);
     85         void addMessageToConsole(MessageSource, MessageLevel, const String& message,
     86                                  unsigned int lineNumber, const String& sourceID);
     87         void addMessageToConsole(MessageSource, MessageType, MessageLevel,
     88                                  const String&, unsigned int, const String&);
     89 
     90         bool canRunBeforeUnloadConfirmPanel();
     91 
     92         bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame);
     93 
     94         void closeWindowSoon();
     95 
     96         void runJavaScriptAlert(Frame*, const String&);
     97         bool runJavaScriptConfirm(Frame*, const String&);
     98         bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result);
     99         bool shouldInterruptJavaScript();
    100 
    101         void setStatusbarText(const WebCore::String&);
    102         bool tabsToLinks() const;
    103         IntRect windowResizerRect() const;
    104 
    105         void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false);
    106         void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
    107         IntPoint screenToWindow(const IntPoint&) const;
    108         IntRect windowToScreen(const IntRect&) const;
    109         PlatformPageClient platformPageClient() const;
    110         void contentsSizeChanged(Frame*, const IntSize&) const;
    111         void scrollRectIntoView(const IntRect&, const ScrollView*) const;
    112 
    113         void addToDirtyRegion(const IntRect&);
    114         void scrollBackingStore(int, int, const IntRect&, const IntRect&);
    115         void updateBackingStore();
    116 
    117         void scrollbarsModeDidChange() const { }
    118         void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
    119 
    120         void setToolTip(const String&);
    121 
    122         virtual void setToolTip(const String&, TextDirection);
    123 
    124         void print(Frame*);
    125 
    126         void exceededDatabaseQuota(Frame*, const String& databaseName);
    127 
    128 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
    129         virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
    130 #endif
    131 
    132         // This is an asynchronous call. The ChromeClient can display UI asking the user for permission
    133         // to use Geolococation. The ChromeClient must call Geolocation::setShouldClearCache() appropriately.
    134         void requestGeolocationPermissionForFrame(Frame*, Geolocation*);
    135 
    136         void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
    137 
    138         bool setCursor(PlatformCursorHandle);
    139 
    140         // Notification that the given form element has changed. This function
    141         // will be called frequently, so handling should be very fast.
    142         void formStateDidChange(const Node*);
    143 
    144         PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks();
    145     };
    146 
    147 } // namespace WebCore
    148 
    149 #endif
    150 
    151