From 79dbc66fba17d6b4967fe86a577b11d15548cdec Mon Sep 17 00:00:00 2001 From: "darin@chromium.org" Date: Fri, 4 Sep 2009 05:42:51 +0000 Subject: Hook up WebEditingClient. Moves the WebViewDelegate parameter back to WebView::Create and adds a second parameter for WebEditingClient. I had hoped to make the WebEditingClient NULL for RenderView on Windows and Mac, but that turned out to not be an option. I need a few methods on all platforms. The Describe* functions from EditorClientImpl are moved into the TestWebViewDelegate since they are only applicable to layout tests. R=dglazkov BUG= TEST=none Review URL: http://codereview.chromium.org/195008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25432 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/api/public/WebEditingAction.h | 8 +++---- webkit/api/public/WebEditingClient.h | 45 ++++++++++++++++++------------------ webkit/api/public/WebTextAffinity.h | 8 +++---- 3 files changed, 29 insertions(+), 32 deletions(-) (limited to 'webkit/api/public') diff --git a/webkit/api/public/WebEditingAction.h b/webkit/api/public/WebEditingAction.h index de716ca..4ac6653 100644 --- a/webkit/api/public/WebEditingAction.h +++ b/webkit/api/public/WebEditingAction.h @@ -1,10 +1,10 @@ /* * Copyright (C) 2009 Google 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: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above @@ -14,7 +14,7 @@ * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -31,8 +31,6 @@ #ifndef WebEditingAction_h #define WebEditingAction_h -#error "This header file is still a work in progress; do not include!" - namespace WebKit { enum WebEditingAction { diff --git a/webkit/api/public/WebEditingClient.h b/webkit/api/public/WebEditingClient.h index 8cc0e01..9b20593 100644 --- a/webkit/api/public/WebEditingClient.h +++ b/webkit/api/public/WebEditingClient.h @@ -1,10 +1,10 @@ /* * Copyright (C) 2009 Google 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: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above @@ -14,7 +14,7 @@ * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -31,38 +31,39 @@ #ifndef WebEditingClient_h #define WebEditingClient_h -#error "This header file is still a work in progress; do not include!" +#include "WebEditingAction.h" +#include "WebTextAffinity.h" namespace WebKit { class WebNode; class WebRange; - class WebView; + class WebString; + // This interface allow the client to intercept and overrule editing + // operations. class WebEditingClient { public: - // The following methods allow the client to intercept and overrule - // editing operations. - virtual bool shouldBeginEditing(WebView*, const WebRange&) = 0; - virtual bool shouldEndEditing(WebView*, const WebRange&) = 0; + virtual bool shouldBeginEditing(const WebRange&) = 0; + virtual bool shouldEndEditing(const WebRange&) = 0; virtual bool shouldInsertNode( - WebView*, const WebNode&, const WebRange&, const WebEditingAction&) = 0; + const WebNode&, const WebRange&, WebEditingAction) = 0; virtual bool shouldInsertText( - WebView*, const WebString&, const WebRange&, const WebEditingAction&) = 0; + const WebString&, const WebRange&, WebEditingAction) = 0; virtual bool shouldChangeSelectedRange( - WebView*, const WebRange& from, const WebRange& to, const WebTextAffinity&, + const WebRange& from, const WebRange& to, WebTextAffinity, bool stillSelecting) = 0; - virtual bool shouldDeleteRange(WebView*, const WebRange&) = 0; - virtual bool shouldApplyStyle(WebView*, const WebString& style, const WebRange&) = 0; + virtual bool shouldDeleteRange(const WebRange&) = 0; + virtual bool shouldApplyStyle(const WebString& style, const WebRange&) = 0; - virtual bool isSmartInsertDeleteEnabled(WebView*) = 0; - virtual bool isSelectTrailingWhitespaceEnabled(WebView*) = 0; - virtual void setInputMethodEnabled(WebView*, bool enabled) = 0; + virtual bool isSmartInsertDeleteEnabled() = 0; + virtual bool isSelectTrailingWhitespaceEnabled() = 0; + virtual void setInputMethodEnabled(bool enabled) = 0; - virtual void didBeginEditing(WebView*) = 0; - virtual void didChangeSelection(WebView*, bool isSelectionEmpty) = 0; - virtual void didChangeContents(WebView*) = 0; - virtual void didExecuteCommand(WebView*, const WebString& commandName) = 0; - virtual void didEndEditing(WebView*) = 0; + virtual void didBeginEditing() = 0; + virtual void didChangeSelection(bool isSelectionEmpty) = 0; + virtual void didChangeContents() = 0; + virtual void didExecuteCommand(const WebString& commandName) = 0; + virtual void didEndEditing() = 0; }; } // namespace WebKit diff --git a/webkit/api/public/WebTextAffinity.h b/webkit/api/public/WebTextAffinity.h index 3fcea31..2ca86aa 100644 --- a/webkit/api/public/WebTextAffinity.h +++ b/webkit/api/public/WebTextAffinity.h @@ -1,10 +1,10 @@ /* * Copyright (C) 2009 Google 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: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above @@ -14,7 +14,7 @@ * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -31,8 +31,6 @@ #ifndef WebTextAffinity_h #define WebTextAffinity_h -#error "This header file is still a work in progress; do not include!" - namespace WebKit { // These constants specify the preferred direction of selection. -- cgit v1.1