Bug 1550519 - Show a translucent parent highlight when a subgrid is highlighted....
[gecko.git] / editor / nsIEditActionListener.idl
blob2fce1c3b065fbd3f7f7c16daeb2f42f548664349
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)]
29 interface nsIEditActionListener : nsISupports
31 /**
32 * Called after the editor creates a node.
33 * @param aTag The tag name of the DOM Node to create.
34 * @param aNewNode The DOM Node that was created.
35 * @param aResult The result of the create node operation.
37 void DidCreateNode(in AString aTag,
38 in Node aNewNode,
39 in nsresult aResult);
41 /**
42 * Called after the editor inserts a node.
43 * @param aNode The DOM Node to insert.
44 * @param aResult The result of the insert node operation.
46 void DidInsertNode(in Node aNode,
47 in nsresult aResult);
49 /**
50 * Called after the editor deletes a node.
51 * @param aChild The node to delete
52 * @param aResult The result of the delete node operation.
54 void DidDeleteNode(in Node aChild, in nsresult aResult);
56 /**
57 * Called after the editor splits a node.
58 * @param aExistingRightNode The node which was split. It will become the
59 * next sibling of the new left node.
60 * @param aNewLeftNode The new node resulting from the split, becomes
61 * the previous sibling of aExistingRightNode.
63 void DidSplitNode(in Node aExistingRightNode,
64 in Node aNewLeftNode);
66 /**
67 * Called after the editor joins 2 nodes.
68 * @param aLeftNode This node will be merged into the right node
69 * @param aRightNode The node that will be merged into.
70 * There is no requirement that the two nodes be of
71 * the same type.
72 * @param aParent The parent of aRightNode
73 * @param aResult The result of the join operation.
75 void DidJoinNodes(in Node aLeftNode,
76 in Node aRightNode,
77 in Node aParent,
78 in nsresult aResult);
80 /**
81 * Called after the editor inserts text.
82 * @param aTextNode This node getting inserted text.
83 * @param aOffset The offset in aTextNode to insert at.
84 * @param aString The string that gets inserted.
85 * @param aResult The result of the insert text operation.
87 void DidInsertText(in CharacterData aTextNode,
88 in long aOffset,
89 in AString aString,
90 in nsresult aResult);
92 /**
93 * Called before the editor deletes text.
94 * @param aTextNode This node getting text deleted.
95 * @param aOffset The offset in aTextNode to delete at.
96 * @param aLength The amount of text to delete.
98 void WillDeleteText(in CharacterData aTextNode,
99 in long aOffset,
100 in long aLength);
103 * Called before the editor deletes text.
104 * @param aTextNode This node getting text deleted.
105 * @param aOffset The offset in aTextNode to delete at.
106 * @param aLength The amount of text to delete.
107 * @param aResult The result of the delete text operation.
109 void DidDeleteText(in CharacterData aTextNode,
110 in long aOffset,
111 in long aLength,
112 in nsresult aResult);
115 * Called before the editor deletes the selection.
116 * @param aSelection The selection to be deleted
118 void WillDeleteSelection(in Selection aSelection);
121 * Called after the editor deletes the selection.
122 * @param aSelection The selection, after deletion
124 void DidDeleteSelection(in Selection aSelection);