PageRenderTime 103ms CodeModel.GetById 60ms app.highlight 3ms RepoModel.GetById 37ms app.codeStats 0ms

/gecko_api/include/nsIRequestObserver.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 129 lines | 57 code | 29 blank | 43 comment | 0 complexity | e5610a98d41439e96f9b91155612ed11 MD5 | raw file
  1/*
  2 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/netwerk/base/public/nsIRequestObserver.idl
  3 */
  4
  5#ifndef __gen_nsIRequestObserver_h__
  6#define __gen_nsIRequestObserver_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 nsIRequest; /* forward declaration */
 18
 19
 20/* starting interface:    nsIRequestObserver */
 21#define NS_IREQUESTOBSERVER_IID_STR "fd91e2e0-1481-11d3-9333-00104ba0fd40"
 22
 23#define NS_IREQUESTOBSERVER_IID \
 24  {0xfd91e2e0, 0x1481, 0x11d3, \
 25    { 0x93, 0x33, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 }}
 26
 27/**
 28 * nsIRequestObserver
 29 *
 30 * @status FROZEN
 31 */
 32class NS_NO_VTABLE NS_SCRIPTABLE nsIRequestObserver : public nsISupports {
 33 public: 
 34
 35  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IREQUESTOBSERVER_IID)
 36
 37  /**
 38     * Called to signify the beginning of an asynchronous request.
 39     *
 40     * @param aRequest request being observed
 41     * @param aContext user defined context
 42     *
 43     * An exception thrown from onStartRequest has the side-effect of
 44     * causing the request to be canceled.
 45     */
 46  /* void onStartRequest (in nsIRequest aRequest, in nsISupports aContext); */
 47  NS_SCRIPTABLE NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) = 0;
 48
 49  /**
 50     * Called to signify the end of an asynchronous request.  This
 51     * call is always preceded by a call to onStartRequest.
 52     *
 53     * @param aRequest request being observed
 54     * @param aContext user defined context
 55     * @param aStatusCode reason for stopping (NS_OK if completed successfully)
 56     *
 57     * An exception thrown from onStopRequest is generally ignored.
 58     */
 59  /* void onStopRequest (in nsIRequest aRequest, in nsISupports aContext, in nsresult aStatusCode); */
 60  NS_SCRIPTABLE NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode) = 0;
 61
 62};
 63
 64  NS_DEFINE_STATIC_IID_ACCESSOR(nsIRequestObserver, NS_IREQUESTOBSERVER_IID)
 65
 66/* Use this macro when declaring classes that implement this interface. */
 67#define NS_DECL_NSIREQUESTOBSERVER \
 68  NS_SCRIPTABLE NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext); \
 69  NS_SCRIPTABLE NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode); 
 70
 71/* Use this macro to declare functions that forward the behavior of this interface to another object. */
 72#define NS_FORWARD_NSIREQUESTOBSERVER(_to) \
 73  NS_SCRIPTABLE NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) { return _to OnStartRequest(aRequest, aContext); } \
 74  NS_SCRIPTABLE NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode) { return _to OnStopRequest(aRequest, aContext, aStatusCode); } 
 75
 76/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
 77#define NS_FORWARD_SAFE_NSIREQUESTOBSERVER(_to) \
 78  NS_SCRIPTABLE NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStartRequest(aRequest, aContext); } \
 79  NS_SCRIPTABLE NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStopRequest(aRequest, aContext, aStatusCode); } 
 80
 81#if 0
 82/* Use the code below as a template for the implementation class for this interface. */
 83
 84/* Header file */
 85class nsRequestObserver : public nsIRequestObserver
 86{
 87public:
 88  NS_DECL_ISUPPORTS
 89  NS_DECL_NSIREQUESTOBSERVER
 90
 91  nsRequestObserver();
 92
 93private:
 94  ~nsRequestObserver();
 95
 96protected:
 97  /* additional members */
 98};
 99
100/* Implementation file */
101NS_IMPL_ISUPPORTS1(nsRequestObserver, nsIRequestObserver)
102
103nsRequestObserver::nsRequestObserver()
104{
105  /* member initializers and constructor code */
106}
107
108nsRequestObserver::~nsRequestObserver()
109{
110  /* destructor code */
111}
112
113/* void onStartRequest (in nsIRequest aRequest, in nsISupports aContext); */
114NS_IMETHODIMP nsRequestObserver::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext)
115{
116    return NS_ERROR_NOT_IMPLEMENTED;
117}
118
119/* void onStopRequest (in nsIRequest aRequest, in nsISupports aContext, in nsresult aStatusCode); */
120NS_IMETHODIMP nsRequestObserver::OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode)
121{
122    return NS_ERROR_NOT_IMPLEMENTED;
123}
124
125/* End of implementation class template. */
126#endif
127
128
129#endif /* __gen_nsIRequestObserver_h__ */