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.

119 lines
3.0 KiB

  1. //+------------------------------------------------------------
  2. //
  3. // Copyright (C) 1998, Microsoft Corporation
  4. //
  5. // File: ccatsender.h
  6. //
  7. // Contents: Class definitions for CIMsgSenderAddr/CCatSender
  8. //
  9. // Classes:
  10. // CIMsgSenderAddr
  11. // CCatSender
  12. //
  13. // Functions:
  14. //
  15. // History:
  16. // jstamerj 980324 19:24:06: Created.
  17. //
  18. //-------------------------------------------------------------
  19. #ifndef __CCATSENDER_H__
  20. #define __CCATSENDER_H__
  21. #include "ccataddr.h"
  22. #define CAT_NULL_SENDER_ADDRESS_SMTP "<>"
  23. //
  24. // CIMsgSenderAddr, abstract class
  25. // class to define how a user's properties are stored and retreived
  26. //
  27. class CIMsgSenderAddr : public CCatAddr
  28. {
  29. public:
  30. CIMsgSenderAddr(CICategorizerListResolveIMP *pCICatListResolve);
  31. virtual ~CIMsgSenderAddr() {}
  32. //
  33. // Storage and retreival procedures
  34. //
  35. HRESULT HrGetOrigAddress(LPTSTR psz, DWORD dwcc, CAT_ADDRESS_TYPE *pType);
  36. HRESULT GetSpecificOrigAddress(CAT_ADDRESS_TYPE CAType, LPTSTR psz, DWORD dwcc);
  37. HRESULT HrAddAddresses(DWORD dwNumAddresses, CAT_ADDRESS_TYPE *rgCAType, LPTSTR *rgpsz);
  38. private:
  39. //
  40. // Inline methods to retrieve ICategorizerItem Props
  41. //
  42. HRESULT GetIMailMsgProperties(IMailMsgProperties **ppIMailMsgProperties)
  43. {
  44. return CICategorizerItemIMP::GetIMailMsgProperties(
  45. ICATEGORIZERITEM_IMAILMSGPROPERTIES,
  46. ppIMailMsgProperties);
  47. }
  48. DWORD PropIdFromCAType(CAT_ADDRESS_TYPE CAType)
  49. {
  50. switch(CAType) {
  51. case CAT_SMTP:
  52. return IMMPID_MP_SENDER_ADDRESS_SMTP;
  53. case CAT_X500:
  54. case CAT_DN:
  55. return IMMPID_MP_SENDER_ADDRESS_X500;
  56. case CAT_X400:
  57. return IMMPID_MP_SENDER_ADDRESS_X400;
  58. case CAT_LEGACYEXDN:
  59. return IMMPID_MP_SENDER_ADDRESS_LEGACY_EX_DN;
  60. case CAT_CUSTOMTYPE:
  61. return IMMPID_MP_SENDER_ADDRESS_OTHER;
  62. break;
  63. default:
  64. _ASSERT(0 && "Unknown address type");
  65. break;
  66. }
  67. return 0;
  68. }
  69. };
  70. //
  71. // CCatSender : public CIMsgSenderAddr
  72. //
  73. class CCatSender :
  74. public CIMsgSenderAddr,
  75. public CCatDLO<CCatSender_didx>
  76. {
  77. public:
  78. CCatSender(CICategorizerListResolveIMP *pCICatListResolve);
  79. virtual ~CCatSender() {}
  80. //
  81. // Catch the call to dispatch query to the store
  82. //
  83. HRESULT HrDispatchQuery();
  84. //
  85. // Completion routines
  86. //
  87. VOID LookupCompletion();
  88. HRESULT HrExpandItem_Default(
  89. PFN_EXPANDITEMCOMPLETION pfnCompletion,
  90. PVOID pContext);
  91. HRESULT HrCompleteItem_Default();
  92. //
  93. // Property setting routines
  94. //
  95. HRESULT AddForward(CAT_ADDRESS_TYPE CAType, LPTSTR szForwardingAddress);
  96. HRESULT AddDLMember(CAT_ADDRESS_TYPE CAType, LPTSTR pszAddress);
  97. HRESULT AddDynamicDLMember(
  98. ICategorizerItemAttributes *pICatItemAttr);
  99. HRESULT HrNeedsResolveing();
  100. };
  101. #endif // __CCATSENDER_H__