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.

158 lines
4.4 KiB

  1. //+------------------------------------------------------------
  2. //
  3. // Copyright (C) 1998, Microsoft Corporation
  4. //
  5. // File: icatmailmsgs.h
  6. //
  7. // Contents: Implementation of ICategorizerMailMsgs
  8. //
  9. // Classes: CICategorizerMailMsgsIMP
  10. //
  11. // Functions:
  12. //
  13. // History:
  14. // jstamerj 1998/06/30 13:21:41: Created.
  15. //
  16. //-------------------------------------------------------------
  17. #ifndef _ICATMAILMSGS_H_
  18. #define _ICATMAILMSGS_H_
  19. #include "mailmsg.h"
  20. #include "smtpevent.h"
  21. #include "cattype.h"
  22. #include <listmacr.h>
  23. #include "mailmsgprops.h"
  24. #include "catperf.h"
  25. #define ICATEGORIZERMAILMSGS_DEFAULTIMSGID 0
  26. #define SIGNATURE_CICATEGORIZERMAILMSGSIMP (DWORD)'ICMM'
  27. #define SIGNATURE_CICATEGORIZERMAILMSGSIMP_INVALID (DWORD)'XCMM'
  28. class CICategorizerMailMsgsIMP : public ICategorizerMailMsgs
  29. {
  30. public:
  31. //IUnknown
  32. STDMETHOD (QueryInterface) (REFIID iid, LPVOID *ppv) {
  33. return m_pIUnknown->QueryInterface(iid, ppv);
  34. }
  35. STDMETHOD_(ULONG, AddRef) () { return m_pIUnknown->AddRef(); }
  36. STDMETHOD_(ULONG, Release) () { return m_pIUnknown->Release(); }
  37. public:
  38. //ICategorizerMailMsgs
  39. STDMETHOD (GetMailMsg) (
  40. IN DWORD dwId,
  41. OUT IMailMsgProperties **ppIMailMsgProperties,
  42. OUT IMailMsgRecipientsAdd **ppIMailMsgRecipientsAdd,
  43. OUT BOOL *pfCreated);
  44. STDMETHOD (ReBindMailMsg) (
  45. IN DWORD dwFlags,
  46. IN IUnknown *pStoreDriver);
  47. STDMETHOD (BeginMailMsgEnumeration) (
  48. IN PCATMAILMSG_ENUMERATOR penumerator);
  49. STDMETHOD (GetNextMailMsg) (
  50. IN PCATMAILMSG_ENUMERATOR penumerator,
  51. OUT DWORD *pdwFlags,
  52. OUT IMailMsgProperties **ppIMailMsgProperties,
  53. OUT IMailMsgRecipientsAdd **ppIMailMsgRecipientsAdd);
  54. STDMETHOD (EndMailMsgEnumeration) (
  55. IN PCATMAILMSG_ENUMERATOR penumerator)
  56. {
  57. //
  58. // Nothing to do...
  59. //
  60. return S_OK;
  61. }
  62. private:
  63. // Internal types
  64. typedef struct _tagIMsgEntry {
  65. LIST_ENTRY listentry;
  66. DWORD dwId;
  67. IUnknown *pIUnknown;
  68. IMailMsgProperties *pIMailMsgProperties;
  69. IMailMsgRecipients *pIMailMsgRecipients;
  70. IMailMsgRecipientsAdd *pIMailMsgRecipientsAdd;
  71. BOOL fBoundToStore;
  72. } IMSGENTRY, *PIMSGENTRY;
  73. private:
  74. // Internal categorizer functions
  75. CICategorizerMailMsgsIMP(
  76. CICategorizerListResolveIMP *pCICatListResolveIMP);
  77. ~CICategorizerMailMsgsIMP();
  78. HRESULT Initialize(
  79. IUnknown *pIMsg);
  80. HRESULT CreateIMsgEntry(
  81. PIMSGENTRY *ppIE,
  82. IUnknown *pIUnknown = NULL,
  83. IMailMsgProperties *pIMailMsgProperties = NULL,
  84. IMailMsgRecipients *pIMailMsgRecipients = NULL,
  85. IMailMsgRecipientsAdd *pIMailMsgRecipientsAdd = NULL,
  86. BOOL fBoundToStore = FALSE);
  87. HRESULT CreateAddIMsgEntry(
  88. DWORD dwId,
  89. IUnknown *pIUnknown = NULL,
  90. IMailMsgProperties *pIMailMsgProperties = NULL,
  91. IMailMsgRecipients *pIMailMsgRecipients = NULL,
  92. IMailMsgRecipientsAdd *pIMailMsgRecipientsAdd = NULL,
  93. BOOL fBoundToStore = FALSE);
  94. HRESULT GetNumIMsgs() { return m_dwNumIMsgs; }
  95. HRESULT WriteListAll();
  96. HRESULT RevertAll();
  97. VOID DeleteBifurcatedMessages();
  98. HRESULT GetAllIUnknowns(
  99. IUnknown **rgpIMsgs,
  100. DWORD cPtrs);
  101. HRESULT SetMsgStatusAll(
  102. DWORD dwMsgStatus);
  103. HRESULT HrPrepareForCompletion();
  104. IUnknown * GetDefaultIUnknown();
  105. IMailMsgProperties * GetDefaultIMailMsgProperties();
  106. IMailMsgRecipients * GetDefaultIMailMsgRecipients();
  107. IMailMsgRecipientsAdd * GetDefaultIMailMsgRecipientsAdd();
  108. PIMSGENTRY FindIMsgEntry(
  109. DWORD dwId);
  110. PCATPERFBLOCK GetPerfBlock();
  111. VOID FinalRelease();
  112. ISMTPServerEx * GetISMTPServerEx();
  113. private:
  114. // Data
  115. DWORD m_dwSignature;
  116. // A count of the number of elements in the list
  117. DWORD m_dwNumIMsgs;
  118. // A list of IMSGENTRY structs
  119. LIST_ENTRY m_listhead;
  120. // Back pointer to use for QI/AddRef/Release
  121. IUnknown *m_pIUnknown;
  122. CICategorizerListResolveIMP *m_pCICatListResolveIMP;
  123. CRITICAL_SECTION m_cs;
  124. friend class CICategorizerListResolveIMP;
  125. };
  126. #endif // _ICATMAILMSGS_H_