Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / editor / idl / nsIContentFilter.idl
blobcebfe64b4bf8a6d685ec88c909e24bae7b31fb41
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
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.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 2003
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Kathleen Brade (brade@netscape.com)
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or 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 MPL, 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 MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
39 #include "nsISupports.idl"
40 #include "domstubs.idl"
42 interface nsIURL;
44 [scriptable, uuid(c18c49a8-62f0-4045-9884-4aa91e388f14)]
45 interface nsIContentFilter : nsISupports
47 /**
48 * This notification occurs in an editor during these events:
49 * * open of document (once rendered in window but before editable)
50 * * paste from clipboard
51 * * drop from mouse
52 * * insertion of html (such as with "cmd_insertHTML")
53 * It provides a hook so the above actions can be canceled or the data
54 * can be modified (using standard DOM APIs) or left untouched. The data
55 * that results (if any) from all filter callbacks is what will be used
56 * for transaction purposes (undo/redo) except for the open event.
58 * The willDeleteSelection parameter is offered for filters who want to
59 * handle the insertion themselves and need to handle drag/drop correctly.
60 * The flag is true when the editor intends to delete the selection.
62 * Callers who want to cancel all insertion can simply set
63 * continueWithInsertion to PR_FALSE and return.
64 * Note: If cancellation occurs during the "open" event, the editor will
65 * still be available but will be empty.
67 * Callers who want to allow insertion of the data with no changes
68 * can simply set continueWithInsertion to PR_TRUE and return.
70 * Callers who want to modify the content (docFragment) being inserted are
71 * responsible for updating contentStartNode, contentStartOffset,
72 * contentEndNode, and contentEndOffset (if necessary).
73 * Callers are responsible for freeing and addref'ing if they want to
74 * completely replace any of the DOM nodes passed in.
76 * The location where insertion will occur should be considered an
77 * approximation since the editor may need to adjust it if it deletes
78 * the selection as part of the event and later determines that insertion
79 * point is an empty container which should also be removed (or in other
80 * scenarios such as -moz-user-select:none).
82 * In some scenarios the selection will be deleted. If callers choose
83 * to adjust the insertion point, they should be careful that the insertion
84 * point is not in the current selection.
86 * The contentStartNode and contentEndNode are not necessarily
87 * immediate children of the docFragment. Any nodes outside of the range
88 * set by contentStartNode and contentEndNode are for context from the
89 * source document.
91 * @param mimeType the mimetype used for retrieving data
92 * @param contentSourceURL location where docFragment came from
93 * @param sourceDocument document where content came from (can be null)
94 * @param willDeleteSelection tells hook if selection will/should be deleted
95 * @param docFragment fragment of node to be inserted
96 * @param contentStartNode node under which content to be inserted begins
97 * @param contentStartOffset start offset within contentStartNode
98 * @param contentEndNode node under which content to be inserted ends
99 * @param contentEndOffset ending offset withing contentEndNode
100 * @param insertionPointNode location where insertion will occur
101 * @param insertionPointOffset offset within node where insertion occurs
102 * @param continueWithInsertion flag to cancel insertion (if desired)
105 void notifyOfInsertion(in AString mimeType,
106 in nsIURL contentSourceURL,
107 in nsIDOMDocument sourceDocument,
108 in PRBool willDeleteSelection,
109 inout nsIDOMNode docFragment,
110 inout nsIDOMNode contentStartNode,
111 inout long contentStartOffset,
112 inout nsIDOMNode contentEndNode,
113 inout long contentEndOffset,
114 inout nsIDOMNode insertionPointNode,
115 inout long insertionPointOffset,
116 out boolean continueWithInsertion);