~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/editor/idl/nsIEditActionListener.idl

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
2
/* ***** BEGIN LICENSE BLOCK *****
 
3
 * Version: NPL 1.1/GPL 2.0/LGPL 2.1
 
4
 *
 
5
 * The contents of this file are subject to the Netscape Public License
 
6
 * Version 1.1 (the "License"); you may not use this file except in
 
7
 * compliance with the License. You may obtain a copy of the License at
 
8
 * http://www.mozilla.org/NPL/
 
9
 *
 
10
 * Software distributed under the License is distributed on an "AS IS" basis,
 
11
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
12
 * for the specific language governing rights and limitations under the
 
13
 * License.
 
14
 *
 
15
 * The Original Code is mozilla.org code.
 
16
 *
 
17
 * The Initial Developer of the Original Code is 
 
18
 * Netscape Communications Corporation.
 
19
 * Portions created by the Initial Developer are Copyright (C) 1998
 
20
 * the Initial Developer. All Rights Reserved.
 
21
 *
 
22
 * Contributor(s):
 
23
 *
 
24
 *
 
25
 * Alternatively, the contents of this file may be used under the terms of
 
26
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
27
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
28
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
29
 * of those above. If you wish to allow use of your version of this file only
 
30
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
31
 * use your version of this file under the terms of the NPL, indicate your
 
32
 * decision by deleting the provisions above and replace them with the notice
 
33
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
34
 * the provisions above, a recipient may use your version of this file under
 
35
 * the terms of any one of the NPL, the GPL or the LGPL.
 
36
 *
 
37
 * ***** END LICENSE BLOCK ***** */
 
38
 
 
39
#include "nsISupports.idl"
 
40
#include "domstubs.idl"
 
41
 
 
42
interface nsISelection;
 
43
 
 
44
 
 
45
/*
 
46
Editor Action Listener interface to outside world
 
47
*/
 
48
 
 
49
 
 
50
/**
 
51
 * A generic editor action listener interface. 
 
52
 * <P>
 
53
 * nsIEditActionListener is the interface used by applications wishing to be notified
 
54
 * when the editor modifies the DOM tree.
 
55
 *
 
56
 * Note:  this is the wrong class to implement if you are interested in generic
 
57
 * change notifications.  For generic notifications, you should implement
 
58
 * nsIDocumentObserver.
 
59
 */
 
60
[scriptable, uuid(b22907b1-ee93-11d2-8d50-000064657374)]
 
