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.

156 lines
4.3 KiB

  1. //============================================================================
  2. // Copyright (C) Microsoft Corporation, 1997 - 1999
  3. //
  4. // File: ipxstaticroute.h
  5. //
  6. // History:
  7. // 12/07/90 Deon Brewis Created.
  8. //
  9. // IPX Static Routes property sheet and property pages
  10. //
  11. //============================================================================
  12. #ifndef _NBPROP_H
  13. #define _NBPROP_H
  14. #ifndef _INFO_H
  15. #include "info.h"
  16. #endif
  17. #ifndef _RTRSHEET_H
  18. #include "rtrsheet.h"
  19. #endif
  20. #ifndef _SRVIEW_H
  21. #include "srview.h"
  22. #endif
  23. // ---------------------------------------------------------------------------
  24. // Forward declarations
  25. // ---------------------------------------------------------------------------
  26. class IPXConnection;
  27. class IpxStaticRoutePropertySheet;
  28. // ---------------------------------------------------------------------------
  29. // class: SafeIPXSRListEntry
  30. //
  31. // IpxSRListEntry is not thread safe or something else is wrong with the TFS
  32. // implementation of smart pointers. Anyway, it does not work in property pages.
  33. // Grrr.... Had to change SPInterfaceInfo m_spIf to CComPtr<IInterfaceInfo>.
  34. // It seems to work now.
  35. //
  36. // Author: deonb
  37. // ---------------------------------------------------------------------------
  38. class SafeIPXSRListEntry
  39. {
  40. public:
  41. CComPtr<IInterfaceInfo> m_spIf;
  42. IPX_STATIC_ROUTE_INFO m_route;
  43. void LoadFrom(BaseIPXResultNodeData *pNodeData);
  44. void SaveTo(BaseIPXResultNodeData *pNodeData);
  45. };
  46. // ---------------------------------------------------------------------------
  47. // class: IpxStaticRoutePropertyPage
  48. // This class handles the IPX Static Route properties
  49. //
  50. // Author: deonb
  51. // ---------------------------------------------------------------------------
  52. class IpxStaticRoutePropertyPage :
  53. public RtrPropertyPage
  54. {
  55. public:
  56. IpxStaticRoutePropertyPage(UINT nIDTemplate, UINT nIDCaption = 0)
  57. : RtrPropertyPage(nIDTemplate, nIDCaption)
  58. {};
  59. ~IpxStaticRoutePropertyPage();
  60. HRESULT Init(BaseIPXResultNodeData *pNodeData,
  61. IpxStaticRoutePropertySheet * pIPXPropSheet);
  62. HRESULT ModifyRouteInfo(ITFSNode *pNode,
  63. SafeIPXSRListEntry *pSREntryNew,
  64. SafeIPXSRListEntry *pSREntryOld);
  65. HRESULT RemoveStaticRoute(SafeIPXSRListEntry *pSREntry, IInfoBase *pInfoBase);
  66. protected:
  67. // Override the OnApply() so that we can grab our data from the
  68. // controls in the dialog.
  69. virtual BOOL OnApply();
  70. SafeIPXSRListEntry m_SREntry;
  71. SafeIPXSRListEntry m_InitSREntry;
  72. IpxStaticRoutePropertySheet *m_pIPXPropSheet;
  73. //{{AFX_VIRTUAL(IpxStaticRoutePropertyPage)
  74. protected:
  75. virtual VOID DoDataExchange(CDataExchange *pDX);
  76. //}}AFX_VIRTUAL
  77. //{{AFX_DATA(IpxStaticRoutePropertyPage)
  78. CSpinButtonCtrl m_spinTickCount;
  79. CSpinButtonCtrl m_spinHopCount;
  80. //}}AFX_DATA
  81. //{{AFX_MSG(IpxStaticRoutePropertyPage)
  82. virtual BOOL OnInitDialog();
  83. //}}AFX_MSG
  84. //{{AFX_MSG(IpxStaticRoutePropertyPage
  85. afx_msg void OnChangeButton();
  86. afx_msg void OnInputFilters();
  87. afx_msg void OnOutputFilters();
  88. //}}AFX_MSG
  89. DECLARE_MESSAGE_MAP()
  90. };
  91. // ---------------------------------------------------------------------------
  92. // Class: IpxStaticRoutePropertySheet
  93. //
  94. // This is the property sheet support class for the properties page of
  95. // IPX Static Route items.
  96. //
  97. // Author: deonb
  98. //---------------------------------------------------------------------------
  99. class IpxStaticRoutePropertySheet :
  100. public RtrPropertySheet
  101. {
  102. public:
  103. IpxStaticRoutePropertySheet(ITFSNode *pNode,
  104. IComponentData *pComponentData,
  105. ITFSComponentData *pTFSCompData,
  106. LPCTSTR pszSheetName,
  107. CWnd *pParent = NULL,
  108. UINT iPage=0,
  109. BOOL fScopePane = TRUE);
  110. HRESULT Init(BaseIPXResultNodeData * pNodeData,
  111. IInterfaceInfo * spInterfaceInfo);
  112. virtual BOOL SaveSheetData();
  113. virtual void CancelSheetData();
  114. BaseIPXResultNodeData * m_pNodeData;
  115. CComPtr<IInterfaceInfo> m_spInterfaceInfo;
  116. CComPtr<ITFSNode> m_spNode;
  117. protected:
  118. IpxStaticRoutePropertyPage m_pageGeneral;
  119. };
  120. // ---------------------------------------------------------------------------
  121. // AddStaticRoute function updated to use a SafeIPXSRListEntry
  122. // ---------------------------------------------------------------------------
  123. HRESULT AddStaticRoute(SafeIPXSRListEntry *pSREntryNew,
  124. IInfoBase *pInfoBase,
  125. InfoBlock *pBlock);
  126. #endif _NBPROP_H