nsIRequestObserver.h 4.2 KB

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