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.

132 lines
3.2 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // condlist.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Declares the class ConditionList.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 03/01/2000 Original version.
  16. //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #ifndef CONDLIST_H
  19. #define CONDLIST_H
  20. #if _MSC_VER >= 1000
  21. #pragma once
  22. #endif
  23. #include <atlapp.h>
  24. #include <atltmp.h>
  25. class CCondition;
  26. class CIASAttrList;
  27. ///////////////////////////////////////////////////////////////////////////////
  28. //
  29. // FUNCTION
  30. //
  31. // CreateCIASAttrList, DestroyCIASAttrList, and ExtractAttrList
  32. //
  33. // DESCRIPTION
  34. //
  35. // Functions for creating and destroying the CIASAttrList object used by the
  36. // ConditionList class below. This is useful if you want to avoid
  37. // dependencies.
  38. //
  39. ///////////////////////////////////////////////////////////////////////////////
  40. CIASAttrList*
  41. WINAPI
  42. CreateCIASAttrList() throw ();
  43. VOID
  44. WINAPI
  45. DestroyCIASAttrList(CIASAttrList* attrList) throw ();
  46. PVOID
  47. WINAPI
  48. ExtractCIASAttrList(CIASAttrList* attrList) throw ();
  49. ///////////////////////////////////////////////////////////////////////////////
  50. //
  51. // CLASS
  52. //
  53. // ConditionList
  54. //
  55. // DESCRIPTION
  56. //
  57. // Manages a ListBox control containing a list of policy conditions.
  58. //
  59. ///////////////////////////////////////////////////////////////////////////////
  60. class ConditionList
  61. {
  62. public:
  63. ConditionList() throw ()
  64. : m_pPolicyNode(&node)
  65. { }
  66. ~ConditionList() throw ();
  67. // This must be called before onInitDialog.
  68. void finalConstruct(
  69. HWND dialog,
  70. CIASAttrList* attrList,
  71. LONG attrFilter,
  72. ISdoDictionaryOld* dnary,
  73. ISdoCollection* conditions,
  74. PCWSTR machineName,
  75. PCWSTR policyName
  76. ) throw ();
  77. void clear() throw ();
  78. ::CString getDisplayText();
  79. BOOL onInitDialog() throw ();
  80. BOOL onApply() throw ();
  81. HRESULT onAdd(BOOL& modified) throw ();
  82. HRESULT onEdit(BOOL& modified, BOOL& bHandled) throw ();
  83. HRESULT onRemove(BOOL& modified, BOOL& bHandled) throw ();
  84. protected:
  85. void AdjustHoritontalScroll();
  86. BOOL CreateConditions();
  87. HRESULT PopulateConditions();
  88. // These let use masquerade as a CWnd.
  89. HWND GetDlgItem(int nID)
  90. { return ::GetDlgItem(m_hWnd, nID); }
  91. LRESULT SendDlgItemMessage(
  92. int nID,
  93. UINT message,
  94. WPARAM wParam = 0,
  95. LPARAM lParam = 0
  96. )
  97. { return ::SendDlgItemMessage(m_hWnd, nID, message, wParam, lParam); }
  98. private:
  99. // Mimics the CPolicyNode class.
  100. struct PolicyNode
  101. {
  102. PWSTR m_bstrDisplayName;
  103. PWSTR m_pszServerAddress;
  104. } node;
  105. HWND m_hWnd;
  106. PolicyNode* m_pPolicyNode;
  107. CIASAttrList* m_pIASAttrList;
  108. LONG m_filter;
  109. CComPtr<ISdoDictionaryOld> m_spDictionarySdo;
  110. CComPtr<ISdoCollection> m_spConditionCollectionSdo;
  111. CSimpleArray<CCondition*> m_ConditionList;
  112. // Not implemented.
  113. ConditionList(ConditionList&);
  114. ConditionList& operator=(ConditionList&);
  115. };
  116. #endif // CONDLIST_H