PageRenderTime 48ms CodeModel.GetById 18ms RepoModel.GetById 1ms 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. #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 NS_SCRIPTABLE nsIRequestObserver : public nsISupports {
  25. public:
  26. NS_DECLARE_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_SCRIPTABLE 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_SCRIPTABLE NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode) = 0;
  50. };
  51. NS_DEFINE_STATIC_IID_ACCESSOR(nsIRequestObserver, NS_IREQUESTOBSERVER_IID)
  52. /* Use this macro when declaring classes that implement this interface. */
  53. #define NS_DECL_NSIREQUESTOBSERVER \
  54. NS_SCRIPTABLE NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext); \
  55. NS_SCRIPTABLE NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode);
  56. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  57. #define NS_FORWARD_NSIREQUESTOBSERVER(_to) \
  58. NS_SCRIPTABLE NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) { return _to OnStartRequest(aRequest, aContext); } \
  59. NS_SCRIPTABLE NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode) { return _to OnStopRequest(aRequest, aContext, aStatusCode); }
  60. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  61. #define NS_FORWARD_SAFE_NSIREQUESTOBSERVER(_to) \
  62. NS_SCRIPTABLE NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStartRequest(aRequest, aContext); } \
  63. NS_SCRIPTABLE NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStopRequest(aRequest, aContext, aStatusCode); }
  64. #if 0
  65. /* Use the code below as a template for the implementation class for this interface. */
  66. /* Header file */
  67. class nsRequestObserver : public nsIRequestObserver
  68. {
  69. public:
  70. NS_DECL_ISUPPORTS
  71. NS_DECL_NSIREQUESTOBSERVER
  72. nsRequestObserver();
  73. private:
  74. ~nsRequestObserver();
  75. protected:
  76. /* additional members */
  77. };
  78. /* Implementation file */
  79. NS_IMPL_ISUPPORTS1(nsRequestObserver, nsIRequestObserver)
  80. nsRequestObserver::nsRequestObserver()
  81. {
  82. /* member initializers and constructor code */
  83. }
  84. nsRequestObserver::~nsRequestObserver()
  85. {
  86. /* destructor code */
  87. }
  88. /* void onStartRequest (in nsIRequest aRequest, in nsISupports aContext); */
  89. NS_IMETHODIMP nsRequestObserver::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext)
  90. {
  91. return NS_ERROR_NOT_IMPLEMENTED;
  92. }
  93. /* void onStopRequest (in nsIRequest aRequest, in nsISupports aContext, in nsresult aStatusCode); */
  94. NS_IMETHODIMP nsRequestObserver::OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode)
  95. {
  96. return NS_ERROR_NOT_IMPLEMENTED;
  97. }
  98. /* End of implementation class template. */
  99. #endif
  100. #endif /* __gen_nsIRequestObserver_h__ */