Bug 1494162 - Part 6: Lazy load the modules in the ElementContainer. r=pbro
[gecko.git] / editor / nsIEditActionListener.idl
blobe2fb4d13c96b1722fe7188d1eb1e448ba3b77856
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 Selection;
14 Editor Action Listener interface to outside world
18 /**
19 * A generic editor action listener interface.
20 * <P>
21 * nsIEditActionListener is the interface used by applications wishing to be notified
22 * when the editor modifies the DOM tree.
24 * Note: this is the wrong class to implement if you are interested in generic
25 * change notifications. For generic notifications, you should implement
26 * nsIDocumentObserver.
28 [scriptable, uuid(b22907b1-ee93-11d2-8d50-000064657374)]
30 interface nsIEditActionListener : nsISupports
32 /**
33 * Called after the editor creates a node.
34 * @param aTag The tag name of the DOM Node to create.
35 * @param aNewNode The DOM Node that was created.
36 * @param aResult The result of the create node operation.
38 void DidCreateNode(in DOMString aTag,
39 in Node aNewNode,
40 in nsresult aResult);
42 /**
43 * Called after the editor inserts a node.
44 * @param aNode The DOM Node to insert.
45 * @param aResult The result of the insert node operation.
47 void DidInsertNode(in Node aNode,
48 in nsresult aResult);
50 /**
51 * Called after the editor deletes a node.
52 * @param aChild The node to delete
53 * @param aResult The result of the delete node operation.
55 void DidDeleteNode(in Node aChild, in nsresult aResult);
57 /**
58 * Called after the editor splits a node.
59 * @param aExistingRightNode The node which was split. It will become the
60 * next sibling of the new left node.
61 * @param aNewLeftNode The new node resulting from the split, becomes
62 * the previous sibling of aExistingRightNode.
64 void DidSplitNode(in Node aExistingRightNode,
65 in Node aNewLeftNode);
67 /**
68 * Called after the editor joins 2 nodes.
69 * @param aLeftNode This node will be merged into the right node
70 * @param aRightNode The node that will be merged into.
71 * There is no requirement that the two nodes be of
72 * the same type.
73 * @param aParent The parent of aRightNode
74 * @param aResult The result of the join operation.
76 void DidJoinNodes(in Node aLeftNode,
77 in Node aRightNode,
78 in Node aParent,
79 in nsresult aResult);
81 /**
82 * Called after the editor inserts text.
83 * @param aTextNode This node getting inserted text.
84 * @param aOffset The offset in aTextNode to insert at.
85 * @param aString The string that gets inserted.
86 * @param aResult The result of the insert text operation.
88 void DidInsertText(in CharacterData aTextNode,
89 in long aOffset,
90 in DOMString aString,
91 in nsresult aResult);
93 /**
94 * Called before the editor deletes text.
95 * @param aTextNode This node getting text deleted.
96 * @param aOffset The offset in aTextNode to delete at.
97 * @param aLength The amount of text to delete.
99 void WillDeleteText(in CharacterData aTextNode,
100 in long aOffset,
101 in long aLength);
104 * Called before the editor deletes text.
105 * @param aTextNode This node getting text deleted.
106 * @param aOffset The offset in aTextNode to delete at.
107 * @param aLength The amount of text to delete.
108 * @param aResult The result of the delete text operation.
110 void DidDeleteText(in CharacterData aTextNode,
111 in long aOffset,
112 in long aLength,
113 in nsresult aResult);
116 * Called before the editor deletes the selection.
117 * @param aSelection The selection to be deleted
119 void WillDeleteSelection(in Selection aSelection);
122 * Called after the editor deletes the selection.
123 * @param aSelection The selection, after deletion
125 void DidDeleteSelection(in Selection aSelection);