nsIEditActionListener

IID:b22907b1-ee93-11d2-8d50-000064657374
Inherits From:nsISupports

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

void DidCreateNode ( DOMString tag , nsIDOMNode node , nsIDOMNode parent , PRInt32 position , nsresult result ) void DidDeleteNode ( nsIDOMNode child , nsresult result ) void DidDeleteSelection ( nsISelection selection ) void DidDeleteText ( nsIDOMCharacterData textNode , PRInt32 offset , PRInt32 length , nsresult result ) void DidInsertNode ( nsIDOMNode node , nsIDOMNode parent , PRInt32 position , nsresult result ) void DidInsertText ( nsIDOMCharacterData textNode , PRInt32 offset , DOMString string , nsresult result ) void DidJoinNodes ( nsIDOMNode leftNode , nsIDOMNode rightNode , nsIDOMNode parent , nsresult result ) void DidSplitNode ( nsIDOMNode existingRightNode , PRInt32 offset , nsIDOMNode newLeftNode , nsresult result ) void WillCreateNode ( DOMString tag , nsIDOMNode parent , PRInt32 position ) void WillDeleteNode ( nsIDOMNode child ) void WillDeleteSelection ( nsISelection selection ) void WillDeleteText ( nsIDOMCharacterData textNode , PRInt32 offset , PRInt32 length ) void WillInsertNode ( nsIDOMNode node , nsIDOMNode parent , PRInt32 position ) void WillInsertText ( nsIDOMCharacterData textNode , PRInt32 offset , DOMString string ) void WillJoinNodes ( nsIDOMNode leftNode , nsIDOMNode rightNode , nsIDOMNode parent ) void WillSplitNode ( nsIDOMNode existingRightNode , PRInt32 offset )

void DidCreateNode ( DOMString tag , nsIDOMNode node , nsIDOMNode parent , PRInt32 position , nsresult result )

Called after the editor creates a node.

Arguments:
tag: The tag name of the DOM Node to create.
node: The DOM Node that was created.
parent: The node to insert the new object into
position: The place in parent to insert the new node 0=first child, 1=second child, etc. any number > number of current children = last child
result: The result of the create node operation.

void DidDeleteNode ( nsIDOMNode child , nsresult result )

Called after the editor deletes a node.

Arguments:
child: The node to delete
result: The result of the delete node operation.

void DidDeleteSelection ( nsISelection selection )

Called after the editor deletes the selection.

Arguments:
selection: The selection, after deletion

void DidDeleteText ( nsIDOMCharacterData textNode , PRInt32 offset , PRInt32 length , nsresult result )

Called before the editor deletes text.

Arguments:
textNode: This node getting text deleted
offset: The offset in textNode to delete at.
length: The amount of text to delete.
result: The result of the delete text operation.

void DidInsertNode ( nsIDOMNode node , nsIDOMNode parent , PRInt32 position , nsresult result )

Called after the editor inserts a node.

Arguments:
node: The DOM Node to insert.
parent: The node to insert the new object into
position: The place in parent to insert the new node 0=first child, 1=second child, etc. any number > number of current children = last child
result: The result of the insert node operation.

void DidInsertText ( nsIDOMCharacterData textNode , PRInt32 offset , DOMString string , nsresult result )

Called after the editor inserts text.

Arguments:
textNode: This node getting inserted text
offset: The offset in textNode to insert at.
string: The string that gets inserted.
result: The result of the insert text operation.

void DidJoinNodes ( nsIDOMNode leftNode , nsIDOMNode rightNode , nsIDOMNode parent , nsresult result )

Called after the editor joins 2 nodes.

Arguments:
leftNode: This node will be merged into the right node
rightNode: The node that will be merged into. There is no requirement that the two nodes be of the same type.
parent: The parent of rightNode
result: The result of the join operation.

void DidSplitNode ( nsIDOMNode existingRightNode , PRInt32 offset , nsIDOMNode newLeftNode , nsresult result )

Called after the editor splits a node.

Arguments:
existingRightNode: the node to split. It will become the new node's next sibling.
offset: the offset of existingRightNode's content|children to do the split at
newLeftNode: [OUT] the new node resulting from the split, becomes existingRightNode's previous sibling.
result

void WillCreateNode ( DOMString tag , nsIDOMNode parent , PRInt32 position )

Called before the editor creates a node.

Arguments:
tag: The tag name of the DOM Node to create.
parent: The node to insert the new object into
position: The place in parent to insert the new node 0=first child, 1=second child, etc. any number > number of current children = last child

void WillDeleteNode ( nsIDOMNode child )

Called before the editor deletes a node.

Arguments:
child: The node to delete

void WillDeleteSelection ( nsISelection selection )

Called before the editor deletes the selection.

Arguments:
selection: The selection to be deleted

void WillDeleteText ( nsIDOMCharacterData textNode , PRInt32 offset , PRInt32 length )

Called before the editor deletes text.

Arguments:
textNode: This node getting text deleted
offset: The offset in textNode to delete at.
length: The amount of text to delete.

void WillInsertNode ( nsIDOMNode node , nsIDOMNode parent , PRInt32 position )

Called before the editor inserts a node.

Arguments:
node: The DOM Node to insert.
parent: The node to insert the new object into
position: The place in parent to insert the new node 0=first child, 1=second child, etc. any number > number of current children = last child

void WillInsertText ( nsIDOMCharacterData textNode , PRInt32 offset , DOMString string )

Called before the editor inserts text.

Arguments:
textNode: This node getting inserted text
offset: The offset in textNode to insert at.
string: The string that gets inserted.

void WillJoinNodes ( nsIDOMNode leftNode , nsIDOMNode rightNode , nsIDOMNode parent )

Called before the editor joins 2 nodes.

Arguments:
leftNode: This node will be merged into the right node
rightNode: The node that will be merged into. There is no requirement that the two nodes be of the same type.
parent: The parent of rightNode

void WillSplitNode ( nsIDOMNode existingRightNode , PRInt32 offset )

Called before the editor splits a node.

Arguments:
existingRightNode: the node to split. It will become the new node's next sibling.
offset: the offset of existingRightNode's content|children to do the split at

References

This interface is passed as an argument to the following methods:

nsIEditor.addEditActionListener, nsIEditor.removeEditActionListener

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com