Bug 1850991 - Update brotli to version 1.1.0. r=jfkthame
[gecko.git] / editor / nsIEditActionListener.idl
blobd959c19e4f44dff8d17ef3cd45b4343412d4d56d
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
7 #include "domstubs.idl"
9 webidl CharacterData;
10 webidl Node;
11 webidl Range;
13 %{C++
14 #include "mozilla/EditorDOMPoint.h"
15 class nsINode;
16 class nsIContent;
19 [ref] native EditorRawDOMPointRef(mozilla::EditorDOMPointBase<nsINode*, nsIContent*>);
22 Editor Action Listener interface to outside world
26 /**
27 * A generic editor action listener interface.
28 * <P>
29 * nsIEditActionListener is the interface used by applications wishing to be notified
30 * when the editor modifies the DOM tree.
32 * Note: this is the wrong class to implement if you are interested in generic
33 * change notifications. For generic notifications, you should implement
34 * nsIDocumentObserver.
36 [scriptable, uuid(b22907b1-ee93-11d2-8d50-000064657374)]
37 interface nsIEditActionListener : nsISupports
39 /**
40 * Called after the editor deletes a node.
41 * @param aChild The node to delete
42 * @param aResult The result of the delete node operation.
44 void DidDeleteNode(in Node aChild, in nsresult aResult);
46 /**
47 * Called after the editor joins 2 nodes.
48 * @param aJoinedPoint The joined point. If aLeftNodeWasRemoved is true,
49 * it points after inserted left node content in the
50 * right node. Otherwise, it points start of inserted
51 * right node content in the left node.
52 * @param aRemovedNode The removed node.
53 * @param aLeftNodeWasRemoved
54 * true if left node is removed and its contents were
55 * moved into start of the right node.
56 * false if right node is removed and its contents were
57 * moved into end of the left node.
59 [noscript]
60 void DidJoinContents([const] in EditorRawDOMPointRef aJoinedPoint,
61 [const] in Node aRemovedNode,
62 in bool aLeftNodeWasRemoved);
64 /**
65 * Called after the editor inserts text.
66 * @param aTextNode This node getting inserted text.
67 * @param aOffset The offset in aTextNode to insert at.
68 * @param aString The string that gets inserted.
69 * @param aResult The result of the insert text operation.
71 void DidInsertText(in CharacterData aTextNode,
72 in long aOffset,
73 in AString aString,
74 in nsresult aResult);
76 /**
77 * Called before the editor deletes text.
78 * @param aTextNode This node getting text deleted.
79 * @param aOffset The offset in aTextNode to delete at.
80 * @param aLength The amount of text to delete.
82 void WillDeleteText(in CharacterData aTextNode,
83 in long aOffset,
84 in long aLength);
86 /**
87 * Called before the editor deletes the ranges.
88 * @param aRangesToDelete The ranges to be deleted.
90 void WillDeleteRanges(in Array<Range> aRangesToDelete);