dom/interfaces/base/nsIBrowserDOMWindow.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/interfaces/base/nsIBrowserDOMWindow.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,103 @@
     1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +interface nsIDOMWindow;
    1.12 +interface nsIURI;
    1.13 +interface nsIFrameLoaderOwner;
    1.14 +
    1.15 +[scriptable, uuid(e420bd32-b8c4-4b47-8cca-09e0bddbb0c3)]
    1.16 +
    1.17 +/**
    1.18 + * The C++ source has access to the browser script source through
    1.19 + * nsIBrowserDOMWindow. It is intended to be attached to the chrome DOMWindow
    1.20 + * of a toplevel browser window (a XUL window). A DOMWindow that does not
    1.21 + * happen to be a browser chrome window will simply have no access to any such
    1.22 + * interface.
    1.23 + */
    1.24 +interface nsIBrowserDOMWindow : nsISupports
    1.25 +{
    1.26 +  /**
    1.27 +   * Values for openURI's aWhere parameter.
    1.28 +   */
    1.29 +  /**
    1.30 +   * Do whatever the default is based on application state, user preferences,
    1.31 +   * and the value of the aContext parameter to openURI.
    1.32 +   */
    1.33 +  const short OPEN_DEFAULTWINDOW = 0;
    1.34 +  /**
    1.35 +   * Open in the "current window".  If aOpener is provided, this should be the
    1.36 +   * top window in aOpener's window hierarchy, but exact behavior is
    1.37 +   * application-dependent.  If aOpener is not provided, it's up to the
    1.38 +   * application to decide what constitutes a "current window".
    1.39 +   */
    1.40 +  const short OPEN_CURRENTWINDOW = 1;
    1.41 +  /**
    1.42 +   * Open in a new window.
    1.43 +   */
    1.44 +  const short OPEN_NEWWINDOW     = 2;
    1.45 +  /**
    1.46 +   * Open in a new content tab in the toplevel browser window corresponding to
    1.47 +   * this nsIBrowserDOMWindow.
    1.48 +   */
    1.49 +  const short OPEN_NEWTAB        = 3;
    1.50 +  /**
    1.51 +   * Open in an existing content tab based on the URI. If a match can't be
    1.52 +   * found, revert to OPEN_NEWTAB behavior.
    1.53 +   */
    1.54 +  const short OPEN_SWITCHTAB     = 4;
    1.55 +
    1.56 +  /**
    1.57 +   * Values for openURI's aContext parameter.  These affect the behavior of
    1.58 +   * OPEN_DEFAULTWINDOW.
    1.59 +   */
    1.60 +  /**
    1.61 +   * external link (load request from another application, xremote, etc).
    1.62 +   */
    1.63 +  const short OPEN_EXTERNAL      = 1;
    1.64 +  /**
    1.65 +   * internal open new window
    1.66 +   */
    1.67 +  const short OPEN_NEW           = 2; 
    1.68 +
    1.69 +  /**
    1.70 +   * Load a URI
    1.71 +
    1.72 +   * @param aURI the URI to open. null is allowed.  If null is passed in, no
    1.73 +   *             load will be done, though the window the load would have
    1.74 +   *             happened in will be returned.
    1.75 +   * @param aWhere see possible values described above.
    1.76 +   * @param aOpener window requesting the open (can be null).
    1.77 +   * @param aContext the context in which the URI is being opened. This
    1.78 +   *                 is used only when aWhere == OPEN_DEFAULTWINDOW.
    1.79 +   * @return the window into which the URI was opened.
    1.80 +  */
    1.81 +  nsIDOMWindow openURI(in nsIURI aURI, in nsIDOMWindow aOpener,
    1.82 +                       in short aWhere, in short aContext);
    1.83 +
    1.84 +  /**
    1.85 +   * As above, but return the nsIFrameLoaderOwner for the new window.
    1.86 +   // XXXbz is this the right API? Do we really need the opener here?
    1.87 +   // See bug 537428
    1.88 +   */
    1.89 +  nsIFrameLoaderOwner openURIInFrame(in nsIURI aURI, in nsIDOMWindow aOpener,
    1.90 +                                     in short aWhere, in short aContext);
    1.91 +
    1.92 +  /**
    1.93 +   * @param  aWindow the window to test.
    1.94 +   * @return whether the window is the main content window for any
    1.95 +   *         currently open tab in this toplevel browser window.
    1.96 +   */
    1.97 +  boolean      isTabContentWindow(in nsIDOMWindow aWindow);
    1.98 +
    1.99 +  /**
   1.100 +  * The contentWindow property of the currently selected browser.
   1.101 +  * This is used to implement .content in remote-Firefox.
   1.102 +  */
   1.103 +
   1.104 +  readonly attribute jsval contentWindow;
   1.105 +};
   1.106 +

mercurial