From d8543bb6618c17b12da906afa77d216f58cf4058 Mon Sep 17 00:00:00 2001 From: Upstream Date: Mon, 12 Jan 1970 13:46:40 +0000 Subject: external/webkit r30707 --- WebKit/wx/WebKitSupport/ChromeClientWx.cpp | 322 +++++++++ WebKit/wx/WebKitSupport/ChromeClientWx.h | 114 +++ WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp | 86 +++ WebKit/wx/WebKitSupport/ContextMenuClientWx.h | 55 ++ WebKit/wx/WebKitSupport/DragClientWx.cpp | 75 ++ WebKit/wx/WebKitSupport/DragClientWx.h | 45 ++ WebKit/wx/WebKitSupport/EditorClientWx.cpp | 390 ++++++++++ WebKit/wx/WebKitSupport/EditorClientWx.h | 110 +++ WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp | 906 ++++++++++++++++++++++++ WebKit/wx/WebKitSupport/FrameLoaderClientWx.h | 225 ++++++ WebKit/wx/WebKitSupport/InspectorClientWx.cpp | 97 +++ WebKit/wx/WebKitSupport/InspectorClientWx.h | 62 ++ 12 files changed, 2487 insertions(+) create mode 100644 WebKit/wx/WebKitSupport/ChromeClientWx.cpp create mode 100644 WebKit/wx/WebKitSupport/ChromeClientWx.h create mode 100644 WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp create mode 100644 WebKit/wx/WebKitSupport/ContextMenuClientWx.h create mode 100644 WebKit/wx/WebKitSupport/DragClientWx.cpp create mode 100644 WebKit/wx/WebKitSupport/DragClientWx.h create mode 100644 WebKit/wx/WebKitSupport/EditorClientWx.cpp create mode 100644 WebKit/wx/WebKitSupport/EditorClientWx.h create mode 100644 WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp create mode 100644 WebKit/wx/WebKitSupport/FrameLoaderClientWx.h create mode 100644 WebKit/wx/WebKitSupport/InspectorClientWx.cpp create mode 100644 WebKit/wx/WebKitSupport/InspectorClientWx.h (limited to 'WebKit/wx/WebKitSupport') diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp new file mode 100644 index 0000000..579e3f9 --- /dev/null +++ b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp @@ -0,0 +1,322 @@ +/* + * Copyright (C) 2007 Kevin Ollivier + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "ChromeClientWx.h" +#include "FloatRect.h" +#include "FrameLoadRequest.h" +#include "NotImplemented.h" +#include "PlatformString.h" + +#include + +#include +#ifndef WX_PRECOMP + #include +#endif +#include + +#include "WebFrame.h" +#include "WebView.h" +#include "WebViewPrivate.h" + +namespace WebCore { + +ChromeClientWx::ChromeClientWx(wxWebView* webView) +{ + m_webView = webView; +} + +ChromeClientWx::~ChromeClientWx() +{ +} + +void ChromeClientWx::chromeDestroyed() +{ + notImplemented(); +} + +void ChromeClientWx::setWindowRect(const FloatRect&) +{ + notImplemented(); +} + +FloatRect ChromeClientWx::windowRect() +{ + notImplemented(); + return FloatRect(); +} + +FloatRect ChromeClientWx::pageRect() +{ + notImplemented(); + return FloatRect(); +} + +float ChromeClientWx::scaleFactor() +{ + notImplemented(); + return 0.0; +} + +void ChromeClientWx::focus() +{ + notImplemented(); +} + +void ChromeClientWx::unfocus() +{ + notImplemented(); +} + +bool ChromeClientWx::canTakeFocus(FocusDirection) +{ + notImplemented(); + return false; +} + +void ChromeClientWx::takeFocus(FocusDirection) +{ + notImplemented(); +} + + +Page* ChromeClientWx::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures&) +{ + + // FIXME: Create a EVT_WEBKIT_NEW_WINDOW event, and only run this code + // when that event is not handled. + + Page* myPage = 0; + wxWebFrame* newFrame = new wxWebFrame(wxTheApp->GetAppName()); + + if (newFrame->webview) { + newFrame->webview->LoadURL(request.resourceRequest().url().string()); + newFrame->Show(true); + + WebViewPrivate* impl = newFrame->webview->m_impl; + if (impl) + myPage = impl->frame->page(); + } + + return myPage; +} + +Page* ChromeClientWx::createModalDialog(Frame*, const FrameLoadRequest&) +{ + notImplemented(); + return 0; +} + +void ChromeClientWx::show() +{ + notImplemented(); +} + +bool ChromeClientWx::canRunModal() +{ + notImplemented(); + return false; +} + +void ChromeClientWx::runModal() +{ + notImplemented(); +} + +void ChromeClientWx::setToolbarsVisible(bool) +{ + notImplemented(); +} + +bool ChromeClientWx::toolbarsVisible() +{ + notImplemented(); + return false; +} + +void ChromeClientWx::setStatusbarVisible(bool) +{ + notImplemented(); +} + +bool ChromeClientWx::statusbarVisible() +{ + notImplemented(); + return false; +} + +void ChromeClientWx::setScrollbarsVisible(bool) +{ + notImplemented(); +} + +bool ChromeClientWx::scrollbarsVisible() +{ + notImplemented(); + return false; +} + +void ChromeClientWx::setMenubarVisible(bool) +{ + notImplemented(); +} + +bool ChromeClientWx::menubarVisible() +{ + notImplemented(); + return false; +} + +void ChromeClientWx::setResizable(bool) +{ + notImplemented(); +} + +void ChromeClientWx::addMessageToConsole(const String& message, + unsigned int lineNumber, + const String& sourceID) +{ + if (m_webView) { + wxWebViewConsoleMessageEvent wkEvent(m_webView); + wkEvent.SetMessage(message); + wkEvent.SetLineNumber(lineNumber); + wkEvent.SetSourceID(sourceID); + m_webView->GetEventHandler()->ProcessEvent(wkEvent); + } +} + +bool ChromeClientWx::canRunBeforeUnloadConfirmPanel() +{ + notImplemented(); + return true; +} + +bool ChromeClientWx::runBeforeUnloadConfirmPanel(const String& string, + Frame* frame) +{ + wxMessageDialog dialog(NULL, string, wxT("Confirm Action?"), wxYES_NO); + return dialog.ShowModal() == wxYES; +} + +void ChromeClientWx::closeWindowSoon() +{ + notImplemented(); +} + +/* + Sites for testing prompts: + Alert - just type in a bad web address or http://www.htmlite.com/JS002.php + Prompt - http://www.htmlite.com/JS007.php + Confirm - http://www.htmlite.com/JS006.php +*/ + +void ChromeClientWx::runJavaScriptAlert(Frame* frame, const String& string) +{ + wxMessageBox(string, wxT("JavaScript Alert"), wxOK); +} + +bool ChromeClientWx::runJavaScriptConfirm(Frame* frame, const String& string) +{ + wxMessageDialog dialog(NULL, string, wxT("JavaScript Confirm"), wxYES_NO); + dialog.Centre(); + return (dialog.ShowModal() == wxID_YES); +} + +bool ChromeClientWx::runJavaScriptPrompt(Frame* frame, const String& message, const String& defaultValue, String& result) +{ + wxTextEntryDialog dialog(NULL, message, wxT("JavaScript Prompt"), wxEmptyString, wxOK | wxCANCEL); + dialog.Centre(); + if (dialog.ShowModal() == wxID_OK) { + result = dialog.GetValue(); + return true; + } + + return false; +} + +void ChromeClientWx::setStatusbarText(const String&) +{ + notImplemented(); +} + +bool ChromeClientWx::shouldInterruptJavaScript() +{ + notImplemented(); + return false; +} + +bool ChromeClientWx::tabsToLinks() const +{ + notImplemented(); + return false; +} + +IntRect ChromeClientWx::windowResizerRect() const +{ + notImplemented(); + return IntRect(); +} + +void ChromeClientWx::addToDirtyRegion(const IntRect&) +{ + notImplemented(); +} + +void ChromeClientWx::scrollBackingStore(int dx, int dy, + const IntRect& scrollViewRect, + const IntRect& clipRect) +{ + notImplemented(); +} + +void ChromeClientWx::updateBackingStore() +{ + notImplemented(); +} + +void ChromeClientWx::mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags) +{ + notImplemented(); +} + +void ChromeClientWx::setToolTip(const String&) +{ + notImplemented(); +} + +void ChromeClientWx::print(Frame*) +{ + notImplemented(); +} + +void ChromeClientWx::exceededDatabaseQuota(Frame*, const String&) +{ + notImplemented(); +} + +} diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.h b/WebKit/wx/WebKitSupport/ChromeClientWx.h new file mode 100644 index 0000000..d80f3f2 --- /dev/null +++ b/WebKit/wx/WebKitSupport/ChromeClientWx.h @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2007 Kevin Ollivier + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ChromeClientWx_H +#define ChromeClientWx_H + +#include "ChromeClient.h" +#include "FocusDirection.h" +#include "IntRect.h" +#include "WebView.h" + +namespace WebCore { + +class ChromeClientWx : public ChromeClient { +public: + ChromeClientWx(wxWebView*); + virtual ~ChromeClientWx(); + virtual void chromeDestroyed(); + + virtual void setWindowRect(const FloatRect&); + virtual FloatRect windowRect(); + + virtual FloatRect pageRect(); + + virtual float scaleFactor(); + + virtual void focus(); + virtual void unfocus(); + + virtual bool canTakeFocus(FocusDirection); + virtual void takeFocus(FocusDirection); + + virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&); + virtual Page* createModalDialog(Frame*, const FrameLoadRequest&); + virtual void show(); + + virtual bool canRunModal(); + virtual void runModal(); + + virtual void setToolbarsVisible(bool); + virtual bool toolbarsVisible(); + + virtual void setStatusbarVisible(bool); + virtual bool statusbarVisible(); + + virtual void setScrollbarsVisible(bool); + virtual bool scrollbarsVisible(); + + virtual void setMenubarVisible(bool); + virtual bool menubarVisible(); + + virtual void setResizable(bool); + + virtual void addMessageToConsole(const String& message, + unsigned int lineNumber, + const String& sourceID); + + virtual bool canRunBeforeUnloadConfirmPanel(); + virtual bool runBeforeUnloadConfirmPanel(const String& message, + Frame* frame); + + virtual void closeWindowSoon(); + + virtual void runJavaScriptAlert(Frame*, const String&); + virtual bool runJavaScriptConfirm(Frame*, const String&); + virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result); + virtual void setStatusbarText(const String&); + virtual bool shouldInterruptJavaScript(); + + virtual bool tabsToLinks() const; + + virtual IntRect windowResizerRect() const; + virtual void addToDirtyRegion(const IntRect&); + virtual void scrollBackingStore(int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect); + virtual void updateBackingStore(); + + virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags); + + virtual void setToolTip(const String&); + + virtual void print(Frame*); + + virtual void exceededDatabaseQuota(Frame*, const String&); + +private: + wxWebView* m_webView; +}; + +} +#endif // ChromeClientWx_H diff --git a/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp b/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp new file mode 100644 index 0000000..8f88f1a --- /dev/null +++ b/WebKit/wx/WebKitSupport/ContextMenuClientWx.cpp @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2007 Kevin Ollivier + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "ContextMenuClientWx.h" +#include "NotImplemented.h" +#include + +namespace WebCore { + +ContextMenuClientWx::~ContextMenuClientWx() +{ +} + +void ContextMenuClientWx::contextMenuDestroyed() +{ + notImplemented(); +} + +PlatformMenuDescription ContextMenuClientWx::getCustomMenuFromDefaultItems(ContextMenu*) +{ + notImplemented(); + return 0; +} + +void ContextMenuClientWx::contextMenuItemSelected(ContextMenuItem*, + const ContextMenu*) +{ + notImplemented(); +} + +void ContextMenuClientWx::downloadURL(const KURL&) +{ + notImplemented(); +} + +void ContextMenuClientWx::copyImageToClipboard(const HitTestResult&) +{ + notImplemented(); +} + +void ContextMenuClientWx::searchWithGoogle(const Frame*) +{ + notImplemented(); +} + +void ContextMenuClientWx::lookUpInDictionary(Frame*) +{ + notImplemented(); +} + +void ContextMenuClientWx::speak(const String&) +{ + notImplemented(); +} + +void ContextMenuClientWx::stopSpeaking() +{ + notImplemented(); +} + +} diff --git a/WebKit/wx/WebKitSupport/ContextMenuClientWx.h b/WebKit/wx/WebKitSupport/ContextMenuClientWx.h new file mode 100644 index 0000000..2655974 --- /dev/null +++ b/WebKit/wx/WebKitSupport/ContextMenuClientWx.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2007 Kevin Ollivier + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ContextMenuClientWx_h +#define ContextMenuClientWx_h + +#include "ContextMenuClient.h" +#include "PlatformMenuDescription.h" + +namespace WebCore { + +class ContextMenuClientWx : public ContextMenuClient { +public: + virtual ~ContextMenuClientWx(); + virtual void contextMenuDestroyed(); + + virtual PlatformMenuDescription getCustomMenuFromDefaultItems(ContextMenu*); + virtual void contextMenuItemSelected(ContextMenuItem*, + const ContextMenu*); + + virtual void downloadURL(const KURL&); + virtual void copyImageToClipboard(const HitTestResult&); + virtual void searchWithGoogle(const Frame*); + virtual void lookUpInDictionary(Frame*); + virtual void speak(const String&); + virtual void stopSpeaking(); +}; + +} + +#endif // ContextMenuClientWx_h diff --git a/WebKit/wx/WebKitSupport/DragClientWx.cpp b/WebKit/wx/WebKitSupport/DragClientWx.cpp new file mode 100644 index 0000000..dcccc34 --- /dev/null +++ b/WebKit/wx/WebKitSupport/DragClientWx.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2007 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "DragClientWx.h" +#include "NotImplemented.h" + +#include + +namespace WebCore { + +DragDestinationAction DragClientWx::actionMaskForDrag(DragData*) +{ + notImplemented(); + return DragDestinationActionAny; +} + +void DragClientWx::willPerformDragDestinationAction(DragDestinationAction, + DragData*) +{ + notImplemented(); +} + +void DragClientWx::willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*) +{ + notImplemented(); +} + +void DragClientWx::dragControllerDestroyed() +{ + notImplemented(); +} + +DragSourceAction DragClientWx::dragSourceActionMaskForPoint(const IntPoint&) +{ + notImplemented(); + return DragSourceActionAny; +} + +void DragClientWx::startDrag(DragImageRef dragImage, + const IntPoint& dragImageOrigin, + const IntPoint& eventPos, Clipboard*, + Frame*, bool linkDrag) +{ + notImplemented(); +} + +DragImageRef DragClientWx::createDragImageForLink(KURL&, const String& label, Frame*) +{ + notImplemented(); + return 0; +} + +} diff --git a/WebKit/wx/WebKitSupport/DragClientWx.h b/WebKit/wx/WebKitSupport/DragClientWx.h new file mode 100644 index 0000000..0e93e66 --- /dev/null +++ b/WebKit/wx/WebKitSupport/DragClientWx.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2007 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "DragClient.h" +#include "DragData.h" + +namespace WebCore { + +class DragClientWx : public WebCore::DragClient { +public: + virtual void willPerformDragDestinationAction(WebCore::DragDestinationAction, + WebCore::DragData*); + virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*); + + virtual WebCore::DragDestinationAction actionMaskForDrag(WebCore::DragData*); + virtual void dragControllerDestroyed(); + virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint&); + + virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragImageOrigin, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag = false); + virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WebCore::String& label, WebCore::Frame*); +}; + +} diff --git a/WebKit/wx/WebKitSupport/EditorClientWx.cpp b/WebKit/wx/WebKitSupport/EditorClientWx.cpp new file mode 100644 index 0000000..7e8889c --- /dev/null +++ b/WebKit/wx/WebKitSupport/EditorClientWx.cpp @@ -0,0 +1,390 @@ +/* + * Copyright (C) 2007 Kevin Ollivier + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "config.h" +#include "EditorClientWx.h" + +#include "EditCommand.h" +#include "Editor.h" +#include "FocusController.h" +#include "Frame.h" +#include "FrameView.h" +#include "KeyboardEvent.h" +#include "KeyboardCodes.h" +#include "NotImplemented.h" +#include "Page.h" +#include "PlatformKeyboardEvent.h" +#include "PlatformString.h" +#include "SelectionController.h" +#include "WebView.h" + +#include + +namespace WebCore { + +EditorClientWx::~EditorClientWx() +{ + m_page = NULL; +} + +void EditorClientWx::setPage(Page* page) +{ + m_page = page; +} + +void EditorClientWx::pageDestroyed() +{ + notImplemented(); +} + +bool EditorClientWx::shouldDeleteRange(Range*) +{ + notImplemented(); + return true; +} + +bool EditorClientWx::shouldShowDeleteInterface(HTMLElement*) +{ + notImplemented(); + return false; +} + +bool EditorClientWx::smartInsertDeleteEnabled() +{ + notImplemented(); + return false; +} + +bool EditorClientWx::isContinuousSpellCheckingEnabled() +{ + notImplemented(); + return false; +} + +void EditorClientWx::toggleContinuousSpellChecking() +{ + notImplemented(); +} + +bool EditorClientWx::isGrammarCheckingEnabled() +{ + notImplemented(); + return false; +} + +void EditorClientWx::toggleGrammarChecking() +{ + notImplemented(); +} + +int EditorClientWx::spellCheckerDocumentTag() +{ + notImplemented(); + return 0; +} + +bool EditorClientWx::selectWordBeforeMenuEvent() +{ + notImplemented(); + return false; +} + +bool EditorClientWx::isEditable() +{ + Frame* frame = m_page->focusController()->focusedOrMainFrame(); + + if (frame) { + wxWebView* webKitWin = dynamic_cast(frame->view()->nativeWindow()); + if (webKitWin) + return webKitWin->IsEditable(); + } + return false; +} + +bool EditorClientWx::shouldBeginEditing(Range*) +{ + notImplemented(); + return true; +} + +bool EditorClientWx::shouldEndEditing(Range*) +{ + notImplemented(); + return true; +} + +bool EditorClientWx::shouldInsertNode(Node*, Range*, + EditorInsertAction) +{ + notImplemented(); + return true; +} + +bool EditorClientWx::shouldInsertText(String, Range*, + EditorInsertAction) +{ + notImplemented(); + return true; +} + +bool EditorClientWx::shouldApplyStyle(CSSStyleDeclaration*, + Range*) +{ + notImplemented(); + return true; +} + +bool EditorClientWx::shouldMoveRangeAfterDelete(Range*, Range*) +{ + notImplemented(); + return true; +} + +bool EditorClientWx::shouldChangeSelectedRange(Range* fromRange, Range* toRange, + EAffinity, bool stillSelecting) +{ + notImplemented(); + return true; +} + +void EditorClientWx::didBeginEditing() +{ + notImplemented(); +} + +void EditorClientWx::respondToChangedContents() +{ + notImplemented(); +} + +void EditorClientWx::didEndEditing() +{ + notImplemented(); +} + +void EditorClientWx::didWriteSelectionToPasteboard() +{ + notImplemented(); +} + +void EditorClientWx::didSetSelectionTypesForPasteboard() +{ + notImplemented(); +} + +void EditorClientWx::registerCommandForUndo(PassRefPtr) +{ + notImplemented(); +} + +void EditorClientWx::registerCommandForRedo(PassRefPtr) +{ + notImplemented(); +} + +void EditorClientWx::clearUndoRedoOperations() +{ + notImplemented(); +} + +bool EditorClientWx::canUndo() const +{ + notImplemented(); + return false; +} + +bool EditorClientWx::canRedo() const +{ + notImplemented(); + return false; +} + +void EditorClientWx::undo() +{ + notImplemented(); +} + +void EditorClientWx::redo() +{ + notImplemented(); +} + +void EditorClientWx::handleInputMethodKeydown(KeyboardEvent* event) +{ +// NOTE: we don't currently need to handle this. When key events occur, +// both this method and handleKeyboardEvent get a chance at handling them. +// We might use this method later on for IME-specific handling. +} + +void EditorClientWx::handleKeyboardEvent(KeyboardEvent* event) +{ + Frame* frame = m_page->focusController()->focusedOrMainFrame(); + if (!frame) + return; + + const PlatformKeyboardEvent* kevent = event->keyEvent(); + if (!kevent->type() == PlatformKeyboardEvent::KeyUp) { + Node* start = frame->selectionController()->start().node(); + if (!start || !start->isContentEditable()) + return; + + if (kevent->type() == PlatformKeyboardEvent::Char && !kevent->ctrlKey() && !kevent->altKey()) { + switch (kevent->windowsVirtualKeyCode()) { + // we handled these on key down, ignore them for char events + case VK_BACK: + case VK_DELETE: + case VK_LEFT: + case VK_RIGHT: + case VK_UP: + case VK_DOWN: + case VK_RETURN: + break; + default: + frame->editor()->insertText(kevent->text(), event); + } + event->setDefaultHandled(); + return; + } + + switch (kevent->windowsVirtualKeyCode()) { + case VK_BACK: + frame->editor()->deleteWithDirection(SelectionController::BACKWARD, + CharacterGranularity, false, true); + break; + case VK_DELETE: + frame->editor()->deleteWithDirection(SelectionController::FORWARD, + CharacterGranularity, false, true); + break; + case VK_LEFT: + frame->editor()->command("MoveLeft").execute(); + break; + case VK_RIGHT: + frame->editor()->command("MoveRight").execute(); + break; + case VK_UP: + frame->editor()->command("MoveUp").execute(); + break; + case VK_DOWN: + frame->editor()->command("MoveDown").execute(); + break; + case VK_RETURN: + frame->editor()->command("InsertLineBreak").execute(); + default: + break; + } + + event->setDefaultHandled(); + } +} + +void EditorClientWx::textFieldDidBeginEditing(Element*) +{ + notImplemented(); +} + +void EditorClientWx::textFieldDidEndEditing(Element*) +{ + notImplemented(); +} + +void EditorClientWx::textDidChangeInTextField(Element*) +{ + notImplemented(); +} + +bool EditorClientWx::doTextFieldCommandFromEvent(Element*, KeyboardEvent*) +{ + notImplemented(); + return false; +} + +void EditorClientWx::textWillBeDeletedInTextField(Element*) +{ + notImplemented(); +} + +void EditorClientWx::textDidChangeInTextArea(Element*) +{ + notImplemented(); +} + +void EditorClientWx::respondToChangedSelection() +{ + notImplemented(); +} + +void EditorClientWx::ignoreWordInSpellDocument(const String&) +{ + notImplemented(); +} + +void EditorClientWx::learnWord(const String&) +{ + notImplemented(); +} + +void EditorClientWx::checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength) +{ + notImplemented(); +} + +void EditorClientWx::checkGrammarOfString(const UChar*, int length, Vector&, int* badGrammarLocation, int* badGrammarLength) +{ + notImplemented(); +} + +void EditorClientWx::updateSpellingUIWithGrammarString(const String&, const GrammarDetail& detail) +{ + notImplemented(); +} + +void EditorClientWx::updateSpellingUIWithMisspelledWord(const String&) +{ + notImplemented(); +} + +void EditorClientWx::showSpellingUI(bool show) +{ + notImplemented(); +} + +bool EditorClientWx::spellingUIIsShowing() +{ + notImplemented(); + return false; +} + +void EditorClientWx::getGuessesForWord(const String&, Vector& guesses) +{ + notImplemented(); +} + +void EditorClientWx::setInputMethodState(bool enabled) +{ + notImplemented(); +} + +} diff --git a/WebKit/wx/WebKitSupport/EditorClientWx.h b/WebKit/wx/WebKitSupport/EditorClientWx.h new file mode 100644 index 0000000..c2234d0 --- /dev/null +++ b/WebKit/wx/WebKitSupport/EditorClientWx.h @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2007 Kevin Ollivier + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef EditorClientWx_h +#define EditorClientWx_h + +#include "EditorClient.h" +#include "Page.h" + +namespace WebCore { + +class EditorClientWx : public EditorClient { +public: + virtual ~EditorClientWx(); + void setPage(Page*); + virtual void pageDestroyed(); + + virtual bool shouldDeleteRange(Range*); + virtual bool shouldShowDeleteInterface(HTMLElement*); + virtual bool smartInsertDeleteEnabled(); + virtual bool isContinuousSpellCheckingEnabled(); + virtual void toggleContinuousSpellChecking(); + virtual bool isGrammarCheckingEnabled(); + virtual void toggleGrammarChecking(); + virtual int spellCheckerDocumentTag(); + + virtual bool selectWordBeforeMenuEvent(); + virtual bool isEditable(); + + virtual bool shouldBeginEditing(Range*); + virtual bool shouldEndEditing(Range*); + virtual bool shouldInsertNode(Node*, Range*, + EditorInsertAction); + virtual bool shouldInsertText(String, Range*, + EditorInsertAction); + virtual bool shouldApplyStyle(CSSStyleDeclaration*, + Range*); + virtual bool shouldMoveRangeAfterDelete(Range*, Range*); + virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, + EAffinity, bool stillSelecting); + + virtual void didBeginEditing(); + virtual void respondToChangedContents(); + virtual void respondToChangedSelection(); + virtual void didEndEditing(); + virtual void didWriteSelectionToPasteboard(); + virtual void didSetSelectionTypesForPasteboard(); + + virtual void registerCommandForUndo(PassRefPtr); + virtual void registerCommandForRedo(PassRefPtr); + virtual void clearUndoRedoOperations(); + + virtual bool canUndo() const; + virtual bool canRedo() const; + + virtual void undo(); + virtual void redo(); + + virtual void handleKeyboardEvent(KeyboardEvent*); + virtual void handleInputMethodKeydown(KeyboardEvent*); + + virtual void textFieldDidBeginEditing(Element*); + virtual void textFieldDidEndEditing(Element*); + virtual void textDidChangeInTextField(Element*); + virtual bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*); + virtual void textWillBeDeletedInTextField(Element*); + virtual void textDidChangeInTextArea(Element*); + + virtual void ignoreWordInSpellDocument(const String&); + virtual void learnWord(const String&); + virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); + virtual void checkGrammarOfString(const UChar*, int length, Vector&, int* badGrammarLocation, int* badGrammarLength); + virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail& detail); + virtual void updateSpellingUIWithMisspelledWord(const String&); + virtual void showSpellingUI(bool show); + virtual bool spellingUIIsShowing(); + virtual void getGuessesForWord(const String&, Vector& guesses); + virtual void setInputMethodState(bool enabled); + +private: + Page* m_page; +}; + +} + +#endif // EditorClientWx_h diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp new file mode 100644 index 0000000..6367e22 --- /dev/null +++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp @@ -0,0 +1,906 @@ +/* + * Copyright (C) 2007 Kevin Ollivier + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "FrameLoaderClientWx.h" + +#include "DocumentLoader.h" +#include "Frame.h" +#include "FrameLoaderTypes.h" +#include "FrameView.h" +#include "FrameTree.h" +#include "HTMLFormElement.h" +#include "NotImplemented.h" +#include "Page.h" +#include "PlatformString.h" +#include "ProgressTracker.h" +#include "ResourceError.h" +#include "ResourceResponse.h" + +#include + +#include "WebView.h" +#include "WebViewPrivate.h" + +namespace WebCore { + +inline int wxNavTypeFromWebNavType(NavigationType type){ + if (type == NavigationTypeLinkClicked) + return wxWEBVIEW_NAV_LINK_CLICKED; + + if (type == NavigationTypeFormSubmitted) + return wxWEBVIEW_NAV_FORM_SUBMITTED; + + if (type == NavigationTypeBackForward) + return wxWEBVIEW_NAV_BACK_NEXT; + + if (type == NavigationTypeReload) + return wxWEBVIEW_NAV_RELOAD; + + if (type == NavigationTypeFormResubmitted) + return wxWEBVIEW_NAV_FORM_RESUBMITTED; + + return wxWEBVIEW_NAV_OTHER; +} + +FrameLoaderClientWx::FrameLoaderClientWx() + : RefCounted(0) + , m_frame(0) +{ +} + + +FrameLoaderClientWx::~FrameLoaderClientWx() +{ +} + +void FrameLoaderClientWx::setFrame(Frame *frame) +{ + m_frame = frame; +} + +void FrameLoaderClientWx::detachFrameLoader() +{ + m_frame = 0; +} + +void FrameLoaderClientWx::ref() +{ + RefCounted::ref(); +} + +void FrameLoaderClientWx::deref() +{ + RefCounted::deref(); +} + +bool FrameLoaderClientWx::hasWebView() const +{ + notImplemented(); + return true; +} + + +bool FrameLoaderClientWx::hasFrameView() const +{ + notImplemented(); + return true; +} + + +bool FrameLoaderClientWx::hasBackForwardList() const +{ + notImplemented(); + return true; +} + + +void FrameLoaderClientWx::resetBackForwardList() +{ + notImplemented(); +} + + +bool FrameLoaderClientWx::provisionalItemIsTarget() const +{ + notImplemented(); + return false; +} + +void FrameLoaderClientWx::makeRepresentation(DocumentLoader*) +{ + notImplemented(); +} + + +void FrameLoaderClientWx::forceLayout() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::forceLayoutForNonHTML() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::updateHistoryForCommit() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::updateHistoryForBackForwardNavigation() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::updateHistoryForReload() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::updateHistoryForStandardLoad() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::updateHistoryForInternalLoad() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::updateHistoryAfterClientRedirect() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::setCopiesOnScroll() +{ + // apparently mac specific + notImplemented(); +} + + +LoadErrorResetToken* FrameLoaderClientWx::tokenForLoadErrorReset() +{ + notImplemented(); + return 0; +} + + +void FrameLoaderClientWx::resetAfterLoadError(LoadErrorResetToken*) +{ + notImplemented(); +} + + +void FrameLoaderClientWx::doNotResetAfterLoadError(LoadErrorResetToken*) +{ + notImplemented(); +} + + +void FrameLoaderClientWx::willCloseDocument() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::detachedFromParent1() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::detachedFromParent2() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::detachedFromParent3() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::detachedFromParent4() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::loadedFromCachedPage() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::dispatchDidHandleOnloadEvents() +{ + wxWindow* target = m_frame->view()->nativeWindow(); + if (target) { + wxWebViewLoadEvent wkEvent(target); + wkEvent.SetState(wxWEBVIEW_LOAD_ONLOAD_HANDLED); + wkEvent.SetURL(m_frame->loader()->documentLoader()->request().url().string()); + target->GetEventHandler()->ProcessEvent(wkEvent); + } +} + + +void FrameLoaderClientWx::dispatchDidReceiveServerRedirectForProvisionalLoad() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::dispatchDidCancelClientRedirect() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::dispatchWillPerformClientRedirect(const KURL&, + double interval, + double fireDate) +{ + notImplemented(); +} + + +void FrameLoaderClientWx::dispatchDidChangeLocationWithinPage() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::dispatchWillClose() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::dispatchDidStartProvisionalLoad() +{ + wxWindow* target = m_frame->view()->nativeWindow(); + if (target) { + wxWebViewLoadEvent wkEvent(target); + wkEvent.SetState(wxWEBVIEW_LOAD_NEGOTIATING); + wkEvent.SetURL(m_frame->loader()->provisionalDocumentLoader()->request().url().string()); + target->GetEventHandler()->ProcessEvent(wkEvent); + } +} + + +void FrameLoaderClientWx::dispatchDidReceiveTitle(const String& title) +{ + wxWebView* target = static_cast(m_frame->view()->nativeWindow()); + if (target) + target->SetPageTitle(title); +} + + +void FrameLoaderClientWx::dispatchDidCommitLoad() +{ + wxWindow* target = m_frame->view()->nativeWindow(); + if (target) { + wxWebViewLoadEvent wkEvent(target); + wkEvent.SetState(wxWEBVIEW_LOAD_TRANSFERRING); + wkEvent.SetURL(m_frame->loader()->documentLoader()->request().url().string()); + target->GetEventHandler()->ProcessEvent(wkEvent); + } +} + +void FrameLoaderClientWx::dispatchDidFinishDocumentLoad() +{ + wxWindow* target = m_frame->view()->nativeWindow(); + if (target) { + wxWebViewLoadEvent wkEvent(target); + wkEvent.SetState(wxWEBVIEW_LOAD_DOC_COMPLETED); + wkEvent.SetURL(m_frame->loader()->url().string()); + target->GetEventHandler()->ProcessEvent(wkEvent); + } +} + +void FrameLoaderClientWx::dispatchDidFinishLoad() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::dispatchDidFirstLayout() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::dispatchShow() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::cancelPolicyCheck() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::dispatchWillSubmitForm(FramePolicyFunction function, + PassRefPtr) +{ + // FIXME: Send an event to allow for alerts and cancellation + if (!m_frame) + return; + (m_frame->loader()->*function)(PolicyUse); +} + + +void FrameLoaderClientWx::dispatchDidLoadMainResource(DocumentLoader*) +{ + notImplemented(); +} + + +void FrameLoaderClientWx::revertToProvisionalState(DocumentLoader*) +{ + notImplemented(); +} + + +void FrameLoaderClientWx::clearUnarchivingState(DocumentLoader*) +{ + notImplemented(); +} + +void FrameLoaderClientWx::postProgressStartedNotification() +{ + notImplemented(); +} + +void FrameLoaderClientWx::postProgressEstimateChangedNotification() +{ + notImplemented(); +} + +void FrameLoaderClientWx::postProgressFinishedNotification() +{ + wxWindow* target = m_frame->view()->nativeWindow(); + if (target) { + wxWebViewLoadEvent wkEvent(target); + wkEvent.SetState(wxWEBVIEW_LOAD_DL_COMPLETED); + wkEvent.SetURL(m_frame->loader()->url().string()); + target->GetEventHandler()->ProcessEvent(wkEvent); + } +} + +void FrameLoaderClientWx::progressStarted() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::progressCompleted() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::setMainFrameDocumentReady(bool b) +{ + notImplemented(); + // this is only interesting once we provide an external API for the DOM +} + + +void FrameLoaderClientWx::willChangeTitle(DocumentLoader*) +{ + notImplemented(); +} + + +void FrameLoaderClientWx::didChangeTitle(DocumentLoader *l) +{ + setTitle(l->title(), l->url()); +} + + +void FrameLoaderClientWx::finishedLoading(DocumentLoader*) +{ + notImplemented(); +} + + +void FrameLoaderClientWx::finalSetupForReplace(DocumentLoader*) +{ + notImplemented(); +} + + +void FrameLoaderClientWx::setDefersLoading(bool) +{ + notImplemented(); +} + + +bool FrameLoaderClientWx::isArchiveLoadPending(ResourceLoader*) const +{ + notImplemented(); + return false; +} + + +void FrameLoaderClientWx::cancelPendingArchiveLoad(ResourceLoader*) +{ + notImplemented(); +} + + +void FrameLoaderClientWx::clearArchivedResources() +{ + notImplemented(); +} + + +bool FrameLoaderClientWx::canShowMIMEType(const String& MIMEType) const +{ + notImplemented(); + return true; +} + + +bool FrameLoaderClientWx::representationExistsForURLScheme(const String& URLScheme) const +{ + notImplemented(); + return false; +} + + +String FrameLoaderClientWx::generatedMIMETypeForURLScheme(const String& URLScheme) const +{ + notImplemented(); + return String(); +} + + +void FrameLoaderClientWx::frameLoadCompleted() +{ + notImplemented(); +} + +void FrameLoaderClientWx::saveViewStateToItem(HistoryItem*) +{ + notImplemented(); +} + +void FrameLoaderClientWx::restoreViewState() +{ + notImplemented(); +} + +void FrameLoaderClientWx::restoreScrollPositionAndViewState() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::provisionalLoadStarted() +{ + notImplemented(); +} + + +bool FrameLoaderClientWx::shouldTreatURLAsSameAsCurrent(const KURL&) const +{ + notImplemented(); + return false; +} + + +void FrameLoaderClientWx::addHistoryItemForFragmentScroll() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::didFinishLoad() +{ + notImplemented(); +} + + +void FrameLoaderClientWx::prepareForDataSourceReplacement() +{ + if (m_frame && m_frame->loader()) + m_frame->loader()->detachChildren(); +} + + +void FrameLoaderClientWx::setTitle(const String& title, const KURL&) +{ + notImplemented(); +} + + +String FrameLoaderClientWx::userAgent(const KURL&) +{ + // FIXME: Use the new APIs introduced by the GTK port to fill in these values. + return String("Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/418.9.1 (KHTML, like Gecko) Safari/419.3"); +} + +void FrameLoaderClientWx::dispatchDidReceiveIcon() +{ + notImplemented(); +} + +void FrameLoaderClientWx::frameLoaderDestroyed() +{ + m_frame = 0; + delete this; +} + +bool FrameLoaderClientWx::canHandleRequest(const WebCore::ResourceRequest&) const +{ + notImplemented(); + return true; +} + +void FrameLoaderClientWx::partClearedInBegin() +{ + notImplemented(); +} + +void FrameLoaderClientWx::updateGlobalHistory(const WebCore::KURL&) +{ + notImplemented(); +} + +bool FrameLoaderClientWx::shouldGoToHistoryItem(WebCore::HistoryItem*) const +{ + notImplemented(); + return true; +} + +void FrameLoaderClientWx::saveScrollPositionAndViewStateToItem(WebCore::HistoryItem*) +{ + notImplemented(); +} + +bool FrameLoaderClientWx::canCachePage() const +{ + return false; +} + +void FrameLoaderClientWx::setMainDocumentError(WebCore::DocumentLoader*, const WebCore::ResourceError&) +{ + notImplemented(); +} + +void FrameLoaderClientWx::committedLoad(WebCore::DocumentLoader* loader, const char* data, int length) +{ + if (!m_frame) + return; + FrameLoader* fl = loader->frameLoader(); + fl->setEncoding(m_response.textEncodingName(), false); + fl->addData(data, length); +} + +WebCore::ResourceError FrameLoaderClientWx::cancelledError(const WebCore::ResourceRequest&) +{ + notImplemented(); + return ResourceError(); +} + +WebCore::ResourceError FrameLoaderClientWx::blockedError(const ResourceRequest&) +{ + notImplemented(); + return ResourceError(); +} + +WebCore::ResourceError FrameLoaderClientWx::cannotShowURLError(const WebCore::ResourceRequest&) +{ + notImplemented(); + return ResourceError(); +} + +WebCore::ResourceError FrameLoaderClientWx::interruptForPolicyChangeError(const WebCore::ResourceRequest&) +{ + notImplemented(); + return ResourceError(); +} + +WebCore::ResourceError FrameLoaderClientWx::cannotShowMIMETypeError(const WebCore::ResourceResponse&) +{ + notImplemented(); + return ResourceError(); +} + +WebCore::ResourceError FrameLoaderClientWx::fileDoesNotExistError(const WebCore::ResourceResponse&) +{ + notImplemented(); + return ResourceError(); +} + +bool FrameLoaderClientWx::shouldFallBack(const WebCore::ResourceError& error) +{ + notImplemented(); + return false; +} + +WTF::PassRefPtr FrameLoaderClientWx::createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData) +{ + RefPtr loader = new DocumentLoader(request, substituteData); + return loader.release(); +} + +void FrameLoaderClientWx::download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&) +{ + notImplemented(); +} + +void FrameLoaderClientWx::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&) +{ + notImplemented(); +} + +void FrameLoaderClientWx::dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest& request, const ResourceResponse& response) +{ + notImplemented(); +} + +void FrameLoaderClientWx::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&) +{ + notImplemented(); +} + +void FrameLoaderClientWx::dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge&) +{ + notImplemented(); +} + +void FrameLoaderClientWx::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long id, const ResourceResponse& response) +{ + notImplemented(); + m_response = response; + m_firstData = true; +} + +void FrameLoaderClientWx::dispatchDidReceiveContentLength(DocumentLoader* loader, unsigned long id, int length) +{ + notImplemented(); +} + +void FrameLoaderClientWx::dispatchDidFinishLoading(DocumentLoader*, unsigned long) +{ + notImplemented(); +} + +void FrameLoaderClientWx::dispatchDidFailLoading(DocumentLoader*, unsigned long, const ResourceError&) +{ + notImplemented(); +} + +bool FrameLoaderClientWx::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int) +{ + notImplemented(); + return false; +} + +void FrameLoaderClientWx::dispatchDidFailProvisionalLoad(const ResourceError&) +{ + notImplemented(); +} + +void FrameLoaderClientWx::dispatchDidFailLoad(const ResourceError&) +{ + notImplemented(); +} + +Frame* FrameLoaderClientWx::dispatchCreatePage() +{ + notImplemented(); + return false; +} + +void FrameLoaderClientWx::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const String& mimetype, const ResourceRequest& request) +{ + if (!m_frame) + return; + + notImplemented(); + (m_frame->loader()->*function)(PolicyUse); +} + +void FrameLoaderClientWx::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction&, const ResourceRequest&, const String&) +{ + if (!m_frame) + return; + + notImplemented(); + (m_frame->loader()->*function)(PolicyUse); +} + +void FrameLoaderClientWx::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction& action, const ResourceRequest& request) +{ + if (!m_frame) + return; + + wxWindow* target = m_frame->view()->nativeWindow(); + if (target) { + wxWebViewBeforeLoadEvent wkEvent(target); + wkEvent.SetNavigationType(wxNavTypeFromWebNavType(action.type())); + wkEvent.SetURL(request.url().string()); + + target->GetEventHandler()->ProcessEvent(wkEvent); + if (wkEvent.IsCancelled()) + (m_frame->loader()->*function)(PolicyIgnore); + else + (m_frame->loader()->*function)(PolicyUse); + + } +} + +void FrameLoaderClientWx::dispatchUnableToImplementPolicy(const ResourceError&) +{ + notImplemented(); +} + +void FrameLoaderClientWx::startDownload(const ResourceRequest&) +{ + notImplemented(); +} + +bool FrameLoaderClientWx::willUseArchive(ResourceLoader*, const ResourceRequest&, const KURL&) const +{ + notImplemented(); + return false; +} + +PassRefPtr FrameLoaderClientWx::createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, + const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight) +{ +/* + FIXME: Temporarily disabling code for loading subframes. While most + (i)frames load and are destroyed properly, the iframe created by + google.com in its new homepage does not get destroyed when + document()->detach() is called, as other (i)frames do. It is destroyed on + app shutdown, but until that point, this 'in limbo' frame will do things + like steal keyboard focus and crash when clicked on. (On some platforms, + it is actually a visible object, even though it's not in a valid state.) + + Since just about every user is probably going to test against Google at + some point, I'm disabling this functionality until I have time to track down + why it is not being destroyed. +*/ + +/* + wxWindow* parent = m_frame->view()->nativeWindow(); + + WebViewFrameData* data = new WebViewFrameData(); + data->name = name; + data->ownerElement = ownerElement; + data->url = url; + data->referrer = referrer; + data->marginWidth = marginWidth; + data->marginHeight = marginHeight; + + wxWebView* newWin = new wxWebView(parent, -1, wxDefaultPosition, wxDefaultSize, data); + + RefPtr childFrame = newWin->m_impl->frame; + + // FIXME: All of the below should probably be moved over into WebCore + childFrame->tree()->setName(name); + m_frame->tree()->appendChild(childFrame); + // ### set override encoding if we have one + + FrameLoadType loadType = m_frame->loader()->loadType(); + FrameLoadType childLoadType = FrameLoadTypeInternal; + + childFrame->loader()->load(url, referrer, childLoadType, + String(), 0, 0); + + // The frame's onload handler may have removed it from the document. + if (!childFrame->tree()->parent()) + return 0; + + delete data; + + return childFrame.get(); +*/ + notImplemented(); + return 0; +} + +ObjectContentType FrameLoaderClientWx::objectContentType(const KURL& url, const String& mimeType) +{ + notImplemented(); + return ObjectContentType(); +} + +Widget* FrameLoaderClientWx::createPlugin(const IntSize&, Element*, const KURL&, const Vector&, const Vector&, const String&, bool loadManually) +{ + notImplemented(); + return 0; +} + +void FrameLoaderClientWx::redirectDataToPlugin(Widget* pluginWidget) +{ + notImplemented(); + return; +} + +Widget* FrameLoaderClientWx::createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL, + const Vector& paramNames, const Vector& paramValues) +{ + notImplemented(); + return 0; +} + +String FrameLoaderClientWx::overrideMediaType() const +{ + notImplemented(); + return String(); +} + +void FrameLoaderClientWx::windowObjectCleared() +{ + notImplemented(); +} + +void FrameLoaderClientWx::didPerformFirstNavigation() const +{ + notImplemented(); +} + +void FrameLoaderClientWx::registerForIconNotification(bool listen) +{ + notImplemented(); +} + +void FrameLoaderClientWx::savePlatformDataToCachedPage(CachedPage*) +{ + notImplemented(); +} + +void FrameLoaderClientWx::transitionToCommittedFromCachedPage(CachedPage*) +{ + notImplemented(); +} + +void FrameLoaderClientWx::transitionToCommittedForNewPage() +{ + notImplemented(); +} + +} diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h new file mode 100644 index 0000000..60405c2 --- /dev/null +++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h @@ -0,0 +1,225 @@ +/* + * Copyright (C) 2007 Kevin Ollivier + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FrameLoaderClientWx_H +#define FrameLoaderClientWx_H + +#include "FrameLoaderClient.h" +#include "FrameLoader.h" +#include "KURL.h" +#include "RefCounted.h" +#include "ResourceResponse.h" + + +namespace WebCore { + + class AuthenticationChallenge; + class DocumentLoader; + class Element; + class FormState; + class NavigationAction; + class String; + class ResourceLoader; + + struct LoadErrorResetToken; + + class FrameLoaderClientWx : public FrameLoaderClient, public RefCounted { + public: + FrameLoaderClientWx(); + ~FrameLoaderClientWx(); + void setFrame(Frame *frame); + virtual void detachFrameLoader(); + + virtual void ref(); + virtual void deref(); + + virtual bool hasWebView() const; // mainly for assertions + virtual bool hasFrameView() const; // ditto + + virtual bool hasBackForwardList() const; + virtual void resetBackForwardList(); + + virtual bool provisionalItemIsTarget() const; + + virtual void makeRepresentation(DocumentLoader*); + virtual void forceLayout(); + virtual void forceLayoutForNonHTML(); + + virtual void updateHistoryForCommit(); + + virtual void updateHistoryForBackForwardNavigation(); + virtual void updateHistoryForReload(); + virtual void updateHistoryForStandardLoad(); + virtual void updateHistoryForInternalLoad(); + + virtual void updateHistoryAfterClientRedirect(); + + virtual void setCopiesOnScroll(); + + virtual LoadErrorResetToken* tokenForLoadErrorReset(); + virtual void resetAfterLoadError(LoadErrorResetToken*); + virtual void doNotResetAfterLoadError(LoadErrorResetToken*); + + virtual void willCloseDocument(); + + virtual void detachedFromParent1(); + virtual void detachedFromParent2(); + virtual void detachedFromParent3(); + virtual void detachedFromParent4(); + + virtual void loadedFromCachedPage(); + + virtual void frameLoaderDestroyed(); + virtual bool canHandleRequest(const ResourceRequest&) const; + + virtual void dispatchDidHandleOnloadEvents(); + virtual void dispatchDidReceiveServerRedirectForProvisionalLoad(); + virtual void dispatchDidCancelClientRedirect(); + virtual void dispatchWillPerformClientRedirect(const KURL&, double interval, double fireDate); + virtual void dispatchDidChangeLocationWithinPage(); + virtual void dispatchWillClose(); + virtual void dispatchDidReceiveIcon(); + virtual void dispatchDidStartProvisionalLoad(); + virtual void dispatchDidReceiveTitle(const String& title); + virtual void dispatchDidCommitLoad(); + virtual void dispatchDidFinishDocumentLoad(); + virtual void dispatchDidFinishLoad(); + virtual void dispatchDidFirstLayout(); + + virtual void dispatchShow(); + virtual void cancelPolicyCheck(); + + virtual void dispatchWillSubmitForm(FramePolicyFunction, PassRefPtr); + + virtual void dispatchDidLoadMainResource(DocumentLoader*); + virtual void revertToProvisionalState(DocumentLoader*); + virtual void clearUnarchivingState(DocumentLoader*); + + virtual void postProgressStartedNotification(); + virtual void postProgressEstimateChangedNotification(); + virtual void postProgressFinishedNotification(); + + virtual void progressStarted(); + virtual void progressCompleted(); + virtual void setMainFrameDocumentReady(bool); + virtual void willChangeTitle(DocumentLoader*); + virtual void didChangeTitle(DocumentLoader*); + virtual void finishedLoading(DocumentLoader*); + virtual void finalSetupForReplace(DocumentLoader*); + + virtual void setDefersLoading(bool); + virtual bool isArchiveLoadPending(ResourceLoader*) const; + virtual void cancelPendingArchiveLoad(ResourceLoader*); + virtual void clearArchivedResources(); + virtual bool canShowMIMEType(const String& MIMEType) const; + virtual bool representationExistsForURLScheme(const String& URLScheme) const; + virtual String generatedMIMETypeForURLScheme(const String& URLScheme) const; + + virtual void frameLoadCompleted(); + virtual void saveViewStateToItem(HistoryItem*); + virtual void restoreViewState(); + virtual void restoreScrollPositionAndViewState(); + virtual void provisionalLoadStarted(); + virtual bool shouldTreatURLAsSameAsCurrent(const KURL&) const; + virtual void addHistoryItemForFragmentScroll(); + virtual void didFinishLoad(); + virtual void prepareForDataSourceReplacement(); + virtual void setTitle(const String& title, const KURL&); + + virtual String userAgent(const KURL&); + + virtual void savePlatformDataToCachedPage(WebCore::CachedPage*); + virtual void transitionToCommittedFromCachedPage(WebCore::CachedPage*); + virtual void transitionToCommittedForNewPage(); + + virtual void updateGlobalHistory(const KURL&); + virtual bool shouldGoToHistoryItem(HistoryItem*) const; + virtual void saveScrollPositionAndViewStateToItem(HistoryItem*); + virtual bool canCachePage() const; + + virtual void setMainDocumentError(DocumentLoader*, const ResourceError&); + virtual void committedLoad(DocumentLoader*, const char*, int); + virtual ResourceError cancelledError(const ResourceRequest&); + virtual ResourceError blockedError(const ResourceRequest&); + virtual ResourceError cannotShowURLError(const ResourceRequest&); + virtual ResourceError interruptForPolicyChangeError(const ResourceRequest&); + virtual ResourceError cannotShowMIMETypeError(const ResourceResponse&); + virtual ResourceError fileDoesNotExistError(const ResourceResponse&); + virtual bool shouldFallBack(const ResourceError&); + virtual WTF::PassRefPtr createDocumentLoader(const ResourceRequest&, const SubstituteData&); + virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&); + + virtual void assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader*, const ResourceRequest&); + + virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long, ResourceRequest&, const ResourceResponse&); + virtual void dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&); + virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&); + virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long, const ResourceResponse&); + virtual void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long, int); + virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long); + virtual void dispatchDidFailLoading(DocumentLoader*, unsigned long, const ResourceError&); + + virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int); + virtual void dispatchDidFailProvisionalLoad(const ResourceError&); + virtual void dispatchDidFailLoad(const ResourceError&); + virtual Frame* dispatchCreatePage(); + virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const String&, const ResourceRequest&); + virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const NavigationAction&, const ResourceRequest&, const String&); + virtual void dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction&, const ResourceRequest&); + virtual void dispatchUnableToImplementPolicy(const ResourceError&); + + virtual void startDownload(const ResourceRequest&); + virtual bool willUseArchive(ResourceLoader*, const ResourceRequest&, const KURL&) const; + + // FIXME: This should probably not be here, but it's needed for the tests currently + virtual void partClearedInBegin(); + + virtual PassRefPtr createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, + const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); + virtual Widget* createPlugin(const IntSize&, Element*, const KURL&, const Vector&, const Vector&, const String&, bool loadManually) ; + virtual void redirectDataToPlugin(Widget* pluginWidget); + + virtual Widget* createJavaAppletWidget(const IntSize&, Element*, const KURL& baseURL, const Vector& paramNames, const Vector& paramValues); + + virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType); + virtual String overrideMediaType() const; + + virtual void windowObjectCleared(); + + virtual void didPerformFirstNavigation() const; + + virtual void registerForIconNotification(bool listen = true); + + private: + Frame *m_frame; + ResourceResponse m_response; + bool m_firstData; + }; + +} + +#endif diff --git a/WebKit/wx/WebKitSupport/InspectorClientWx.cpp b/WebKit/wx/WebKitSupport/InspectorClientWx.cpp new file mode 100644 index 0000000..e77a068 --- /dev/null +++ b/WebKit/wx/WebKitSupport/InspectorClientWx.cpp @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2007 Kevin Ollivier All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "InspectorClientWx.h" + +#include "NotImplemented.h" +#include "Page.h" +#include "PlatformString.h" + +namespace WebCore { + +InspectorClientWx::InspectorClientWx() +{ + notImplemented(); +} + +InspectorClientWx::~InspectorClientWx() +{ + notImplemented(); +} + +void InspectorClientWx::inspectorDestroyed() +{ + notImplemented(); +} + +Page* InspectorClientWx::createPage() +{ + notImplemented(); + return 0; +} + +String InspectorClientWx::localizedStringsURL() +{ + notImplemented(); + return String(); +} + +void InspectorClientWx::showWindow() +{ + notImplemented(); +} + +void InspectorClientWx::closeWindow() +{ + notImplemented(); +} + +void InspectorClientWx::attachWindow() +{ + notImplemented(); +} + +void InspectorClientWx::detachWindow() +{ + notImplemented(); +} + +void InspectorClientWx::highlight(Node*) +{ + notImplemented(); +} + +void InspectorClientWx::hideHighlight() +{ + notImplemented(); +} + +void InspectorClientWx::inspectedURLChanged(const String& newURL) +{ + notImplemented(); +} + +}; diff --git a/WebKit/wx/WebKitSupport/InspectorClientWx.h b/WebKit/wx/WebKitSupport/InspectorClientWx.h new file mode 100644 index 0000000..5616278 --- /dev/null +++ b/WebKit/wx/WebKitSupport/InspectorClientWx.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) Kevin Ollivier All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef InspectorClientWx_h +#define InspectorClientWx_h + +#include "InspectorClient.h" + +namespace WebCore { + +class Node; +class Page; +class String; + +class InspectorClientWx : public InspectorClient { +public: + InspectorClientWx(); + ~InspectorClientWx(); + + virtual void inspectorDestroyed(); + + virtual Page* createPage(); + + virtual String localizedStringsURL(); + + virtual void showWindow(); + virtual void closeWindow(); + + virtual void attachWindow(); + virtual void detachWindow(); + + virtual void highlight(Node*); + virtual void hideHighlight(); + + virtual void inspectedURLChanged(const String& newURL); +}; + +} // namespace WebCore + +#endif // !defined(InspectorClient_h) -- cgit v1.1