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.

185 lines
5.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: nspage.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _NSPAGE_H
  11. #define _NSPAGE_H
  12. ///////////////////////////////////////////////////////////////////////////////
  13. // FORWARD DECLARATIONS
  14. class CDNS_NS_Record;
  15. class CDNSRecordNodeEditInfoList;
  16. class CDNSRecordNodeEditInfo;
  17. class CDNSDomainNode;
  18. ////////////////////////////////////////////////////////////////////////////
  19. class CNSListCtrl : public CListCtrl
  20. {
  21. public:
  22. void Initialize();
  23. BOOL InsertNSRecordEntry(CDNSRecordNodeEditInfo* pNSInfo, int nItemIndex);
  24. void UpdateNSRecordEntry(int nItemIndex);
  25. int GetSelection();
  26. void SetSelection(int nSel);
  27. CDNSRecordNodeEditInfo* GetSelectionEditInfo();
  28. private:
  29. void InsertItemHelper(int nIndex, CDNSRecordNodeEditInfo* pNSInfo,
  30. LPCTSTR lpszName, LPCTSTR lpszValue);
  31. void BuildIPAddrDisplayString(CDNSRecordNodeEditInfo* pNSInfo, CString& szDisplayData);
  32. void GetIPAddressString(CDNSRecordNodeEditInfo* pNSInfo, CString& sz);
  33. DECLARE_MESSAGE_MAP()
  34. };
  35. ///////////////////////////////////////////////////////////////////////////////
  36. // CDNSNameServersPropertyPage
  37. class CDNSNameServersPropertyPage : public CPropertyPageBase
  38. {
  39. // Construction
  40. public:
  41. CDNSNameServersPropertyPage(UINT nIDTemplate = IDD_NAME_SERVERS_PAGE,
  42. UINT nIDCaption = 0);
  43. virtual ~CDNSNameServersPropertyPage();
  44. void SetReadOnly() { m_bReadOnly = TRUE;}
  45. virtual BOOL OnPropertyChange(BOOL bScopePane, long* pChangeMask);
  46. BOOL HasMeaningfulTTL() { return m_bMeaningfulTTL; }
  47. // Overrides
  48. virtual BOOL OnApply();
  49. CDNSDomainNode* GetDomainNode() { ASSERT(m_pDomainNode != NULL); return m_pDomainNode;}
  50. void SetDomainNode(CDNSDomainNode* pDomainNode)
  51. {ASSERT(pDomainNode != NULL); m_pDomainNode = pDomainNode;}
  52. protected:
  53. BOOL m_bMeaningfulTTL; // true if TTL has meaning (zone, delegation), false on root hints
  54. BOOL m_bReadOnly;
  55. CDNSRecordNodeEditInfoList* m_pCloneInfoList;
  56. // access to external list of NS records (must override to hook up)
  57. virtual void ReadRecordNodesList() = 0;
  58. virtual BOOL WriteNSRecordNodesList();
  59. virtual BOOL OnWriteNSRecordNodesListError();
  60. virtual void OnCountChange(int){}
  61. // message handlers
  62. virtual BOOL OnInitDialog();
  63. afx_msg void OnAddButton();
  64. afx_msg void OnRemoveButton();
  65. afx_msg void OnEditButton();
  66. // data
  67. CNSListCtrl m_listCtrl;
  68. // internal helpers
  69. void LoadUIData();
  70. void FillNsListView();
  71. void EnableEditorButtons(int nListBoxSel);
  72. void EnableButtons(BOOL bEnable);
  73. void SetDescription(LPCWSTR lpsz) { SetDlgItemText(IDC_STATIC_DESCR, lpsz);}
  74. CStatic* GetDescription() { return (CStatic*)GetDlgItem(IDC_STATIC_DESCR); }
  75. void SetMessage(LPCWSTR lpsz) { SetDlgItemText(IDC_STATIC_MESSAGE, lpsz);}
  76. CButton* GetAddButton() { return (CButton*)GetDlgItem(IDC_ADD_NS_BUTTON);}
  77. CButton* GetRemoveButton() { return (CButton*)GetDlgItem(IDC_REMOVE_NS_BUTTON);}
  78. CButton* GetEditButton() { return (CButton*)GetDlgItem(IDC_EDIT_NS_BUTTON);}
  79. DECLARE_MESSAGE_MAP()
  80. private:
  81. CDNSDomainNode* m_pDomainNode;
  82. };
  83. ///////////////////////////////////////////////////////////////////////////////
  84. // CDNSNameServersWizardPage
  85. class CDNSNameServersWizardPage : public CPropertyPageBase
  86. {
  87. // Construction
  88. public:
  89. CDNSNameServersWizardPage(UINT nIDTemplate = IDD_NAME_SERVERS_PAGE);
  90. virtual ~CDNSNameServersWizardPage();
  91. void SetReadOnly() { m_bReadOnly = TRUE;}
  92. virtual BOOL OnPropertyChange(BOOL bScopePane, long* pChangeMask);
  93. BOOL HasMeaningfulTTL() { return m_bMeaningfulTTL; }
  94. // Overrides
  95. virtual BOOL OnApply();
  96. CDNSDomainNode* GetDomainNode() { ASSERT(m_pDomainNode != NULL); return m_pDomainNode;}
  97. void SetDomainNode(CDNSDomainNode* pDomainNode)
  98. {ASSERT(pDomainNode != NULL); m_pDomainNode = pDomainNode;}
  99. protected:
  100. BOOL m_bMeaningfulTTL; // true if TTL has meaning (zone, delegation), false on root hints
  101. BOOL m_bReadOnly;
  102. CDNSRecordNodeEditInfoList* m_pCloneInfoList;
  103. // access to external list of NS records (must override to hook up)
  104. virtual void ReadRecordNodesList() = 0;
  105. virtual BOOL WriteNSRecordNodesList();
  106. virtual BOOL OnWriteNSRecordNodesListError();
  107. virtual void OnCountChange(int){}
  108. // message handlers
  109. virtual BOOL OnInitDialog();
  110. afx_msg void OnAddButton();
  111. afx_msg void OnRemoveButton();
  112. afx_msg void OnEditButton();
  113. // data
  114. CNSListCtrl m_listCtrl;
  115. // internal helpers
  116. void LoadUIData();
  117. void FillNsListView();
  118. void EnableEditorButtons(int nListBoxSel);
  119. void EnableButtons(BOOL bEnable);
  120. void SetDescription(LPCWSTR lpsz) { SetDlgItemText(IDC_STATIC_DESCR, lpsz);}
  121. CStatic* GetDescription() { return (CStatic*)GetDlgItem(IDC_STATIC_DESCR); }
  122. void SetMessage(LPCWSTR lpsz) { SetDlgItemText(IDC_STATIC_MESSAGE, lpsz);}
  123. CButton* GetAddButton() { return (CButton*)GetDlgItem(IDC_ADD_NS_BUTTON);}
  124. CButton* GetRemoveButton() { return (CButton*)GetDlgItem(IDC_REMOVE_NS_BUTTON);}
  125. CButton* GetEditButton() { return (CButton*)GetDlgItem(IDC_EDIT_NS_BUTTON);}
  126. DECLARE_MESSAGE_MAP()
  127. private:
  128. CDNSDomainNode* m_pDomainNode;
  129. };
  130. #endif // _NSPAGE_H