nsIWebBrowserFocus.idl 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. interface mozIDOMWindowProxy;
  7. interface nsIDOMElement;
  8. #include "nsISupports.idl"
  9. /**
  10. * nsIWebBrowserFocus
  11. * Interface that embedders use for controlling and interacting
  12. * with the browser focus management. The embedded browser can be focused by
  13. * clicking in it or tabbing into it. If the browser is currently focused and
  14. * the embedding application's top level window is disabled, deactivate() must
  15. * be called, and activate() called again when the top level window is
  16. * reactivated for the browser's focus memory to work correctly.
  17. */
  18. [scriptable, uuid(7f8c754e-5b36-44be-bc96-191b49f08ea6)]
  19. interface nsIWebBrowserFocus : nsISupports
  20. {
  21. /**
  22. * MANDATORY
  23. * activate() is a mandatory call that must be made to the browser
  24. * when the embedding application's window is activated *and* the
  25. * browser area was the last thing in focus. This method can also be called
  26. * if the embedding application wishes to give the browser area focus,
  27. * without affecting the currently focused element within the browser.
  28. *
  29. * @note
  30. * If you fail to make this call, mozilla focus memory will not work
  31. * correctly.
  32. */
  33. void activate();
  34. /**
  35. * MANDATORY
  36. * deactivate() is a mandatory call that must be made to the browser
  37. * when the embedding application's window is deactivated *and* the
  38. * browser area was the last thing in focus. On non-windows platforms,
  39. * deactivate() should also be called when focus moves from the browser
  40. * to the embedding chrome.
  41. *
  42. * @note
  43. * If you fail to make this call, mozilla focus memory will not work
  44. * correctly.
  45. */
  46. void deactivate();
  47. /**
  48. * Give the first element focus within mozilla
  49. * (i.e. TAB was pressed and focus should enter mozilla)
  50. */
  51. void setFocusAtFirstElement();
  52. /**
  53. * Give the last element focus within mozilla
  54. * (i.e. SHIFT-TAB was pressed and focus should enter mozilla)
  55. */
  56. void setFocusAtLastElement();
  57. /**
  58. * The currently focused nsDOMWindow when the browser is active,
  59. * or the last focused nsDOMWindow when the browser is inactive.
  60. */
  61. attribute mozIDOMWindowProxy focusedWindow;
  62. /**
  63. * The currently focused nsDOMElement when the browser is active,
  64. * or the last focused nsDOMElement when the browser is inactive.
  65. */
  66. attribute nsIDOMElement focusedElement;
  67. };