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.

560 lines
13 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1998
  6. //
  7. // File: zonewiz.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _ZONEWIZ_H
  11. #define _ZONEWIZ_H
  12. #include "ipeditor.h"
  13. ///////////////////////////////////////////////////////////////////////////////
  14. // FORWARD DECLARATIONS
  15. class CDNSServerNode;
  16. class CDNSZoneNode;
  17. class CDNSZoneWiz_StartPropertyPage;
  18. class CDNSZoneWiz_SelectServerPropertyPage;
  19. class CDNSZoneWiz_ZoneTypePropertyPage;
  20. class CDNSZoneWiz_ZoneLookupPropertyPage;
  21. class CDNSZoneWiz_ZoneNamePropertyPageBase;
  22. class CDNSZoneWiz_FwdZoneNamePropertyPage;
  23. class CDNSZoneWiz_DynamicPropertyPage;
  24. class CDNSZoneWiz_RevZoneNamePropertyPage;
  25. class CDNSZoneWiz_MastersPropertyPage;
  26. class CDNSZoneWiz_StoragePropertyPage;
  27. #ifdef USE_NDNC
  28. class CDNSZoneWiz_ADReplicationPropertyPage;
  29. #endif // USE_NDNC
  30. class CDNSZoneWiz_FinishPropertyPage;
  31. ///////////////////////////////////////////////////////////////////////////////
  32. // CDNSCreateZoneInfo
  33. // information gathered by the Zone Wizard
  34. class CDNSCreateZoneInfo
  35. {
  36. public:
  37. CDNSCreateZoneInfo();
  38. ~CDNSCreateZoneInfo();
  39. void ResetIpArr();
  40. void SetIpArr(PIP_ADDRESS ipMastersArray, DWORD nMastersCount);
  41. const CDNSCreateZoneInfo& operator=(const CDNSCreateZoneInfo& info);
  42. typedef enum { newFile = 0 , importFile, useADS} storageType;
  43. BOOL m_bPrimary;
  44. BOOL m_bForward;
  45. BOOL m_bIsStub;
  46. CString m_szZoneName;
  47. CString m_szZoneStorage;
  48. storageType m_storageType;
  49. #ifdef USE_NDNC
  50. ReplicationType m_replType;
  51. CString m_szCustomReplName;
  52. #endif // USE_NDNC
  53. PIP_ADDRESS m_ipMastersArray;
  54. DWORD m_nMastersCount;
  55. BOOL m_bLocalListOfMasters;
  56. UINT m_nDynamicUpdate;
  57. // UI session specific info (not used for actual creation)
  58. BOOL m_bWasForward;
  59. };
  60. ///////////////////////////////////////////////////////////////////////////////
  61. // CDNSZoneWizardHolder
  62. // page holder to contain DNS zone wizard property pages
  63. class CDNSZoneWizardHolder : public CPropertyPageHolderBase
  64. {
  65. public:
  66. CDNSZoneWizardHolder(CComponentDataObject* pComponentData);
  67. // simple cast helpers
  68. CDNSServerNode* GetServerNode() { return (CDNSServerNode*)GetContainerNode();}
  69. void SetServerNode(CDNSServerNode* pServerNode) { SetContainerNode((CDNSServerNode*) pServerNode);}
  70. void SetZoneNode(CDNSZoneNode* pZoneNode) { SetTreeNode((CTreeNode*)pZoneNode); }
  71. CDNSZoneNode* GetZoneNode() { return (CDNSZoneNode*)GetTreeNode();}
  72. void Initialize(CDNSServerNode* pServerNode, // might be null,
  73. BOOL bServerPage = FALSE, BOOL bFinishPage = TRUE);
  74. void PreSetZoneLookupType(BOOL bForward);
  75. void PreSetZoneLookupTypeEx(BOOL bForward, UINT nZoneType, BOOL bADIntegrated);
  76. void SetContextPages(UINT nNextToPage, UINT nBackToPage);
  77. UINT GetFirstEntryPointPageID();
  78. UINT GetLastEntryPointPageID();
  79. CDNSCreateZoneInfo* GetZoneInfoPtr() { return m_pZoneInfo;}
  80. void SetZoneInfoPtr(CDNSCreateZoneInfo* pZoneInfo)
  81. {
  82. m_pZoneInfo = (pZoneInfo != NULL) ? pZoneInfo : NULL;
  83. }
  84. static DNS_STATUS CDNSZoneWizardHolder::CreateZoneHelper(CDNSServerNode* pServerNode,
  85. CDNSCreateZoneInfo* pZoneInfo,
  86. CComponentDataObject* pComponentData);
  87. private:
  88. // data for zone creation
  89. CDNSCreateZoneInfo m_zoneInfo;
  90. CDNSCreateZoneInfo* m_pZoneInfo;
  91. BOOL CreateZone();
  92. // cached pointers to property pages
  93. CDNSZoneWiz_StartPropertyPage* m_pStartPage;
  94. CDNSZoneWiz_SelectServerPropertyPage* m_pTargetServerPage;
  95. CDNSZoneWiz_ZoneTypePropertyPage* m_pReplicationTypePage;
  96. CDNSZoneWiz_ZoneLookupPropertyPage* m_pZoneLookupPage;
  97. CDNSZoneWiz_FwdZoneNamePropertyPage* m_pFwdZoneNamePage;
  98. CDNSZoneWiz_DynamicPropertyPage* m_pDynamicPage;
  99. CDNSZoneWiz_RevZoneNamePropertyPage* m_pRevZoneNamePage;
  100. CDNSZoneWiz_MastersPropertyPage* m_pMastersPage;
  101. CDNSZoneWiz_StoragePropertyPage* m_pStoragePage;
  102. #ifdef USE_NDNC
  103. CDNSZoneWiz_ADReplicationPropertyPage* m_pADReplPage;
  104. #endif // USE_NDNC
  105. CDNSZoneWiz_FinishPropertyPage* m_pFinishPage;
  106. BOOL m_bKnowZoneLookupType; // already know Fwd/Rev type
  107. BOOL m_bKnowZoneLookupTypeEx; // already know Fwd/Rev, AD-integrated, and zone type
  108. BOOL m_bServerPage;
  109. BOOL m_bFinishPage;
  110. UINT m_nNextToPage;
  111. UINT m_nBackToPage;
  112. // helper functions
  113. // to access data in the holder
  114. friend class CDNSZoneWiz_StartPropertyPage;
  115. friend class CDNSZoneWiz_SelectServerPropertyPage;
  116. friend class CDNSZoneWiz_ZoneTypePropertyPage;
  117. friend class CDNSZoneWiz_ZoneLookupPropertyPage;
  118. friend class CDNSZoneWiz_ZoneNamePropertyPageBase;
  119. friend class CDNSZoneWiz_FwdZoneNamePropertyPage;
  120. friend class CDNSZoneWiz_DynamicPropertyPage;
  121. friend class CDNSZoneWiz_RevZoneNamePropertyPage;
  122. friend class CDNSZoneWiz_MastersPropertyPage;
  123. friend class CDNSZoneWiz_StoragePropertyPage;
  124. #ifdef USE_NDNC
  125. friend class CDNSZoneWiz_ADReplicationPropertyPage;
  126. #endif USE_NDNC
  127. friend class CDNSZoneWiz_FinishPropertyPage;
  128. };
  129. //////////////////////////////////////////////////////////////////////////
  130. // CDNSZoneWiz_StartPropertyPage
  131. class CDNSZoneWiz_StartPropertyPage : public CPropertyPageBase
  132. {
  133. // Construction
  134. public:
  135. CDNSZoneWiz_StartPropertyPage();
  136. // Overrides
  137. public:
  138. virtual BOOL OnSetActive();
  139. protected:
  140. virtual BOOL OnInitDialog();
  141. public:
  142. // Dialog Data
  143. enum { IDD = IDD_ZWIZ_START };
  144. };
  145. //////////////////////////////////////////////////////////////////////////
  146. // CDNSZoneWiz_SelectServerPropertyPage
  147. class CDNSZoneWiz_SelectServerPropertyPage : public CPropertyPageBase
  148. {
  149. // Construction
  150. public:
  151. CDNSZoneWiz_SelectServerPropertyPage();
  152. // Dialog Data
  153. enum { IDD = IDD_ZWIZ_SELECT_SERVER };
  154. // Overrides
  155. public:
  156. virtual BOOL OnSetActive();
  157. virtual LRESULT OnWizardNext();
  158. virtual BOOL OnKillActive();
  159. protected:
  160. // Implementation
  161. protected:
  162. // Generated message map functions
  163. virtual BOOL OnInitDialog();
  164. afx_msg void OnListboxSelChange(); // message handler
  165. DECLARE_MESSAGE_MAP()
  166. private:
  167. CListBox* GetServerListBox()
  168. { return (CListBox*)GetDlgItem(IDC_SERVERS_LIST);}
  169. };
  170. //////////////////////////////////////////////////////////////////////////
  171. // CDNSZoneWiz_ZoneTypePropertyPage
  172. class CDNSZoneWiz_ZoneTypePropertyPage : public CPropertyPageBase
  173. {
  174. // Construction
  175. public:
  176. CDNSZoneWiz_ZoneTypePropertyPage();
  177. // Dialog Data
  178. enum { IDD = IDD_ZWIZ_ZONE_TYPE };
  179. // Overrides
  180. public:
  181. virtual BOOL OnSetActive();
  182. virtual LRESULT OnWizardNext();
  183. virtual LRESULT OnWizardBack();
  184. virtual BOOL OnKillActive();
  185. protected:
  186. // Implementation
  187. protected:
  188. // Generated message map functions
  189. virtual BOOL OnInitDialog();
  190. afx_msg void OnRadioChange();
  191. DECLARE_MESSAGE_MAP()
  192. private:
  193. void SetUIState();
  194. void GetUIState();
  195. };
  196. //////////////////////////////////////////////////////////////////////////
  197. // CDNSZoneWiz_ZoneLookupPropertyPage
  198. class CDNSZoneWiz_ZoneLookupPropertyPage : public CPropertyPageBase
  199. {
  200. // Construction
  201. public:
  202. CDNSZoneWiz_ZoneLookupPropertyPage();
  203. // Dialog Data
  204. enum { IDD = IDD_ZWIZ_ZONE_LOOKUP };
  205. // Overrides
  206. public:
  207. virtual BOOL OnSetActive();
  208. virtual LRESULT OnWizardNext();
  209. virtual LRESULT OnWizardBack();
  210. // Implementation
  211. protected:
  212. // Generated message map functions
  213. virtual BOOL OnInitDialog();
  214. afx_msg void OnChangeEditZoneName();
  215. private:
  216. };
  217. //////////////////////////////////////////////////////////////////////////
  218. // CDNSZoneWiz_ZoneNamePropertyPageBase
  219. class CDNSZoneWiz_ZoneNamePropertyPageBase : public CPropertyPageBase
  220. {
  221. // Construction
  222. public:
  223. CDNSZoneWiz_ZoneNamePropertyPageBase(UINT nIDD);
  224. // Overrides
  225. public:
  226. virtual BOOL OnSetActive();
  227. virtual LRESULT OnWizardNext();
  228. virtual LRESULT OnWizardBack();
  229. protected:
  230. // Implementation
  231. protected:
  232. // Generated message map functions
  233. afx_msg void OnBrowse();
  234. afx_msg void OnChangeEditZoneName();
  235. DECLARE_MESSAGE_MAP()
  236. protected:
  237. CButton* GetBrowseButton() { return (CButton*)GetDlgItem(IDC_BROWSE_BUTTON);}
  238. CEdit* GetZoneNameEdit() { return (CEdit*)GetDlgItem(IDC_EDIT_ZONE_NAME);}
  239. void SetUIState();
  240. void GetUIState();
  241. };
  242. //////////////////////////////////////////////////////////////////////////
  243. // CDNSZoneWiz_FwdZoneNamePropertyPage
  244. class CDNSZoneWiz_FwdZoneNamePropertyPage :
  245. public CDNSZoneWiz_ZoneNamePropertyPageBase
  246. {
  247. // Construction
  248. public:
  249. CDNSZoneWiz_FwdZoneNamePropertyPage();
  250. // Dialog Data
  251. enum { IDD = IDD_ZWIZ_FWD_ZONE_NAME };
  252. };
  253. //////////////////////////////////////////////////////////////////////////
  254. // CDNSZoneWiz_RevZoneNamePropertyPage
  255. class CDNSZoneWiz_RevZoneNamePropertyPage :
  256. public CDNSZoneWiz_ZoneNamePropertyPageBase
  257. {
  258. // Construction
  259. public:
  260. CDNSZoneWiz_RevZoneNamePropertyPage();
  261. // Dialog Data
  262. enum { IDD = IDD_ZWIZ_REV_ZONE_NAME };
  263. // Overrides
  264. public:
  265. virtual BOOL OnSetActive();
  266. protected:
  267. // Implementation
  268. protected:
  269. // Generated message map functions
  270. virtual BOOL OnInitDialog();
  271. afx_msg void OnChangeSubnetIPv4Ctrl();
  272. // afx_msg void OnChangeMaskIPv4Ctrl();
  273. afx_msg void OnChangeUseIPRadio();
  274. afx_msg void OnChangeUseEditRadio();
  275. afx_msg void OnHelpButton();
  276. DECLARE_MESSAGE_MAP()
  277. private:
  278. BOOL m_bUseIP; // flags to tell wich entry method we use
  279. CButton* GetUseIPRadio() { return (CButton*)GetDlgItem(IDC_USE_IP_RADIO);}
  280. CButton* GetUseEditRadio() { return (CButton*)GetDlgItem(IDC_USE_EDIT_RADIO);}
  281. CDNSIPv4Control* GetSubnetIPv4Ctrl()
  282. { return (CDNSIPv4Control*)GetDlgItem(IDC_SUBNET_IPEDIT);}
  283. /* CDNSIPv4Control* GetMaskIPv4Ctrl()
  284. { return (CDNSIPv4Control*)GetDlgItem(IDC_MASK_IPEDIT);}
  285. */
  286. void SyncRadioButtons(BOOL bPrevUseIP);
  287. void ResetIPEditAndNameValue();
  288. BOOL BuildZoneName(DWORD* dwSubnetArr /*, DWORD* dwMaskArr*/);
  289. };
  290. //////////////////////////////////////////////////////////////////////////
  291. // CDNSZoneWiz_MastersPropertyPage
  292. class CZoneWiz_MastersIPEditor : public CIPEditor
  293. {
  294. public:
  295. virtual void OnChangeData();
  296. };
  297. class CDNSZoneWiz_MastersPropertyPage : public CPropertyPageBase
  298. {
  299. // Construction
  300. public:
  301. CDNSZoneWiz_MastersPropertyPage();
  302. // Dialog Data
  303. enum { IDD = IDD_ZWIZ_MASTERS };
  304. // Overrides
  305. public:
  306. virtual BOOL OnSetActive();
  307. virtual LRESULT OnWizardNext();
  308. virtual LRESULT OnWizardBack();
  309. protected:
  310. // Implementation
  311. protected:
  312. // Generated message map functions
  313. virtual BOOL OnInitDialog();
  314. afx_msg void OnBrowse();
  315. DECLARE_MESSAGE_MAP()
  316. private:
  317. CZoneWiz_MastersIPEditor m_editor;
  318. void SetValidIPArray(BOOL b);
  319. BOOL m_bValidIPArray;
  320. void SetUIState();
  321. void GetUIState();
  322. friend class CZoneWiz_MastersIPEditor;
  323. };
  324. //////////////////////////////////////////////////////////////////////////
  325. // CDNSZoneWiz_DynamicPropertyPage
  326. class CDNSZoneWiz_DynamicPropertyPage : public CPropertyPageBase
  327. {
  328. // Construction
  329. public:
  330. CDNSZoneWiz_DynamicPropertyPage();
  331. ~CDNSZoneWiz_DynamicPropertyPage()
  332. {
  333. }
  334. // Dialog Data
  335. enum { IDD = IDD_ZWIZ_DYNAMIC_UPDATE };
  336. // Overrides
  337. public:
  338. virtual BOOL OnSetActive();
  339. virtual LRESULT OnWizardNext();
  340. virtual LRESULT OnWizardBack();
  341. // Implementation
  342. protected:
  343. // Generated message map functions
  344. virtual BOOL OnInitDialog();
  345. DECLARE_MESSAGE_MAP()
  346. private:
  347. void SetUIState();
  348. void GetUIState();
  349. };
  350. //////////////////////////////////////////////////////////////////////////
  351. // CDNSZoneWiz_StoragePropertyPage
  352. class CDNSZoneWiz_StoragePropertyPage : public CPropertyPageBase
  353. {
  354. // Construction
  355. public:
  356. CDNSZoneWiz_StoragePropertyPage();
  357. ~CDNSZoneWiz_StoragePropertyPage()
  358. {
  359. }
  360. // Dialog Data
  361. enum { IDD = IDD_ZWIZ_STORAGE };
  362. // Overrides
  363. public:
  364. virtual BOOL OnSetActive();
  365. virtual LRESULT OnWizardNext();
  366. virtual LRESULT OnWizardBack();
  367. virtual BOOL OnKillActive();
  368. protected:
  369. // Implementation
  370. protected:
  371. // Generated message map functions
  372. virtual BOOL OnInitDialog();
  373. afx_msg void OnChangeNewFileZoneName();
  374. afx_msg void OnChangeImportFileZoneName();
  375. afx_msg void OnChangeRadioCreateNewFile();
  376. afx_msg void OnChangeRadioImportFile();
  377. DECLARE_MESSAGE_MAP()
  378. private:
  379. UINT m_nCurrRadio;
  380. BOOL ValidateEditBoxString(UINT nID);
  381. void SyncRadioButtons(UINT nID);
  382. void SetUIState();
  383. void GetUIState();
  384. };
  385. #ifdef USE_NDNC
  386. //////////////////////////////////////////////////////////////////////////
  387. // CDNSZoneWiz_ADReplicationPropertyPage
  388. class CDNSZoneWiz_ADReplicationPropertyPage : public CPropertyPageBase
  389. {
  390. // Construction
  391. public:
  392. CDNSZoneWiz_ADReplicationPropertyPage();
  393. ~CDNSZoneWiz_ADReplicationPropertyPage()
  394. {
  395. }
  396. // Dialog Data
  397. enum { IDD = IDD_ZWIZ_AD_REPLICATION };
  398. // Overrides
  399. public:
  400. virtual BOOL OnSetActive();
  401. virtual LRESULT OnWizardNext();
  402. virtual LRESULT OnWizardBack();
  403. virtual BOOL OnKillActive();
  404. protected:
  405. // Implementation
  406. protected:
  407. // Generated message map functions
  408. virtual BOOL OnInitDialog();
  409. afx_msg void OnRadioChange();
  410. afx_msg void OnCustomComboSelChange();
  411. DECLARE_MESSAGE_MAP()
  412. private:
  413. void SyncRadioButtons();
  414. void SetUIState();
  415. void GetUIState();
  416. };
  417. #endif // USE_NDNC
  418. //////////////////////////////////////////////////////////////////////////
  419. // CDNSZoneWiz_FinishPropertyPage
  420. class CDNSZoneWiz_FinishPropertyPage : public CPropertyPageBase
  421. {
  422. // Construction
  423. public:
  424. CDNSZoneWiz_FinishPropertyPage();
  425. // Dialog Data
  426. enum { IDD = IDD_ZWIZ_FINISH };
  427. // Overrides
  428. public:
  429. virtual BOOL OnSetActive();
  430. virtual LRESULT OnWizardBack();
  431. virtual BOOL OnWizardFinish();
  432. protected:
  433. virtual BOOL OnInitDialog();
  434. private:
  435. CDNSManageControlTextHelper m_typeText;
  436. CDNSToggleTextControlHelper m_lookupText;
  437. void DisplaySummaryInfo();
  438. };
  439. #endif // _ZONEWIZ_H