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.

222 lines
7.0 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-2000 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CluAdmin.h
  7. //
  8. // Abstract:
  9. // Definition of the CClusterAdminApp class, which is the main
  10. // application class for the CLUADMIN application.
  11. //
  12. // Author:
  13. // David Potter (davidp) May 1, 1996
  14. //
  15. // Revision History:
  16. //
  17. // Notes:
  18. //
  19. /////////////////////////////////////////////////////////////////////////////
  20. #ifndef _CLUADMIN_H_
  21. #define _CLUADMIN_H_
  22. #ifndef __AFXWIN_H__
  23. #error include 'stdafx.h' before including this file for PCH
  24. #endif
  25. #ifndef _UNICODE
  26. #error _UNICODE *must* be defined!
  27. #endif
  28. /////////////////////////////////////////////////////////////////////////////
  29. // Include Files
  30. /////////////////////////////////////////////////////////////////////////////
  31. #ifndef _RESOURCE_H_
  32. #include "resource.h" // main symbols
  33. #define _RESOURCE_H_
  34. #endif
  35. #ifndef _BARFCLUS_H_
  36. #include "BarfClus.h" // for BARF overrides of CLUSAPIs
  37. #endif
  38. #ifndef _NOTIFY_H_
  39. #include "Notify.h" // for CClusterNotifyContext, CClusterNotifyKeyList
  40. #endif
  41. /////////////////////////////////////////////////////////////////////////////
  42. // Forward Class Declarations
  43. /////////////////////////////////////////////////////////////////////////////
  44. class CClusterAdminApp;
  45. /////////////////////////////////////////////////////////////////////////////
  46. // External Class Declarations
  47. /////////////////////////////////////////////////////////////////////////////
  48. class CRecentClusterList;
  49. class CCluAdminCommandLineInfo;
  50. /////////////////////////////////////////////////////////////////////////////
  51. // Type Definitions
  52. /////////////////////////////////////////////////////////////////////////////
  53. enum ImageListIndex
  54. {
  55. IMGLI_FOLDER = 0,
  56. IMGLI_CLUSTER,
  57. IMGLI_CLUSTER_UNKNOWN,
  58. IMGLI_NODE,
  59. IMGLI_NODE_DOWN,
  60. IMGLI_NODE_PAUSED,
  61. IMGLI_NODE_UNKNOWN,
  62. IMGLI_GROUP,
  63. IMGLI_GROUP_PARTIALLY_ONLINE,
  64. IMGLI_GROUP_PENDING,
  65. IMGLI_GROUP_OFFLINE,
  66. IMGLI_GROUP_FAILED,
  67. IMGLI_GROUP_UNKNOWN,
  68. IMGLI_RES,
  69. IMGLI_RES_OFFLINE,
  70. IMGLI_RES_PENDING,
  71. IMGLI_RES_FAILED,
  72. IMGLI_RES_UNKNOWN,
  73. IMGLI_RESTYPE,
  74. IMGLI_RESTYPE_UNKNOWN,
  75. IMGLI_NETWORK,
  76. IMGLI_NETWORK_PARTITIONED,
  77. IMGLI_NETWORK_DOWN,
  78. IMGLI_NETWORK_UNKNOWN,
  79. IMGLI_NETIFACE,
  80. IMGLI_NETIFACE_UNREACHABLE,
  81. IMGLI_NETIFACE_FAILED,
  82. IMGLI_NETIFACE_UNKNOWN,
  83. IMGLI_MAX
  84. };
  85. /////////////////////////////////////////////////////////////////////////////
  86. // CClusterAdminApp:
  87. // See CluAdmin.cpp for the implementation of this class
  88. /////////////////////////////////////////////////////////////////////////////
  89. class CClusterAdminApp : public CWinApp
  90. {
  91. DECLARE_DYNAMIC( CClusterAdminApp );
  92. public:
  93. CClusterAdminApp( void );
  94. CRecentClusterList * PrclRecentClusterList( void) { return (CRecentClusterList *) m_pRecentFileList; }
  95. // Overrides
  96. // ClassWizard generated virtual function overrides
  97. //{{AFX_VIRTUAL(CClusterAdminApp)
  98. public:
  99. virtual BOOL InitInstance();
  100. virtual BOOL OnIdle(IN LONG lCount);
  101. virtual CDocument* OpenDocumentFile(LPCTSTR lpszFileName);
  102. virtual int ExitInstance();
  103. virtual void AddToRecentFileList(LPCTSTR lpszPathName);
  104. //}}AFX_VIRTUAL
  105. // Implementation
  106. #ifdef _CLUADMIN_USE_OLE_
  107. COleTemplateServer m_server;
  108. // Server object for document creation
  109. #endif
  110. protected:
  111. CMultiDocTemplate * m_pDocTemplate;
  112. CImageList m_ilSmallImages;
  113. CImageList m_ilLargeImages;
  114. HCHANGE m_hchangeNotifyPort;
  115. LCID m_lcid;
  116. CClusterNotifyKeyList m_cnkl;
  117. CClusterNotifyContext m_cnctx;
  118. CWinThread * m_wtNotifyThread;
  119. HCLUSTER m_hOpenedCluster;
  120. ULONG m_nIdleCount;
  121. // Indices of images in the image list.
  122. UINT m_rgiimg[IMGLI_MAX];
  123. IUnknown * m_punkClusCfgClient;
  124. BOOL BInitNotifyThread(void);
  125. static UINT AFX_CDECL NotifyThreadProc(LPVOID pParam);
  126. CClusterNotifyContext * Pcnctx(void) { return &m_cnctx; }
  127. CWinThread * WtNotifyThread(void) const { return m_wtNotifyThread; }
  128. BOOL ProcessShellCommand(IN OUT CCluAdminCommandLineInfo & rCmdInfo);
  129. void InitGlobalImageList(void);
  130. public:
  131. CMultiDocTemplate * PdocTemplate(void) const { return m_pDocTemplate; }
  132. CImageList * PilSmallImages(void) { return &m_ilSmallImages; }
  133. CImageList * PilLargeImages(void) { return &m_ilLargeImages; }
  134. HCHANGE HchangeNotifyPort(void) const { return m_hchangeNotifyPort; }
  135. LCID Lcid(void) const { return m_lcid; }
  136. CClusterNotifyKeyList & Cnkl(void) { return m_cnkl; }
  137. HCLUSTER HOpenedCluster(void) const { return m_hOpenedCluster; }
  138. // Indices of images in the image list.
  139. UINT Iimg(ImageListIndex imgli) { return m_rgiimg[imgli]; }
  140. void LoadImageIntoList(
  141. IN OUT CImageList * pil,
  142. IN ID idbImage,
  143. IN UINT imgli
  144. );
  145. static void LoadImageIntoList(
  146. IN OUT CImageList * pil,
  147. IN ID idbImage,
  148. OUT UINT * piimg = NULL
  149. );
  150. void LoadClusCfgClient( void );
  151. void SaveConnections(void);
  152. afx_msg LRESULT OnRestoreDesktop(WPARAM wparam, LPARAM lparam);
  153. afx_msg LRESULT OnClusterNotify(WPARAM wparam, LPARAM lparam);
  154. //{{AFX_MSG(CClusterAdminApp)
  155. afx_msg void OnAppAbout();
  156. afx_msg void OnFileOpen();
  157. afx_msg void OnFileNewCluster();
  158. afx_msg void OnWindowCloseAll();
  159. afx_msg void OnUpdateWindowCloseAll(CCmdUI* pCmdUI);
  160. //}}AFX_MSG
  161. #ifdef _DEBUG
  162. afx_msg void OnTraceSettings();
  163. afx_msg void OnBarfSettings();
  164. afx_msg void OnBarfAllSettings();
  165. #endif
  166. DECLARE_MESSAGE_MAP()
  167. }; //*** class CClusterAdminApp
  168. /////////////////////////////////////////////////////////////////////////////
  169. // Global Functions
  170. /////////////////////////////////////////////////////////////////////////////
  171. BOOL BCreateFont(OUT CFont & rfont, IN int nPoints, IN BOOL bBold);
  172. void NewNodeWizard( LPCTSTR pcszName, BOOL fIgnoreErrors = FALSE );
  173. inline CClusterAdminApp * GetClusterAdminApp(void)
  174. {
  175. ASSERT_KINDOF(CClusterAdminApp, AfxGetApp());
  176. return (CClusterAdminApp *) AfxGetApp();
  177. }
  178. inline CFrameWnd * PframeMain(void)
  179. {
  180. return (CFrameWnd *) AfxGetMainWnd();
  181. }
  182. /////////////////////////////////////////////////////////////////////////////
  183. #endif // _CLUADMIN_H_