PageRenderTime 23ms CodeModel.GetById 14ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/embedding/browser/webBrowser/nsIWebBrowserFocus.idl

http://github.com/zpao/v8monkey
IDL | 110 lines | 13 code | 9 blank | 88 comment | 0 complexity | e85ff5c0d6a0adbea401bbb65bf404f8 MD5 | raw file
  1/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2 *
  3 * ***** BEGIN LICENSE BLOCK *****
  4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5 *
  6 * The contents of this file are subject to the Mozilla Public License Version
  7 * 1.1 (the "License"); you may not use this file except in compliance with
  8 * the License. You may obtain a copy of the License at
  9 * http://www.mozilla.org/MPL/
 10 *
 11 * Software distributed under the License is distributed on an "AS IS" basis,
 12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 13 * for the specific language governing rights and limitations under the
 14 * License.
 15 *
 16 * The Original Code is the Mozilla browser.
 17 *
 18 * The Initial Developer of the Original Code is
 19 * Netscape Communications, Inc.
 20 * Portions created by the Initial Developer are Copyright (C) 1999
 21 * the Initial Developer. All Rights Reserved.
 22 *
 23 * Contributor(s):
 24 *   Chris Saari <saari@netscape.com>
 25 *   Dan Rosen <dr@netscape.com>
 26 *
 27 * Alternatively, the contents of this file may be used under the terms of
 28 * either the GNU General Public License Version 2 or later (the "GPL"), or
 29 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 30 * in which case the provisions of the GPL or the LGPL are applicable instead
 31 * of those above. If you wish to allow use of your version of this file only
 32 * under the terms of either the GPL or the LGPL, and not to allow others to
 33 * use your version of this file under the terms of the MPL, indicate your
 34 * decision by deleting the provisions above and replace them with the notice
 35 * and other provisions required by the GPL or the LGPL. If you do not delete
 36 * the provisions above, a recipient may use your version of this file under
 37 * the terms of any one of the MPL, the GPL or the LGPL.
 38 *
 39 * ***** END LICENSE BLOCK ***** */
 40
 41interface nsIDOMWindow;
 42interface nsIDOMElement;
 43
 44#include "nsISupports.idl"
 45
 46/**
 47 * nsIWebBrowserFocus
 48 * Interface that embedders use for controlling and interacting
 49 * with the browser focus management. The embedded browser can be focused by
 50 * clicking in it or tabbing into it. If the browser is currently focused and
 51 * the embedding application's top level window is disabled, deactivate() must
 52 * be called, and activate() called again when the top level window is
 53 * reactivated for the browser's focus memory to work correctly.
 54 */
 55
 56[scriptable, uuid(9c5d3c58-1dd1-11b2-a1c9-f3699284657a)]
 57interface nsIWebBrowserFocus : nsISupports
 58{
 59  /**
 60   * MANDATORY
 61   * activate() is a mandatory call that must be made to the browser
 62   * when the embedding application's window is activated *and* the 
 63   * browser area was the last thing in focus.  This method can also be called
 64   * if the embedding application wishes to give the browser area focus,
 65   * without affecting the currently focused element within the browser.
 66   *
 67   * @note
 68   * If you fail to make this call, mozilla focus memory will not work
 69   * correctly.
 70   */
 71  void activate();
 72
 73  /**
 74   * MANDATORY
 75   * deactivate() is a mandatory call that must be made to the browser
 76   * when the embedding application's window is deactivated *and* the
 77   * browser area was the last thing in focus.  On non-windows platforms,
 78   * deactivate() should also be called when focus moves from the browser
 79   * to the embedding chrome.
 80   *
 81   * @note
 82   * If you fail to make this call, mozilla focus memory will not work
 83   * correctly.
 84   */
 85  void deactivate();
 86
 87  /**
 88   * Give the first element focus within mozilla
 89   * (i.e. TAB was pressed and focus should enter mozilla)
 90   */
 91  void setFocusAtFirstElement();
 92
 93  /**
 94   * Give the last element focus within mozilla
 95   * (i.e. SHIFT-TAB was pressed and focus should enter mozilla)
 96   */
 97  void setFocusAtLastElement();
 98  
 99  /**
100   * The currently focused nsDOMWindow when the browser is active,
101   * or the last focused nsDOMWindow when the browser is inactive.
102   */
103  attribute nsIDOMWindow focusedWindow;
104  
105  /**
106   * The currently focused nsDOMElement when the browser is active,
107   * or the last focused nsDOMElement when the browser is inactive.
108   */
109  attribute nsIDOMElement focusedElement;
110};