PageRenderTime 32ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/gecko_api/include/nsIDOMWindowUtils.h

http://firefox-mac-pdf.googlecode.com/
C Header | 296 lines | 121 code | 43 blank | 132 comment | 0 complexity | 23f8ed7ec35c8a9e2ad2178d39ffb27f MD5 | raw file
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/dom/public/idl/base/nsIDOMWindowUtils.idl
  3. */
  4. #ifndef __gen_nsIDOMWindowUtils_h__
  5. #define __gen_nsIDOMWindowUtils_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. class nsIDOMElement; /* forward declaration */
  14. /* starting interface: nsIDOMWindowUtils */
  15. #define NS_IDOMWINDOWUTILS_IID_STR "1cfc1a0a-e348-4b18-b61b-935c192f85c4"
  16. #define NS_IDOMWINDOWUTILS_IID \
  17. {0x1cfc1a0a, 0xe348, 0x4b18, \
  18. { 0xb6, 0x1b, 0x93, 0x5c, 0x19, 0x2f, 0x85, 0xc4 }}
  19. class NS_NO_VTABLE NS_SCRIPTABLE nsIDOMWindowUtils : public nsISupports {
  20. public:
  21. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMWINDOWUTILS_IID)
  22. /**
  23. * Image animation mode of the window. When this attribute's value
  24. * is changed, the implementation should set all images in the window
  25. * to the given value. That is, when set to kDontAnimMode, all images
  26. * will stop animating. The attribute's value must be one of the
  27. * animationMode values from imgIContainer.
  28. * @note Images may individually override the window's setting after
  29. * the window's mode is set. Therefore images given different modes
  30. * since the last setting of the window's mode may behave
  31. * out of line with the window's overall mode.
  32. * @note The attribute's value is the window's overall mode. It may
  33. * for example continue to report kDontAnimMode after all images
  34. * have subsequently been individually animated.
  35. * @note Only images immediately in this window are affected;
  36. * this is not recursive to subwindows.
  37. * @see imgIContainer
  38. */
  39. /* attribute unsigned short imageAnimationMode; */
  40. NS_SCRIPTABLE NS_IMETHOD GetImageAnimationMode(PRUint16 *aImageAnimationMode) = 0;
  41. NS_SCRIPTABLE NS_IMETHOD SetImageAnimationMode(PRUint16 aImageAnimationMode) = 0;
  42. /**
  43. * Whether the charset of the window's current document has been forced by
  44. * the user.
  45. * Cannot be accessed from unprivileged context (not content-accessible)
  46. */
  47. /* readonly attribute boolean docCharsetIsForced; */
  48. NS_SCRIPTABLE NS_IMETHOD GetDocCharsetIsForced(PRBool *aDocCharsetIsForced) = 0;
  49. /**
  50. * Function to get metadata associated with the window's current document
  51. * @param aName the name of the metadata. This should be all lowercase.
  52. * @return the value of the metadata, or the empty string if it's not set
  53. *
  54. * Will throw a DOM security error if called without UniversalXPConnect
  55. * privileges.
  56. */
  57. /* AString getDocumentMetadata (in AString aName); */
  58. NS_SCRIPTABLE NS_IMETHOD GetDocumentMetadata(const nsAString & aName, nsAString & _retval) = 0;
  59. /**
  60. * Force an immediate redraw of this window.
  61. */
  62. /* void redraw (); */
  63. NS_SCRIPTABLE NS_IMETHOD Redraw(void) = 0;
  64. /** Synthesize a mouse event for a window. The event types supported
  65. * are:
  66. * mousedown, mouseup, mousemove, mouseover, mouseout, contextmenu
  67. *
  68. * Events are sent in coordinates offset by aX and aY from the window.
  69. *
  70. * Note that additional events may be fired as a result of this call. For
  71. * instance, typically a click event will be fired as a result of a
  72. * mousedown and mouseup in sequence.
  73. *
  74. * Normally at this level of events, the mouseover and mouseout events are
  75. * only fired when the window is entered or exited. For inter-element
  76. * mouseover and mouseout events, a movemove event fired on the new element
  77. * should be sufficient to generate the correct over and out events as well.
  78. *
  79. * Cannot be accessed from unprivileged context (not content-accessible)
  80. * Will throw a DOM security error if called without UniversalXPConnect
  81. * privileges.
  82. *
  83. * @param aType event type
  84. * @param aX x offset
  85. * @param aY y offset
  86. * @param aButton button to synthesize
  87. * @param aClickCount number of clicks that have been performed
  88. * @param aModifiers modifiers pressed, using constants defined in nsIDOMNSEvent
  89. */
  90. /* void sendMouseEvent (in AString aType, in long aX, in long aY, in long aButton, in long aClickCount, in long aModifiers); */
  91. NS_SCRIPTABLE NS_IMETHOD SendMouseEvent(const nsAString & aType, PRInt32 aX, PRInt32 aY, PRInt32 aButton, PRInt32 aClickCount, PRInt32 aModifiers) = 0;
  92. /**
  93. * Synthesize a key event to the window. The event types supported are:
  94. * keydown, keyup, keypress
  95. *
  96. * Key events generally end up being sent to the focused node.
  97. *
  98. * Cannot be accessed from unprivileged context (not content-accessible)
  99. * Will throw a DOM security error if called without UniversalXPConnect
  100. * privileges.
  101. *
  102. * @param aType event type
  103. * @param aKeyCode key code
  104. * @param aCharCode character code
  105. * @param aModifiers modifiers pressed, using constants defined in nsIDOMNSEvent
  106. */
  107. /* void sendKeyEvent (in AString aType, in long aKeyCode, in long aCharCode, in long aModifiers); */
  108. NS_SCRIPTABLE NS_IMETHOD SendKeyEvent(const nsAString & aType, PRInt32 aKeyCode, PRInt32 aCharCode, PRInt32 aModifiers) = 0;
  109. /**
  110. * See nsIWidget::SynthesizeNativeKeyEvent
  111. *
  112. * Cannot be accessed from unprivileged context (not content-accessible)
  113. * Will throw a DOM security error if called without UniversalXPConnect
  114. * privileges.
  115. */
  116. /* void sendNativeKeyEvent (in long aNativeKeyboardLayout, in long aNativeKeyCode, in long aModifierFlags, in AString aCharacters, in AString aUnmodifiedCharacters); */
  117. NS_SCRIPTABLE NS_IMETHOD SendNativeKeyEvent(PRInt32 aNativeKeyboardLayout, PRInt32 aNativeKeyCode, PRInt32 aModifierFlags, const nsAString & aCharacters, const nsAString & aUnmodifiedCharacters) = 0;
  118. /**
  119. * Focus the element aElement. The element should be in the same document
  120. * that the window is displaying. Pass null to blur the element, if any,
  121. * that currently has focus, and focus the document.
  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 aElement the element to focus
  128. */
  129. /* void focus (in nsIDOMElement aElement); */
  130. NS_SCRIPTABLE NS_IMETHOD Focus(nsIDOMElement *aElement) = 0;
  131. /**
  132. * Force a garbage collection. This will run the cycle-collector twice to
  133. * make sure all garbage is collected.
  134. *
  135. * Will throw a DOM security error if called without UniversalXPConnect
  136. * privileges in non-debug builds. Available to all callers in debug builds.
  137. */
  138. /* void garbageCollect (); */
  139. NS_SCRIPTABLE NS_IMETHOD GarbageCollect(void) = 0;
  140. };
  141. NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMWindowUtils, NS_IDOMWINDOWUTILS_IID)
  142. /* Use this macro when declaring classes that implement this interface. */
  143. #define NS_DECL_NSIDOMWINDOWUTILS \
  144. NS_SCRIPTABLE NS_IMETHOD GetImageAnimationMode(PRUint16 *aImageAnimationMode); \
  145. NS_SCRIPTABLE NS_IMETHOD SetImageAnimationMode(PRUint16 aImageAnimationMode); \
  146. NS_SCRIPTABLE NS_IMETHOD GetDocCharsetIsForced(PRBool *aDocCharsetIsForced); \
  147. NS_SCRIPTABLE NS_IMETHOD GetDocumentMetadata(const nsAString & aName, nsAString & _retval); \
  148. NS_SCRIPTABLE NS_IMETHOD Redraw(void); \
  149. NS_SCRIPTABLE NS_IMETHOD SendMouseEvent(const nsAString & aType, PRInt32 aX, PRInt32 aY, PRInt32 aButton, PRInt32 aClickCount, PRInt32 aModifiers); \
  150. NS_SCRIPTABLE NS_IMETHOD SendKeyEvent(const nsAString & aType, PRInt32 aKeyCode, PRInt32 aCharCode, PRInt32 aModifiers); \
  151. NS_SCRIPTABLE NS_IMETHOD SendNativeKeyEvent(PRInt32 aNativeKeyboardLayout, PRInt32 aNativeKeyCode, PRInt32 aModifierFlags, const nsAString & aCharacters, const nsAString & aUnmodifiedCharacters); \
  152. NS_SCRIPTABLE NS_IMETHOD Focus(nsIDOMElement *aElement); \
  153. NS_SCRIPTABLE NS_IMETHOD GarbageCollect(void);
  154. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  155. #define NS_FORWARD_NSIDOMWINDOWUTILS(_to) \
  156. NS_SCRIPTABLE NS_IMETHOD GetImageAnimationMode(PRUint16 *aImageAnimationMode) { return _to GetImageAnimationMode(aImageAnimationMode); } \
  157. NS_SCRIPTABLE NS_IMETHOD SetImageAnimationMode(PRUint16 aImageAnimationMode) { return _to SetImageAnimationMode(aImageAnimationMode); } \
  158. NS_SCRIPTABLE NS_IMETHOD GetDocCharsetIsForced(PRBool *aDocCharsetIsForced) { return _to GetDocCharsetIsForced(aDocCharsetIsForced); } \
  159. NS_SCRIPTABLE NS_IMETHOD GetDocumentMetadata(const nsAString & aName, nsAString & _retval) { return _to GetDocumentMetadata(aName, _retval); } \
  160. NS_SCRIPTABLE NS_IMETHOD Redraw(void) { return _to Redraw(); } \
  161. NS_SCRIPTABLE NS_IMETHOD SendMouseEvent(const nsAString & aType, PRInt32 aX, PRInt32 aY, PRInt32 aButton, PRInt32 aClickCount, PRInt32 aModifiers) { return _to SendMouseEvent(aType, aX, aY, aButton, aClickCount, aModifiers); } \
  162. NS_SCRIPTABLE NS_IMETHOD SendKeyEvent(const nsAString & aType, PRInt32 aKeyCode, PRInt32 aCharCode, PRInt32 aModifiers) { return _to SendKeyEvent(aType, aKeyCode, aCharCode, aModifiers); } \
  163. NS_SCRIPTABLE NS_IMETHOD SendNativeKeyEvent(PRInt32 aNativeKeyboardLayout, PRInt32 aNativeKeyCode, PRInt32 aModifierFlags, const nsAString & aCharacters, const nsAString & aUnmodifiedCharacters) { return _to SendNativeKeyEvent(aNativeKeyboardLayout, aNativeKeyCode, aModifierFlags, aCharacters, aUnmodifiedCharacters); } \
  164. NS_SCRIPTABLE NS_IMETHOD Focus(nsIDOMElement *aElement) { return _to Focus(aElement); } \
  165. NS_SCRIPTABLE NS_IMETHOD GarbageCollect(void) { return _to GarbageCollect(); }
  166. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  167. #define NS_FORWARD_SAFE_NSIDOMWINDOWUTILS(_to) \
  168. NS_SCRIPTABLE NS_IMETHOD GetImageAnimationMode(PRUint16 *aImageAnimationMode) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetImageAnimationMode(aImageAnimationMode); } \
  169. NS_SCRIPTABLE NS_IMETHOD SetImageAnimationMode(PRUint16 aImageAnimationMode) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetImageAnimationMode(aImageAnimationMode); } \
  170. NS_SCRIPTABLE NS_IMETHOD GetDocCharsetIsForced(PRBool *aDocCharsetIsForced) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDocCharsetIsForced(aDocCharsetIsForced); } \
  171. NS_SCRIPTABLE NS_IMETHOD GetDocumentMetadata(const nsAString & aName, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDocumentMetadata(aName, _retval); } \
  172. NS_SCRIPTABLE NS_IMETHOD Redraw(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Redraw(); } \
  173. NS_SCRIPTABLE NS_IMETHOD SendMouseEvent(const nsAString & aType, PRInt32 aX, PRInt32 aY, PRInt32 aButton, PRInt32 aClickCount, PRInt32 aModifiers) { return !_to ? NS_ERROR_NULL_POINTER : _to->SendMouseEvent(aType, aX, aY, aButton, aClickCount, aModifiers); } \
  174. NS_SCRIPTABLE NS_IMETHOD SendKeyEvent(const nsAString & aType, PRInt32 aKeyCode, PRInt32 aCharCode, PRInt32 aModifiers) { return !_to ? NS_ERROR_NULL_POINTER : _to->SendKeyEvent(aType, aKeyCode, aCharCode, aModifiers); } \
  175. NS_SCRIPTABLE NS_IMETHOD SendNativeKeyEvent(PRInt32 aNativeKeyboardLayout, PRInt32 aNativeKeyCode, PRInt32 aModifierFlags, const nsAString & aCharacters, const nsAString & aUnmodifiedCharacters) { return !_to ? NS_ERROR_NULL_POINTER : _to->SendNativeKeyEvent(aNativeKeyboardLayout, aNativeKeyCode, aModifierFlags, aCharacters, aUnmodifiedCharacters); } \
  176. NS_SCRIPTABLE NS_IMETHOD Focus(nsIDOMElement *aElement) { return !_to ? NS_ERROR_NULL_POINTER : _to->Focus(aElement); } \
  177. NS_SCRIPTABLE NS_IMETHOD GarbageCollect(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->GarbageCollect(); }
  178. #if 0
  179. /* Use the code below as a template for the implementation class for this interface. */
  180. /* Header file */
  181. class nsDOMWindowUtils : public nsIDOMWindowUtils
  182. {
  183. public:
  184. NS_DECL_ISUPPORTS
  185. NS_DECL_NSIDOMWINDOWUTILS
  186. nsDOMWindowUtils();
  187. private:
  188. ~nsDOMWindowUtils();
  189. protected:
  190. /* additional members */
  191. };
  192. /* Implementation file */
  193. NS_IMPL_ISUPPORTS1(nsDOMWindowUtils, nsIDOMWindowUtils)
  194. nsDOMWindowUtils::nsDOMWindowUtils()
  195. {
  196. /* member initializers and constructor code */
  197. }
  198. nsDOMWindowUtils::~nsDOMWindowUtils()
  199. {
  200. /* destructor code */
  201. }
  202. /* attribute unsigned short imageAnimationMode; */
  203. NS_IMETHODIMP nsDOMWindowUtils::GetImageAnimationMode(PRUint16 *aImageAnimationMode)
  204. {
  205. return NS_ERROR_NOT_IMPLEMENTED;
  206. }
  207. NS_IMETHODIMP nsDOMWindowUtils::SetImageAnimationMode(PRUint16 aImageAnimationMode)
  208. {
  209. return NS_ERROR_NOT_IMPLEMENTED;
  210. }
  211. /* readonly attribute boolean docCharsetIsForced; */
  212. NS_IMETHODIMP nsDOMWindowUtils::GetDocCharsetIsForced(PRBool *aDocCharsetIsForced)
  213. {
  214. return NS_ERROR_NOT_IMPLEMENTED;
  215. }
  216. /* AString getDocumentMetadata (in AString aName); */
  217. NS_IMETHODIMP nsDOMWindowUtils::GetDocumentMetadata(const nsAString & aName, nsAString & _retval)
  218. {
  219. return NS_ERROR_NOT_IMPLEMENTED;
  220. }
  221. /* void redraw (); */
  222. NS_IMETHODIMP nsDOMWindowUtils::Redraw()
  223. {
  224. return NS_ERROR_NOT_IMPLEMENTED;
  225. }
  226. /* void sendMouseEvent (in AString aType, in long aX, in long aY, in long aButton, in long aClickCount, in long aModifiers); */
  227. NS_IMETHODIMP nsDOMWindowUtils::SendMouseEvent(const nsAString & aType, PRInt32 aX, PRInt32 aY, PRInt32 aButton, PRInt32 aClickCount, PRInt32 aModifiers)
  228. {
  229. return NS_ERROR_NOT_IMPLEMENTED;
  230. }
  231. /* void sendKeyEvent (in AString aType, in long aKeyCode, in long aCharCode, in long aModifiers); */
  232. NS_IMETHODIMP nsDOMWindowUtils::SendKeyEvent(const nsAString & aType, PRInt32 aKeyCode, PRInt32 aCharCode, PRInt32 aModifiers)
  233. {
  234. return NS_ERROR_NOT_IMPLEMENTED;
  235. }
  236. /* void sendNativeKeyEvent (in long aNativeKeyboardLayout, in long aNativeKeyCode, in long aModifierFlags, in AString aCharacters, in AString aUnmodifiedCharacters); */
  237. NS_IMETHODIMP nsDOMWindowUtils::SendNativeKeyEvent(PRInt32 aNativeKeyboardLayout, PRInt32 aNativeKeyCode, PRInt32 aModifierFlags, const nsAString & aCharacters, const nsAString & aUnmodifiedCharacters)
  238. {
  239. return NS_ERROR_NOT_IMPLEMENTED;
  240. }
  241. /* void focus (in nsIDOMElement aElement); */
  242. NS_IMETHODIMP nsDOMWindowUtils::Focus(nsIDOMElement *aElement)
  243. {
  244. return NS_ERROR_NOT_IMPLEMENTED;
  245. }
  246. /* void garbageCollect (); */
  247. NS_IMETHODIMP nsDOMWindowUtils::GarbageCollect()
  248. {
  249. return NS_ERROR_NOT_IMPLEMENTED;
  250. }
  251. /* End of implementation class template. */
  252. #endif
  253. #endif /* __gen_nsIDOMWindowUtils_h__ */