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"
|
|
|
|
|
2011-05-23 11:53:31 -07:00
|
|
|
%{ C++
|
|
|
|
#include "jspubtd.h"
|
|
|
|
%}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsIPrompt;
|
|
|
|
interface nsIControllers;
|
|
|
|
interface nsIDOMLocation;
|
2007-07-26 10:52:26 -07:00
|
|
|
interface nsIVariant;
|
2010-09-08 22:38:04 -07:00
|
|
|
interface nsIAnimationFrameListener;
|
2011-04-21 20:17:31 -07:00
|
|
|
interface nsIDOMMediaQueryList;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-05-23 23:54:23 -07:00
|
|
|
[scriptable, uuid(3a7b0839-b9d6-42ff-8ba6-910aba60a966)]
|
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;
|
|
|
|
|
|
|
|
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,
|
2010-05-13 15:26:10 -07:00
|
|
|
[optional] in DOMString aInitial);
|
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.
|
|
|
|
*/
|
2011-05-23 11:53:31 -07:00
|
|
|
[implicit_jscontext, binaryname(PostMessageMoz)]
|
|
|
|
void postMessage(in jsval message, in DOMString targetOrigin);
|
2010-05-12 17:56:08 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the number of times this document for this window has
|
|
|
|
* been painted to the screen.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long long mozPaintCount;
|
2010-08-11 14:05:28 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Request a refresh of this browser window.
|
|
|
|
*/
|
2010-09-08 22:38:04 -07:00
|
|
|
void
|
|
|
|
mozRequestAnimationFrame([optional] in nsIAnimationFrameListener aListener);
|
2010-08-11 14:05:28 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The current animation start time in milliseconds since the epoch.
|
|
|
|
*/
|
|
|
|
readonly attribute long long mozAnimationStartTime;
|
2011-04-21 20:17:31 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
|
|
|
|
*/
|
|
|
|
nsIDOMMediaQueryList matchMedia(in DOMString media_query_list);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
2010-11-23 00:50:55 -08:00
|
|
|
|
|
|
|
[scriptable, uuid(8fc58f56-f769-4368-a098-edd08550cf1a)]
|
|
|
|
interface nsIDOMMozURLProperty : nsISupports
|
|
|
|
{
|
|
|
|
DOMString createObjectURL(in nsIDOMBlob blob);
|
|
|
|
void revokeObjectURL(in DOMString URL);
|
|
|
|
};
|
|
|
|
|
|
|
|
[scriptable, uuid(05563c0c-b74c-41ad-91d1-bc22d580a581)]
|
|
|
|
interface nsIDOMWindow_2_0_BRANCH : nsISupports
|
|
|
|
{
|
|
|
|
readonly attribute nsIDOMMozURLProperty URL;
|
|
|
|
};
|