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"
14 #include
"mozilla/EditorDOMPoint.h"
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
30 * A generic editor action listener interface.
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
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
);
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.
63 void DidJoinContents
([const] in EditorRawDOMPointRef aJoinedPoint
,
64 [const] in Node aRemovedNode
,
65 in bool aLeftNodeWasRemoved
);
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
,
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
,
90 * Called before the editor deletes the ranges.
91 * @param aRangesToDelete The ranges to be deleted.
93 void WillDeleteRanges
(in Array
<Range> aRangesToDelete
);