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.

105 lines
4.7 KiB

  1. // --------------------------------------------------------------------------------
  2. // Partial.h
  3. // Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  4. // Steven J. Bailey
  5. // --------------------------------------------------------------------------------
  6. #ifndef __PARTIAL_H
  7. #define __PARTIAL_H
  8. // --------------------------------------------------------------------------------
  9. // Depends
  10. // --------------------------------------------------------------------------------
  11. #include "mimeole.h"
  12. // --------------------------------------------------------------------------------
  13. // PARTINFO
  14. // --------------------------------------------------------------------------------
  15. typedef struct tagPARTINFO {
  16. BYTE fRejected; // Rejected in CombineParts
  17. IMimeMessage *pMessage; // The message object...
  18. } PARTINFO, *LPPARTINFO;
  19. // --------------------------------------------------------------------------------
  20. // CMimeMessageParts
  21. // --------------------------------------------------------------------------------
  22. class CMimeMessageParts : public IMimeMessageParts
  23. {
  24. public:
  25. // ----------------------------------------------------------------------------
  26. // Construction
  27. // ----------------------------------------------------------------------------
  28. CMimeMessageParts(void);
  29. ~CMimeMessageParts(void);
  30. // ----------------------------------------------------------------------------
  31. // IUnknown
  32. // ----------------------------------------------------------------------------
  33. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  34. STDMETHODIMP_(ULONG) AddRef(void);
  35. STDMETHODIMP_(ULONG) Release(void);
  36. // ----------------------------------------------------------------------------
  37. // IMimeMessageParts
  38. // ----------------------------------------------------------------------------
  39. STDMETHODIMP CombineParts(IMimeMessage **ppMessage);
  40. STDMETHODIMP AddPart(IMimeMessage *pMessage);
  41. STDMETHODIMP SetMaxParts(ULONG cParts);
  42. STDMETHODIMP CountParts(ULONG *pcParts);
  43. STDMETHODIMP EnumParts(IMimeEnumMessageParts **ppEnum);
  44. private:
  45. // ----------------------------------------------------------------------------
  46. // Private Data
  47. // ----------------------------------------------------------------------------
  48. LONG m_cRef; // Reference count
  49. ULONG m_cParts; // Valid elements in m_prgpPart
  50. ULONG m_cAlloc; // Size of m_prgPart
  51. LPPARTINFO m_prgPart; // Array of partinfo structures;
  52. CRITICAL_SECTION m_cs; // Thread safety
  53. };
  54. // --------------------------------------------------------------------------------
  55. // CMimeEnumMessageParts
  56. // --------------------------------------------------------------------------------
  57. class CMimeEnumMessageParts : public IMimeEnumMessageParts
  58. {
  59. public:
  60. // ----------------------------------------------------------------------------
  61. // Construction
  62. // ----------------------------------------------------------------------------
  63. CMimeEnumMessageParts(void);
  64. ~CMimeEnumMessageParts(void);
  65. // ----------------------------------------------------------------------------
  66. // IUnknown
  67. // ----------------------------------------------------------------------------
  68. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  69. STDMETHODIMP_(ULONG) AddRef(void);
  70. STDMETHODIMP_(ULONG) Release(void);
  71. // ----------------------------------------------------------------------------
  72. // IMimeEnumMessageParts
  73. // ----------------------------------------------------------------------------
  74. STDMETHODIMP Next(ULONG cParts, IMimeMessage **prgpMessage, ULONG *pcFetched);
  75. STDMETHODIMP Skip(ULONG cParts);
  76. STDMETHODIMP Reset(void);
  77. STDMETHODIMP Clone(IMimeEnumMessageParts **ppEnum);
  78. STDMETHODIMP Count(ULONG *pcParts);
  79. // ----------------------------------------------------------------------------
  80. // CMimeEnumMessageParts
  81. // ----------------------------------------------------------------------------
  82. HRESULT HrInit(ULONG iPart, ULONG cParts, LPPARTINFO prgPart);
  83. private:
  84. // ----------------------------------------------------------------------------
  85. // Private Data
  86. // ----------------------------------------------------------------------------
  87. LONG m_cRef; // Reference count
  88. ULONG m_iPart; // Current Part
  89. ULONG m_cParts; // Total number of parts
  90. LPPARTINFO m_prgPart; // Array of parts to enumerate
  91. CRITICAL_SECTION m_cs; // Thread safety
  92. };
  93. #endif // __PARTIAL_H