/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
 * The contents of this file are subject to the Netscape 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/NPL/
 *
 * 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 Netscape are
 * Copyright (C) 2000 Netscape Communications Corporation. All
 * Rights Reserved.
 *
 * Contributor(s):
 *   Vidur Apparao <vidur@netscape.com> (original author)
 *   Johnny Stenback <jst@netscape.com>
 */

#include "nsIDOMWindow.idl"

interface nsISidebar;
interface nsIPrompt;
interface nsIControllers;
interface nsIDOMLocation;


[scriptable, uuid(9c911860-7dd9-11d4-9a83-000064657374)]
interface nsIDOMWindowInternal : nsIDOMWindow
{
  readonly attribute nsIDOMWindowInternal        window;
  readonly attribute nsIDOMWindowInternal        self;
  readonly attribute nsIDOMNavigator             navigator;
  readonly attribute nsIDOMScreen                screen;
  readonly attribute nsIDOMHistory               history;

  /* [replaceable] content */
  readonly attribute nsIDOMWindow                content;

  /* [replaceable] sidebar */
  readonly attribute nsISidebar                  sidebar;

  /* [replaceable] prompter */
  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;
  readonly attribute nsIDOMPkcs11                pkcs11;

  /* [replaceable] controllers */
  readonly attribute nsIControllers              controllers;
           attribute nsIDOMWindowInternal        opener;
           attribute DOMString                   status;
           attribute DOMString                   defaultStatus;

  // XXX: The setter that takes a string argument needs to be special
  // cased!
  readonly attribute nsIDOMLocation              location;
           attribute DOMString                   title;

           attribute long                        innerWidth;
           attribute long                        innerHeight;
           attribute long                        outerWidth;
           attribute long                        outerHeight;
           attribute long                        screenX;
           attribute long                        screenY;

  readonly attribute long                        pageXOffset;
  readonly attribute long                        pageYOffset;

  /* [replaceable] length */
  readonly attribute unsigned long               length;

  void                      alert(in DOMString text);
  boolean                   confirm(in DOMString text);

  // XXX prompt() should return a null string if cancel is pressed
  DOMString                 prompt(in DOMString aMessage,
                                   in DOMString aInitial,
                                   in DOMString aTitle,
                                   in unsigned long aSavePassword);

  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                      GetAttention();
  void                      scroll(in long xScroll, in long yScroll);

  void                      clearTimeout(in long timerID);
  void                      clearInterval(in long timerID);
  //[noscript] long           setTimeout(/* in function,
  //                                        in unsigned long timeout */);
  //[noscript] long           setInterval(/* in function,
  //                                        in unsigned long timeout */);

  void                      setCursor(in DOMString cursor);

  [noscript] nsIDOMWindow   open(in DOMString url, in DOMString name,
                                 in DOMString options);
  // 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.
  [noscript] nsIDOMWindow   openDialog(in DOMString url, in DOMString name,
                                       in DOMString options,
                                       in nsISupports aExtraArgument);
  void                      close();

  void                      updateCommands(in DOMString action);

  DOMString                 escape(in DOMString str);
  DOMString                 unescape(in DOMString str);
};
