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: ipxserviceprop.h
  5. //
  6. // History:
  7. // 12/07/90 Deon Brewis Created.
  8. //
  9. // IPX Static Service 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 "ssview.h"
  22. #endif
  23. // ---------------------------------------------------------------------------
  24. // Forward declarations
  25. // ---------------------------------------------------------------------------
  26. class IPXConnection;
  27. class IpxStaticServicePropertySheet;
  28. // ---------------------------------------------------------------------------
  29. // class: SafeIPXSSListEntry
  30. //
  31. // IpxSSListEntry 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 SafeIPXSSListEntry
  39. {
  40. public:
  41. CComPtr<IInterfaceInfo> m_spIf;
  42. IPX_STATIC_SERVICE_INFO m_service;
  43. void LoadFrom(BaseIPXResultNodeData *pNodeData);
  44. void SaveTo(BaseIPXResultNodeData *pNodeData);
  45. };
  46. // ---------------------------------------------------------------------------
  47. // class: IpxStaticServicePropertyPage
  48. // This class handles the IPX Static Route properties
  49. //
  50. // Author: deonb
  51. // ---------------------------------------------------------------------------
  52. class IpxStaticServicePropertyPage :
  53. public RtrPropertyPage
  54. {
  55. public:
  56. IpxStaticServicePropertyPage(UINT nIDTemplate, UINT nIDCaption = 0)
  57. : RtrPropertyPage(nIDTemplate, nIDCaption)
  58. {};
  59. ~IpxStaticServicePropertyPage();
  60. HRESULT Init(BaseIPXResultNodeData *pNodeData,
  61. IpxStaticServicePropertySheet * pIPXPropSheet);
  62. HRESULT ModifyRouteInfo(ITFSNode *pNode,
  63. SafeIPXSSListEntry *pSSEntryNew,
  64. SafeIPXSSListEntry *pSSEntryOld);
  65. HRESULT RemoveStaticService(SafeIPXSSListEntry *pSSEntry,
  66. IInfoBase *pInfoBase);
  67. protected:
  68. // Override the OnApply() so that we can grab our data from the
  69. // controls in the dialog.
  70. virtual BOOL OnApply();
  71. SafeIPXSSListEntry m_SREntry;
  72. SafeIPXSSListEntry m_InitSREntry;
  73. IpxStaticServicePropertySheet *m_pIPXPropSheet;
  74. //{{AFX_VIRTUAL(IpxStaticServicePropertyPage)
  75. protected:
  76. virtual VOID DoDataExchange(CDataExchange *pDX);
  77. //}}AFX_VIRTUAL
  78. //{{AFX_DATA(IpxStaticServicePropertyPage)
  79. CSpinButtonCtrl m_spinHopCount;
  80. //}}AFX_DATA
  81. //{{AFX_MSG(IpxStaticServicePropertyPage)
  82. virtual BOOL OnInitDialog();
  83. //}}AFX_MSG
  84. //{{AFX_MSG(IpxStaticServicePropertyPage
  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: IpxStaticServicePropertySheet
  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 IpxStaticServicePropertySheet :
  100. public RtrPropertySheet
  101. {
  102. public:
  103. IpxStaticServicePropertySheet(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. IpxStaticServicePropertyPage m_pageGeneral;
  119. };
  120. // ---------------------------------------------------------------------------
  121. // AddStaticRoute function updated to use a SafeIPXSRListEntry
  122. // ---------------------------------------------------------------------------
  123. HRESULT AddStaticService(SafeIPXSSListEntry *pSSEntry,
  124. IInfoBase *InfoBase,
  125. InfoBlock *pBlock);
  126. #endif _NBPROP_H