|
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 invalidateWindow(const IntRect&, bool); |
|
106 virtual void invalidateContentsAndWindow(const IntRect&, bool); |
|
107 virtual void invalidateContentsForSlowScroll(const IntRect&, bool); |
|
108 virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); |
|
109 |
|
110 virtual IntPoint screenToWindow(const IntPoint&) const; |
|
111 virtual IntRect windowToScreen(const IntRect&) const; |
|
112 virtual PlatformPageClient platformPageClient() const; |
|
113 virtual void contentsSizeChanged(Frame*, const IntSize&) const; |
|
114 |
|
115 virtual void scrollbarsModeDidChange() const { } |
|
116 virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags); |
|
117 |
|
118 virtual void setToolTip(const String&, TextDirection); |
|
119 |
|
120 virtual void print(Frame*); |
|
121 |
|
122 #if ENABLE(DATABASE) |
|
123 virtual void exceededDatabaseQuota(Frame*, const String&); |
|
124 #endif |
|
125 |
|
126 #if ENABLE(OFFLINE_WEB_APPLICATIONS) |
|
127 virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); |
|
128 #endif |
|
129 |
|
130 virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); |
|
131 virtual void chooseIconForFiles(const Vector<String>&, FileChooser*); |
|
132 |
|
133 virtual void formStateDidChange(const Node*) { } |
|
134 |
|
135 virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks() { return 0; } |
|
136 |
|
137 virtual void setCursor(const Cursor&); |
|
138 |
|
139 virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const {} |
|
140 |
|
141 virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*); |
|
142 virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*) { } |
|
143 |
|
144 private: |
|
145 wxWebView* m_webView; |
|
146 }; |
|
147 |
|
148 } |
|
149 #endif // ChromeClientWx_H |