2001-09-26 02:53:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-03-28 03:11:08 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
#include "domstubs.idl"
|
2003-07-18 23:03:34 +04:00
|
|
|
|
2018-04-07 01:32:25 +03:00
|
|
|
webidl CharacterData;
|
2018-05-08 20:52:36 +03:00
|
|
|
webidl Selection;
|
2001-03-28 03:11:08 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
Editor Action Listener interface to outside world
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2015-05-28 18:58:42 +03:00
|
|
|
* A generic editor action listener interface.
|
2001-03-28 03:11:08 +04:00
|
|
|
* <P>
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
[scriptable, uuid(b22907b1-ee93-11d2-8d50-000064657374)]
|
|
|
|
|
2018-01-13 04:10:05 +03:00
|
|
|
interface nsIEditActionListener : nsISupports
|
|
|
|
{
|
2015-05-28 18:58:42 +03:00
|
|
|
/**
|
2001-03-28 03:11:08 +04:00
|
|
|
* Called after the editor creates a node.
|
|
|
|
* @param aTag The tag name of the DOM Node to create.
|
2017-11-08 12:16:46 +03:00
|
|
|
* @param aNewNode The DOM Node that was created.
|
2001-03-28 03:11:08 +04:00
|
|
|
* @param aResult The result of the create node operation.
|
|
|
|
*/
|
|
|
|
void DidCreateNode(in DOMString aTag,
|
2017-11-08 12:16:46 +03:00
|
|
|
in nsIDOMNode aNewNode,
|
|
|
|
in nsresult aResult);
|
2001-03-28 03:11:08 +04:00
|
|
|
|
2015-05-28 18:58:42 +03:00
|
|
|
/**
|
2001-03-28 03:11:08 +04:00
|
|
|
* Called after the editor inserts a node.
|
|
|
|
* @param aNode The DOM Node to insert.
|
|
|
|
* @param aResult The result of the insert node operation.
|
|
|
|
*/
|
|
|
|
void DidInsertNode(in nsIDOMNode aNode,
|
2017-11-28 15:26:10 +03:00
|
|
|
in nsresult aResult);
|
2001-03-28 03:11:08 +04:00
|
|
|
|
2015-05-28 18:58:42 +03:00
|
|
|
/**
|
2001-03-28 03:11:08 +04:00
|
|
|
* Called after the editor deletes a node.
|
|
|
|
* @param aChild The node to delete
|
|
|
|
* @param aResult The result of the delete node operation.
|
|
|
|
*/
|
|
|
|
void DidDeleteNode(in nsIDOMNode aChild, in nsresult aResult);
|
|
|
|
|
2015-05-28 18:58:42 +03:00
|
|
|
/**
|
2001-03-28 03:11:08 +04:00
|
|
|
* Called after the editor splits a node.
|
2017-11-13 17:52:16 +03:00
|
|
|
* @param aExistingRightNode The node which was split. It will become the
|
|
|
|
* next sibling of the new left node.
|
|
|
|
* @param aNewLeftNode The new node resulting from the split, becomes
|
|
|
|
* the previous sibling of aExistingRightNode.
|
2001-03-28 03:11:08 +04:00
|
|
|
*/
|
|
|
|
void DidSplitNode(in nsIDOMNode aExistingRightNode,
|
2017-11-13 17:52:16 +03:00
|
|
|
in nsIDOMNode aNewLeftNode);
|
2001-03-28 03:11:08 +04:00
|
|
|
|
2015-05-28 18:58:42 +03:00
|
|
|
/**
|
2001-03-28 03:11:08 +04:00
|
|
|
* Called after the editor joins 2 nodes.
|
|
|
|
* @param aLeftNode This node will be merged into the right node
|
|
|
|
* @param aRightNode The node that will be merged into.
|
|
|
|
* There is no requirement that the two nodes be of
|
|
|
|
* the same type.
|
|
|
|
* @param aParent The parent of aRightNode
|
|
|
|
* @param aResult The result of the join operation.
|
|
|
|
*/
|
|
|
|
void DidJoinNodes(in nsIDOMNode aLeftNode,
|
|
|
|
in nsIDOMNode aRightNode,
|
|
|
|
in nsIDOMNode aParent,
|
|
|
|
in nsresult aResult);
|
|
|
|
|
2015-05-28 18:58:42 +03:00
|
|
|
/**
|
2001-03-28 03:11:08 +04:00
|
|
|
* Called after the editor inserts text.
|
2018-04-07 01:32:25 +03:00
|
|
|
* @param aTextNode This node getting inserted text.
|
2001-03-28 03:11:08 +04:00
|
|
|
* @param aOffset The offset in aTextNode to insert at.
|
|
|
|
* @param aString The string that gets inserted.
|
|
|
|
* @param aResult The result of the insert text operation.
|
|
|
|
*/
|
2018-04-07 01:32:25 +03:00
|
|
|
void DidInsertText(in CharacterData aTextNode,
|
2018-03-19 22:45:55 +03:00
|
|
|
in long aOffset,
|
|
|
|
in DOMString aString,
|
|
|
|
in nsresult aResult);
|
2001-03-28 03:11:08 +04:00
|
|
|
|
2015-05-28 18:58:42 +03:00
|
|
|
/**
|
2001-03-28 03:11:08 +04:00
|
|
|
* Called before the editor deletes text.
|
2018-04-07 01:32:25 +03:00
|
|
|
* @param aTextNode This node getting text deleted.
|
2001-03-28 03:11:08 +04:00
|
|
|
* @param aOffset The offset in aTextNode to delete at.
|
|
|
|
* @param aLength The amount of text to delete.
|
|
|
|
*/
|
2018-04-07 01:32:25 +03:00
|
|
|
void WillDeleteText(in CharacterData aTextNode,
|
2018-03-19 22:45:55 +03:00
|
|
|
in long aOffset,
|
|
|
|
in long aLength);
|
2001-03-28 03:11:08 +04:00
|
|
|
|
2015-05-28 18:58:42 +03:00
|
|
|
/**
|
2001-03-28 03:11:08 +04:00
|
|
|
* Called before the editor deletes text.
|
2018-04-07 01:32:25 +03:00
|
|
|
* @param aTextNode This node getting text deleted.
|
2001-03-28 03:11:08 +04:00
|
|
|
* @param aOffset The offset in aTextNode to delete at.
|
|
|
|
* @param aLength The amount of text to delete.
|
|
|
|
* @param aResult The result of the delete text operation.
|
|
|
|
*/
|
2018-04-07 01:32:25 +03:00
|
|
|
void DidDeleteText(in CharacterData aTextNode,
|
2018-03-19 22:45:55 +03:00
|
|
|
in long aOffset,
|
|
|
|
in long aLength,
|
2018-04-07 01:32:25 +03:00
|
|
|
in nsresult aResult);
|
2001-03-28 03:11:08 +04:00
|
|
|
|
2015-05-28 18:58:42 +03:00
|
|
|
/**
|
2001-03-28 03:11:08 +04:00
|
|
|
* Called before the editor deletes the selection.
|
|
|
|
* @param aSelection The selection to be deleted
|
|
|
|
*/
|
2018-05-08 20:52:36 +03:00
|
|
|
void WillDeleteSelection(in Selection aSelection);
|
2001-03-28 03:11:08 +04:00
|
|
|
|
2015-05-28 18:58:42 +03:00
|
|
|
/**
|
2001-03-28 03:11:08 +04:00
|
|
|
* Called after the editor deletes the selection.
|
|
|
|
* @param aSelection The selection, after deletion
|
|
|
|
*/
|
2018-05-08 20:52:36 +03:00
|
|
|
void DidDeleteSelection(in Selection aSelection);
|
2001-03-28 03:11:08 +04:00
|
|
|
};
|