1 /* -*- Mode: IDL; 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) 2000
20 * the Initial Developer. All Rights Reserved.
23 * Vidur Apparao <vidur@netscape.com> (original author)
24 * Johnny Stenback <jst@netscape.com>
26 * Alternatively, the contents of this file may be used under the terms of
27 * either of the GNU General Public License Version 2 or later (the "GPL"),
28 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 #include
"nsIDOMWindow2.idl"
43 interface nsIControllers
;
44 interface nsIDOMLocation
;
47 [scriptable
, uuid(3414EBC7
-731F
-4697-9F43
-ACA6F5050875
)]
48 interface nsIDOMWindowInternal
: nsIDOMWindow2
50 readonly attribute nsIDOMWindowInternal window
;
52 /* [replaceable] self */
53 readonly attribute nsIDOMWindowInternal self
;
55 readonly attribute nsIDOMNavigator navigator
;
56 readonly attribute nsIDOMScreen screen
;
57 readonly attribute nsIDOMHistory history
;
59 /* [replaceable] content */
60 readonly attribute nsIDOMWindow content
;
62 /* [replaceable] prompter */
63 [noscript
] readonly attribute nsIPrompt prompter
;
65 /* [replaceable] menubar */
66 readonly attribute nsIDOMBarProp menubar
;
68 /* [replaceable] toolbar */
69 readonly attribute nsIDOMBarProp toolbar
;
71 /* [replaceable] locationbar */
72 readonly attribute nsIDOMBarProp locationbar
;
74 /* [replaceable] personalbar */
75 readonly attribute nsIDOMBarProp personalbar
;
77 /* [replaceable] statusbar */
78 readonly attribute nsIDOMBarProp statusbar
;
80 /* [replaceable] directories */
81 readonly attribute nsIDOMBarProp directories
;
82 readonly attribute
boolean closed
;
83 readonly attribute nsIDOMCrypto crypto
;
84 readonly attribute nsIDOMPkcs11 pkcs11
;
86 // XXX Shouldn't this be in nsIDOMChromeWindow?
87 /* [replaceable] controllers */
88 readonly attribute nsIControllers controllers
;
90 attribute nsIDOMWindowInternal opener
;
93 attribute DOMString status
;
94 attribute DOMString defaultStatus
;
96 // XXX: The setter that takes a string argument needs to be special
98 readonly attribute nsIDOMLocation location
;
101 attribute
long innerWidth
;
102 attribute
long innerHeight
;
103 attribute
long outerWidth
;
104 attribute
long outerHeight
;
105 attribute
long screenX
;
106 attribute
long screenY
;
108 /* The offset in pixels by which the window is scrolled */
109 readonly attribute
long pageXOffset
;
110 readonly attribute
long pageYOffset
;
112 /* The maximum offset that the window can be scrolled to
113 (i.e., the document width/height minus the scrollport width/height) */
114 readonly attribute
long scrollMaxX
;
115 readonly attribute
long scrollMaxY
;
117 /* [replaceable] length */
118 readonly attribute
unsigned long length
;
120 attribute
boolean fullScreen
;
122 void alert
(in DOMString text
);
123 boolean confirm
(in DOMString text
);
125 // prompt() should return a null string if cancel is pressed
126 DOMString prompt
([optional] in DOMString aMessage
,
127 [optional] in DOMString aInitial
,
128 [optional] in DOMString aTitle
,
129 [optional] in unsigned long aSavePassword
);
141 void moveTo
(in long xPos
, in long yPos
);
142 void moveBy
(in long xDif
, in long yDif
);
143 void resizeTo
(in long width
, in long height
);
144 void resizeBy
(in long widthDif
, in long heightDif
);
145 void scroll
(in long xScroll
, in long yScroll
);
147 //void clearTimeout(in long timerID);
148 //void clearInterval(in long timerID);
149 //[noscript] long setTimeout(/* in function,
150 // in unsigned long timeout */);
151 //[noscript] long setInterval(/* in function,
152 // in unsigned long timeout */);
155 * Open a new window with this one as the parent. This method will
156 * NOT examine the JS stack for purposes of determining a caller.
157 * This window will be used for security checks during the search by
158 * name and the default character set on the newly opened window
159 * will just be the default character set of this window.
161 [noscript
] nsIDOMWindow open
(in DOMString url
, in DOMString name
,
162 in DOMString options
);
165 * This method works like open except that aExtraArgument gets
166 * converted into the array window.arguments in JS, if
167 * aExtraArgument is a nsISupportsArray then the individual items in
168 * the array are inserted into window.arguments, and primitive
169 * nsISupports (nsISupportsPrimitives) types are converted to native
170 * JS types when possible.
172 [noscript
] nsIDOMWindow openDialog
(in DOMString url
, in DOMString name
,
173 in DOMString options
,
174 in nsISupports aExtraArgument
);
177 // XXX Should this be in nsIDOMChromeWindow?
178 void updateCommands
(in DOMString action
);
181 * @param str: the search pattern
182 * @param caseSensitive: is the search caseSensitive
183 * @param backwards: should we search backwards
184 * @param wrapAround: should we wrap the search
185 * @param wholeWord: should we search only for whole words
186 * @param searchInFrames: should we search through all frames
187 * @param showDialog: should we show the Find dialog
189 boolean find
([optional] in DOMString str
,
190 [optional] in boolean caseSensitive
,
191 [optional] in boolean backwards
,
192 [optional] in boolean wrapAround
,
193 [optional] in boolean wholeWord
,
194 [optional] in boolean searchInFrames
,
195 [optional] in boolean showDialog
);
197 // Ascii base64 data to binary data and vice versa...
198 DOMString atob
(in DOMString aAsciiString
);
199 DOMString btoa
(in DOMString aBase64Data
);
201 readonly attribute nsIDOMElement frameElement
;
203 nsIVariant showModalDialog
(in DOMString aURI
,
204 [optional] in nsIVariant aArgs
,
205 [optional] in DOMString aOptions
);
208 * Implements a safe message-passing system which can cross same-origin
211 * This method, when called, causes a MessageEvent to be asynchronously
212 * dispatched at the primary document for the window upon which this method is
213 * called. (Note that the postMessage property on windows is allAccess and
214 * thus is readable cross-origin.) The dispatched event will have message as
215 * its data, the calling context's window as its source, and an origin
216 * determined by the calling context's main document URI. The targetOrigin
217 * argument specifies a URI and is used to restrict the message to be sent
218 * only when the target window has the same origin as targetOrigin (since,
219 * when the sender and the target have different origins, neither can read the
220 * location of the other).
222 * See the WHATWG HTML5 specification, section 6.4, for more details.
224 [binaryname
(PostMessageMoz
)] void postMessage
(in DOMString
message,
225 in DOMString targetOrigin
);