Source code of Windows XP (NT5)
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.

120 lines
3.0 KiB

  1. // alias.h : Declaration of the CSmtpAdminAlias
  2. #include "resource.h" // main symbols
  3. #include "smtptype.h"
  4. #include "smtpapi.h"
  5. /////////////////////////////////////////////////////////////////////////////
  6. // smtpadm
  7. class CSmtpAdminAlias :
  8. public ISmtpAdminAlias,
  9. public IPrivateUnknown,
  10. public IPrivateDispatch,
  11. public IADsExtension,
  12. public INonDelegatingUnknown,
  13. public ISupportErrorInfo,
  14. public CComObjectRoot,
  15. public CComCoClass<CSmtpAdminAlias,&CLSID_CSmtpAdminAlias>
  16. {
  17. public:
  18. CSmtpAdminAlias();
  19. virtual ~CSmtpAdminAlias();
  20. BEGIN_COM_MAP(CSmtpAdminAlias)
  21. COM_INTERFACE_ENTRY(IDispatch)
  22. COM_INTERFACE_ENTRY(IADs)
  23. COM_INTERFACE_ENTRY(ISmtpAdminAlias)
  24. COM_INTERFACE_ENTRY(IADsExtension)
  25. COM_INTERFACE_ENTRY(IPrivateUnknown)
  26. COM_INTERFACE_ENTRY(IPrivateDispatch)
  27. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  28. END_COM_MAP()
  29. //DECLARE_NOT_AGGREGATABLE(CSmtpAdminAlias)
  30. // Remove the comment from the line above if you don't want your object to
  31. // support aggregation. The default is to support it
  32. DECLARE_REGISTRY(CSmtpAdminAlias, _T("Smtpadm.Alias.1"), _T("Smtpadm.Alias"), IDS_SMTPADMIN_ALIAS_DESC, THREADFLAGS_BOTH)
  33. // ISupportsErrorInfo
  34. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  35. //
  36. // This declares methods for the following:
  37. // IADsExtension
  38. // IUnknown
  39. // IDispatch
  40. // IPrivateUnknown
  41. // IPrivateDispatch
  42. //
  43. #define THIS_LIBID LIBID_SMTPADMLib
  44. #define THIS_IID IID_ISmtpAdminAlias
  45. #include "adsimp.inl"
  46. #undef THIS_LIBID
  47. #undef THIS_IID
  48. // ISmtpAdminAlias
  49. public:
  50. //
  51. // IADs methods:
  52. //
  53. DECLARE_IADS_METHODS()
  54. //////////////////////////////////////////////////////////////////////
  55. // Properties:
  56. //////////////////////////////////////////////////////////////////////
  57. // Which service to configure:
  58. STDMETHODIMP get_Server ( BSTR * pstrServer );
  59. STDMETHODIMP put_Server ( BSTR strServer );
  60. STDMETHODIMP get_ServiceInstance ( long * plServiceInstance );
  61. STDMETHODIMP put_ServiceInstance ( long lServiceInstance );
  62. // enumeration
  63. STDMETHODIMP get_Count ( long* plCount );
  64. // The current alias's properties:
  65. STDMETHODIMP get_EmailId ( BSTR * pstrEmailId );
  66. STDMETHODIMP put_EmailId ( BSTR strEmailId );
  67. STDMETHODIMP get_Domain ( BSTR * pstrDomain );
  68. STDMETHODIMP put_Domain ( BSTR strDomain );
  69. STDMETHODIMP get_Type ( long * plType );
  70. STDMETHODIMP put_Type ( long lType );
  71. //////////////////////////////////////////////////////////////////////
  72. // Methods:
  73. //////////////////////////////////////////////////////////////////////
  74. STDMETHODIMP Find ( BSTR strWildmat,
  75. long cMaxResults
  76. );
  77. STDMETHODIMP GetNth ( long dwIndex );
  78. //////////////////////////////////////////////////////////////////////
  79. // Data:
  80. //////////////////////////////////////////////////////////////////////
  81. private:
  82. CIADsImpl m_iadsImpl;
  83. LONG m_lCount;
  84. // current alias
  85. long m_lType;
  86. CComBSTR m_strEmailId;
  87. CComBSTR m_strDomain;
  88. // Todo: add a list of alias
  89. LPSMTP_NAME_LIST m_pSmtpNameList;
  90. };