summaryrefslogtreecommitdiffstats
path: root/webkit/api/public
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 05:42:51 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 05:42:51 +0000
commit79dbc66fba17d6b4967fe86a577b11d15548cdec (patch)
treedf2853054e47aa76cea79eb6664f4c21cb54bd9e /webkit/api/public
parentbdc66ceff07dac7b74ddea70fabdf535936d39b1 (diff)
downloadchromium_src-79dbc66fba17d6b4967fe86a577b11d15548cdec.zip
chromium_src-79dbc66fba17d6b4967fe86a577b11d15548cdec.tar.gz
chromium_src-79dbc66fba17d6b4967fe86a577b11d15548cdec.tar.bz2
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
Diffstat (limited to 'webkit/api/public')
-rw-r--r--webkit/api/public/WebEditingAction.h8
-rw-r--r--webkit/api/public/WebEditingClient.h45
-rw-r--r--webkit/api/public/WebTextAffinity.h8
3 files changed, 29 insertions, 32 deletions
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.