forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nsIEditActionListener.idl
113 lines (100 loc) · 3.92 KB
/
nsIEditActionListener.idl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "nsISupports.idl"
#include "domstubs.idl"
webidl CharacterData;
webidl Node;
webidl Selection;
/*
Editor Action Listener interface to outside world
*/
/**
* A generic editor action listener interface.
* <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)]
interface nsIEditActionListener : nsISupports
{
/**
* Called after the editor creates a node.
* @param aTag The tag name of the DOM Node to create.
* @param aNewNode The DOM Node that was created.
* @param aResult The result of the create node operation.
*/
void DidCreateNode(in AString aTag,
in Node aNewNode,
in nsresult aResult);
/**
* 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 Node aNode,
in nsresult aResult);
/**
* 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 Node aChild, in nsresult aResult);
/**
* Called after the editor splits a node.
* @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.
*/
void DidSplitNode(in Node aExistingRightNode,
in Node aNewLeftNode);
/**
* 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 Node aLeftNode,
in Node aRightNode,
in Node aParent,
in nsresult aResult);
/**
* Called after the editor inserts text.
* @param aTextNode This node getting inserted text.
* @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.
*/
void DidInsertText(in CharacterData aTextNode,
in long aOffset,
in AString aString,
in nsresult aResult);
/**
* Called before the editor deletes text.
* @param aTextNode This node getting text deleted.
* @param aOffset The offset in aTextNode to delete at.
* @param aLength The amount of text to delete.
*/
void WillDeleteText(in CharacterData aTextNode,
in long aOffset,
in long aLength);
/**
* Called before the editor deletes the selection.
* @param aSelection The selection to be deleted
*/
void WillDeleteSelection(in Selection aSelection);
/**
* Called after the editor deletes the selection.
* @param aSelection The selection, after deletion
*/
void DidDeleteSelection(in Selection aSelection);
};