nsIWebBrowser.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/embedding/browser/webBrowser/nsIWebBrowser.idl
  3. */
  4. #ifndef __gen_nsIWebBrowser_h__
  5. #define __gen_nsIWebBrowser_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 nsIInterfaceRequestor; /* forward declaration */
  14. class nsIWebBrowserChrome; /* forward declaration */
  15. class nsIURIContentListener; /* forward declaration */
  16. class nsIDOMWindow; /* forward declaration */
  17. class nsIWeakReference; /* forward declaration */
  18. /* starting interface: nsIWebBrowser */
  19. #define NS_IWEBBROWSER_IID_STR "69e5df00-7b8b-11d3-af61-00a024ffc08c"
  20. #define NS_IWEBBROWSER_IID \
  21. {0x69e5df00, 0x7b8b, 0x11d3, \
  22. { 0xaf, 0x61, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c }}
  23. /**
  24. * The nsIWebBrowser interface is implemented by web browser objects.
  25. * Embedders use this interface during initialisation to associate
  26. * the new web browser instance with the embedders chrome and
  27. * to register any listeners. The interface may also be used at runtime
  28. * to obtain the content DOM window and from that the rest of the DOM.
  29. *
  30. * @status FROZEN
  31. */
  32. class NS_NO_VTABLE nsIWebBrowser : public nsISupports {
  33. public:
  34. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IWEBBROWSER_IID)
  35. /**
  36. * Registers a listener of the type specified by the iid to receive
  37. * callbacks. The browser stores a weak reference to the listener
  38. * to avoid any circular dependencies.
  39. * Typically this method will be called to register an object
  40. * to receive <CODE>nsIWebProgressListener</CODE> or
  41. * <CODE>nsISHistoryListener</CODE> notifications in which case the
  42. * the IID is that of the interface.
  43. *
  44. * @param aListener The listener to be added.
  45. * @param aIID The IID of the interface that will be called
  46. * on the listener as appropriate.
  47. * @return <CODE>NS_OK</CODE> for successful registration;
  48. * <CODE>NS_ERROR_INVALID_ARG</CODE> if aIID is not
  49. * supposed to be registered using this method;
  50. * <CODE>NS_ERROR_FAILURE</CODE> either aListener did not
  51. * expose the interface specified by the IID, or some
  52. * other internal error occurred.
  53. *
  54. * @see removeWebBrowserListener
  55. * @see nsIWeakReference
  56. * @see nsIWebProgressListener
  57. * @see nsISHistoryListener
  58. *
  59. * @return <CODE>NS_OK</CODE>, listener was successfully added;
  60. * <CODE>NS_ERROR_INVALID_ARG</CODE>, one of the arguments was
  61. * invalid or the object did not implement the interface
  62. * specified by the IID.
  63. */
  64. /* void addWebBrowserListener (in nsIWeakReference aListener, in nsIIDRef aIID); */
  65. NS_IMETHOD AddWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID) = 0;
  66. /**
  67. * Removes a previously registered listener.
  68. *
  69. * @param aListener The listener to be removed.
  70. * @param aIID The IID of the interface on the listener that will
  71. * no longer be called.
  72. *
  73. * @return <CODE>NS_OK</CODE>, listener was successfully removed;
  74. * <CODE>NS_ERROR_INVALID_ARG</CODE> arguments was invalid or
  75. * the object did not implement the interface specified by the IID.
  76. *
  77. * @see addWebBrowserListener
  78. * @see nsIWeakReference
  79. */
  80. /* void removeWebBrowserListener (in nsIWeakReference aListener, in nsIIDRef aIID); */
  81. NS_IMETHOD RemoveWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID) = 0;
  82. /**
  83. * The chrome object associated with the browser instance. The embedder
  84. * must create one chrome object for <I>each</I> browser object
  85. * that is instantiated. The embedder must associate the two by setting
  86. * this property to point to the chrome object before creating the browser
  87. * window via the browser's <CODE>nsIBaseWindow</CODE> interface.
  88. *
  89. * The chrome object must also implement <CODE>nsIEmbeddingSiteWindow</CODE>.
  90. *
  91. * The chrome may optionally implement <CODE>nsIInterfaceRequestor</CODE>,
  92. * <CODE>nsIWebBrowserChromeFocus</CODE>,
  93. * <CODE>nsIContextMenuListener</CODE> and
  94. * <CODE>nsITooltipListener</CODE> to receive additional notifications
  95. * from the browser object.
  96. *
  97. * The chrome object may optionally implement <CODE>nsIWebProgressListener</CODE>
  98. * instead of explicitly calling <CODE>addWebBrowserListener</CODE> and
  99. * <CODE>removeWebBrowserListener</CODE> to register a progress listener
  100. * object. If the implementation does this, it must also implement
  101. * <CODE>nsIWeakReference</CODE>.
  102. *
  103. * @note The implementation should not refcount the supplied chrome
  104. * object; it should assume that a non <CODE>nsnull</CODE> value is
  105. * always valid. The embedder must explicitly set this value back
  106. * to nsnull if the chrome object is destroyed before the browser
  107. * object.
  108. *
  109. * @see nsIBaseWindow
  110. * @see nsIWebBrowserChrome
  111. * @see nsIEmbeddingSiteWindow
  112. * @see nsIInterfaceRequestor
  113. * @see nsIWebBrowserChromeFocus
  114. * @see nsIContextMenuListener
  115. * @see nsITooltipListener
  116. * @see nsIWeakReference
  117. * @see nsIWebProgressListener
  118. */
  119. /* attribute nsIWebBrowserChrome containerWindow; */
  120. NS_IMETHOD GetContainerWindow(nsIWebBrowserChrome * *aContainerWindow) = 0;
  121. NS_IMETHOD SetContainerWindow(nsIWebBrowserChrome * aContainerWindow) = 0;
  122. /**
  123. * URI content listener parent. The embedder may set this property to
  124. * their own implementation if they intend to override or prevent
  125. * how certain kinds of content are loaded.
  126. *
  127. * @note If this attribute is set to an object that implements
  128. * nsISupportsWeakReference, the implementation should get the
  129. * nsIWeakReference and hold that. Otherwise, the implementation
  130. * should not refcount this interface; it should assume that a non
  131. * null value is always valid. In that case, the embedder should
  132. * explicitly set this value back to null if the parent content
  133. * listener is destroyed before the browser object.
  134. *
  135. * @see nsIURIContentListener
  136. */
  137. /* attribute nsIURIContentListener parentURIContentListener; */
  138. NS_IMETHOD GetParentURIContentListener(nsIURIContentListener * *aParentURIContentListener) = 0;
  139. NS_IMETHOD SetParentURIContentListener(nsIURIContentListener * aParentURIContentListener) = 0;
  140. /**
  141. * The top-level DOM window. The embedder may walk the entire
  142. * DOM starting from this value.
  143. *
  144. * @see nsIDOMWindow
  145. */
  146. /* readonly attribute nsIDOMWindow contentDOMWindow; */
  147. NS_IMETHOD GetContentDOMWindow(nsIDOMWindow * *aContentDOMWindow) = 0;
  148. };
  149. /* Use this macro when declaring classes that implement this interface. */
  150. #define NS_DECL_NSIWEBBROWSER \
  151. NS_IMETHOD AddWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID); \
  152. NS_IMETHOD RemoveWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID); \
  153. NS_IMETHOD GetContainerWindow(nsIWebBrowserChrome * *aContainerWindow); \
  154. NS_IMETHOD SetContainerWindow(nsIWebBrowserChrome * aContainerWindow); \
  155. NS_IMETHOD GetParentURIContentListener(nsIURIContentListener * *aParentURIContentListener); \
  156. NS_IMETHOD SetParentURIContentListener(nsIURIContentListener * aParentURIContentListener); \
  157. NS_IMETHOD GetContentDOMWindow(nsIDOMWindow * *aContentDOMWindow);
  158. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  159. #define NS_FORWARD_NSIWEBBROWSER(_to) \
  160. NS_IMETHOD AddWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID) { return _to AddWebBrowserListener(aListener, aIID); } \
  161. NS_IMETHOD RemoveWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID) { return _to RemoveWebBrowserListener(aListener, aIID); } \
  162. NS_IMETHOD GetContainerWindow(nsIWebBrowserChrome * *aContainerWindow) { return _to GetContainerWindow(aContainerWindow); } \
  163. NS_IMETHOD SetContainerWindow(nsIWebBrowserChrome * aContainerWindow) { return _to SetContainerWindow(aContainerWindow); } \
  164. NS_IMETHOD GetParentURIContentListener(nsIURIContentListener * *aParentURIContentListener) { return _to GetParentURIContentListener(aParentURIContentListener); } \
  165. NS_IMETHOD SetParentURIContentListener(nsIURIContentListener * aParentURIContentListener) { return _to SetParentURIContentListener(aParentURIContentListener); } \
  166. NS_IMETHOD GetContentDOMWindow(nsIDOMWindow * *aContentDOMWindow) { return _to GetContentDOMWindow(aContentDOMWindow); }
  167. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  168. #define NS_FORWARD_SAFE_NSIWEBBROWSER(_to) \
  169. NS_IMETHOD AddWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddWebBrowserListener(aListener, aIID); } \
  170. NS_IMETHOD RemoveWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveWebBrowserListener(aListener, aIID); } \
  171. NS_IMETHOD GetContainerWindow(nsIWebBrowserChrome * *aContainerWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContainerWindow(aContainerWindow); } \
  172. NS_IMETHOD SetContainerWindow(nsIWebBrowserChrome * aContainerWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetContainerWindow(aContainerWindow); } \
  173. NS_IMETHOD GetParentURIContentListener(nsIURIContentListener * *aParentURIContentListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetParentURIContentListener(aParentURIContentListener); } \
  174. NS_IMETHOD SetParentURIContentListener(nsIURIContentListener * aParentURIContentListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetParentURIContentListener(aParentURIContentListener); } \
  175. NS_IMETHOD GetContentDOMWindow(nsIDOMWindow * *aContentDOMWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContentDOMWindow(aContentDOMWindow); }
  176. #if 0
  177. /* Use the code below as a template for the implementation class for this interface. */
  178. /* Header file */
  179. class nsWebBrowser : public nsIWebBrowser
  180. {
  181. public:
  182. NS_DECL_ISUPPORTS
  183. NS_DECL_NSIWEBBROWSER
  184. nsWebBrowser();
  185. private:
  186. ~nsWebBrowser();
  187. protected:
  188. /* additional members */
  189. };
  190. /* Implementation file */
  191. NS_IMPL_ISUPPORTS1(nsWebBrowser, nsIWebBrowser)
  192. nsWebBrowser::nsWebBrowser()
  193. {
  194. /* member initializers and constructor code */
  195. }
  196. nsWebBrowser::~nsWebBrowser()
  197. {
  198. /* destructor code */
  199. }
  200. /* void addWebBrowserListener (in nsIWeakReference aListener, in nsIIDRef aIID); */
  201. NS_IMETHODIMP nsWebBrowser::AddWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID)
  202. {
  203. return NS_ERROR_NOT_IMPLEMENTED;
  204. }
  205. /* void removeWebBrowserListener (in nsIWeakReference aListener, in nsIIDRef aIID); */
  206. NS_IMETHODIMP nsWebBrowser::RemoveWebBrowserListener(nsIWeakReference *aListener, const nsIID & aIID)
  207. {
  208. return NS_ERROR_NOT_IMPLEMENTED;
  209. }
  210. /* attribute nsIWebBrowserChrome containerWindow; */
  211. NS_IMETHODIMP nsWebBrowser::GetContainerWindow(nsIWebBrowserChrome * *aContainerWindow)
  212. {
  213. return NS_ERROR_NOT_IMPLEMENTED;
  214. }
  215. NS_IMETHODIMP nsWebBrowser::SetContainerWindow(nsIWebBrowserChrome * aContainerWindow)
  216. {
  217. return NS_ERROR_NOT_IMPLEMENTED;
  218. }
  219. /* attribute nsIURIContentListener parentURIContentListener; */
  220. NS_IMETHODIMP nsWebBrowser::GetParentURIContentListener(nsIURIContentListener * *aParentURIContentListener)
  221. {
  222. return NS_ERROR_NOT_IMPLEMENTED;
  223. }
  224. NS_IMETHODIMP nsWebBrowser::SetParentURIContentListener(nsIURIContentListener * aParentURIContentListener)
  225. {
  226. return NS_ERROR_NOT_IMPLEMENTED;
  227. }
  228. /* readonly attribute nsIDOMWindow contentDOMWindow; */
  229. NS_IMETHODIMP nsWebBrowser::GetContentDOMWindow(nsIDOMWindow * *aContentDOMWindow)
  230. {
  231. return NS_ERROR_NOT_IMPLEMENTED;
  232. }
  233. /* End of implementation class template. */
  234. #endif
  235. #endif /* __gen_nsIWebBrowser_h__ */