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.

180 lines
5.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: C H K L I S T . H
  7. //
  8. // Contents: Declares bindings checkbox related utility functions
  9. // and classes.
  10. //
  11. // Notes:
  12. //
  13. // Created: tongl 20 Nov 1997
  14. //
  15. //----------------------------------------------------------------------------
  16. #pragma once
  17. #include "netcfgx.h"
  18. #include "netcon.h"
  19. class CBindingPathObj;
  20. class CComponentObj;
  21. typedef list<CBindingPathObj *> ListBPObj;
  22. typedef ListBPObj::iterator ListBPObj_ITER;
  23. typedef list<INetCfgComponent *> ListComp;
  24. typedef ListComp::iterator ListComp_ITER;
  25. // States of a BindingPathObject
  26. enum BPOBJ_STATE
  27. {
  28. BPOBJ_ENABLED,
  29. BPOBJ_DISABLED,
  30. BPOBJ_UNSET
  31. };
  32. // States of a ComponentObject
  33. enum CHECK_STATE
  34. {
  35. CHECKED,
  36. MIXED,
  37. INTENT_CHECKED,
  38. UNCHECKED,
  39. UNSET
  40. };
  41. // Utility functions
  42. //
  43. HRESULT HrRebuildBindingPathObjCollection(INetCfgComponent * pnccAdapter,
  44. ListBPObj * pListObj);
  45. HRESULT HrInsertBindingPathObj(ListBPObj * pListBPObj,
  46. CBindingPathObj * pBPObj);
  47. HRESULT HrRefreshBindingPathObjCollectionState(ListBPObj * pListBPObj);
  48. HRESULT HrRefreshCheckListState(HWND hwndListView,
  49. CComponentObj *pChangedCompObj);
  50. HRESULT HrEnableBindingPath(INetCfgBindingPath * pncbp, BOOL fEnable);
  51. // Classes
  52. class CBindingPathObj : CNetCfgDebug<CBindingPathObj>
  53. {
  54. public:
  55. // constructor and destructor
  56. CBindingPathObj(INetCfgBindingPath * pncbp);
  57. ~CBindingPathObj();
  58. // methods
  59. BPOBJ_STATE GetBindingState(){ return m_BindingState; };
  60. void SetBindingState(BPOBJ_STATE state) { m_BindingState = state; };
  61. ULONG GetDepth() { return m_ulPathLen; };
  62. HRESULT HrInsertSuperPath(CBindingPathObj * pbpobjSuperPath);
  63. HRESULT HrInsertSubPath(CBindingPathObj * pbpobjSubPath);
  64. HRESULT HrEnable(ListBPObj * plistBPObj);
  65. HRESULT HrDisable(ListBPObj * plistBPObj);
  66. #if DBG
  67. VOID DumpSubPathList();
  68. VOID DumpPath();
  69. #endif
  70. // Declare friend class
  71. friend class CComponentObj;
  72. // Friend function declarations
  73. friend HRESULT HrRebuildBindingPathObjCollection(INetCfgComponent * pnccAdapter,
  74. ListBPObj * pListObj);
  75. friend HRESULT HrInsertBindingPathObj(ListBPObj * pListBPObj,
  76. CBindingPathObj * pBPObj);
  77. friend HRESULT HrRefreshBindingPathObjCollectionState(ListBPObj * pListBPObj);
  78. friend HRESULT HrRefreshCheckListState(HWND hwndListView,
  79. CComponentObj *pChangedCompObj);
  80. public:
  81. // data members
  82. // the corresponding binding path
  83. INetCfgBindingPath * m_pncbp;
  84. // length of the binding path
  85. ULONG m_ulPathLen;
  86. // list of BindingPathObjects that contains a subpath
  87. ListBPObj m_listSubPaths;
  88. ListBPObj m_listSuperPaths;
  89. // pointer to a ComponentObj if the top component
  90. // corresponds to a component in our listview
  91. CComponentObj * m_pCompObj;
  92. BPOBJ_STATE m_BindingState;
  93. };
  94. class CComponentObj : CNetCfgDebug<CComponentObj>
  95. {
  96. public:
  97. // constructor
  98. CComponentObj(INetCfgComponent * pncc);
  99. ~CComponentObj();
  100. // methods
  101. HRESULT HrInit(ListBPObj * plistBindingPaths);
  102. HRESULT HrCheck(ListBPObj * plistBPObj);
  103. HRESULT HrUncheck(ListBPObj * plistBPObj);
  104. CHECK_STATE GetChkState(){ return m_CheckState;} ;
  105. void SetChkState(CHECK_STATE state) { m_CheckState = state; };
  106. CHECK_STATE GetExpChkState(){ return m_ExpCheckState;} ;
  107. void SetExpChkState(CHECK_STATE state) { m_ExpCheckState = state; };
  108. BOOL GetDepStateChanged(){ return m_DepStateChanged;} ;
  109. void SetDepStateChanged(BOOL changed) { m_DepStateChanged = changed; };
  110. // Declare friend class
  111. friend class CComponentObj;
  112. // Friend function declarations
  113. friend HRESULT HrRefreshBindingPathObjCollectionState(ListBPObj * pListBPObj);
  114. friend HRESULT HrRefreshCheckListState(HWND hwndListView,
  115. CComponentObj *pChangedCompObj);
  116. friend BOOL FValidatePageContents( HWND hwndDlg,
  117. HWND hwndList,
  118. INetCfg * pnc,
  119. INetCfgComponent * pnccAdapter,
  120. ListBPObj * plistBindingPaths);
  121. private:
  122. // data members
  123. // corresponding netcfg component
  124. INetCfgComponent * m_pncc;
  125. // list of corresponding BindingPathObjects
  126. ListBPObj m_listBPObj;
  127. // current check state
  128. CHECK_STATE m_CheckState;
  129. // expected check state
  130. CHECK_STATE m_ExpCheckState;
  131. // dependend component state changed flag
  132. BOOL m_DepStateChanged;
  133. };