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