nsIEditActionListener

A generic editor action listener interface.

nsIEditActionListener is the interface used by applications wishing to be notified when the editor modifies the DOM tree. Note: this is the wrong class to implement if you are interested in generic change notifications. For generic notifications, you should implement nsIDocumentObserver. ## Methods ## ### WillCreateNode(aTag, aParent, aPosition) ### Called before the editor creates a node. #### Parameters ####

aTag The tag name of the DOM Node to create.
aParent The node to insert the new object into
aPosition The place in aParent to insert the new node 0=first child, 1=second child, etc. any number > number of current children = last child
### DidCreateNode(aTag, aNode, aParent, aPosition, aResult) ### Called after the editor creates a node. #### Parameters ####
aTag The tag name of the DOM Node to create.
aNode The DOM Node that was created.
aParent The node to insert the new object into
aPosition The place in aParent to insert the new node 0=first child, 1=second child, etc. any number > number of current children = last child
aResult The result of the create node operation.
### WillInsertNode(aNode, aParent, aPosition) ### Called before the editor inserts a node. #### Parameters ####
aNode The DOM Node to insert.
aParent The node to insert the new object into
aPosition The place in aParent to insert the new node 0=first child, 1=second child, etc. any number > number of current children = last child
### DidInsertNode(aNode, aParent, aPosition, aResult) ### Called after the editor inserts a node. #### Parameters ####
aNode The DOM Node to insert.
aParent The node to insert the new object into
aPosition The place in aParent to insert the new node 0=first child, 1=second child, etc. any number > number of current children = last child
aResult The result of the insert node operation.
### WillDeleteNode(aChild) ### Called before the editor deletes a node. #### Parameters ####
aChild The node to delete
### DidDeleteNode(aChild, aResult) ### Called after the editor deletes a node. #### Parameters ####
aChild The node to delete
aResult The result of the delete node operation.
### WillSplitNode(aExistingRightNode, aOffset) ### Called before the editor splits a node. #### Parameters ####
aExistingRightNode the node to split. It will become the new node's next sibling.
aOffset the offset of aExistingRightNode's content|children to do the split at
aNewLeftNode [OUT] the new node resulting from the split, becomes aExistingRightNode's previous sibling.
### DidSplitNode(aExistingRightNode, aOffset, aNewLeftNode, aResult) ### Called after the editor splits a node. #### Parameters ####
aExistingRightNode the node to split. It will become the new node's next sibling.
aOffset the offset of aExistingRightNode's content|children to do the split at
aNewLeftNode [OUT] the new node resulting from the split, becomes aExistingRightNode's previous sibling.
### WillJoinNodes(aLeftNode, aRightNode, aParent) ### Called before the editor joins 2 nodes. #### Parameters ####
aLeftNode This node will be merged into the right node
aRightNode The node that will be merged into. There is no requirement that the two nodes be of the same type.
aParent The parent of aRightNode
### DidJoinNodes(aLeftNode, aRightNode, aParent, aResult) ### Called after the editor joins 2 nodes. #### Parameters ####
aLeftNode This node will be merged into the right node
aRightNode The node that will be merged into. There is no requirement that the two nodes be of the same type.
aParent The parent of aRightNode
aResult The result of the join operation.
### WillInsertText(aTextNode, aOffset, aString) ### Called before the editor inserts text. #### Parameters ####
aTextNode This node getting inserted text
aOffset The offset in aTextNode to insert at.
aString The string that gets inserted.
### DidInsertText(aTextNode, aOffset, aString, aResult) ### Called after the editor inserts text. #### Parameters ####
aTextNode This node getting inserted text
aOffset The offset in aTextNode to insert at.
aString The string that gets inserted.
aResult The result of the insert text operation.
### WillDeleteText(aTextNode, aOffset, aLength) ### Called before the editor deletes text. #### Parameters ####
aTextNode This node getting text deleted
aOffset The offset in aTextNode to delete at.
aLength The amount of text to delete.
### DidDeleteText(aTextNode, aOffset, aLength, aResult) ### Called before the editor deletes text. #### Parameters ####
aTextNode This node getting text deleted
aOffset The offset in aTextNode to delete at.
aLength The amount of text to delete.
aResult The result of the delete text operation.
### WillDeleteSelection(aSelection) ### Called before the editor deletes the selection. #### Parameters ####
aSelection The selection to be deleted
### DidDeleteSelection(aSelection) ### Called after the editor deletes the selection. #### Parameters ####
aSelection The selection, after deletion