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.

383 lines
9.5 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. repnodpp.h
  7. Replication Node Property page
  8. FILE HISTORY:
  9. */
  10. #if !defined(AFX_REPNODPP_H__04D55B71_4E32_11D1_B9B0_00C04FBF914A__INCLUDED_)
  11. #define AFX_REPNODPP_H__04D55B71_4E32_11D1_B9B0_00C04FBF914A__INCLUDED_
  12. #if _MSC_VER >= 1000
  13. #pragma once
  14. #endif // _MSC_VER >= 1000
  15. #ifndef _CONFIG_H
  16. #include "config.h"
  17. #endif
  18. #ifndef _LISTVIEW_H
  19. #include "listview.h"
  20. #endif
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CRepNodePropGen dialog
  23. class CRepNodePropGen : public CPropertyPageBase
  24. {
  25. DECLARE_DYNCREATE(CRepNodePropGen)
  26. // Construction
  27. public:
  28. CRepNodePropGen();
  29. ~CRepNodePropGen();
  30. // Dialog Data
  31. //{{AFX_DATA(CRepNodePropGen)
  32. enum { IDD = IDD_REP_NODE_GENERAL };
  33. CButton m_checkPushwithPartners;
  34. CButton m_checkMigrate;
  35. BOOL m_fMigrate;
  36. BOOL m_fPushwithPartners;
  37. //}}AFX_DATA
  38. UINT m_uImage;
  39. // Overrides
  40. // ClassWizard generate virtual function overrides
  41. //{{AFX_VIRTUAL(CRepNodePropGen)
  42. public:
  43. virtual BOOL OnApply();
  44. virtual void OnOK();
  45. protected:
  46. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  47. //}}AFX_VIRTUAL
  48. // Implementation
  49. protected:
  50. // Generated message map functions
  51. //{{AFX_MSG(CRepNodePropGen)
  52. virtual BOOL OnInitDialog();
  53. afx_msg void OnCheckMigrate();
  54. afx_msg void OnCheckRepWithPartners();
  55. //}}AFX_MSG
  56. DECLARE_MESSAGE_MAP()
  57. private:
  58. CConfiguration * m_pConfig;
  59. void UpdateConfig();
  60. HRESULT UpdateServerConfiguration();
  61. HRESULT GetConfig();
  62. public:
  63. virtual DWORD * GetHelpMap() { return WinsGetHelpMap(CRepNodePropGen::IDD);};
  64. };
  65. /////////////////////////////////////////////////////////////////////////////
  66. // CRepNodePropPush dialog
  67. class CRepNodePropPush : public CPropertyPageBase
  68. {
  69. DECLARE_DYNCREATE(CRepNodePropPush)
  70. // Construction
  71. public:
  72. CRepNodePropPush();
  73. ~CRepNodePropPush();
  74. // Dialog Data
  75. //{{AFX_DATA(CRepNodePropPush)
  76. enum { IDD = IDD_REP_NODE_PUSH };
  77. CButton m_checkPushPersistence;
  78. CSpinButtonCtrl m_spinUpdateCount;
  79. CEdit m_editUpdateCount;
  80. CButton m_checkPushStartup;
  81. CButton m_checkRepOnAddrChange;
  82. BOOL m_fRepOnAddrChange;
  83. BOOL m_fPushStartup;
  84. DWORD m_dwPushUpdateCount;
  85. //}}AFX_DATA
  86. // Overrides
  87. // ClassWizard generate virtual function overrides
  88. //{{AFX_VIRTUAL(CRepNodePropPush)
  89. public:
  90. virtual BOOL OnApply();
  91. virtual void OnOK();
  92. protected:
  93. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  94. //}}AFX_VIRTUAL
  95. // Implementation
  96. protected:
  97. // Generated message map functions
  98. //{{AFX_MSG(CRepNodePropPush)
  99. virtual BOOL OnInitDialog();
  100. afx_msg void OnCheckPushOnAddressChange();
  101. afx_msg void OnCheckPushOnStartup();
  102. afx_msg void OnCheckPushPersist();
  103. afx_msg void OnChangeEditUpdateCount();
  104. //}}AFX_MSG
  105. DECLARE_MESSAGE_MAP()
  106. private:
  107. CConfiguration * m_pConfig;
  108. void UpdateConfig();
  109. HRESULT UpdateServerConfiguration();
  110. HRESULT GetConfig();
  111. CString ToString(int nNumber);
  112. public:
  113. virtual DWORD * GetHelpMap() { return WinsGetHelpMap(CRepNodePropPush::IDD);};
  114. };
  115. /////////////////////////////////////////////////////////////////////////////
  116. // CRepNodePropPull dialog
  117. class CRepNodePropPull : public CPropertyPageBase
  118. {
  119. DECLARE_DYNCREATE(CRepNodePropPull)
  120. // Construction
  121. public:
  122. CRepNodePropPull();
  123. ~CRepNodePropPull();
  124. // Dialog Data
  125. //{{AFX_DATA(CRepNodePropPull)
  126. enum { IDD = IDD_REP_NODE_PULL };
  127. CButton m_checkPullPersistence;
  128. CSpinButtonCtrl m_spinStartSecond;
  129. CSpinButtonCtrl m_spinStartMinute;
  130. CSpinButtonCtrl m_spinStartHour;
  131. CSpinButtonCtrl m_spinRetryCount;
  132. CSpinButtonCtrl m_spinRepIntMinute;
  133. CSpinButtonCtrl m_spinRepIntHour;
  134. CSpinButtonCtrl m_spinRepIntDay;
  135. CEdit m_editStartSecond;
  136. CEdit m_editStartMinute;
  137. CEdit m_editStartHour;
  138. CEdit m_editRetryCount;
  139. CEdit m_editRepIntMinute;
  140. CEdit m_editRepIntHour;
  141. CEdit m_editRepIntDay;
  142. CButton m_checkpullTrigOnStartup;
  143. BOOL m_fpullTrigOnStartup;
  144. DWORD m_dwRetryCount;
  145. int m_nPullStartHour;
  146. int m_nPullStartMinute;
  147. int m_nPullStartSecond;
  148. int m_nRepliDay;
  149. int m_nRepliHour;
  150. int m_nRepliMinute;
  151. //}}AFX_DATA
  152. // Overrides
  153. // ClassWizard generate virtual function overrides
  154. //{{AFX_VIRTUAL(CRepNodePropPull)
  155. public:
  156. virtual BOOL OnApply();
  157. virtual void OnOK();
  158. protected:
  159. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  160. //}}AFX_VIRTUAL
  161. // Implementation
  162. protected:
  163. // Generated message map functions
  164. //{{AFX_MSG(CRepNodePropPull)
  165. virtual BOOL OnInitDialog();
  166. afx_msg void OnChangeEditRepIntHour();
  167. afx_msg void OnCheckPullPersist();
  168. //}}AFX_MSG
  169. DECLARE_MESSAGE_MAP()
  170. private:
  171. CConfiguration * m_pConfig;
  172. DWORD CalculatePullStartInt();
  173. DWORD CalculateReplInt();
  174. void UpdateConfig();
  175. HRESULT UpdateServerConfiguration();
  176. void SetPullStartTimeData(DWORD dwPullStartTime);
  177. void SetPullTimeIntData(DWORD dwPullInternal);
  178. HRESULT GetConfig();
  179. CString ToString(int nNumber);
  180. public:
  181. virtual DWORD * GetHelpMap() { return WinsGetHelpMap(CRepNodePropPull::IDD);};
  182. };
  183. /////////////////////////////////////////////////////////////////////////////
  184. // CRepNodePropAdvanced dialog
  185. #define PERSMODE_NON_GRATA 0
  186. #define PERSMODE_GRATA 1
  187. class CRepNodePropAdvanced : public CPropertyPageBase
  188. {
  189. DECLARE_DYNCREATE(CRepNodePropAdvanced)
  190. // Construction
  191. public:
  192. CRepNodePropAdvanced();
  193. ~CRepNodePropAdvanced();
  194. // Dialog Data
  195. //{{AFX_DATA(cRepNodePropAdvanced)
  196. enum { IDD = IDD_REP_NODE_ADVANCED };
  197. CButton m_buttonAdd;
  198. CButton m_buttonRemove;
  199. CButton m_checkPushPersistence;
  200. CButton m_checkPullPersistence;
  201. CListCtrl m_listOwners;
  202. CStatic m_staticDesp;
  203. CStatic m_staticMulticastTTL;
  204. CStatic m_staticMulticastInt;
  205. CSpinButtonCtrl m_spinMulticastTTL;
  206. CSpinButtonCtrl m_spinMulticastSecond;
  207. CSpinButtonCtrl m_spinMulticastMinute;
  208. CSpinButtonCtrl m_spinMulticastHour;
  209. CEdit m_editMulticastSecond;
  210. CEdit m_editMulticastTTL;
  211. CEdit m_editMulticastMinute;
  212. CEdit m_editMulticastHour;
  213. CButton m_checkenableAutoConfig;
  214. BOOL m_fEnableAuto;
  215. DWORD m_dwHours;
  216. DWORD m_dwMinutes;
  217. DWORD m_dwSeconds;
  218. DWORD m_dwMulticastTTL;
  219. //}}AFX_DATA
  220. int HandleSort(LPARAM lParam1, LPARAM lParam2);
  221. // Overrides
  222. // ClassWizard generate virtual function overrides
  223. //{{AFX_VIRTUAL(cRepNodePropAdvanced)
  224. public:
  225. virtual BOOL OnApply();
  226. virtual void OnOK();
  227. protected:
  228. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  229. //}}AFX_VIRTUAL
  230. // Implementation
  231. protected:
  232. // Generated message map functions
  233. //{{AFX_MSG(cRepNodePropAdvanced)
  234. virtual BOOL OnInitDialog();
  235. afx_msg void OnCheckEnableAutoPartnerConfig();
  236. afx_msg void OnChangeEditMulticastHour();
  237. afx_msg void OnButtonAdd();
  238. afx_msg void OnButtonRemove();
  239. afx_msg void OnItemchangedListOwners(NMHDR* pNMHDR, LRESULT* pResult);
  240. afx_msg void OnColumnclickListOwners(NMHDR* pNMHDR, LRESULT* pResult);
  241. afx_msg void OnRadioGrata();
  242. afx_msg void OnRadioNonGrata();
  243. //}}AFX_MSG
  244. DECLARE_MESSAGE_MAP()
  245. int m_nSortColumn;
  246. BOOL m_aSortOrder[COLUMN_MAX];
  247. private:
  248. CConfiguration* m_pConfig;
  249. DWORD m_dwPersonaMode;
  250. CStringArray m_strPersonaNonGrata;
  251. CStringArray m_strPersonaGrata;
  252. HRESULT GetConfig();
  253. CString ToString(int nNumber);
  254. void EnableControls(BOOL bEnable = TRUE);
  255. void FillControls();
  256. HRESULT UpdateServerConfiguration();
  257. void UpdateConfig();
  258. void InitializeControls();
  259. void Sort(int nCol);
  260. public:
  261. virtual DWORD * GetHelpMap() { return WinsGetHelpMap(CRepNodePropAdvanced::IDD);};
  262. BOOL IsDuplicate(CString &strServerName);
  263. BOOL IsCurrentServer(CString &strServerName);
  264. // for reading and writing the servers to the registry
  265. DWORD ReadFromRegistry();
  266. DWORD WriteToRegistry();
  267. DWORD ResolveIPAddress(CString &strIP, CString &strServerName);
  268. void FillServerInfo();
  269. void GetServerName(CString &strServerName);
  270. void RemoveFromArray(CString &strSel);
  271. void SetRemoveButtonState();
  272. CString m_strIPAddress;
  273. CString m_strServerName;
  274. typedef CString REGKEYNAME;
  275. static const REGKEYNAME lpstrPartnersRoot;
  276. };
  277. class CRepNodeProperties : public CPropertyPageHolderBase
  278. {
  279. public:
  280. CRepNodeProperties(ITFSNode * pNode,
  281. IComponentData * pComponentData,
  282. ITFSComponentData * pTFSCompData,
  283. LPCTSTR pszSheetName
  284. );
  285. virtual ~CRepNodeProperties();
  286. ITFSComponentData * GetTFSCompData()
  287. {
  288. if (m_spTFSCompData)
  289. m_spTFSCompData->AddRef();
  290. return m_spTFSCompData;
  291. }
  292. void SetConfig(CConfiguration * pConfig)
  293. {
  294. m_Config = *pConfig;
  295. }
  296. CConfiguration * GetConfig()
  297. {
  298. return &m_Config;
  299. }
  300. public:
  301. CRepNodePropGen m_pageGeneral;
  302. CRepNodePropPush m_pagePush;
  303. CRepNodePropPull m_pagePull;
  304. CRepNodePropAdvanced m_pageAdvanced;
  305. CConfiguration m_Config;
  306. protected:
  307. SPITFSComponentData m_spTFSCompData;
  308. };
  309. //{{AFX_INSERT_LOCATION}}
  310. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  311. #endif // !defined(AFX_REPNODPP_H__04D55B71_4E32_11D1_B9B0_00C04FBF914A__INCLUDED_)