summaryrefslogtreecommitdiffstats
path: root/editor/nsIEditActionListener.idl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /editor/nsIEditActionListener.idl
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'editor/nsIEditActionListener.idl')
-rw-r--r--editor/nsIEditActionListener.idl91
1 files changed, 91 insertions, 0 deletions
diff --git a/editor/nsIEditActionListener.idl b/editor/nsIEditActionListener.idl
new file mode 100644
index 0000000000..d959c19e4f
--- /dev/null
+++ b/editor/nsIEditActionListener.idl
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "nsISupports.idl"
+#include "domstubs.idl"
+
+webidl CharacterData;
+webidl Node;
+webidl Range;
+
+%{C++
+#include "mozilla/EditorDOMPoint.h"
+class nsINode;
+class nsIContent;
+%}
+
+[ref] native EditorRawDOMPointRef(mozilla::EditorDOMPointBase<nsINode*, nsIContent*>);
+
+/*
+Editor Action Listener interface to outside world
+*/
+
+
+/**
+ * A generic editor action listener interface.
+ * <P>
+ * nsIEditActionListener is the interface used by applications wishing to be notified
+ * when the editor modifies the DOM tree.
+ *
+ * Note: this is the wrong class to implement if you are interested in generic
+ * change notifications. For generic notifications, you should implement
+ * nsIDocumentObserver.
+ */
+[scriptable, uuid(b22907b1-ee93-11d2-8d50-000064657374)]
+interface nsIEditActionListener : nsISupports
+{
+ /**
+ * Called after the editor deletes a node.
+ * @param aChild The node to delete
+ * @param aResult The result of the delete node operation.
+ */
+ void DidDeleteNode(in Node aChild, in nsresult aResult);
+
+ /**
+ * Called after the editor joins 2 nodes.
+ * @param aJoinedPoint The joined point. If aLeftNodeWasRemoved is true,
+ * it points after inserted left node content in the
+ * right node. Otherwise, it points start of inserted
+ * right node content in the left node.
+ * @param aRemovedNode The removed node.
+ * @param aLeftNodeWasRemoved
+ * true if left node is removed and its contents were
+ * moved into start of the right node.
+ * false if right node is removed and its contents were
+ * moved into end of the left node.
+ */
+ [noscript]
+ void DidJoinContents([const] in EditorRawDOMPointRef aJoinedPoint,
+ [const] in Node aRemovedNode,
+ in bool aLeftNodeWasRemoved);
+
+ /**
+ * Called after the editor inserts text.
+ * @param aTextNode This node getting inserted text.
+ * @param aOffset The offset in aTextNode to insert at.
+ * @param aString The string that gets inserted.
+ * @param aResult The result of the insert text operation.
+ */
+ void DidInsertText(in CharacterData aTextNode,
+ in long aOffset,
+ in AString aString,
+ in nsresult aResult);
+
+ /**
+ * Called before the editor deletes text.
+ * @param aTextNode This node getting text deleted.
+ * @param aOffset The offset in aTextNode to delete at.
+ * @param aLength The amount of text to delete.
+ */
+ void WillDeleteText(in CharacterData aTextNode,
+ in long aOffset,
+ in long aLength);
+
+ /**
+ * Called before the editor deletes the ranges.
+ * @param aRangesToDelete The ranges to be deleted.
+ */
+ void WillDeleteRanges(in Array<Range> aRangesToDelete);
+};