61
 
 
62
interface nsIEditActionListener : nsISupports{
 
63
 
 
64
  /** 
 
65
   * Called before the editor creates a node.
 
66
   * @param aTag      The tag name of the DOM Node to create.
 
67
   * @param aParent   The node to insert the new object into
 
68
   * @param aPosition The place in aParent to insert the new node
 
69
   *                  0=first child, 1=second child, etc.
 
70
   *                  any number > number of current children = last child
 
71
   */
 
72
  void WillCreateNode(in DOMString aTag,
 
73
                            in nsIDOMNode   aParent,
 
74
                            in long aPosition);
 
75
 
 
76
  /** 
 
77
   * Called after the editor creates a node.
 
78
   * @param aTag      The tag name of the DOM Node to create.
 
79
   * @param aNode     The DOM Node that was created.
 
80
   * @param aParent   The node to insert the new object into
 
81
   * @param aPosition The place in aParent to insert the new node
 
82
   *                  0=first child, 1=second child, etc.
 
83
   *                  any number > number of current children = last child
 
84
   * @param aResult   The result of the create node operation.
 
85
   */
 
86
  void DidCreateNode(in DOMString aTag,
 
87
                           in nsIDOMNode aNode,
 
88
                           in nsIDOMNode aParent,
 
89
                           in long          aPosition,
 
90
                           in nsresult      aResult);
 
91
 
 
92
  /** 
 
93
   * Called before the editor inserts a node.
 
94
   * @param aNode     The DOM Node to insert.
 
95
   * @param aParent   The node to insert the new object into
 
96
   * @param aPosition The place in aParent to insert the new node
 
97
   *                  0=first child, 1=second child, etc.
 
98
   *                  any number > number of current children = last child
 
99
   */
 
100
  void WillInsertNode(in nsIDOMNode aNode,
 
101
                            in nsIDOMNode aParent,
 
102
                            in long      aPosition);
 
103
 
 
104
  /** 
 
105
   * Called after the editor inserts a node.
 
106
   * @param aNode     The DOM Node to insert.
 
107
   * @param aParent   The node to insert the new object into
 
108
   * @param aPosition The place in aParent to insert the new node
 
109
   *                  0=first child, 1=second child, etc.
 
110
   *                  any number > number of current children = last child
 
111
   * @param aResult   The result of the insert node operation.
 
112
   */
 
113
  void DidInsertNode(in nsIDOMNode aNode,
 
114
                           in nsIDOMNode aParent,
 
115
                           in long      aPosition,
 
116
                           in nsresult    aResult);
 
117
 
 
118
  /** 
 
119
   * Called before the editor deletes a node.
 
120
   * @param aChild    The node to delete
 
121
   */
 
122
  void WillDeleteNode(in nsIDOMNode aChild);
 
123
 
 
124
  /** 
 
125
   * Called after the editor deletes a node.
 
126
   * @param aChild    The node to delete
 
127
   * @param aResult   The result of the delete node operation.
 
128
   */
 
129
  void DidDeleteNode(in nsIDOMNode aChild, in nsresult aResult);
 
130
 
 
131
  /** 
 
132
   * Called before the editor splits a node.
 
133
   * @param aExistingRightNode   the node to split.  It will become the new node's next sibling.
 
134
   * @param aOffset              the offset of aExistingRightNode's content|children to do the split at
 
135
   * @param aNewLeftNode         [OUT] the new node resulting from the split, becomes aExistingRightNode's previous sibling.
 
136
   */
 
137
  void WillSplitNode(in nsIDOMNode aExistingRightNode,
 
138
                           in long      aOffset);
 
139
 
 
140
  /** 
 
141
   * Called after the editor splits a node.
 
142
   * @param aExistingRightNode   the node to split.  It will become the new node's next sibling.
 
143
   * @param aOffset              the offset of aExistingRightNode's content|children to do the split at
 
144
   * @param aNewLeftNode         [OUT] the new node resulting from the split, becomes aExistingRightNode's previous sibling.
 
145
   */
 
146
  void DidSplitNode(in nsIDOMNode aExistingRightNode,
 
147
                          in long      aOffset,
 
148
                          in nsIDOMNode aNewLeftNode,
 
149
                          in nsresult    aResult);
 
150
 
 
151
  /** 
 
152
   * Called before the editor joins 2 nodes.
 
153
   * @param aLeftNode   This node will be merged into the right node
 
154
   * @param aRightNode  The node that will be merged into.
 
155
   *                    There is no requirement that the two nodes be of
 
156
   *                    the same type.
 
157
   * @param aParent     The parent of aRightNode
 
158
   */
 
159
  void WillJoinNodes(in nsIDOMNode aLeftNode,
 
160
                           in nsIDOMNode aRightNode,
 
161
                           in nsIDOMNode aParent);
 
162
 
 
163
  /** 
 
164
   * Called after the editor joins 2 nodes.
 
165
   * @param aLeftNode   This node will be merged into the right node
 
166
   * @param aRightNode  The node that will be merged into.
 
167
   *                    There is no requirement that the two nodes be of
 
168
   *                    the same type.
 
169
   * @param aParent     The parent of aRightNode
 
170
   * @param aResult     The result of the join operation.
 
171
   */
 
172
  void DidJoinNodes(in nsIDOMNode aLeftNode,
 
173
                          in nsIDOMNode aRightNode,
 
174
                          in nsIDOMNode aParent,
 
175
                          in nsresult    aResult);
 
176
 
 
177
  /** 
 
178
   * Called before the editor inserts text.
 
179
   * @param aTextNode   This node getting inserted text
 
180
   * @param aOffset     The offset in aTextNode to insert at.
 
181
   * @param aString     The string that gets inserted.
 
182
   */
 
183
  void WillInsertText(in nsIDOMCharacterData aTextNode,
 
184
                            in long          aOffset,
 
185
                            in DOMString     aString);
 
186
 
 
187
  /** 
 
188
   * Called after the editor inserts text.
 
189
   * @param aTextNode   This node getting inserted text
 
190
   * @param aOffset     The offset in aTextNode to insert at.
 
191
   * @param aString     The string that gets inserted.
 
192
   * @param aResult     The result of the insert text operation.
 
193
   */
 
194
  void DidInsertText(in nsIDOMCharacterData aTextNode,
 
195
                           in long                aOffset,
 
196
                           in DOMString           aString,
 
197
                           in nsresult            aResult);
 
198
 
 
199
  /** 
 
200
   * Called before the editor deletes text.
 
201
   * @param aTextNode   This node getting text deleted
 
202
   * @param aOffset     The offset in aTextNode to delete at.
 
203
   * @param aLength     The amount of text to delete.
 
204
   */
 
205
  void WillDeleteText(in nsIDOMCharacterData aTextNode,
 
206
                            in long                aOffset,
 
207
                            in long                aLength);
 
208
 
 
209
  /** 
 
210
   * Called before the editor deletes text.
 
211
   * @param aTextNode   This node getting text deleted
 
212
   * @param aOffset     The offset in aTextNode to delete at.
 
213
   * @param aLength     The amount of text to delete.
 
214
   * @param aResult     The result of the delete text operation.
 
215
   */
 
216
  void DidDeleteText(in nsIDOMCharacterData aTextNode,
 
217
                           in long                aOffset,
 
218
                           in long                aLength,
 
219
                           in nsresult              aResult);
 
220
 
 
221
  /** 
 
222
   * Called before the editor deletes the selection.
 
223
   * @param aSelection   The selection to be deleted
 
224
   */
 
225
  void WillDeleteSelection(in nsISelection aSelection);
 
226
 
 
227
  /** 
 
228
   * Called after the editor deletes the selection.
 
229
   * @param aSelection   The selection, after deletion
 
230
   */
 
231
  void DidDeleteSelection(in nsISelection aSelection);
 
232
};