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.

242 lines
6.3 KiB

  1. //============================================================================
  2. // Copyright (C) Microsoft Corporation, 1997 - 1999
  3. //
  4. // File: srview.h
  5. //
  6. // History:
  7. // 09/05/97 Kenn M. Takara Created.
  8. //
  9. //
  10. //============================================================================
  11. #ifndef _ATLKVIEW_H
  12. #define _ATLKVIEW_H
  13. #ifndef _BASEHAND_H
  14. #include "basehand.h"
  15. #endif
  16. #ifndef _HANDLERS_H
  17. #include "handlers.h"
  18. #endif
  19. #ifndef _XSTREAM_H
  20. #include "xstream.h" // need for ColumnData
  21. #endif
  22. #ifndef _INFO_H
  23. #include "info.h"
  24. #endif
  25. #ifndef _IFACE_H
  26. #include "iface.h"
  27. #endif
  28. #ifndef _BASECON_H
  29. #include "basecon.h" // BaseContainerHandler
  30. #endif
  31. #ifndef _ATLKSTRM_H
  32. #include "ATLKstrm.h"
  33. #endif
  34. #ifndef _RTRSHEET_H
  35. #include "rtrsheet.h"
  36. #endif
  37. // forward declarations
  38. struct SATLKNodeMenu;
  39. class CAdapterInfo;
  40. //
  41. // If you ADD any columns to this enum, Be sure to update
  42. // the string ids for the column headers in srview.cpp
  43. //
  44. enum
  45. {
  46. ATLK_SI_ADAPTER = 0,
  47. ATLK_SI_STATUS,
  48. ATLK_SI_NETRANGE,
  49. ATLK_SI_MAX_COLUMNS,
  50. };
  51. /*---------------------------------------------------------------------------
  52. We store a pointer to the IPConnection object in our node data
  53. ---------------------------------------------------------------------------*/
  54. //
  55. //#define GET_ATLK_NODEDATA(pNode) \
  56. // (IPConnection *) pNode->GetData(TFS_DATA_USER)
  57. //#define SET_ATLK_NODEDATA(pNode, pData) \
  58. // pNode->SetData(TFS_DATA_USER, (ULONG) pData)
  59. /*---------------------------------------------------------------------------
  60. Struct: ATLKListEntry
  61. This is an intermediate data structure.
  62. ---------------------------------------------------------------------------*/
  63. struct ATLKListEntry
  64. {
  65. SPIInterfaceInfo m_spIf;
  66. };
  67. typedef CList<ATLKListEntry *, ATLKListEntry *> ATLKList;
  68. /*---------------------------------------------------------------------------
  69. Class: ATLKNodeHandler
  70. ---------------------------------------------------------------------------*/
  71. class ATLKNodeHandler :
  72. public BaseContainerHandler
  73. {
  74. public:
  75. ATLKNodeHandler(ITFSComponentData *pTFSCompData);
  76. ~ATLKNodeHandler();
  77. // Override QI to handle embedded interface
  78. STDMETHOD(QueryInterface)(REFIID iid, LPVOID *ppv);
  79. DeclareEmbeddedInterface(IRtrAdviseSink, IUnknown)
  80. // base handler functionality we override
  81. OVERRIDE_NodeHandler_HasPropertyPages();
  82. OVERRIDE_NodeHandler_CreatePropertyPages();
  83. OVERRIDE_NodeHandler_GetString();
  84. OVERRIDE_NodeHandler_OnCreateDataObject();
  85. OVERRIDE_NodeHandler_OnAddMenuItems();
  86. OVERRIDE_NodeHandler_OnCommand();
  87. OVERRIDE_NodeHandler_DestroyHandler();
  88. OVERRIDE_BaseHandlerNotify_OnExpand();
  89. OVERRIDE_BaseHandlerNotify_OnVerbRefresh();
  90. OVERRIDE_BaseResultHandlerNotify_OnResultRefresh();
  91. OVERRIDE_ResultHandler_AddMenuItems();
  92. OVERRIDE_ResultHandler_Command();
  93. OVERRIDE_ResultHandler_CompareItems();
  94. OVERRIDE_BaseResultHandlerNotify_OnResultShow();
  95. // Initializes the handler
  96. HRESULT Init(IRouterInfo *pRouter, ATLKConfigStream *pConfigStream);
  97. // Initializes the node
  98. HRESULT ConstructNode(ITFSNode *pNode);
  99. public:
  100. // Structure used to pass data to callbacks - used as a way of
  101. // avoiding recomputation
  102. struct SMenuData
  103. {
  104. SPITFSNode m_spNode;
  105. };
  106. static ULONG ATLKEnableFlags(const SRouterNodeMenu *pMenuData,
  107. INT_PTR pUserData);
  108. protected:
  109. // Refresh the data for these nodes
  110. HRESULT SynchronizeNodeData(ITFSNode *pThisNode);
  111. HRESULT UnmarkAllNodes(ITFSNode *pNode, ITFSNodeEnum *pEnum);
  112. HRESULT RemoveAllUnmarkedNodes(ITFSNode *pNode, ITFSNodeEnum *pEnum);
  113. HRESULT SetAdapterData(ITFSNode *pNode,
  114. CAdapterInfo *pAdapter,
  115. DWORD dwEnableAtlkRouting);
  116. // Helper function to add interfaces to the UI
  117. HRESULT AddInterfaceNode(ITFSNode *pParent, IInterfaceInfo *pIf,
  118. IInfoBase *pInfoBase, ITFSNode **ppNewNode);
  119. // Functions to help determine if a netcard is ok
  120. BOOL FIsFunctioningNetcard(LPCTSTR pszId);
  121. // Command implementations
  122. HRESULT OnNewInterface();
  123. LONG_PTR m_ulConnId;// notification id for RtrMgrProt
  124. LONG_PTR m_ulRefreshConnId; // notification id for Refresh
  125. LONG_PTR m_ulStatsConnId;
  126. MMC_COOKIE m_cookie; // cookie for the node
  127. SPIRtrMgrInfo m_spRm;
  128. SPIRtrMgrProtocolInfo m_spRmProt;
  129. ATLKConfigStream * m_pConfigStream;
  130. CString m_stTitle;
  131. BOOL m_fProtocolIsRunning; // TRUE if protocol is running
  132. // Members used by netcard detection routines
  133. HDEVINFO m_hDevInfo;
  134. // strings used in interface column descriptions
  135. CString m_szProxy;
  136. CString m_szRouterQuerier;
  137. CString m_szRouterSilent;
  138. // ATLKGroupStatistics m_ATLKGroupStats;
  139. };
  140. /*---------------------------------------------------------------------------
  141. Class: ATLKInterfaceHandler
  142. This is the handler for the interface nodes that appear in the ATLK
  143. node.
  144. ---------------------------------------------------------------------------*/
  145. class ATLKInterfaceHandler : public BaseResultHandler
  146. {
  147. public:
  148. ATLKInterfaceHandler(ITFSComponentData *pCompData);
  149. OVERRIDE_NodeHandler_HasPropertyPages();
  150. OVERRIDE_NodeHandler_CreatePropertyPages();
  151. OVERRIDE_NodeHandler_OnCreateDataObject();
  152. OVERRIDE_ResultHandler_AddMenuItems();
  153. OVERRIDE_ResultHandler_Command();
  154. OVERRIDE_ResultHandler_OnCreateDataObject();
  155. OVERRIDE_ResultHandler_DestroyResultHandler();
  156. OVERRIDE_ResultHandler_HasPropertyPages()
  157. { return hrOK; };
  158. OVERRIDE_ResultHandler_CreatePropertyPages();
  159. OVERRIDE_BaseResultHandlerNotify_OnResultDelete();
  160. // Initializes the node
  161. HRESULT ConstructNode(ITFSNode *pNode, IInterfaceInfo *pIfInfo);
  162. HRESULT Init(IInterfaceInfo *pInfo, ITFSNode *pParent, ATLKConfigStream *pConfigStream);
  163. HRESULT OnRemoveInterface(ITFSNode *pNode);
  164. // Refresh the data for this node
  165. void RefreshInterface(MMC_COOKIE cookie);
  166. public:
  167. // Structure used to pass data to callbacks - used as a way of
  168. // avoiding recomputation
  169. struct SMenuData
  170. {
  171. ULONG m_ulMenuId;
  172. SPITFSNode m_spNode;
  173. };
  174. protected:
  175. SPIInterfaceInfo m_spInterfaceInfo;
  176. // ATLKInterfaceStatistics m_ATLKInterfaceStats;
  177. };
  178. bool IfATLKRoutingEnabled();
  179. #endif _ATLKVIEW_H