xpfe/appshell/public/nsIXULWindow.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpfe/appshell/public/nsIXULWindow.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,124 @@
     1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + *
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +
    1.12 +/**
    1.13 + * The nsIXULWindow
    1.14 + *
    1.15 + * When the window is destroyed, it will fire a "xul-window-destroyed"
    1.16 + * notification through the global observer service.
    1.17 + */
    1.18 +
    1.19 +interface nsIDocShell;
    1.20 +interface nsIDocShellTreeItem;
    1.21 +interface nsIXULBrowserWindow;
    1.22 +
    1.23 +[scriptable, uuid(CCF9E98A-E442-4061-9F74-94539DD9FE9E)]
    1.24 +interface nsIXULWindow : nsISupports
    1.25 +{
    1.26 +  /**
    1.27 +   * The docshell owning the XUL for this window.
    1.28 +   */
    1.29 +  readonly attribute nsIDocShell docShell;
    1.30 +
    1.31 +  /**
    1.32 +   * Indicates if this window is instrinsically sized.	
    1.33 +   */
    1.34 +  attribute boolean intrinsicallySized;
    1.35 +
    1.36 +  /**
    1.37 +   * The primary content shell.  
    1.38 +   *
    1.39 +   * Note that this is a docshell tree item and therefore can not be assured of
    1.40 +   * what object it is. It could be an editor, a docshell, or a browser object.
    1.41 +   * Or down the road any other object that supports being a DocShellTreeItem
    1.42 +   * Query accordingly to determine the capabilities.
    1.43 +   */
    1.44 +  readonly attribute nsIDocShellTreeItem primaryContentShell;
    1.45 +
    1.46 +  /**
    1.47 +   * The content shell specified by the supplied id.
    1.48 +   *
    1.49 +   * Note that this is a docshell tree item and therefore can not be assured of
    1.50 +   * what object it is.  It could be an editor, a docshell, or a browser object.
    1.51 +   * Or down the road any other object that supports being a DocShellTreeItem
    1.52 +   * Query accordingly to determine the capabilities.
    1.53 +   */
    1.54 +  nsIDocShellTreeItem getContentShellById(in wstring ID);
    1.55 +
    1.56 +  /**
    1.57 +   * Tell this window that it has picked up a child XUL window
    1.58 +   * @param aChild the child window being added
    1.59 +   */
    1.60 +  void addChildWindow(in nsIXULWindow aChild);
    1.61 +
    1.62 +  /**
    1.63 +   * Tell this window that it has lost a child XUL window
    1.64 +   * @param aChild the child window being removed
    1.65 +   */
    1.66 +  void removeChildWindow(in nsIXULWindow aChild);
    1.67 +
    1.68 +  /**
    1.69 +   * Move the window to a centered position.
    1.70 +   * @param aRelative If not null, the window relative to which the window is
    1.71 +   *                  moved. See aScreen parameter for details.
    1.72 +   * @param aScreen   PR_TRUE to center the window relative to the screen
    1.73 +   *                  containing aRelative if aRelative is not null. If
    1.74 +   *                  aRelative is null then relative to the screen of the
    1.75 +   *                  opener window if it was initialized by passing it to
    1.76 +   *                  nsWebShellWindow::Initialize. Failing that relative to
    1.77 +   *                  the main screen.
    1.78 +   *                  PR_FALSE to center it relative to aRelative itself.
    1.79 +   * @param aAlert    PR_TRUE to move the window to an alert position,
    1.80 +   *                  generally centered horizontally and 1/3 down from the top.
    1.81 +   */
    1.82 +  void center(in nsIXULWindow aRelative, in boolean aScreen, in boolean aAlert);
    1.83 +
    1.84 +  /**
    1.85 +   * Shows the window as a modal window. That is, ensures that it is visible
    1.86 +   * and runs a local event loop, exiting only once the window has been closed.
    1.87 +   */
    1.88 +  void showModal();
    1.89 +
    1.90 +  const unsigned long lowestZ = 0;
    1.91 +  const unsigned long loweredZ = 4;  /* "alwaysLowered" attribute */
    1.92 +  const unsigned long normalZ = 5;
    1.93 +  const unsigned long raisedZ = 6;   /* "alwaysRaised" attribute */
    1.94 +  const unsigned long highestZ = 9;
    1.95 +
    1.96 +  attribute unsigned long zLevel;
    1.97 +
    1.98 +  /**
    1.99 +   * contextFlags are from nsIWindowCreator2
   1.100 +   */
   1.101 +  attribute uint32_t contextFlags;
   1.102 +
   1.103 +  attribute uint32_t chromeFlags;
   1.104 +
   1.105 +  /**
   1.106 +   * Begin assuming |chromeFlags| don't change hereafter, and assert
   1.107 +   * if they do change.  The state change is one-way and idempotent.
   1.108 +   */
   1.109 +  void assumeChromeFlagsAreFrozen();
   1.110 +
   1.111 +  /**
   1.112 +   * Create a new window.
   1.113 +   * @param aChromeFlags see nsIWebBrowserChrome
   1.114 +   * @return the newly minted window
   1.115 +   */
   1.116 +  nsIXULWindow createNewWindow(in int32_t aChromeFlags);
   1.117 +
   1.118 +  attribute nsIXULBrowserWindow XULBrowserWindow;
   1.119 +
   1.120 +  /**
   1.121 +   * Back-door method to force application of chrome flags at a particular
   1.122 +   * time.  Do NOT call this unless you know what you're doing!  In particular,
   1.123 +   * calling this when this XUL window doesn't yet have a document in its
   1.124 +   * docshell could cause problems.
   1.125 +   */
   1.126 +  [noscript] void applyChromeFlags();
   1.127 +};

mercurial