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.

113 lines
3.0 KiB

  1. #ifndef __ACTION_H
  2. #define __ACTION_H
  3. ///////////////////////////////////////////////////////////////////////////////
  4. /* File: action.h
  5. Description: Declarations for classes to handle actions associated
  6. with user notifications (email, popup dialog etc).
  7. CAction
  8. CActionEmail
  9. CActionPopup
  10. Revision History:
  11. Date Description Programmer
  12. -------- --------------------------------------------------- ----------
  13. 07/01/97 Initial creation. BrianAu
  14. */
  15. ///////////////////////////////////////////////////////////////////////////////
  16. #ifndef __MAPISEND_H
  17. # include "mapisend.h"
  18. #endif
  19. //
  20. // Fwd declarations. Don't need headers.
  21. //
  22. class CHistory;
  23. class CStatisticsList;
  24. class CAction
  25. {
  26. public:
  27. CAction(VOID) { };
  28. virtual ~CAction(VOID) { };
  29. virtual HRESULT DoAction(CHistory& history) = 0;
  30. private:
  31. //
  32. // Prevent copy.
  33. //
  34. CAction(const CAction& rhs);
  35. CAction& operator = (const CAction& rhs);
  36. };
  37. class CActionEmail : public CAction
  38. {
  39. public:
  40. CActionEmail(CMapiSession& MapiSession,
  41. LPMAPIFOLDER pMapiFolder,
  42. LPTSTR pszRecipientsTo,
  43. LPTSTR pszRecipientsCc,
  44. LPTSTR pszRecipientsBcc,
  45. LPCTSTR pszSubject,
  46. CMapiMessageBody& MsgBody);
  47. virtual ~CActionEmail(VOID);
  48. virtual HRESULT DoAction(CHistory& history);
  49. private:
  50. CMapiSession& m_MapiSession; // Reference to MAPI session object.
  51. CMapiRecipients m_MapiRecipients; // List of recipients for for message.
  52. CMapiMessage m_MapiMsg; // MAPI message we'll build and send.
  53. MAPI m_Mapi; // MAPI functions.
  54. //
  55. // Prevent copy.
  56. //
  57. CActionEmail(const CActionEmail& rhs);
  58. CActionEmail& operator = (const CActionEmail& rhs);
  59. };
  60. class CActionPopup : public CAction
  61. {
  62. public:
  63. CActionPopup(CStatisticsList& stats);
  64. virtual ~CActionPopup(VOID);
  65. virtual HRESULT DoAction(CHistory& history);
  66. private:
  67. CStatisticsList& m_stats;
  68. HWND m_hwnd;
  69. HINSTANCE m_hmodCOMCTL32;
  70. HICON m_hiconDialog;
  71. static UINT m_idAutoCloseTimer;
  72. static UINT m_uAutoCloseTimeout;
  73. HRESULT CreateAndRunPopup(
  74. HINSTANCE hInst,
  75. LPCTSTR pszDlgTemplate,
  76. HWND hwndParent);
  77. static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  78. BOOL OnInitDialog(HWND hwnd);
  79. BOOL OnDestroy(HWND hwnd);
  80. BOOL OnNcDestroy(HWND hwnd);
  81. VOID InitializeList(HWND hwndList);
  82. //
  83. // Prevent copy.
  84. //
  85. CActionPopup(const CActionPopup& rhs);
  86. CActionPopup& operator = (const CActionPopup& rhs);
  87. };
  88. #endif //__ACTION_H