|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "domstubs.idl" |
|
7 |
|
8 [scriptable, uuid(4237c376-d637-4b6e-9f8a-1da57e867834)] |
|
9 interface nsIDOMJSWindow : nsISupports |
|
10 { |
|
11 void dump(in DOMString str); |
|
12 |
|
13 /** |
|
14 * These methods take typeless arguments and optional arguments, the |
|
15 * first argument is either a function or a string, the second |
|
16 * argument must be a number (ms) and the rest of the arguments (2 |
|
17 * ... n) are passed to the callback function |
|
18 */ |
|
19 long setTimeout(); |
|
20 long setInterval(); |
|
21 |
|
22 /** |
|
23 * These methods take one optional argument that's the timer ID to |
|
24 * clear. Often in existing code these methods are passed undefined, |
|
25 * which is a nop so we need to support that as well. |
|
26 */ |
|
27 void clearTimeout([optional] in long handle); |
|
28 void clearInterval([optional] in long handle); |
|
29 |
|
30 /** |
|
31 * This method is here for backwards compatibility with 4.x only, |
|
32 * its implementation is a no-op |
|
33 */ |
|
34 void setResizable(in boolean resizable); |
|
35 |
|
36 /** |
|
37 * @deprecated These are old Netscape 4 methods. Do not use, |
|
38 * the implementation is no-op. |
|
39 */ |
|
40 void captureEvents(); |
|
41 void releaseEvents(); |
|
42 |
|
43 /** |
|
44 * This is the scriptable version of nsIDOMWindow::open() |
|
45 * that takes 3 optional arguments. Its binary name is OpenJS to |
|
46 * avoid colliding with nsIDOMWindow::open(), which has the |
|
47 * same signature. The reason we can't have that collision is that |
|
48 * the implementation needs to know whether it was called from JS or |
|
49 * not. |
|
50 * |
|
51 * IOW, DO NOT CALL THIS FROM C++ |
|
52 */ |
|
53 [binaryname(OpenJS)] nsIDOMWindow open([optional] in DOMString url, |
|
54 [optional] in DOMString name, |
|
55 [optional] in DOMString options); |
|
56 |
|
57 /** |
|
58 * This is the scriptable version of |
|
59 * nsIDOMWindow::openDialog() that takes 3 optional |
|
60 * arguments, plus any additional arguments are passed on as |
|
61 * arguments on the dialog's window object (window.arguments). |
|
62 */ |
|
63 nsIDOMWindow openDialog([optional] in DOMString url, |
|
64 [optional] in DOMString name, |
|
65 [optional] in DOMString options); |
|
66 |
|
67 /** |
|
68 * window.frames in Netscape 4.x and IE is just a reference to the |
|
69 * window itself (i.e. window.frames === window), but this doesn't |
|
70 * make sense from a generic API point of view so that's why this is |
|
71 * JS specific. |
|
72 * |
|
73 * This property is "replaceable" in JavaScript. |
|
74 */ |
|
75 readonly attribute nsIDOMWindow frames; |
|
76 |
|
77 [implicit_jscontext, binaryname(ScriptableContent)] |
|
78 readonly attribute jsval content; |
|
79 }; |