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.

90 lines
2.9 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // AplyRule.h
  4. //
  5. ///////////////////////////////////////////////////////////////////////////////
  6. // Bring in only once
  7. #pragma once
  8. #include "oerules.h"
  9. #include "rulesmgr.h"
  10. // Forward declarations
  11. class CProgress;
  12. class CRuleDescriptUI;
  13. class COEApplyRulesUI
  14. {
  15. private:
  16. enum
  17. {
  18. STATE_UNINIT = 0x00000000,
  19. STATE_INITIALIZED = 0x00000001,
  20. STATE_LOADED = 0x00000002,
  21. STATE_NONEWSACCT = 0x00000004
  22. };
  23. enum
  24. {
  25. RULE_PAGE_MAIL = 0x00000000,
  26. RULE_PAGE_NEWS = 0x00000001,
  27. RULE_PAGE_MAX = 0x00000002,
  28. RULE_PAGE_MASK = 0x000000FF
  29. };
  30. struct RECURSEAPPLY
  31. {
  32. IOEExecRules * pIExecRules;
  33. HWND hwndOwner;
  34. CProgress * pProgress;
  35. };
  36. private:
  37. HWND m_hwndOwner;
  38. DWORD m_dwFlags;
  39. DWORD m_dwState;
  40. HWND m_hwndDlg;
  41. HWND m_hwndList;
  42. HWND m_hwndDescript;
  43. CRuleDescriptUI * m_pDescriptUI;
  44. RULENODE * m_prnodeList;
  45. RULE_TYPE m_typeRule;
  46. IOERule * m_pIRuleDef;
  47. public:
  48. // Constructor/destructor
  49. COEApplyRulesUI() : m_hwndOwner(NULL), m_dwFlags(0), m_dwState(STATE_UNINIT),
  50. m_hwndDlg(NULL), m_hwndList(NULL), m_hwndDescript(NULL),
  51. m_pDescriptUI(NULL), m_prnodeList(NULL), m_typeRule(RULE_TYPE_MAIL),
  52. m_pIRuleDef(NULL) {}
  53. ~COEApplyRulesUI();
  54. // Main UI methods
  55. HRESULT HrInit(HWND hwndOwner, DWORD dwFlags, RULE_TYPE typeRule, RULENODE * prnode, IOERule * pIRuleDef);
  56. HRESULT HrShow(VOID);
  57. // Dialog methods
  58. static INT_PTR CALLBACK FOEApplyRulesDlgProc(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam);
  59. // Message handling methods
  60. BOOL FOnInitDialog(HWND hwndDlg);
  61. BOOL FOnCommand(UINT uiNotify, INT iCtl, HWND hwndCtl);
  62. BOOL FOnDestroy(VOID);
  63. static HRESULT _HrRecurseApplyFolder(FOLDERINFO * pFolder, BOOL fSubFolders, DWORD cIndent, DWORD_PTR dwCookie);
  64. private:
  65. BOOL _FLoadListCtrl(VOID);
  66. BOOL _FAddRuleToList(DWORD dwIndex, IOERule * pIRule);
  67. VOID _EnableButtons(INT iSelected);
  68. // For dealing with the description field
  69. VOID _LoadRule(INT iSelected);
  70. // Functions to deal with the basic actions
  71. BOOL _FOnClose(VOID);
  72. BOOL _FOnApplyRules(VOID);
  73. FOLDERID _FldIdGetFolderSel(VOID);
  74. };