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.

111 lines
3.2 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // RulesUI.h
  4. //
  5. ///////////////////////////////////////////////////////////////////////////////
  6. // Bring in only once
  7. #pragma once
  8. #include "rulesmgr.h"
  9. // Rules Manager UI Page Base Class
  10. class COERulesPageUI
  11. {
  12. protected:
  13. enum
  14. {
  15. STATE_UNINIT = 0x00000000,
  16. STATE_INITIALIZED = 0x00000001,
  17. STATE_DIRTY = 0x00000002
  18. };
  19. protected:
  20. UINT m_uiDlgRscId;
  21. UINT m_uiTabLabelId;
  22. DWORD m_dwFlags;
  23. DWORD m_dwState;
  24. public:
  25. COERulesPageUI();
  26. COERulesPageUI(UINT uiDlgRscId, UINT uiTabLabelId, DWORD dwFlags, DWORD dwState) :
  27. m_uiDlgRscId(uiDlgRscId), m_uiTabLabelId(uiTabLabelId), m_dwFlags(dwFlags), m_dwState(dwState) {}
  28. virtual ~COERulesPageUI() {};
  29. virtual HRESULT HrInit(HWND hwndOwner, DWORD dwFlags) = 0;
  30. virtual HRESULT HrCommitChanges(DWORD dwFlags, BOOL fClearDirty) = 0;
  31. // Accessor functions
  32. UINT UiGetDlgRscId(VOID) {return m_uiDlgRscId;}
  33. UINT UiGetTabLabelId(VOID) {return m_uiTabLabelId;}
  34. virtual DLGPROC DlgProcGetPageDlgProc(VOID) = 0;
  35. BOOL FIsDirty(VOID) {return (0 != (m_dwState & STATE_DIRTY));}
  36. virtual BOOL FGetRules(RULE_TYPE typeRule, RULENODE ** pprnode) = 0;
  37. };
  38. enum RULEMGR_FLAGS
  39. {
  40. RMF_MAIL = 0x00000000,
  41. RMF_NEWS = 0x00000001,
  42. RMF_JUNK = 0x00000002,
  43. RMF_SENDERS = 0x00000003
  44. };
  45. // Rules Manager UI Class
  46. class COERulesMgrUI
  47. {
  48. private:
  49. enum
  50. {
  51. STATE_UNINIT = 0x00000000,
  52. STATE_INITIALIZED = 0x00000001
  53. };
  54. enum
  55. {
  56. RULE_DIALOG_PAD = 0x00000004
  57. };
  58. enum
  59. {
  60. RULE_PAGE_MAIL = 0x00000000,
  61. RULE_PAGE_NEWS = 0x00000001,
  62. RULE_PAGE_JUNK = 0x00000002,
  63. RULE_PAGE_SENDERS = 0x00000003,
  64. RULE_PAGE_MAX = 0x00000004,
  65. RULE_PAGE_MASK = 0x000000FF
  66. };
  67. private:
  68. HWND m_hwndOwner;
  69. DWORD m_dwFlags;
  70. DWORD m_dwState;
  71. HWND m_hwndDlg;
  72. HWND m_hwndTab;
  73. COERulesPageUI * m_rgRuleTab[RULE_PAGE_MAX];
  74. public:
  75. // Constructor/destructor
  76. COERulesMgrUI();
  77. ~COERulesMgrUI();
  78. // Main UI methods
  79. HRESULT HrInit(HWND hwndOwner, DWORD dwFlags);
  80. HRESULT HrShow(VOID);
  81. // Dialog methods
  82. static INT_PTR CALLBACK FOERuleMgrDlgProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  83. // Message handling methods
  84. BOOL FOnInitDialog(HWND hwndDlg);
  85. BOOL FOnCommand(UINT uiNotify, INT iCtl, HWND hwndCtl);
  86. BOOL FOnNotify(INT iCtl, NMHDR * pnmhdr);
  87. BOOL FOnDestroy(VOID);
  88. BOOL FOnGetRules(RULE_TYPE typeRule, RULENODE ** pprnode);
  89. private:
  90. BOOL _FOnOK(VOID);
  91. BOOL _FOnCancel(VOID);
  92. BOOL _FInitTabCtrl(VOID);
  93. };