/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. interface nsIDOMWindow;
  41. interface nsIDOMElement;
  42. #include "nsISupports.idl"
  43. /**
  44. * nsIWebBrowserFocus
  45. * Interface that embedders use for controlling and interacting
  46. * with the browser focus management. The embedded browser can be focused by
  47. * clicking in it or tabbing into it. If the browser is currently focused and
  48. * the embedding application's top level window is disabled, deactivate() must
  49. * be called, and activate() called again when the top level window is
  50. * reactivated for the browser's focus memory to work correctly.
  51. */
  52. [scriptable, uuid(9c5d3c58-1dd1-11b2-a1c9-f3699284657a)]
  53. interface nsIWebBrowserFocus : nsISupports
  54. {
  55. /**
  56. * MANDATORY
  57. * activate() is a mandatory call that must be made to the browser
  58. * when the embedding application's window is activated *and* the
  59. * browser area was the last thing in focus. This method can also be called
  60. * if the embedding application wishes to give the browser area focus,
  61. * without affecting the currently focused element within the browser.
  62. *
  63. * @note
  64. * If you fail to make this call, mozilla focus memory will not work
  65. * correctly.
  66. */
  67. void activate();
  68. /**
  69. * MANDATORY
  70. * deactivate() is a mandatory call that must be made to the browser
  71. * when the embedding application's window is deactivated *and* the
  72. * browser area was the last thing in focus. On non-windows platforms,
  73. * deactivate() should also be called when focus moves from the browser
  74. * to the embedding chrome.
  75. *
  76. * @note
  77. * If you fail to make this call, mozilla focus memory will not work
  78. * correctly.
  79. */
  80. void deactivate();
  81. /**
  82. * Give the first element focus within mozilla
  83. * (i.e. TAB was pressed and focus should enter mozilla)
  84. */
  85. void setFocusAtFirstElement();
  86. /**
  87. * Give the last element focus within mozilla
  88. * (i.e. SHIFT-TAB was pressed and focus should enter mozilla)
  89. */
  90. void setFocusAtLastElement();
  91. /**
  92. * The currently focused nsDOMWindow when the browser is active,
  93. * or the last focused nsDOMWindow when the browser is inactive.
  94. */
  95. attribute nsIDOMWindow focusedWindow;
  96. /**
  97. * The currently focused nsDOMElement when the browser is active,
  98. * or the last focused nsDOMElement when the browser is inactive.
  99. */
  100. attribute nsIDOMElement focusedElement;
  101. };