nsIWebBrowserFocus.idl 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 <[email protected]>
  25. * Dan Rosen <[email protected]>
  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. * @status FROZEN
  53. */
  54. [scriptable, uuid(9c5d3c58-1dd1-11b2-a1c9-f3699284657a)]
  55. interface nsIWebBrowserFocus : nsISupports
  56. {
  57. /**
  58. * MANDATORY
  59. * activate() is a mandatory call that must be made to the browser
  60. * when the embedding application's window is activated *and* the
  61. * browser area was the last thing in focus. This method can also be called
  62. * if the embedding application wishes to give the browser area focus,
  63. * without affecting the currently focused element within the browser.
  64. *
  65. * @note
  66. * If you fail to make this call, mozilla focus memory will not work
  67. * correctly.
  68. */
  69. void activate();
  70. /**
  71. * MANDATORY
  72. * deactivate() is a mandatory call that must be made to the browser
  73. * when the embedding application's window is deactivated *and* the
  74. * browser area was the last thing in focus. On non-windows platforms,
  75. * deactivate() should also be called when focus moves from the browser
  76. * to the embedding chrome.
  77. *
  78. * @note
  79. * If you fail to make this call, mozilla focus memory will not work
  80. * correctly.
  81. */
  82. void deactivate();
  83. /**
  84. * Give the first element focus within mozilla
  85. * (i.e. TAB was pressed and focus should enter mozilla)
  86. */
  87. void setFocusAtFirstElement();
  88. /**
  89. * Give the last element focus within mozilla
  90. * (i.e. SHIFT-TAB was pressed and focus should enter mozilla)
  91. */
  92. void setFocusAtLastElement();
  93. /**
  94. * The currently focused nsDOMWindow when the browser is active,
  95. * or the last focused nsDOMWindow when the browser is inactive.
  96. */
  97. attribute nsIDOMWindow focusedWindow;
  98. /**
  99. * The currently focused nsDOMElement when the browser is active,
  100. * or the last focused nsDOMElement when the browser is inactive.
  101. */
  102. attribute nsIDOMElement focusedElement;
  103. };