PageRenderTime 57ms CodeModel.GetById 46ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/gecko_api/include/nsIWebBrowser.h

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