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.

410 lines
8.2 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // policywiz.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Declares the classes that implement the new proxy policy wizard.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 03/11/2000 Original version.
  16. // 04/19/2000 Marshall SDOs across apartments.
  17. //
  18. ///////////////////////////////////////////////////////////////////////////////
  19. #ifndef POLICYWIZ_H
  20. #define POLICYWIZ_H
  21. #if _MSC_VER >= 1000
  22. #pragma once
  23. #endif
  24. #include <condlist.h>
  25. class NewPolicyWizard;
  26. ///////////////////////////////////////////////////////////////////////////////
  27. //
  28. // CLASS
  29. //
  30. // NewPolicyStartPage
  31. //
  32. // DESCRIPTION
  33. //
  34. // Implements the Welcome page.
  35. //
  36. ///////////////////////////////////////////////////////////////////////////////
  37. class NewPolicyStartPage : public SnapInPropertyPage
  38. {
  39. public:
  40. NewPolicyStartPage(NewPolicyWizard& wizard);
  41. protected:
  42. virtual BOOL OnInitDialog();
  43. virtual BOOL OnSetActive();
  44. DEFINE_ERROR_CAPTION(IDS_POLICY_E_CAPTION);
  45. private:
  46. NewPolicyWizard& parent;
  47. };
  48. ///////////////////////////////////////////////////////////////////////////////
  49. //
  50. // CLASS
  51. //
  52. // NewPolicyNamePage
  53. //
  54. // DESCRIPTION
  55. //
  56. // Implements the page where the user chooses the policy name.
  57. //
  58. ///////////////////////////////////////////////////////////////////////////////
  59. class NewPolicyNamePage : public SnapInPropertyPage
  60. {
  61. public:
  62. NewPolicyNamePage(NewPolicyWizard& wizard);
  63. PCWSTR getName() const throw ()
  64. { return name; }
  65. protected:
  66. virtual LRESULT OnWizardNext();
  67. afx_msg void onButtonClick();
  68. afx_msg void onChangeName();
  69. DECLARE_MESSAGE_MAP()
  70. DEFINE_ERROR_CAPTION(IDS_POLICY_E_CAPTION);
  71. virtual void setData();
  72. void setButtons();
  73. private:
  74. NewPolicyWizard& parent;
  75. CComBSTR name;
  76. };
  77. ///////////////////////////////////////////////////////////////////////////////
  78. //
  79. // CLASS
  80. //
  81. // NewPolicyTypePage
  82. //
  83. // DESCRIPTION
  84. //
  85. // Implements the page where the user chooses the policy type.
  86. //
  87. ///////////////////////////////////////////////////////////////////////////////
  88. class NewPolicyTypePage : public SnapInPropertyPage
  89. {
  90. public:
  91. NewPolicyTypePage(NewPolicyWizard& wizard);
  92. protected:
  93. virtual LRESULT OnWizardNext();
  94. afx_msg void onButtonClick(UINT id);
  95. DECLARE_MESSAGE_MAP()
  96. DEFINE_ERROR_CAPTION(IDS_POLICY_E_CAPTION);
  97. virtual void setData();
  98. void setControlState();
  99. private:
  100. NewPolicyWizard& parent;
  101. LONG outerType;
  102. LONG innerType;
  103. };
  104. ///////////////////////////////////////////////////////////////////////////////
  105. //
  106. // CLASS
  107. //
  108. // NewPolicyOutsourcePage
  109. //
  110. // DESCRIPTION
  111. //
  112. // Implements the page for outsourced dial.
  113. //
  114. ///////////////////////////////////////////////////////////////////////////////
  115. class NewPolicyOutsourcePage : public SnapInPropertyPage
  116. {
  117. public:
  118. NewPolicyOutsourcePage(NewPolicyWizard& wizard);
  119. PCWSTR getRealm() const throw ()
  120. { return realm; }
  121. bool isStripped() const throw ()
  122. { return strip; }
  123. protected:
  124. virtual LRESULT OnWizardBack();
  125. virtual LRESULT OnWizardNext();
  126. afx_msg void onChangeRealm();
  127. DECLARE_MESSAGE_MAP()
  128. DEFINE_ERROR_CAPTION(IDS_POLICY_E_CAPTION);
  129. virtual void setData();
  130. void setButtons();
  131. private:
  132. NewPolicyWizard& parent;
  133. CComBSTR realm;
  134. bool strip;
  135. };
  136. ///////////////////////////////////////////////////////////////////////////////
  137. //
  138. // CLASS
  139. //
  140. // NewPolicyDirectPage
  141. //
  142. // DESCRIPTION
  143. //
  144. // Implements the page for dial-up and VPN directly to the corp.
  145. //
  146. ///////////////////////////////////////////////////////////////////////////////
  147. class NewPolicyDirectPage : public SnapInPropertyPage
  148. {
  149. public:
  150. NewPolicyDirectPage(NewPolicyWizard& wizard);
  151. protected:
  152. virtual BOOL OnInitDialog();
  153. virtual BOOL OnSetActive();
  154. virtual LRESULT OnWizardBack();
  155. DEFINE_ERROR_CAPTION(IDS_POLICY_E_CAPTION);
  156. private:
  157. NewPolicyWizard& parent;
  158. };
  159. ///////////////////////////////////////////////////////////////////////////////
  160. //
  161. // CLASS
  162. //
  163. // NewPolicyForwardPage
  164. //
  165. // DESCRIPTION
  166. //
  167. // Implements the page for forwarding to a RADIUS server group.
  168. //
  169. ///////////////////////////////////////////////////////////////////////////////
  170. class NewPolicyForwardPage : public SnapInPropertyPage
  171. {
  172. public:
  173. NewPolicyForwardPage(NewPolicyWizard& wizard);
  174. PCWSTR getRealm() const throw ()
  175. { return realm; }
  176. PCWSTR getGroup() const throw ()
  177. { return providerName; }
  178. bool isStripped() const throw ()
  179. { return strip; }
  180. protected:
  181. virtual LRESULT OnWizardBack();
  182. virtual LRESULT OnWizardNext();
  183. afx_msg void onChangeRealm();
  184. afx_msg void onNewGroup();
  185. DECLARE_MESSAGE_MAP()
  186. DEFINE_ERROR_CAPTION(IDS_POLICY_E_CAPTION);
  187. virtual void setData();
  188. void setButtons();
  189. private:
  190. NewPolicyWizard& parent;
  191. SdoCollection serverGroups;
  192. CComboBox groupsCombo;
  193. CComBSTR realm;
  194. CComBSTR providerName;
  195. bool strip;
  196. };
  197. ///////////////////////////////////////////////////////////////////////////////
  198. //
  199. // CLASS
  200. //
  201. // NewPolicyConditionPage
  202. //
  203. // DESCRIPTION
  204. //
  205. // Implements the page for editing the conditions.
  206. //
  207. ///////////////////////////////////////////////////////////////////////////////
  208. class NewPolicyConditionPage : public SnapInPropertyPage
  209. {
  210. public:
  211. NewPolicyConditionPage(NewPolicyWizard& wizard);
  212. protected:
  213. virtual BOOL OnInitDialog();
  214. virtual LRESULT OnWizardBack();
  215. virtual LRESULT OnWizardNext();
  216. afx_msg void onAdd();
  217. afx_msg void onEdit();
  218. afx_msg void onRemove();
  219. DECLARE_MESSAGE_MAP()
  220. DEFINE_ERROR_CAPTION(IDS_POLICY_E_CAPTION);
  221. virtual void setData();
  222. void setButtons();
  223. private:
  224. NewPolicyWizard& parent;
  225. CListBox listBox;
  226. ConditionList condList;
  227. };
  228. ///////////////////////////////////////////////////////////////////////////////
  229. //
  230. // CLASS
  231. //
  232. // NewPolicyProfilePage
  233. //
  234. // DESCRIPTION
  235. //
  236. // Implements the page for editing the profile.
  237. //
  238. ///////////////////////////////////////////////////////////////////////////////
  239. class NewPolicyProfilePage : public SnapInPropertyPage
  240. {
  241. public:
  242. NewPolicyProfilePage(NewPolicyWizard& wizard);
  243. protected:
  244. virtual BOOL OnSetActive();
  245. afx_msg void onEditProfile();
  246. DECLARE_MESSAGE_MAP()
  247. DEFINE_ERROR_CAPTION(IDS_POLICY_E_CAPTION);
  248. private:
  249. NewPolicyWizard& parent;
  250. };
  251. ///////////////////////////////////////////////////////////////////////////////
  252. //
  253. // CLASS
  254. //
  255. // NewPolicyFinishPage
  256. //
  257. // DESCRIPTION
  258. //
  259. // Implements the completion page.
  260. //
  261. ///////////////////////////////////////////////////////////////////////////////
  262. class NewPolicyFinishPage : public SnapInPropertyPage
  263. {
  264. public:
  265. NewPolicyFinishPage(NewPolicyWizard& wizard);
  266. protected:
  267. virtual BOOL OnInitDialog();
  268. virtual LRESULT OnWizardBack();
  269. DEFINE_ERROR_CAPTION(IDS_POLICY_E_CAPTION);
  270. virtual void setData();
  271. virtual void saveChanges();
  272. private:
  273. NewPolicyWizard& parent;
  274. CRichEditCtrl tasks;
  275. };
  276. ///////////////////////////////////////////////////////////////////////////////
  277. //
  278. // CLASS
  279. //
  280. // NewPolicyWizard
  281. //
  282. // DESCRIPTION
  283. //
  284. // Implements the new proxy policy wizard.
  285. //
  286. ///////////////////////////////////////////////////////////////////////////////
  287. class NewPolicyWizard : public CPropertySheetEx
  288. {
  289. public:
  290. NewPolicyWizard(
  291. SdoConnection& connection,
  292. SnapInView* snapInView = NULL
  293. );
  294. virtual INT_PTR DoModal();
  295. ::CString getFinishText();
  296. enum Type
  297. {
  298. OUTSOURCED,
  299. DIRECT,
  300. FORWARD,
  301. CUSTOM
  302. };
  303. Type getType() const throw ();
  304. SdoConnection& cxn;
  305. SnapInView* view;
  306. //////////
  307. // Public properties used by the wizard pages.
  308. //////////
  309. Sdo policy;
  310. Sdo profile;
  311. SdoCollection conditions;
  312. SdoProfile attributes;
  313. LONG custom;
  314. LONG radius;
  315. LONG dialin;
  316. protected:
  317. virtual BOOL OnInitDialog();
  318. private:
  319. SdoStream<Sdo> policyStream;
  320. SdoStream<Sdo> profileStream;
  321. NewPolicyStartPage start;
  322. NewPolicyNamePage name;
  323. NewPolicyTypePage type;
  324. NewPolicyOutsourcePage outsource;
  325. NewPolicyDirectPage direct;
  326. NewPolicyForwardPage forward;
  327. NewPolicyConditionPage condition;
  328. NewPolicyProfilePage profilePage;
  329. NewPolicyFinishPage finish;
  330. };
  331. #endif // POLICYWIZ_H