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
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) 1998
20 * the Initial Developer. All Rights Reserved.
23 * Simon Fraser <sfraser@netscape.com>
24 * Mike Judge <mjudge@netscape.com>
25 * Charles Manske <cmanske@netscape.com>
27 * Alternatively, the contents of this file may be used under the terms of
28 * either of the GNU General Public License Version 2 or later (the "GPL"),
29 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 * in which case the provisions of the GPL or the LGPL are applicable instead
31 * of those above. If you wish to allow use of your version of this file only
32 * under the terms of either the GPL or the LGPL, and not to allow others to
33 * use your version of this file under the terms of the MPL, indicate your
34 * decision by deleting the provisions above and replace them with the notice
35 * and other provisions required by the GPL or the LGPL. If you do not delete
36 * the provisions above, a recipient may use your version of this file under
37 * the terms of any one of the MPL, the GPL or the LGPL.
39 * ***** END LICENSE BLOCK ***** */
41 #include
"nsISupports.idl"
42 #include
"domstubs.idl"
46 [scriptable
, uuid(274cd32e
-3675
-47e1
-9d8a
-fc6504ded9ce
)]
48 interface nsIEditingSession
: nsISupports
51 * Error codes when we fail to create an editor
52 * is placed in attribute editorStatus
54 const long eEditorOK
= 0;
55 const long eEditorCreationInProgress
= 1;
56 const long eEditorErrorCantEditMimeType
= 2;
57 const long eEditorErrorFileNotFound
= 3;
58 const long eEditorErrorCantEditFramesets
= 8;
59 const long eEditorErrorUnknown
= 9;
62 * Status after editor creation and document loading
63 * Value is one of the above error codes
65 readonly attribute
unsigned long editorStatus
;
68 * Make this window editable
69 * @param aWindow nsIDOMWindow, the window the embedder needs to make editable
70 * @param aEditorType string, "html" "htmlsimple" "text" "textsimple"
71 * @param aMakeWholeDocumentEditable if PR_TRUE make the whole document in
72 * aWindow editable, otherwise it's the
73 * embedder who should make the document
74 * (or part of it) editable.
75 * @param aInteractive if PR_FALSE turn off scripting and plugins
77 void makeWindowEditable
(in nsIDOMWindow window
, in string aEditorType
,
78 in boolean doAfterUriLoad
,
79 in boolean aMakeWholeDocumentEditable
,
80 in boolean aInteractive
);
83 * Test whether a specific window has had its editable flag set; it may have an editor
84 * now, or will get one after the uri load.
86 * Use this, passing the content root window, to test if we've set up editing
89 boolean windowIsEditable
(in nsIDOMWindow window
);
92 * Get the editor for this window. May return null
94 nsIEditor getEditorForWindow
(in nsIDOMWindow window
);
97 * Setup editor and related support objects
99 void setupEditorOnWindow
(in nsIDOMWindow window
);
102 * Destroy editor and related support objects
104 void tearDownEditorOnWindow
(in nsIDOMWindow window
);
106 void setEditorOnControllers
(in nsIDOMWindow aWindow
,
107 in nsIEditor aEditor
);
110 * Disable scripts and plugins in aWindow.
112 void disableJSAndPlugins
(in nsIDOMWindow aWindow
);
115 * Restore JS and plugins (enable/disable them) according to the state they
116 * were before the last call to disableJSAndPlugins.
118 void restoreJSAndPlugins
(in nsIDOMWindow aWindow
);
121 * Removes all the editor's controllers/listeners etc and makes the window
124 void detachFromWindow
(in nsIDOMWindow aWindow
);
127 * Undos detachFromWindow(), reattaches this editing session/editor
130 void reattachToWindow
(in nsIDOMWindow aWindow
);