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.

185 lines
5.4 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. afx_msg void OnListItemChanged(NMHDR*, LRESULT*);
  67. // data
  68. CNSListCtrl m_listCtrl;
  69. // internal helpers
  70. void LoadUIData();
  71. void FillNsListView();
  72. void EnableEditorButtons(int nListBoxSel);
  73. void EnableButtons(BOOL bEnable);
  74. void SetDescription(LPCWSTR lpsz) { SetDlgItemText(IDC_STATIC_DESCR, lpsz);}
  75. CStatic* GetDescription() { return (CStatic*)GetDlgItem(IDC_STATIC_DESCR); }
  76. void SetMessage(LPCWSTR lpsz) { SetDlgItemText(IDC_STATIC_MESSAGE, lpsz);}
  77. CButton* GetAddButton() { return (CButton*)GetDlgItem(IDC_ADD_NS_BUTTON);}
  78. CButton* GetRemoveButton() { return (CButton*)GetDlgItem(IDC_REMOVE_NS_BUTTON);}
  79. CButton* GetEditButton() { return (CButton*)GetDlgItem(IDC_EDIT_NS_BUTTON);}
  80. DECLARE_MESSAGE_MAP()
  81. private:
  82. CDNSDomainNode* m_pDomainNode;
  83. };
  84. ///////////////////////////////////////////////////////////////////////////////
  85. // CDNSNameServersWizardPage
  86. class CDNSNameServersWizardPage : public CPropertyPageBase
  87. {
  88. // Construction
  89. public:
  90. CDNSNameServersWizardPage(UINT nIDTemplate = IDD_NAME_SERVERS_PAGE);
  91. virtual ~CDNSNameServersWizardPage();
  92. void SetReadOnly() { m_bReadOnly = TRUE;}
  93. virtual BOOL OnPropertyChange(BOOL bScopePane, long* pChangeMask);
  94. BOOL HasMeaningfulTTL() { return m_bMeaningfulTTL; }
  95. // Overrides
  96. virtual BOOL OnApply();
  97. CDNSDomainNode* GetDomainNode() { ASSERT(m_pDomainNode != NULL); return m_pDomainNode;}
  98. void SetDomainNode(CDNSDomainNode* pDomainNode)
  99. {ASSERT(pDomainNode != NULL); m_pDomainNode = pDomainNode;}
  100. protected:
  101. BOOL m_bMeaningfulTTL; // true if TTL has meaning (zone, delegation), false on root hints
  102. BOOL m_bReadOnly;
  103. CDNSRecordNodeEditInfoList* m_pCloneInfoList;
  104. // access to external list of NS records (must override to hook up)
  105. virtual void ReadRecordNodesList() = 0;
  106. virtual BOOL WriteNSRecordNodesList();
  107. virtual BOOL OnWriteNSRecordNodesListError();
  108. virtual void OnCountChange(int){}
  109. // message handlers
  110. virtual BOOL OnInitDialog();
  111. afx_msg void OnAddButton();
  112. afx_msg void OnRemoveButton();
  113. afx_msg void OnEditButton();
  114. afx_msg void OnListItemChanged(NMHDR*, LRESULT*);
  115. // data
  116. CNSListCtrl m_listCtrl;
  117. // internal helpers
  118. void LoadUIData();
  119. void FillNsListView();
  120. void EnableEditorButtons(int nListBoxSel);
  121. void EnableButtons(BOOL bEnable);
  122. void SetDescription(LPCWSTR lpsz) { SetDlgItemText(IDC_STATIC_DESCR, lpsz);}
  123. CStatic* GetDescription() { return (CStatic*)GetDlgItem(IDC_STATIC_DESCR); }
  124. void SetMessage(LPCWSTR lpsz) { SetDlgItemText(IDC_STATIC_MESSAGE, lpsz);}
  125. CButton* GetAddButton() { return (CButton*)GetDlgItem(IDC_ADD_NS_BUTTON);}
  126. CButton* GetRemoveButton() { return (CButton*)GetDlgItem(IDC_REMOVE_NS_BUTTON);}
  127. CButton* GetEditButton() { return (CButton*)GetDlgItem(IDC_EDIT_NS_BUTTON);}
  128. DECLARE_MESSAGE_MAP()
  129. private:
  130. CDNSDomainNode* m_pDomainNode;
  131. };
  132. #endif // _NSPAGE_H