embedding/browser/webBrowser/nsIWebBrowserFocus.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/embedding/browser/webBrowser/nsIWebBrowserFocus.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,76 @@
     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 +interface nsIDOMWindow;
    1.11 +interface nsIDOMElement;
    1.12 +
    1.13 +#include "nsISupports.idl"
    1.14 +
    1.15 +/**
    1.16 + * nsIWebBrowserFocus
    1.17 + * Interface that embedders use for controlling and interacting
    1.18 + * with the browser focus management. The embedded browser can be focused by
    1.19 + * clicking in it or tabbing into it. If the browser is currently focused and
    1.20 + * the embedding application's top level window is disabled, deactivate() must
    1.21 + * be called, and activate() called again when the top level window is
    1.22 + * reactivated for the browser's focus memory to work correctly.
    1.23 + */
    1.24 +
    1.25 +[scriptable, uuid(9c5d3c58-1dd1-11b2-a1c9-f3699284657a)]
    1.26 +interface nsIWebBrowserFocus : nsISupports
    1.27 +{
    1.28 +  /**
    1.29 +   * MANDATORY
    1.30 +   * activate() is a mandatory call that must be made to the browser
    1.31 +   * when the embedding application's window is activated *and* the 
    1.32 +   * browser area was the last thing in focus.  This method can also be called
    1.33 +   * if the embedding application wishes to give the browser area focus,
    1.34 +   * without affecting the currently focused element within the browser.
    1.35 +   *
    1.36 +   * @note
    1.37 +   * If you fail to make this call, mozilla focus memory will not work
    1.38 +   * correctly.
    1.39 +   */
    1.40 +  void activate();
    1.41 +
    1.42 +  /**
    1.43 +   * MANDATORY
    1.44 +   * deactivate() is a mandatory call that must be made to the browser
    1.45 +   * when the embedding application's window is deactivated *and* the
    1.46 +   * browser area was the last thing in focus.  On non-windows platforms,
    1.47 +   * deactivate() should also be called when focus moves from the browser
    1.48 +   * to the embedding chrome.
    1.49 +   *
    1.50 +   * @note
    1.51 +   * If you fail to make this call, mozilla focus memory will not work
    1.52 +   * correctly.
    1.53 +   */
    1.54 +  void deactivate();
    1.55 +
    1.56 +  /**
    1.57 +   * Give the first element focus within mozilla
    1.58 +   * (i.e. TAB was pressed and focus should enter mozilla)
    1.59 +   */
    1.60 +  void setFocusAtFirstElement();
    1.61 +
    1.62 +  /**
    1.63 +   * Give the last element focus within mozilla
    1.64 +   * (i.e. SHIFT-TAB was pressed and focus should enter mozilla)
    1.65 +   */
    1.66 +  void setFocusAtLastElement();
    1.67 +  
    1.68 +  /**
    1.69 +   * The currently focused nsDOMWindow when the browser is active,
    1.70 +   * or the last focused nsDOMWindow when the browser is inactive.
    1.71 +   */
    1.72 +  attribute nsIDOMWindow focusedWindow;
    1.73 +  
    1.74 +  /**
    1.75 +   * The currently focused nsDOMElement when the browser is active,
    1.76 +   * or the last focused nsDOMElement when the browser is inactive.
    1.77 +   */
    1.78 +  attribute nsIDOMElement focusedElement;
    1.79 +};

mercurial