1 /* 2 * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com> 3 * 4 * All rights reserved. 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 ChromeClientWx_H 29 #define ChromeClientWx_H 30 31 #include "ChromeClient.h" 32 #include "FocusDirection.h" 33 #include "IntRect.h" 34 #include "WebView.h" 35 36 namespace WebCore { 37 38 class ChromeClientWx : public ChromeClient { 39 public: 40 ChromeClientWx(wxWebView*); 41 virtual ~ChromeClientWx(); 42 virtual void chromeDestroyed(); 43 44 virtual void setWindowRect(const FloatRect&); 45 virtual FloatRect windowRect(); 46 47 virtual FloatRect pageRect(); 48 49 virtual float scaleFactor(); 50 51 virtual void focus(); 52 virtual void unfocus(); 53 54 virtual bool canTakeFocus(FocusDirection); 55 virtual void takeFocus(FocusDirection); 56 57 virtual void focusedNodeChanged(Node*); 58 59 virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&); 60 virtual Page* createModalDialog(Frame*, const FrameLoadRequest&); 61 virtual void show(); 62 63 virtual bool canRunModal(); 64 virtual void runModal(); 65 66 virtual void setToolbarsVisible(bool); 67 virtual bool toolbarsVisible(); 68 69 virtual void setStatusbarVisible(bool); 70 virtual bool statusbarVisible(); 71 72 virtual void setScrollbarsVisible(bool); 73 virtual bool scrollbarsVisible(); 74 75 virtual void setMenubarVisible(bool); 76 virtual bool menubarVisible(); 77 78 virtual void setResizable(bool); 79 80 virtual void addMessageToConsole(MessageSource source, 81 MessageType type, 82 MessageLevel level, 83 const String& message, 84 unsigned int lineNumber, 85 const String& sourceID); 86 87 virtual bool canRunBeforeUnloadConfirmPanel(); 88 virtual bool runBeforeUnloadConfirmPanel(const String& message, 89 Frame* frame); 90 91 virtual void closeWindowSoon(); 92 93 virtual void runJavaScriptAlert(Frame*, const String&); 94 virtual bool runJavaScriptConfirm(Frame*, const String&); 95 virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result); 96 virtual void setStatusbarText(const String&); 97 virtual bool shouldInterruptJavaScript(); 98 99 virtual bool tabsToLinks() const; 100 101 virtual IntRect windowResizerRect() const; 102 virtual void scrollBackingStore(int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect); 103 virtual void updateBackingStore(); 104 105 virtual void repaint(const IntRect&, bool contentChanged, bool immediate = false, bool repaintContentOnly = false); 106 virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); 107 virtual IntPoint screenToWindow(const IntPoint&) const; 108 virtual IntRect windowToScreen(const IntRect&) const; 109 virtual PlatformPageClient platformPageClient() const; 110 virtual void contentsSizeChanged(Frame*, const IntSize&) const; 111 scrollbarsModeDidChange()112 virtual void scrollbarsModeDidChange() const { } 113 virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags); 114 115 virtual void setToolTip(const String&, TextDirection); 116 117 virtual void print(Frame*); 118 119 #if ENABLE(DATABASE) 120 virtual void exceededDatabaseQuota(Frame*, const String&); 121 #endif 122 123 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 124 virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); 125 #endif 126 127 virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); 128 formStateDidChange(const Node *)129 virtual void formStateDidChange(const Node*) { } 130 createHTMLParserQuirks()131 virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() { return 0; } 132 133 virtual bool setCursor(PlatformCursorHandle); 134 scrollRectIntoView(const IntRect &,const ScrollView *)135 virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const {} 136 137 virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*); 138 139 private: 140 wxWebView* m_webView; 141 }; 142 143 } 144 #endif // ChromeClientWx_H 145