Bug 1758813 [wpt PR 33142] - Implement RP sign out, a=testonly
[gecko.git] / editor / nsIEditActionListener.idl
blob9d148b188c0f909c6b9b547a2e3b064f34fec1bf
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;
17 namespace mozilla {
18 template class EditorDOMPointBase<nsINode*, nsIContent*>;
19 } // namespace mozilla
22 [ref] native EditorRawDOMPointRef(mozilla::EditorDOMPointBase<nsINode*, nsIContent*>);
25 Editor Action Listener interface to outside world
29 /**
30 * A generic editor action listener interface.
31 * <P>
32 * nsIEditActionListener is the interface used by applications wishing to be notified
33 * when the editor modifies the DOM tree.
35 * Note: this is the wrong class to implement if you are interested in generic
36 * change notifications. For generic notifications, you should implement
37 * nsIDocumentObserver.
39 [scriptable, uuid(b22907b1-ee93-11d2-8d50-000064657374)]
40 interface nsIEditActionListener : nsISupports
42 /**
43 * Called after the editor deletes a node.
44 * @param aChild The node to delete
45 * @param aResult The result of the delete node operation.
47 void DidDeleteNode(in Node aChild, in nsresult aResult);
49 /**
50 * Called after the editor joins 2 nodes.
51 * @param aJoinedPoint The joined point. If aLeftNodeWasRemoved is true,
52 * it points after inserted left node content in the
53 * right node. Otherwise, it points start of inserted
54 * right node content in the left node.
55 * @param aRemovedNode The removed node.
56 * @param aLeftNodeWasRemoved
57 * true if left node is removed and its contents were
58 * moved into start of the right node.
59 * false if right node is removed and its contents were
60 * moved into end of the left node.
62 [noscript]
63 void DidJoinContents([const] in EditorRawDOMPointRef aJoinedPoint,
64 [const] in Node aRemovedNode,
65 in bool aLeftNodeWasRemoved);
67 /**
68 * Called after the editor inserts text.
69 * @param aTextNode This node getting inserted text.
70 * @param aOffset The offset in aTextNode to insert at.
71 * @param aString The string that gets inserted.
72 * @param aResult The result of the insert text operation.
74 void DidInsertText(in CharacterData aTextNode,
75 in long aOffset,
76 in AString aString,
77 in nsresult aResult);
79 /**
80 * Called before the editor deletes text.
81 * @param aTextNode This node getting text deleted.
82 * @param aOffset The offset in aTextNode to delete at.
83 * @param aLength The amount of text to delete.
85 void WillDeleteText(in CharacterData aTextNode,
86 in long aOffset,
87 in long aLength);
89 /**
90 * Called before the editor deletes the ranges.
91 * @param aRangesToDelete The ranges to be deleted.
93 void WillDeleteRanges(in Array<Range> aRangesToDelete);