2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2000
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Vidur Apparao <vidur@netscape.com> (original author)
|
|
|
|
* Johnny Stenback <jst@netscape.com>
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#include "nsIDOMWindow2.idl"
|
|
|
|
|
|
|
|
interface nsIPrompt;
|
|
|
|
interface nsIControllers;
|
|
|
|
interface nsIDOMLocation;
|
2007-07-26 10:52:26 -07:00
|
|
|
interface nsIVariant;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-08-03 14:41:36 -07:00
|
|
|
[scriptable, uuid(c2f4433a-8b4c-4676-ab30-3bffd26fb29e)]
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsIDOMWindowInternal : nsIDOMWindow2
|
|
|
|
{
|
|
|
|
readonly attribute nsIDOMWindowInternal window;
|
|
|
|
|
|
|
|
/* [replaceable] self */
|
|
|
|
readonly attribute nsIDOMWindowInternal self;
|
|
|
|
|
|
|
|
readonly attribute nsIDOMNavigator navigator;
|
|
|
|
readonly attribute nsIDOMScreen screen;
|
|
|
|
readonly attribute nsIDOMHistory history;
|
|
|
|
|
|
|
|
/* [replaceable] content */
|
|
|
|
readonly attribute nsIDOMWindow content;
|
|
|
|
|
|
|
|
/* [replaceable] prompter */
|
|
|
|
[noscript] readonly attribute nsIPrompt prompter;
|
|
|
|
|
|
|
|
/* [replaceable] menubar */
|
|
|
|
readonly attribute nsIDOMBarProp menubar;
|
|
|
|
|
|
|
|
/* [replaceable] toolbar */
|
|
|
|
readonly attribute nsIDOMBarProp toolbar;
|
|
|
|
|
|
|
|
/* [replaceable] locationbar */
|
|
|
|
readonly attribute nsIDOMBarProp locationbar;
|
|
|
|
|
|
|
|
/* [replaceable] personalbar */
|
|
|
|
readonly attribute nsIDOMBarProp personalbar;
|
|
|
|
|
|
|
|
/* [replaceable] statusbar */
|
|
|
|
readonly attribute nsIDOMBarProp statusbar;
|
|
|
|
|
|
|
|
/* [replaceable] directories */
|
|
|
|
readonly attribute nsIDOMBarProp directories;
|
|
|
|
readonly attribute boolean closed;
|
|
|
|
readonly attribute nsIDOMCrypto crypto;
|
2009-05-27 06:12:28 -07:00
|
|
|
readonly attribute nsIDOMPkcs11 pkcs11;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// XXX Shouldn't this be in nsIDOMChromeWindow?
|
|
|
|
/* [replaceable] controllers */
|
|
|
|
readonly attribute nsIControllers controllers;
|
|
|
|
|
|
|
|
attribute nsIDOMWindowInternal opener;
|
|
|
|
|
|
|
|
/* [replaceable] */
|
|
|
|
attribute DOMString status;
|
|
|
|
attribute DOMString defaultStatus;
|
|
|
|
|
|
|
|
// XXX: The setter that takes a string argument needs to be special
|
|
|
|
// cased!
|
|
|
|
readonly attribute nsIDOMLocation location;
|
|
|
|
|
|
|
|
/* [replaceable] */
|
|
|
|
attribute long innerWidth;
|
|
|
|
attribute long innerHeight;
|
|
|
|
attribute long outerWidth;
|
|
|
|
attribute long outerHeight;
|
|
|
|
attribute long screenX;
|
|
|
|
attribute long screenY;
|
2009-07-29 20:16:44 -07:00
|
|
|
readonly attribute float mozInnerScreenX;
|
|
|
|
readonly attribute float mozInnerScreenY;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/* The offset in pixels by which the window is scrolled */
|
|
|
|
readonly attribute long pageXOffset;
|
|
|
|
readonly attribute long pageYOffset;
|
|
|
|
|
|
|
|
/* The maximum offset that the window can be scrolled to
|
|
|
|
(i.e., the document width/height minus the scrollport width/height) */
|
|
|
|
readonly attribute long scrollMaxX;
|
|
|
|
readonly attribute long scrollMaxY;
|
|
|
|
|
|
|
|
/* [replaceable] length */
|
|
|
|
readonly attribute unsigned long length;
|
|
|
|
|
|
|
|
attribute boolean fullScreen;
|
|
|
|
|
|
|
|
void alert(in DOMString text);
|
|
|
|
boolean confirm(in DOMString text);
|
|
|
|
|
|
|
|
// prompt() should return a null string if cancel is pressed
|
2008-09-05 14:54:53 -07:00
|
|
|
DOMString prompt([optional] in DOMString aMessage,
|
|
|
|
[optional] in DOMString aInitial,
|
|
|
|
[optional] in DOMString aTitle,
|
|
|
|
[optional] in unsigned long aSavePassword);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
void focus();
|
|
|
|
void blur();
|
|
|
|
|
|
|
|
void back();
|
|
|
|
void forward();
|
|
|
|
void home();
|
|
|
|
void stop();
|
|
|
|
|
|
|
|
void print();
|
|
|
|
|
|
|
|
void moveTo(in long xPos, in long yPos);
|
|
|
|
void moveBy(in long xDif, in long yDif);
|
|
|
|
void resizeTo(in long width, in long height);
|
|
|
|
void resizeBy(in long widthDif, in long heightDif);
|
|
|
|
void scroll(in long xScroll, in long yScroll);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Open a new window with this one as the parent. This method will
|
|
|
|
* NOT examine the JS stack for purposes of determining a caller.
|
|
|
|
* This window will be used for security checks during the search by
|
|
|
|
* name and the default character set on the newly opened window
|
|
|
|
* will just be the default character set of this window.
|
|
|
|
*/
|
|
|
|
[noscript] nsIDOMWindow open(in DOMString url, in DOMString name,
|
|
|
|
in DOMString options);
|
2008-09-09 18:23:34 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This method works like open except that aExtraArgument gets
|
|
|
|
* converted into the array window.arguments in JS, if
|
|
|
|
* aExtraArgument is a nsISupportsArray then the individual items in
|
|
|
|
* the array are inserted into window.arguments, and primitive
|
|
|
|
* nsISupports (nsISupportsPrimitives) types are converted to native
|
|
|
|
* JS types when possible.
|
|
|
|
*/
|
2007-03-22 10:30:00 -07:00
|
|
|
[noscript] nsIDOMWindow openDialog(in DOMString url, in DOMString name,
|
|
|
|
in DOMString options,
|
|
|
|
in nsISupports aExtraArgument);
|
|
|
|
void close();
|
|
|
|
|
|
|
|
// XXX Should this be in nsIDOMChromeWindow?
|
|
|
|
void updateCommands(in DOMString action);
|
|
|
|
|
2008-09-05 14:54:53 -07:00
|
|
|
/* Find in page.
|
2007-03-22 10:30:00 -07:00
|
|
|
* @param str: the search pattern
|
|
|
|
* @param caseSensitive: is the search caseSensitive
|
|
|
|
* @param backwards: should we search backwards
|
|
|
|
* @param wrapAround: should we wrap the search
|
|
|
|
* @param wholeWord: should we search only for whole words
|
|
|
|
* @param searchInFrames: should we search through all frames
|
|
|
|
* @param showDialog: should we show the Find dialog
|
|
|
|
*/
|
2008-09-05 14:54:53 -07:00
|
|
|
boolean find([optional] in DOMString str,
|
|
|
|
[optional] in boolean caseSensitive,
|
|
|
|
[optional] in boolean backwards,
|
|
|
|
[optional] in boolean wrapAround,
|
|
|
|
[optional] in boolean wholeWord,
|
|
|
|
[optional] in boolean searchInFrames,
|
|
|
|
[optional] in boolean showDialog);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Ascii base64 data to binary data and vice versa...
|
|
|
|
DOMString atob(in DOMString aAsciiString);
|
|
|
|
DOMString btoa(in DOMString aBase64Data);
|
|
|
|
|
|
|
|
readonly attribute nsIDOMElement frameElement;
|
2007-07-26 10:52:26 -07:00
|
|
|
|
|
|
|
nsIVariant showModalDialog(in DOMString aURI,
|
|
|
|
[optional] in nsIVariant aArgs,
|
|
|
|
[optional] in DOMString aOptions);
|
2008-01-29 17:31:29 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements a safe message-passing system which can cross same-origin
|
|
|
|
* boundaries.
|
|
|
|
*
|
2008-05-02 12:26:47 -07:00
|
|
|
* This method, when called, causes a MessageEvent to be asynchronously
|
|
|
|
* dispatched at the primary document for the window upon which this method is
|
|
|
|
* called. (Note that the postMessage property on windows is allAccess and
|
|
|
|
* thus is readable cross-origin.) The dispatched event will have message as
|
|
|
|
* its data, the calling context's window as its source, and an origin
|
|
|
|
* determined by the calling context's main document URI. The targetOrigin
|
|
|
|
* argument specifies a URI and is used to restrict the message to be sent
|
|
|
|
* only when the target window has the same origin as targetOrigin (since,
|
|
|
|
* when the sender and the target have different origins, neither can read the
|
|
|
|
* location of the other).
|
2008-01-29 17:31:29 -08:00
|
|
|
*
|
|
|
|
* See the WHATWG HTML5 specification, section 6.4, for more details.
|
|
|
|
*/
|
2008-02-26 19:48:54 -08:00
|
|
|
[binaryname(PostMessageMoz)] void postMessage(in DOMString message,
|
2008-05-02 12:26:47 -07:00
|
|
|
in DOMString targetOrigin);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|