1 /*
2 * Copyright (C) 2006 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
4 * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com> All rights reserved.
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 #include "config.h"
29 #include "ChromeClientHaiku.h"
30
31 #include "Frame.h"
32 #include "FrameLoadRequest.h"
33 #include "FrameView.h"
34 #include "HitTestResult.h"
35 #include "NotImplemented.h"
36 #include "PlatformString.h"
37
38 #include <Alert.h>
39 #include <String.h>
40
41
42 namespace WebCore {
43
ChromeClientHaiku()44 ChromeClientHaiku::ChromeClientHaiku()
45 {
46 }
47
~ChromeClientHaiku()48 ChromeClientHaiku::~ChromeClientHaiku()
49 {
50 }
51
chromeDestroyed()52 void ChromeClientHaiku::chromeDestroyed()
53 {
54 notImplemented();
55 }
56
setWindowRect(const FloatRect &)57 void ChromeClientHaiku::setWindowRect(const FloatRect&)
58 {
59 notImplemented();
60 }
61
windowRect()62 FloatRect ChromeClientHaiku::windowRect()
63 {
64 notImplemented();
65 return FloatRect(0, 0, 200, 200);
66 }
67
pageRect()68 FloatRect ChromeClientHaiku::pageRect()
69 {
70 notImplemented();
71 return FloatRect(0, 0, 200, 200);
72 }
73
scaleFactor()74 float ChromeClientHaiku::scaleFactor()
75 {
76 notImplemented();
77 return 1.0;
78 }
79
focus()80 void ChromeClientHaiku::focus()
81 {
82 notImplemented();
83 }
84
unfocus()85 void ChromeClientHaiku::unfocus()
86 {
87 notImplemented();
88 }
89
canTakeFocus(FocusDirection)90 bool ChromeClientHaiku::canTakeFocus(FocusDirection)
91 {
92 notImplemented();
93 return true;
94 }
95
takeFocus(FocusDirection)96 void ChromeClientHaiku::takeFocus(FocusDirection)
97 {
98 notImplemented();
99 }
100
createWindow(Frame *,const FrameLoadRequest &,const WebCore::WindowFeatures &)101 Page* ChromeClientHaiku::createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&)
102 {
103 notImplemented();
104 return 0;
105 }
106
createModalDialog(Frame *,const FrameLoadRequest &)107 Page* ChromeClientHaiku::createModalDialog(Frame*, const FrameLoadRequest&)
108 {
109 notImplemented();
110 return 0;
111 }
112
show()113 void ChromeClientHaiku::show()
114 {
115 notImplemented();
116 }
117
canRunModal()118 bool ChromeClientHaiku::canRunModal()
119 {
120 notImplemented();
121 return false;
122 }
123
runModal()124 void ChromeClientHaiku::runModal()
125 {
126 notImplemented();
127 }
128
setToolbarsVisible(bool)129 void ChromeClientHaiku::setToolbarsVisible(bool)
130 {
131 notImplemented();
132 }
133
toolbarsVisible()134 bool ChromeClientHaiku::toolbarsVisible()
135 {
136 notImplemented();
137 return false;
138 }
139
setStatusbarVisible(bool)140 void ChromeClientHaiku::setStatusbarVisible(bool)
141 {
142 notImplemented();
143 }
144
statusbarVisible()145 bool ChromeClientHaiku::statusbarVisible()
146 {
147 notImplemented();
148 return false;
149 }
150
setScrollbarsVisible(bool)151 void ChromeClientHaiku::setScrollbarsVisible(bool)
152 {
153 notImplemented();
154 }
155
scrollbarsVisible()156 bool ChromeClientHaiku::scrollbarsVisible()
157 {
158 notImplemented();
159 return true;
160 }
161
setMenubarVisible(bool)162 void ChromeClientHaiku::setMenubarVisible(bool)
163 {
164 notImplemented();
165 }
166
menubarVisible()167 bool ChromeClientHaiku::menubarVisible()
168 {
169 notImplemented();
170 return false;
171 }
172
setResizable(bool)173 void ChromeClientHaiku::setResizable(bool)
174 {
175 notImplemented();
176 }
177
addMessageToConsole(const String & message,unsigned int lineNumber,const String & sourceID)178 void ChromeClientHaiku::addMessageToConsole(const String& message, unsigned int lineNumber,
179 const String& sourceID)
180 {
181 printf("MESSAGE %s:%i %s\n", BString(sourceID).String(), lineNumber, BString(message).String());
182 }
183
addMessageToConsole(MessageSource,MessageLevel,const String & message,unsigned int lineNumber,const String & sourceID)184 void ChromeClientHaiku::addMessageToConsole(MessageSource, MessageLevel, const String& message,
185 unsigned int lineNumber, const String& sourceID)
186 {
187 printf("MESSAGE %s:%i %s\n", BString(sourceID).String(), lineNumber, BString(message).String());
188 }
189
addMessageToConsole(MessageSource,MessageType,MessageLevel,const String & message,unsigned int lineNumber,const String & sourceID)190 void ChromeClientHaiku::addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message,
191 unsigned int lineNumber, const String& sourceID)
192 {
193 printf("MESSAGE %s:%i %s\n", BString(sourceID).String(), lineNumber, BString(message).String());
194 }
195
canRunBeforeUnloadConfirmPanel()196 bool ChromeClientHaiku::canRunBeforeUnloadConfirmPanel()
197 {
198 notImplemented();
199 return false;
200 }
201
runBeforeUnloadConfirmPanel(const String & message,Frame * frame)202 bool ChromeClientHaiku::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
203 {
204 notImplemented();
205 return false;
206 }
207
closeWindowSoon()208 void ChromeClientHaiku::closeWindowSoon()
209 {
210 notImplemented();
211 }
212
runJavaScriptAlert(Frame *,const String & msg)213 void ChromeClientHaiku::runJavaScriptAlert(Frame*, const String& msg)
214 {
215 BAlert* alert = new BAlert("JavaScript", BString(msg).String(), "OK");
216 alert->Go();
217 }
218
runJavaScriptConfirm(Frame *,const String & msg)219 bool ChromeClientHaiku::runJavaScriptConfirm(Frame*, const String& msg)
220 {
221 BAlert* alert = new BAlert("JavaScript", BString(msg).String(), "Yes", "No");
222 return !alert->Go();
223 }
224
runJavaScriptPrompt(Frame *,const String & message,const String & defaultValue,String & result)225 bool ChromeClientHaiku::runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result)
226 {
227 notImplemented();
228 return false;
229 }
230
setStatusbarText(const String &)231 void ChromeClientHaiku::setStatusbarText(const String&)
232 {
233 notImplemented();
234 }
235
shouldInterruptJavaScript()236 bool ChromeClientHaiku::shouldInterruptJavaScript()
237 {
238 notImplemented();
239 return false;
240 }
241
tabsToLinks() const242 bool ChromeClientHaiku::tabsToLinks() const
243 {
244 return false;
245 }
246
windowResizerRect() const247 IntRect ChromeClientHaiku::windowResizerRect() const
248 {
249 return IntRect();
250 }
251
repaint(const IntRect &,bool contentChanged,bool immediate,bool repaintContentOnly)252 void ChromeClientHaiku::repaint(const IntRect&, bool contentChanged, bool immediate, bool repaintContentOnly)
253 {
254 notImplemented();
255 }
256
scroll(const IntSize & scrollDelta,const IntRect & rectToScroll,const IntRect & clipRect)257 void ChromeClientHaiku::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
258 {
259 notImplemented();
260 }
261
screenToWindow(const IntPoint &) const262 IntPoint ChromeClientHaiku::screenToWindow(const IntPoint&) const
263 {
264 notImplemented();
265 return IntPoint();
266 }
267
windowToScreen(const IntRect &) const268 IntRect ChromeClientHaiku::windowToScreen(const IntRect&) const
269 {
270 notImplemented();
271 return IntRect();
272 }
273
platformWindow() const274 PlatformWidget ChromeClientHaiku::platformWindow() const
275 {
276 notImplemented();
277 return PlatformWidget();
278 }
279
contentsSizeChanged(Frame *,const IntSize &) const280 void ChromeClientHaiku::contentsSizeChanged(Frame*, const IntSize&) const
281 {
282 notImplemented();
283 }
284
scrollRectIntoView(const IntRect &,const ScrollView *) const285 void ChromeClientHaiku::scrollRectIntoView(const IntRect&, const ScrollView*) const
286 {
287 notImplemented();
288 }
289
addToDirtyRegion(const IntRect &)290 void ChromeClientHaiku::addToDirtyRegion(const IntRect&)
291 {
292 }
293
scrollBackingStore(int,int,const IntRect &,const IntRect &)294 void ChromeClientHaiku::scrollBackingStore(int, int, const IntRect&, const IntRect&)
295 {
296 }
297
updateBackingStore()298 void ChromeClientHaiku::updateBackingStore()
299 {
300 }
301
mouseDidMoveOverElement(const HitTestResult & hit,unsigned)302 void ChromeClientHaiku::mouseDidMoveOverElement(const HitTestResult& hit, unsigned /*modifierFlags*/)
303 {
304 // Some extra info
305 notImplemented();
306 }
307
setToolTip(const String & tip)308 void ChromeClientHaiku::setToolTip(const String& tip)
309 {
310 notImplemented();
311 }
312
setToolTip(const String & tip,TextDirection)313 void ChromeClientHaiku::setToolTip(const String& tip, TextDirection)
314 {
315 notImplemented();
316 }
317
print(Frame *)318 void ChromeClientHaiku::print(Frame*)
319 {
320 notImplemented();
321 }
322
exceededDatabaseQuota(Frame *,const String & databaseName)323 void ChromeClientHaiku::exceededDatabaseQuota(Frame*, const String& databaseName)
324 {
325 notImplemented();
326 }
327
328 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
reachedMaxAppCacheSize(int64_t spaceNeeded)329 void ChromeClientWx::reachedMaxAppCacheSize(int64_t spaceNeeded)
330 {
331 notImplemented();
332 }
333 #endif
334
requestGeolocationPermissionForFrame(Frame *,Geolocation *)335 void ChromeClientHaiku::requestGeolocationPermissionForFrame(Frame*, Geolocation*)
336 {
337 notImplemented();
338 }
339
runOpenPanel(Frame *,PassRefPtr<FileChooser>)340 void ChromeClientHaiku::runOpenPanel(Frame*, PassRefPtr<FileChooser>)
341 {
342 notImplemented();
343 }
344
setCursor(PlatformCursorHandle)345 bool ChromeClientHaiku::setCursor(PlatformCursorHandle)
346 {
347 notImplemented();
348 return false;
349 }
350
351 // Notification that the given form element has changed. This function
352 // will be called frequently, so handling should be very fast.
formStateDidChange(const Node *)353 void ChromeClientHaiku::formStateDidChange(const Node*)
354 {
355 notImplemented();
356 }
357
createHTMLParserQuirks()358 PassOwnPtr<HTMLParserQuirks> ChromeClientHaiku::createHTMLParserQuirks()
359 {
360 notImplemented();
361 return 0;
362 }
363
364 } // namespace WebCore
365
366