PageRenderTime 160ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/gecko_sdk/idl/nsIDOMWindowUtils.idl

http://firefox-mac-pdf.googlecode.com/
IDL | 181 lines | 26 code | 13 blank | 142 comment | 0 complexity | f20175b150d3a1ef9dc97943f2235ab2 MD5 | raw file
  1. /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4. *
  5. * The contents of this file are subject to the Mozilla Public License Version
  6. * 1.1 (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. * http://www.mozilla.org/MPL/
  9. *
  10. * Software distributed under the License is distributed on an "AS IS" basis,
  11. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12. * for the specific language governing rights and limitations under the
  13. * License.
  14. *
  15. * The Original Code is mozilla.org code.
  16. *
  17. * The Initial Developer of the Original Code is
  18. * Mozilla.org
  19. * Portions created by the Initial Developer are Copyright (C) 2004
  20. * the Initial Developer. All Rights Reserved.
  21. *
  22. * Contributor(s):
  23. *
  24. * Alternatively, the contents of this file may be used under the terms of
  25. * either of the GNU General Public License Version 2 or later (the "GPL"),
  26. * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27. * in which case the provisions of the GPL or the LGPL are applicable instead
  28. * of those above. If you wish to allow use of your version of this file only
  29. * under the terms of either the GPL or the LGPL, and not to allow others to
  30. * use your version of this file under the terms of the MPL, indicate your
  31. * decision by deleting the provisions above and replace them with the notice
  32. * and other provisions required by the GPL or the LGPL. If you do not delete
  33. * the provisions above, a recipient may use your version of this file under
  34. * the terms of any one of the MPL, the GPL or the LGPL.
  35. *
  36. * ***** END LICENSE BLOCK ***** */
  37. #include "nsISupports.idl"
  38. /**
  39. * nsIDOMWindowUtils is intended for infrequently-used methods related
  40. * to the current nsIDOMWindow. Some of the methods may require
  41. * elevated privileges; the method implementations should contain the
  42. * necessary security checks. Access this interface by calling
  43. * getInterface on a DOMWindow.
  44. */
  45. interface nsIDOMElement;
  46. [scriptable, uuid(1cfc1a0a-e348-4b18-b61b-935c192f85c4)]
  47. interface nsIDOMWindowUtils : nsISupports {
  48. /**
  49. * Image animation mode of the window. When this attribute's value
  50. * is changed, the implementation should set all images in the window
  51. * to the given value. That is, when set to kDontAnimMode, all images
  52. * will stop animating. The attribute's value must be one of the
  53. * animationMode values from imgIContainer.
  54. * @note Images may individually override the window's setting after
  55. * the window's mode is set. Therefore images given different modes
  56. * since the last setting of the window's mode may behave
  57. * out of line with the window's overall mode.
  58. * @note The attribute's value is the window's overall mode. It may
  59. * for example continue to report kDontAnimMode after all images
  60. * have subsequently been individually animated.
  61. * @note Only images immediately in this window are affected;
  62. * this is not recursive to subwindows.
  63. * @see imgIContainer
  64. */
  65. attribute unsigned short imageAnimationMode;
  66. /**
  67. * Whether the charset of the window's current document has been forced by
  68. * the user.
  69. * Cannot be accessed from unprivileged context (not content-accessible)
  70. */
  71. readonly attribute boolean docCharsetIsForced;
  72. /**
  73. * Function to get metadata associated with the window's current document
  74. * @param aName the name of the metadata. This should be all lowercase.
  75. * @return the value of the metadata, or the empty string if it's not set
  76. *
  77. * Will throw a DOM security error if called without UniversalXPConnect
  78. * privileges.
  79. */
  80. AString getDocumentMetadata(in AString aName);
  81. /**
  82. * Force an immediate redraw of this window.
  83. */
  84. void redraw();
  85. /** Synthesize a mouse event for a window. The event types supported
  86. * are:
  87. * mousedown, mouseup, mousemove, mouseover, mouseout, contextmenu
  88. *
  89. * Events are sent in coordinates offset by aX and aY from the window.
  90. *
  91. * Note that additional events may be fired as a result of this call. For
  92. * instance, typically a click event will be fired as a result of a
  93. * mousedown and mouseup in sequence.
  94. *
  95. * Normally at this level of events, the mouseover and mouseout events are
  96. * only fired when the window is entered or exited. For inter-element
  97. * mouseover and mouseout events, a movemove event fired on the new element
  98. * should be sufficient to generate the correct over and out events as well.
  99. *
  100. * Cannot be accessed from unprivileged context (not content-accessible)
  101. * Will throw a DOM security error if called without UniversalXPConnect
  102. * privileges.
  103. *
  104. * @param aType event type
  105. * @param aX x offset
  106. * @param aY y offset
  107. * @param aButton button to synthesize
  108. * @param aClickCount number of clicks that have been performed
  109. * @param aModifiers modifiers pressed, using constants defined in nsIDOMNSEvent
  110. */
  111. void sendMouseEvent(in AString aType,
  112. in long aX,
  113. in long aY,
  114. in long aButton,
  115. in long aClickCount,
  116. in long aModifiers);
  117. /**
  118. * Synthesize a key event to the window. The event types supported are:
  119. * keydown, keyup, keypress
  120. *
  121. * Key events generally end up being sent to the focused node.
  122. *
  123. * Cannot be accessed from unprivileged context (not content-accessible)
  124. * Will throw a DOM security error if called without UniversalXPConnect
  125. * privileges.
  126. *
  127. * @param aType event type
  128. * @param aKeyCode key code
  129. * @param aCharCode character code
  130. * @param aModifiers modifiers pressed, using constants defined in nsIDOMNSEvent
  131. */
  132. void sendKeyEvent(in AString aType,
  133. in long aKeyCode,
  134. in long aCharCode,
  135. in long aModifiers);
  136. /**
  137. * See nsIWidget::SynthesizeNativeKeyEvent
  138. *
  139. * Cannot be accessed from unprivileged context (not content-accessible)
  140. * Will throw a DOM security error if called without UniversalXPConnect
  141. * privileges.
  142. */
  143. void sendNativeKeyEvent(in long aNativeKeyboardLayout,
  144. in long aNativeKeyCode,
  145. in long aModifierFlags,
  146. in AString aCharacters,
  147. in AString aUnmodifiedCharacters);
  148. /**
  149. * Focus the element aElement. The element should be in the same document
  150. * that the window is displaying. Pass null to blur the element, if any,
  151. * that currently has focus, and focus the document.
  152. *
  153. * Cannot be accessed from unprivileged context (not content-accessible)
  154. * Will throw a DOM security error if called without UniversalXPConnect
  155. * privileges.
  156. *
  157. * @param aElement the element to focus
  158. */
  159. void focus(in nsIDOMElement aElement);
  160. /**
  161. * Force a garbage collection. This will run the cycle-collector twice to
  162. * make sure all garbage is collected.
  163. *
  164. * Will throw a DOM security error if called without UniversalXPConnect
  165. * privileges in non-debug builds. Available to all callers in debug builds.
  166. */
  167. void garbageCollect();
  168. };