Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
3.1 KiB

  1. #ifndef _RESPONSE_H_
  2. #define _RESPONSE_H_
  3. // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  4. //
  5. // RESPONSE.H
  6. //
  7. // Header for DAV response class.
  8. //
  9. // Copyright 1986-1997 Microsoft Corporation, All Rights Reserved
  10. //
  11. #include <sgstruct.h> // For PSGITEM in IResponse::AddBodyFile()
  12. #include <autoptr.h> // For CMTRefCounted parent
  13. #include <body.h> // For auto_ref_handle, etc.
  14. // ------------------------------------------------------------------------
  15. //
  16. // CLASS IResponse
  17. //
  18. // Interface of the HTTP 1.1/DAV 1.0 response using an ISAPI
  19. // EXTENSION_CONTROL_BLOCK
  20. //
  21. class IEcb;
  22. class IBodyPart;
  23. class IResponseBase : public CMTRefCounted
  24. {
  25. private:
  26. // NOT IMPLEMENTED
  27. //
  28. IResponseBase& operator=( const IResponseBase& );
  29. IResponseBase( const IResponseBase& );
  30. protected:
  31. // CREATORS
  32. // Only create this object through it's descendents!
  33. IResponseBase() {};
  34. public:
  35. virtual void AddBodyText( UINT cbText, LPCSTR pszText ) = 0;
  36. virtual void AddBodyText( UINT cchText, LPCWSTR pwszText ) = 0;
  37. virtual void AddBodyFile( const auto_ref_handle& hf,
  38. UINT64 ibFile64 = 0,
  39. UINT64 cbFile64 = 0xFFFFFFFFFFFFFFFF ) = 0;
  40. };
  41. class IResponse : public IResponseBase
  42. {
  43. private:
  44. // NOT IMPLEMENTED
  45. //
  46. IResponse& operator=( const IResponse& );
  47. IResponse( const IResponse& );
  48. protected:
  49. // CREATORS
  50. // Only create this object through it's descendents!
  51. //
  52. IResponse() {};
  53. public:
  54. // CREATORS
  55. //
  56. virtual ~IResponse() = 0;
  57. // ACCESSORS
  58. //
  59. virtual IEcb * GetEcb() const = 0;
  60. virtual BOOL FIsEmpty() const = 0;
  61. virtual DWORD DwStatusCode() const = 0;
  62. virtual DWORD DwSubError() const = 0;
  63. virtual LPCSTR LpszStatusDescription() const = 0;
  64. virtual LPCSTR LpszGetHeader( LPCSTR pszName ) const = 0;
  65. // MANIPULATORS
  66. //
  67. virtual void SetStatus( int iStatusCode,
  68. LPCSTR lpszReserved,
  69. UINT uiCustomSubError,
  70. LPCSTR lpszBodyDetail,
  71. UINT uiBodyDetail = 0 ) = 0;
  72. virtual void ClearHeaders() = 0;
  73. virtual void SetHeader( LPCSTR pszName, LPCSTR pszValue, BOOL fMultiple = FALSE ) = 0;
  74. virtual void SetHeader( LPCSTR pszName, LPCWSTR pwszValue, BOOL fMultiple = FALSE ) = 0;
  75. virtual void ClearBody() = 0;
  76. virtual void SupressBody() = 0;
  77. virtual void AddBodyText( UINT cbText, LPCSTR pszText ) = 0;
  78. virtual void AddBodyFile( const auto_ref_handle& hf,
  79. UINT64 ibFile64 = 0,
  80. UINT64 cbFile64 = 0xFFFFFFFFFFFFFFFF ) = 0;
  81. virtual void AddBodyStream( IStream& stm ) = 0;
  82. virtual void AddBodyStream( IStream& stm, UINT ibOffset, UINT cbSize ) = 0;
  83. virtual void AddBodyPart( IBodyPart * pBodyPart ) = 0;
  84. //
  85. // Various sending mechanisms
  86. //
  87. virtual SCODE ScForward( LPCWSTR pwszURI,
  88. BOOL fKeepQueryString=TRUE,
  89. BOOL fCustomErrorUrl = FALSE) = 0;
  90. virtual SCODE ScRedirect( LPCSTR pszURI ) = 0;
  91. virtual void Defer() = 0;
  92. virtual void SendPartial() = 0;
  93. virtual void SendComplete() = 0;
  94. virtual void FinishMethod() = 0;
  95. };
  96. IResponse * NewResponse( IEcb& ecb );
  97. #endif // !defined(_RESPONSE_H_)