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.

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