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.

310 lines
5.7 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. //}}AFX_VIRTUAL
  131. //
  132. // Implementation
  133. //
  134. protected:
  135. // Generated message map functions
  136. //{{AFX_MSG(CMMMEditDlg)
  137. virtual BOOL OnInitDialog();
  138. virtual void OnOK();
  139. //}}AFX_MSG
  140. DECLARE_MESSAGE_MAP()
  141. private:
  142. BOOL m_fIPBinding;
  143. CString & m_strServerName;
  144. CString & m_entry;
  145. CObListPlus m_oblIpAddresses;
  146. CStringList & m_strlBindings;
  147. CStringList & m_strlOtherBindings;
  148. };
  149. class CMMMDlg : public CDialog
  150. /*++
  151. Class Description:
  152. Mutlti-multi-multi dialog
  153. Public Interface:
  154. CMMMDlg : Constructor
  155. --*/
  156. {
  157. //
  158. // Construction
  159. //
  160. public:
  161. CMMMDlg(
  162. IN LPCTSTR lpServerName,
  163. IN DWORD dwInstance,
  164. IN CComAuthInfo * pAuthInfo,
  165. IN LPCTSTR lpMetaPath,
  166. IN CStringList & strlBindings,
  167. IN CStringList & strlSecureBindings,
  168. IN CWnd * pParent = NULL
  169. );
  170. //
  171. // Access
  172. //
  173. public:
  174. CStringList & GetBindings() { return m_strlBindings; }
  175. CStringList & GetSecureBindings() { return m_strlSecureBindings; }
  176. //
  177. // Dialog Data
  178. //
  179. protected:
  180. //{{AFX_DATA(CMMMDlg)
  181. enum { IDD = IDD_MMM };
  182. CButton m_button_Add;
  183. CButton m_button_Remove;
  184. CButton m_button_Edit;
  185. CButton m_button_AddSSL;
  186. CButton m_button_RemoveSSL;
  187. CButton m_button_EditSSL;
  188. CButton m_button_OK;
  189. //}}AFX_DATA
  190. CMMMListBox m_list_Bindings;
  191. CMMMListBox m_list_SSLBindings;
  192. CStringList m_strlBindings;
  193. CStringList m_strlSecureBindings;
  194. //
  195. // Overrides
  196. //
  197. protected:
  198. // ClassWizard generated virtual function overrides
  199. //{{AFX_VIRTUAL(CMMMDlg)
  200. protected:
  201. virtual void DoDataExchange(CDataExchange * pDX);
  202. //}}AFX_VIRTUAL
  203. //
  204. // Implementation
  205. //
  206. protected:
  207. // Generated message map functions
  208. //{{AFX_MSG(CMMMDlg)
  209. afx_msg void OnButtonAdd();
  210. afx_msg void OnButtonEdit();
  211. afx_msg void OnButtonRemove();
  212. afx_msg void OnButtonAddSsl();
  213. afx_msg void OnButtonEditSsl();
  214. afx_msg void OnButtonRemoveSsl();
  215. afx_msg void OnDblclkListMmm();
  216. afx_msg void OnDblclkListSslMmm();
  217. afx_msg void OnSelchangeListMmm();
  218. afx_msg void OnSelchangeListSslMmm();
  219. virtual BOOL OnInitDialog();
  220. //}}AFX_MSG
  221. DECLARE_MESSAGE_MAP()
  222. BOOL OnItemChanged();
  223. BOOL SetControlStates();
  224. void AddBindings(CMMMListBox & list, CStringList & strl);
  225. private:
  226. BOOL m_fDirty;
  227. BOOL m_fCertInstalled;
  228. CString m_strServerName;
  229. CComAuthInfo * m_pAuthInfo;
  230. CString m_strMetaPath;
  231. CRMCListBoxResources m_ListBoxRes;
  232. };
  233. //
  234. // Inline Expansion
  235. //
  236. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  237. inline CString & CMMMListBox::GetItem(UINT nIndex)
  238. {
  239. return *(CString *)GetItemDataPtr(nIndex);
  240. }
  241. inline int CMMMListBox::AddItem(CString & item)
  242. {
  243. return AddString((LPCTSTR)&item);
  244. }
  245. #endif // __MMMDLG_H__