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.

129 lines
3.5 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (C) 1999-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ConfigAlertEmail.h
  7. //
  8. // Description:
  9. // declare the class CConfigAlertEmail
  10. //
  11. // Implement files:
  12. // ConfigAlertEmail.cpp
  13. //
  14. // History:
  15. // 1. lustar.li (Guogang Li), creation date in 17-DEC-2000
  16. //
  17. // Notes:
  18. //
  19. //
  20. //////////////////////////////////////////////////////////////////////////////
  21. #ifndef _CONFIGALERTEMAIL_H_
  22. #define _CONFIGALERTEMAIL_H_
  23. #include "resource.h" // main symbols
  24. #include "taskctx.h"
  25. #include "comdef.h"
  26. //
  27. // Define the tasks supported by this COM Server
  28. //
  29. typedef enum
  30. {
  31. NONE_FOUND,
  32. RAISE_SET_ALERT_EMAIL_ALERT,
  33. SET_ALERT_EMAIL
  34. } SET_ALERT_EMAIL_TASK_TYPE;
  35. #define MAX_MAIL_ADDRESS_LENGH 256
  36. //////////////////////////////////////////////////////////////////////////////
  37. //++
  38. //
  39. // class CConfigAlertEmail
  40. //
  41. // Description:
  42. // The class implement the COM interface SetAlertEmail.AlertEmail.1, used
  43. // to config the alert email on server appliance.
  44. //
  45. // History:
  46. // 1. lustar.li (Guogang Li), creation date in 17-DEC-2000
  47. //--
  48. //////////////////////////////////////////////////////////////////////////////
  49. class ATL_NO_VTABLE CConfigAlertEmail :
  50. public CComObjectRootEx<CComSingleThreadModel>,
  51. public CComCoClass<CConfigAlertEmail, &CLSID_ConfigAlertEmail>,
  52. public IDispatchImpl<IApplianceTask, &IID_IApplianceTask, &LIBID_SETALERTEMAILLib>
  53. {
  54. public:
  55. //
  56. // Constructor and Destructor
  57. //
  58. CConfigAlertEmail()
  59. {
  60. }
  61. ~CConfigAlertEmail()
  62. {
  63. }
  64. DECLARE_REGISTRY_RESOURCEID(IDR_CONFIGALERTEMAIL)
  65. DECLARE_PROTECT_FINAL_CONSTRUCT()
  66. BEGIN_COM_MAP(CConfigAlertEmail)
  67. COM_INTERFACE_ENTRY(IApplianceTask)
  68. COM_INTERFACE_ENTRY(IDispatch)
  69. END_COM_MAP()
  70. public:
  71. //
  72. // IApplianceTask
  73. //
  74. STDMETHOD(OnTaskExecute)(
  75. /*[in]*/ IUnknown* pTaskContext
  76. );
  77. STDMETHOD(OnTaskComplete)(
  78. /*[in]*/ IUnknown* pTaskContext,
  79. /*[in]*/ LONG lTaskResult
  80. );
  81. private:
  82. SET_ALERT_EMAIL_TASK_TYPE GetMethodName(IN ITaskContext *pTaskParameter);
  83. //
  84. // Functions to raise the Set Chime Settings alert
  85. //
  86. STDMETHOD(RaiseSetAlertEmailAlert)(void);
  87. BOOL ShouldRaiseSetAlertEmailAlert(void);
  88. BOOL DoNotRaiseSetAlertEmailAlert(void);
  89. BOOL ClearSetAlertEmailAlert(void);
  90. //
  91. // Functions for setting Chime Settings
  92. //
  93. STDMETHOD(SetAlertEmailSettings)(
  94. IN ITaskContext *pTaskContext
  95. );
  96. STDMETHOD(RollbackSetAlertEmailSettings)(
  97. IN ITaskContext *pTaskContext
  98. );
  99. STDMETHOD(GetSetAlertEmailSettingsParameters)(
  100. IN ITaskContext *pTaskContext,
  101. OUT BOOL *pbEnableAlertEmail,
  102. OUT DWORD *pdwSendEmailType,
  103. OUT _bstr_t *pbstrMailAddress
  104. );
  105. //
  106. // Data members for saving previous values
  107. //
  108. DWORD m_bEnableAlertEmail;
  109. DWORD m_dwSendEmailType;
  110. TCHAR m_szReceiverMailAddress[MAX_MAIL_ADDRESS_LENGH];
  111. };
  112. #endif //_CONFIGALERTEMAIL_H_