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
4 *
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/
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) 2000
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 * Johnny Stenback <jst@netscape.com> (original author)
24 *
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.
36 *
37 * ***** END LICENSE BLOCK ***** */
38
39 #include "domstubs.idl"
40
41 [scriptable, uuid(c8188620-1dd1-11b2-bc88-df8440498add)]
42 interface nsIDOMJSWindow : nsISupports
43 {
44 void dump(in DOMString str);
45
46 /**
47 * These methods take typeless arguments and optional arguments, the
48 * first argument is either a function or a string, the second
49 * argument must be a number (ms) and the rest of the arguments (2
50 * ... n) are passed to the callback function
51 */
52 long setTimeout();
53 long setInterval();
54
55 /**
56 * These methods take one optional argument that's the timer ID to
57 * clear. Often in existing code these methods are passed undefined,
58 * which is a nop so we need to support that as well.
59 */
60 void clearTimeout();
61 void clearInterval();
62
63 /**
64 * This method is here for backwards compatibility with 4.x only,
65 * its implementation is a no-op
66 */
67 void setResizable(in boolean resizable);
68
69 /**
70 * @deprecated These are old Netscape 4 methods. Do not use,
71 * the implementation is no-op.
72 */
73 void captureEvents(in long eventFlags);
74 void releaseEvents(in long eventFlags);
75 void routeEvent(in nsIDOMEvent evt);
76 void enableExternalCapture();
77 void disableExternalCapture();
78
79 /**
80 * The prompt method takes up to four arguments, the arguments are
81 * message, initial prompt value, title and a save password flag
82 */
83 DOMString prompt();
84
85 /**
86 * These are the scriptable versions of nsIDOMWindowInternal::open() and
87 * nsIDOMWindowInternal::openDialog() that take 3 optional arguments. Unlike
88 * the nsIDOMWindowInternal methods, these methods assume that they are
89 * called from JavaScript and hence will look on the JS context stack to
90 * determine the caller and hence correct security context for doing their
91 * search for an existing named window. Also, these methods will set the
92 * default charset on the newly opened window based on the current document
93 * charset in the caller.
94 */
95 nsIDOMWindow open();
96 nsIDOMWindow openDialog();
97
98 /**
99 * window.frames in Netscape 4.x and IE is just a reference to the
100 * window itself (i.e. window.frames === window), but this doesn't
101 * make sense from a generic API point of view so that's why this is
102 * JS specific.
103 *
104 * This property is "replaceable" in JavaScript.
105 */
106 readonly attribute nsIDOMWindow frames;
107
108 /* Scriptable version of find(). See nsIDOMWindowInternal for the
109 * non-scriptable version. It takes 7 optional arguments:
110 * @param searchString: the search string
111 * @param caseSensitive: is the search case sensitive?
112 * @param backwards: should we search backwards?
113 * @param wrapAround: should wrap the search?
114 * @param wholeWord: should we search only for whole words?
115 * @param searchInFrames: should we search in all frames?
116 * @param showDialog: should we show the Find Dialog?
117 */
118 boolean find();
119 };