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.

473 lines
11 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. mscopewiz.h
  7. DHCP multicast scope creation dialog
  8. FILE HISTORY:
  9. */
  10. #if !defined _MSCOPWIZ_H
  11. #define _MSCOPWIZ_H
  12. #if _MSC_VER >= 1000
  13. #pragma once
  14. #endif // _MSC_VER >= 1000
  15. /////////////////////////////////////////////////////////////////////////////
  16. //
  17. // CMScopeWizName dialog
  18. //
  19. /////////////////////////////////////////////////////////////////////////////
  20. class CMScopeWizName : public CPropertyPageBase
  21. {
  22. DECLARE_DYNCREATE(CMScopeWizName)
  23. // Construction
  24. public:
  25. CMScopeWizName();
  26. ~CMScopeWizName();
  27. // Dialog Data
  28. //{{AFX_DATA(CMScopeWizName)
  29. enum { IDD = IDW_MSCOPE_NAME };
  30. CEdit m_editScopeName;
  31. CEdit m_editScopeComment;
  32. CString m_strName;
  33. CString m_strComment;
  34. //}}AFX_DATA
  35. // Overrides
  36. // ClassWizard generate virtual function overrides
  37. //{{AFX_VIRTUAL(CMScopeWizName)
  38. public:
  39. virtual LRESULT OnWizardNext();
  40. virtual BOOL OnSetActive();
  41. protected:
  42. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  43. //}}AFX_VIRTUAL
  44. // Implementation
  45. public:
  46. void UpdateButtons();
  47. protected:
  48. // Generated message map functions
  49. //{{AFX_MSG(CMScopeWizName)
  50. virtual BOOL OnInitDialog();
  51. afx_msg void OnChangeEditScopeName();
  52. //}}AFX_MSG
  53. DECLARE_MESSAGE_MAP()
  54. };
  55. /////////////////////////////////////////////////////////////////////////////
  56. //
  57. // CMScopeWizInvalidName dialog
  58. //
  59. /////////////////////////////////////////////////////////////////////////////
  60. class CMScopeWizInvalidName : public CPropertyPageBase
  61. {
  62. DECLARE_DYNCREATE(CMScopeWizInvalidName)
  63. // Construction
  64. public:
  65. CMScopeWizInvalidName();
  66. ~CMScopeWizInvalidName();
  67. // Dialog Data
  68. //{{AFX_DATA(CMScopeWizInvalidName)
  69. enum { IDD = IDW_MSCOPE_INVALID_NAME };
  70. // NOTE - ClassWizard will add data members here.
  71. // DO NOT EDIT what you see in these blocks of generated code !
  72. //}}AFX_DATA
  73. // Overrides
  74. // ClassWizard generate virtual function overrides
  75. //{{AFX_VIRTUAL(CMScopeWizInvalidName)
  76. public:
  77. virtual LRESULT OnWizardBack();
  78. virtual BOOL OnSetActive();
  79. protected:
  80. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  81. //}}AFX_VIRTUAL
  82. // Implementation
  83. protected:
  84. // Generated message map functions
  85. //{{AFX_MSG(CMScopeWizInvalidName)
  86. virtual BOOL OnInitDialog();
  87. //}}AFX_MSG
  88. DECLARE_MESSAGE_MAP()
  89. };
  90. /////////////////////////////////////////////////////////////////////////////
  91. //
  92. // CMScopeWizSetRange dialog
  93. //
  94. /////////////////////////////////////////////////////////////////////////////
  95. class CMScopeWizSetRange : public CPropertyPageBase
  96. {
  97. DECLARE_DYNCREATE(CMScopeWizSetRange)
  98. // Construction
  99. public:
  100. CMScopeWizSetRange();
  101. ~CMScopeWizSetRange();
  102. // Dialog Data
  103. //{{AFX_DATA(CMScopeWizSetRange)
  104. enum { IDD = IDW_MSCOPE_SET_SCOPE };
  105. CSpinButtonCtrl m_spinTTL;
  106. CEdit m_editTTL;
  107. //}}AFX_DATA
  108. CWndIpAddress m_ipaStart; // Start Address
  109. CWndIpAddress m_ipaEnd; // End Address
  110. // Overrides
  111. // ClassWizard generate virtual function overrides
  112. //{{AFX_VIRTUAL(CMScopeWizSetRange)
  113. public:
  114. virtual LRESULT OnWizardNext();
  115. virtual LRESULT OnWizardBack();
  116. virtual BOOL OnSetActive();
  117. virtual BOOL OnKillActive();
  118. protected:
  119. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  120. //}}AFX_VIRTUAL
  121. // Implementation
  122. public:
  123. BOOL GetScopeRange(CDhcpIpRange * pdhcpIpRange);
  124. BYTE GetTTL();
  125. protected:
  126. BOOL m_fPageActive;
  127. // Generated message map functions
  128. //{{AFX_MSG(CMScopeWizSetRange)
  129. virtual BOOL OnInitDialog();
  130. afx_msg void OnKillfocusPoolStart();
  131. afx_msg void OnKillfocusPoolStop();
  132. afx_msg void OnChangeEditMaskLength();
  133. afx_msg void OnKillfocusSubnetMask();
  134. afx_msg void OnChangePoolStart();
  135. afx_msg void OnChangePoolStop();
  136. //}}AFX_MSG
  137. DECLARE_MESSAGE_MAP()
  138. void UpdateButtons();
  139. };
  140. /////////////////////////////////////////////////////////////////////////////
  141. //
  142. // CMScopeWizSetExclusions dialog
  143. //
  144. /////////////////////////////////////////////////////////////////////////////
  145. class CMScopeWizSetExclusions : public CPropertyPageBase
  146. {
  147. DECLARE_DYNCREATE(CMScopeWizSetExclusions)
  148. // Construction
  149. public:
  150. CMScopeWizSetExclusions();
  151. ~CMScopeWizSetExclusions();
  152. // Dialog Data
  153. //{{AFX_DATA(CMScopeWizSetExclusions)
  154. enum { IDD = IDW_MSCOPE_SET_EXCLUSIONS };
  155. CListBox m_listboxExclusions;
  156. CButton m_buttonExclusionDelete;
  157. CButton m_buttonExclusionAdd;
  158. //}}AFX_DATA
  159. CWndIpAddress m_ipaStart; // Start Address
  160. CWndIpAddress m_ipaEnd; // End Address
  161. // Overrides
  162. // ClassWizard generate virtual function overrides
  163. //{{AFX_VIRTUAL(CMScopeWizSetExclusions)
  164. public:
  165. virtual LRESULT OnWizardNext();
  166. virtual LRESULT OnWizardBack();
  167. virtual BOOL OnSetActive();
  168. protected:
  169. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  170. //}}AFX_VIRTUAL
  171. // Implementation
  172. public:
  173. CExclusionList * GetExclusionList() { return &m_listExclusions; }
  174. protected:
  175. // Generated message map functions
  176. //{{AFX_MSG(CMScopeWizSetExclusions)
  177. virtual BOOL OnInitDialog();
  178. afx_msg void OnButtonExclusionAdd();
  179. afx_msg void OnButtonExclusionDelete();
  180. //}}AFX_MSG
  181. afx_msg void OnChangeExclusionStart();
  182. afx_msg void OnChangeExclusionEnd();
  183. DECLARE_MESSAGE_MAP()
  184. CExclusionList m_listExclusions;
  185. // Fill the exclusions listbox from the current list
  186. void Fill ( int nCurSel = 0, BOOL bToggleRedraw = TRUE ) ;
  187. // Return TRUE if the given range overlaps an already-defined range
  188. BOOL IsOverlappingRange ( CDhcpIpRange & dhcIpRange ) ;
  189. // Store the excluded IP range values into a range object
  190. BOOL GetExclusionRange (CDhcpIpRange & dhcIpRange ) ;
  191. // Format an IP range pair into the exclusion edit controls
  192. void FillExcl ( CDhcpIpRange * pdhcIpRange ) ;
  193. void UpdateButtons();
  194. };
  195. /////////////////////////////////////////////////////////////////////////////
  196. //
  197. // CMScopeWizLeaseTime dialog
  198. //
  199. /////////////////////////////////////////////////////////////////////////////
  200. class CMScopeWizLeaseTime : public CPropertyPageBase
  201. {
  202. DECLARE_DYNCREATE(CMScopeWizLeaseTime)
  203. // Construction
  204. public:
  205. CMScopeWizLeaseTime();
  206. ~CMScopeWizLeaseTime();
  207. // Dialog Data
  208. //{{AFX_DATA(CMScopeWizLeaseTime)
  209. enum { IDD = IDW_MSCOPE_LEASE_TIME };
  210. CSpinButtonCtrl m_spinMinutes;
  211. CSpinButtonCtrl m_spinHours;
  212. CSpinButtonCtrl m_spinDays;
  213. CEdit m_editMinutes;
  214. CEdit m_editHours;
  215. CEdit m_editDays;
  216. //}}AFX_DATA
  217. static int m_nDaysDefault;
  218. static int m_nHoursDefault;
  219. static int m_nMinutesDefault;
  220. // Overrides
  221. // ClassWizard generate virtual function overrides
  222. //{{AFX_VIRTUAL(CMScopeWizLeaseTime)
  223. public:
  224. virtual LRESULT OnWizardNext();
  225. virtual LRESULT OnWizardBack();
  226. virtual BOOL OnSetActive();
  227. protected:
  228. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  229. //}}AFX_VIRTUAL
  230. // Implementation
  231. public:
  232. DWORD GetLeaseTime();
  233. protected:
  234. // Generated message map functions
  235. //{{AFX_MSG(CMScopeWizLeaseTime)
  236. virtual BOOL OnInitDialog();
  237. afx_msg void OnRadioLeaseLimited();
  238. afx_msg void OnRadioLeaseUnlimited();
  239. afx_msg void OnChangeEditLeaseHours();
  240. afx_msg void OnChangeEditLeaseMinutes();
  241. //}}AFX_MSG
  242. DECLARE_MESSAGE_MAP()
  243. void ActivateDuration(BOOL fActive);
  244. };
  245. /////////////////////////////////////////////////////////////////////////////
  246. //
  247. // CMScopeWizFinished dialog
  248. //
  249. /////////////////////////////////////////////////////////////////////////////
  250. class CMScopeWizFinished : public CPropertyPageBase
  251. {
  252. DECLARE_DYNCREATE(CMScopeWizFinished)
  253. // Construction
  254. public:
  255. CMScopeWizFinished();
  256. ~CMScopeWizFinished();
  257. // Dialog Data
  258. //{{AFX_DATA(CMScopeWizFinished)
  259. enum { IDD = IDW_MSCOPE_FINISHED };
  260. CStatic m_staticTitle;
  261. //}}AFX_DATA
  262. CFont m_fontBig;
  263. // Overrides
  264. // ClassWizard generate virtual function overrides
  265. //{{AFX_VIRTUAL(CMScopeWizFinished)
  266. public:
  267. virtual BOOL OnWizardFinish();
  268. virtual BOOL OnSetActive();
  269. protected:
  270. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  271. //}}AFX_VIRTUAL
  272. // Implementation
  273. protected:
  274. // Generated message map functions
  275. //{{AFX_MSG(CMScopeWizFinished)
  276. virtual BOOL OnInitDialog();
  277. //}}AFX_MSG
  278. DECLARE_MESSAGE_MAP()
  279. };
  280. /////////////////////////////////////////////////////////////////////////////
  281. // CMScopeWizWelcome dialog
  282. class CMScopeWizWelcome : public CPropertyPageBase
  283. {
  284. DECLARE_DYNCREATE(CMScopeWizWelcome)
  285. // Construction
  286. public:
  287. CMScopeWizWelcome();
  288. ~CMScopeWizWelcome();
  289. // Dialog Data
  290. //{{AFX_DATA(CMScopeWizWelcome)
  291. enum { IDD = IDW_MSCOPE_WELCOME };
  292. CStatic m_staticTitle;
  293. //}}AFX_DATA
  294. CFont m_fontBig;
  295. // Overrides
  296. // ClassWizard generate virtual function overrides
  297. //{{AFX_VIRTUAL(CMScopeWizWelcome)
  298. public:
  299. virtual BOOL OnSetActive();
  300. protected:
  301. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  302. //}}AFX_VIRTUAL
  303. // Implementation
  304. protected:
  305. // Generated message map functions
  306. //{{AFX_MSG(CMScopeWizWelcome)
  307. virtual BOOL OnInitDialog();
  308. //}}AFX_MSG
  309. DECLARE_MESSAGE_MAP()
  310. };
  311. /////////////////////////////////////////////////////////////////////////////
  312. // CMScopeWizActivate dialog
  313. class CMScopeWizActivate : public CPropertyPageBase
  314. {
  315. DECLARE_DYNCREATE(CMScopeWizActivate)
  316. // Construction
  317. public:
  318. CMScopeWizActivate();
  319. ~CMScopeWizActivate();
  320. // Dialog Data
  321. //{{AFX_DATA(CMScopeWizActivate)
  322. enum { IDD = IDW_MSCOPE_ACTIVATE };
  323. CButton m_radioYes;
  324. //}}AFX_DATA
  325. BOOL m_fActivate;
  326. // Overrides
  327. // ClassWizard generate virtual function overrides
  328. //{{AFX_VIRTUAL(CMScopeWizActivate)
  329. public:
  330. virtual LRESULT OnWizardNext();
  331. virtual BOOL OnSetActive();
  332. protected:
  333. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  334. //}}AFX_VIRTUAL
  335. // Implementation
  336. protected:
  337. // Generated message map functions
  338. //{{AFX_MSG(CMScopeWizActivate)
  339. virtual BOOL OnInitDialog();
  340. //}}AFX_MSG
  341. DECLARE_MESSAGE_MAP()
  342. };
  343. //{{AFX_INSERT_LOCATION}}
  344. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  345. //}}AFX
  346. ///////////////////////////////////////////////////////////////////////////////
  347. //
  348. // CMScopeWiz
  349. // page holder to contain multicast scope wizard pages
  350. //
  351. /////////////////////////////////////////////////////////////////////////////
  352. class CMScopeWiz : public CPropertyPageHolderBase
  353. {
  354. friend class CMScopeWizWelcome;
  355. friend class CMScopeWizName;
  356. friend class CMScopeWizInvalidName;
  357. friend class CMScopeWizSetRange;
  358. friend class CMScopeWizSetExclusions;
  359. friend class CMScopeWizLeaseTime;
  360. friend class CMScopeWizFinished;
  361. public:
  362. CMScopeWiz(ITFSNode * pNode,
  363. IComponentData * pComponentData,
  364. ITFSComponentData * pTFSCompData,
  365. LPCTSTR pszSheetName);
  366. virtual ~CMScopeWiz();
  367. virtual DWORD OnFinish();
  368. BOOL GetScopeRange(CDhcpIpRange * pdhcpIpRange);
  369. ITFSComponentData * GetTFSCompData()
  370. {
  371. if (m_spTFSCompData)
  372. m_spTFSCompData->AddRef();
  373. return m_spTFSCompData;
  374. }
  375. public:
  376. CMScopeWizWelcome m_pageWelcome;
  377. CMScopeWizName m_pageName;
  378. CMScopeWizInvalidName m_pageInvalidName;
  379. CMScopeWizSetRange m_pageSetRange;
  380. CMScopeWizSetExclusions m_pageSetExclusions;
  381. CMScopeWizLeaseTime m_pageLeaseTime;
  382. CMScopeWizActivate m_pageActivate;
  383. CMScopeWizFinished m_pageFinished;
  384. protected:
  385. DWORD CreateScope();
  386. SPITFSComponentData m_spTFSCompData;
  387. };
  388. #endif // !defined _MSCOPWIZ_H