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.

314 lines
6.1 KiB

  1. /*++
  2. Copyright (c) 1994-1998 Microsoft Corporation
  3. Module Name :
  4. mmmdlg.h
  5. Abstract:
  6. Multi-multi-multi dialog editor definitions
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Project:
  10. Internet Services Manager
  11. Revision History:
  12. --*/
  13. #ifndef __MMMDLG_H__
  14. #define __MMMDLG_H__
  15. //
  16. // UINT DDX/DDV helper function that uses a blank string to denote 0
  17. //
  18. void AFXAPI DDXV_UINT(
  19. IN CDataExchange * pDX,
  20. IN UINT nID,
  21. IN OUT UINT & uValue,
  22. IN UINT uMin,
  23. IN UINT uMax,
  24. IN UINT nEmptyErrorMsg = 0
  25. );
  26. //
  27. // Helper function to check to see if binding is unique
  28. //
  29. BOOL
  30. IsBindingUnique(
  31. IN CString & strBinding,
  32. IN CStringList & strlBindings,
  33. IN int iCurrent = -1
  34. );
  35. /*
  36. //
  37. // Helper function to build and verify binding strings.
  38. //
  39. BOOL
  40. VerifyBindingInfo(
  41. OUT CString & strBinding,
  42. OUT CString & strSecureBinding,
  43. IN CStringList & strlBindings,
  44. IN CStringList & strlSecureBindings,
  45. IN int iBindings,
  46. IN int iSSLBindings,
  47. IN CIPAddress & iaIpAddress,
  48. IN UINT nTCPPort,
  49. IN UINT nSSLPort,
  50. IN CString & strDomainName
  51. );
  52. */
  53. class CMMMListBox : public CHeaderListBox
  54. {
  55. /*++
  56. Class Description:
  57. Multi-multi-multi listbox.
  58. Public Interface:
  59. CMMMListBox : Constructor
  60. GetItem : Get item at specified position
  61. in the listbox
  62. AddItem : Add new item to the listbox
  63. Initialize : Initialize the listbox
  64. --*/
  65. DECLARE_DYNAMIC(CMMMListBox);
  66. public:
  67. //
  68. // Number of bitmaps
  69. //
  70. static const nBitmaps;
  71. public:
  72. CMMMListBox(
  73. IN LPCTSTR lpszRegKey,
  74. IN int cColumns,
  75. IN const ODL_COLUMN_DEF * pColumns
  76. );
  77. public:
  78. CString & GetItem(UINT nIndex);
  79. int AddItem(CString & item);
  80. virtual BOOL Initialize();
  81. protected:
  82. virtual void DrawItemEx(CRMCListBoxDrawStruct & ds);
  83. protected:
  84. int m_cColumns;
  85. const ODL_COLUMN_DEF * m_pColumns;
  86. CString m_strDefaultIP;
  87. CString m_strNoPort;
  88. };
  89. class CMMMEditDlg : public CDialog
  90. /*++
  91. Class Description:
  92. Multi-Multi-Multi edit entry dialog
  93. Public Interface:
  94. CMMMEditDlg : Constructor
  95. --*/
  96. {
  97. //
  98. // Construction
  99. //
  100. public:
  101. CMMMEditDlg(
  102. IN CString & strServerName,
  103. IN OUT CStringList & strlBindings,
  104. IN CStringList & strlOtherBindings,
  105. IN OUT CString & strEntry,
  106. IN BOOL fIPBinding = TRUE,
  107. IN CWnd * pParent = NULL
  108. );
  109. //
  110. // Dialog Data
  111. //
  112. protected:
  113. //{{AFX_DATA(CMMMEditDlg)
  114. enum { IDD = IDD_EDIT_MMM };
  115. int m_nIpAddressSel;
  116. UINT m_nPort;
  117. CString m_strDomainName;
  118. CStatic m_static_Port;
  119. CComboBox m_combo_IpAddresses;
  120. //}}AFX_DATA
  121. CIPAddress m_iaIpAddress;
  122. //
  123. // Overrides
  124. //
  125. protected:
  126. // ClassWizard generated virtual function overrides
  127. //{{AFX_VIRTUAL(CMMMEditDlg)
  128. protected:
  129. virtual void DoDataExchange(CDataExchange* pDX);
  130. virtual void OnHelp();
  131. //}}AFX_VIRTUAL
  132. //
  133. // Implementation
  134. //
  135. protected:
  136. // Generated message map functions
  137. //{{AFX_MSG(CMMMEditDlg)
  138. virtual BOOL OnInitDialog();
  139. virtual void OnOK();
  140. //}}AFX_MSG
  141. DECLARE_MESSAGE_MAP()
  142. private:
  143. BOOL m_fIPBinding;
  144. CString & m_strServerName;
  145. CString & m_entry;
  146. CObListPlus m_oblIpAddresses;
  147. CStringList & m_strlBindings;
  148. CStringList & m_strlOtherBindings;
  149. UINT m_nHelpContext;
  150. };
  151. class CMMMDlg : public CDialog
  152. /*++
  153. Class Description:
  154. Mutlti-multi-multi dialog
  155. Public Interface:
  156. CMMMDlg : Constructor
  157. --*/
  158. {
  159. //
  160. // Construction
  161. //
  162. public:
  163. CMMMDlg(
  164. IN LPCTSTR lpServerName,
  165. IN DWORD dwInstance,
  166. IN CComAuthInfo * pAuthInfo,
  167. IN LPCTSTR lpMetaPath,
  168. IN CStringList & strlBindings,
  169. IN CStringList & strlSecureBindings,
  170. IN CWnd * pParent = NULL
  171. );
  172. //
  173. // Access
  174. //
  175. public:
  176. CStringList & GetBindings() { return m_strlBindings; }
  177. CStringList & GetSecureBindings() { return m_strlSecureBindings; }
  178. //
  179. // Dialog Data
  180. //
  181. protected:
  182. //{{AFX_DATA(CMMMDlg)
  183. enum { IDD = IDD_MMM };
  184. CButton m_button_Add;
  185. CButton m_button_Remove;
  186. CButton m_button_Edit;
  187. CButton m_button_AddSSL;
  188. CButton m_button_RemoveSSL;
  189. CButton m_button_EditSSL;
  190. CButton m_button_OK;
  191. //}}AFX_DATA
  192. CMMMListBox m_list_Bindings;
  193. CMMMListBox m_list_SSLBindings;
  194. CStringList m_strlBindings;
  195. CStringList m_strlSecureBindings;
  196. //
  197. // Overrides
  198. //
  199. protected:
  200. // ClassWizard generated virtual function overrides
  201. //{{AFX_VIRTUAL(CMMMDlg)
  202. protected:
  203. virtual void DoDataExchange(CDataExchange * pDX);
  204. virtual void OnHelp();
  205. //}}AFX_VIRTUAL
  206. //
  207. // Implementation
  208. //
  209. protected:
  210. // Generated message map functions
  211. //{{AFX_MSG(CMMMDlg)
  212. afx_msg void OnButtonAdd();
  213. afx_msg void OnButtonEdit();
  214. afx_msg void OnButtonRemove();
  215. afx_msg void OnButtonAddSsl();
  216. afx_msg void OnButtonEditSsl();
  217. afx_msg void OnButtonRemoveSsl();
  218. afx_msg void OnDblclkListMmm();
  219. afx_msg void OnDblclkListSslMmm();
  220. afx_msg void OnSelchangeListMmm();
  221. afx_msg void OnSelchangeListSslMmm();
  222. virtual BOOL OnInitDialog();
  223. //}}AFX_MSG
  224. DECLARE_MESSAGE_MAP()
  225. BOOL OnItemChanged();
  226. BOOL SetControlStates();
  227. void AddBindings(CMMMListBox & list, CStringList & strl);
  228. private:
  229. BOOL m_fDirty;
  230. BOOL m_fCertInstalled;
  231. CString m_strServerName;
  232. CComAuthInfo * m_pAuthInfo;
  233. CString m_strMetaPath;
  234. CRMCListBoxResources m_ListBoxRes;
  235. UINT m_nHelpContext;
  236. };
  237. //
  238. // Inline Expansion
  239. //
  240. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  241. inline CString & CMMMListBox::GetItem(UINT nIndex)
  242. {
  243. return *(CString *)GetItemDataPtr(nIndex);
  244. }
  245. inline int CMMMListBox::AddItem(CString & item)
  246. {
  247. return AddString((LPCTSTR)&item);
  248. }
  249. #endif // __MMMDLG_H__