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.

205 lines
6.7 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // FILE : FaxServerNode.h //
  3. // //
  4. // DESCRIPTION : Header file for CFaxServerNode snapin node class //
  5. // This is the "Fax" node in the scope pane. //
  6. // //
  7. // AUTHOR : yossg //
  8. // //
  9. // HISTORY : //
  10. // Sep 22 1999 yossg Init . //
  11. // Nov 24 1999 yossg Rename file from FaxCfg //
  12. // Dec 9 1999 yossg Call InitDisplayName from parent //
  13. // Mar 16 2000 yossg Add service start-stop //
  14. // Jun 25 2000 yossg add stream and command line primary snapin //
  15. // machine targeting. //
  16. // //
  17. // Copyright (C) 1998 - 2000 Microsoft Corporation All Rights Reserved //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #ifndef H_FAXSERVERNODE_H
  20. #define H_FAXSERVERNODE_H
  21. //#pragma message( "H_FAXSERVERNODE_H" )
  22. //
  23. // Dialog H files
  24. //
  25. #include "ppFaxServerGeneral.h"
  26. #include "ppFaxServerReceipts.h"
  27. #include "ppFaxServerLogging.h"
  28. #include "ppFaxServerEvents.h"
  29. #include "ppFaxServerInbox.h"
  30. #include "ppFaxServerOutbox.h"
  31. #include "ppFaxServerSentItems.h"
  32. //
  33. // MMC FaxServer connection class
  34. //
  35. #include "FaxServer.h"
  36. #include "FaxMMCGlobals.h"
  37. #include "snapin.h"
  38. #include "snpnscp.h"
  39. class CppFaxServerGeneral;
  40. class CppFaxServerReceipts;
  41. class CppFaxServerEvents;
  42. class CppFaxServerLogging;
  43. class CppFaxServerOutbox;
  44. class CppFaxServerInbox;
  45. class CppFaxServerSentItems;
  46. //////////////////////////////////////////////////////////////
  47. //class COutRoutingRulesNode;
  48. class CFaxServerNode : public CNodeWithScopeChildrenList<CFaxServerNode, FALSE>
  49. {
  50. public:
  51. BEGIN_SNAPINCOMMAND_MAP(CFaxServerNode, FALSE)
  52. SNAPINCOMMAND_ENTRY(IDM_SRV_START, OnServiceStartCommand)
  53. SNAPINCOMMAND_ENTRY(IDM_SRV_STOP, OnServiceStopCommand)
  54. SNAPINCOMMAND_ENTRY(ID_START_BUTTON, OnServiceStartCommand)
  55. SNAPINCOMMAND_ENTRY(ID_STOP_BUTTON, OnServiceStopCommand)
  56. SNAPINCOMMAND_ENTRY(ID_CLIENTCONSOLE_BUTTON, OnLaunchClientConsole)
  57. SNAPINCOMMAND_ENTRY(IDM_LAUNCH_CONSOLE, OnLaunchClientConsole)
  58. END_SNAPINCOMMAND_MAP()
  59. BEGIN_SNAPINTOOLBARID_MAP(CFaxServerNode)
  60. SNAPINTOOLBARID_ENTRY(IDR_TOOLBAR_STARTSTOP)
  61. END_SNAPINTOOLBARID_MAP()
  62. SNAPINMENUID(IDR_FAX_MENU)
  63. //
  64. // Constructor
  65. //
  66. CFaxServerNode(CSnapInItem * pParentNode, CSnapin * pComponentData, LPTSTR lptstrServerName ) :
  67. CNodeWithScopeChildrenList<CFaxServerNode, FALSE>(pParentNode, pComponentData ),
  68. m_FaxServer(lptstrServerName)
  69. {
  70. m_pFaxServerGeneral = NULL;
  71. m_pFaxServerEmail = NULL;
  72. m_pFaxServerEvents = NULL;
  73. m_pFaxServerLogging = NULL;
  74. m_pFaxServerOutbox = NULL;
  75. m_pFaxServerInbox = NULL;
  76. m_pFaxServerSentItems = NULL;
  77. m_pParentNodeEx = NULL; // we are at the root now
  78. m_fAllowOverrideServerName = FALSE;
  79. m_IsPrimaryModeSnapin = FALSE;
  80. m_IsLaunchedFromSavedMscFile = FALSE;
  81. }
  82. //
  83. // Destructor
  84. //
  85. ~CFaxServerNode()
  86. {
  87. }
  88. virtual HRESULT PopulateScopeChildrenList();
  89. virtual HRESULT InsertColumns(IHeaderCtrl* pHeaderCtrl);
  90. virtual HRESULT SetVerbs(IConsoleVerb *pConsoleVerb);
  91. // virtual
  92. HRESULT OnRefresh(LPARAM arg,
  93. LPARAM param,
  94. IComponentData *pComponentData,
  95. IComponent * pComponent,
  96. DATA_OBJECT_TYPES type);
  97. //
  98. // Property pages methods
  99. //
  100. STDMETHOD(CreatePropertyPages)(LPPROPERTYSHEETCALLBACK lpProvider,
  101. LONG_PTR handle,
  102. IUnknown* pUnk,
  103. DATA_OBJECT_TYPES type);
  104. STDMETHOD(CreateSnapinManagerPages)(LPPROPERTYSHEETCALLBACK lpProvider,
  105. LONG_PTR handle);
  106. STDMETHOD(QueryPagesFor)(DATA_OBJECT_TYPES type)
  107. {
  108. if (type == CCT_SCOPE || type == CCT_RESULT || type == CCT_SNAPIN_MANAGER)
  109. return S_OK;
  110. return S_FALSE;
  111. }
  112. HRESULT InitDisplayName();
  113. const CComBSTR& GetServerName();
  114. STDMETHOD(SetServerNameOnSnapinAddition)(BSTR bstrServerName, BOOL fAllowOverrideServerName);
  115. STDMETHOD(UpdateServerName)(BSTR bstrServerName);
  116. //
  117. // inline Fax Server ptr
  118. //
  119. inline CFaxServer * GetFaxServer() /*const*/
  120. {
  121. return &m_FaxServer;
  122. };
  123. void UpdateMenuState(UINT id, LPTSTR pBuf, UINT *flags);
  124. BOOL UpdateToolbarButton( UINT id, BYTE fsState );
  125. HRESULT OnShowContextHelp(
  126. IDisplayHelp* pDisplayHelp, LPOLESTR helpFile);
  127. BOOL GetAllowOverrideServerName() { return m_fAllowOverrideServerName; };
  128. HRESULT InitDetailedDisplayName(); //Plus ServerName
  129. void SetIsLaunchedFromSavedMscFile() { m_IsLaunchedFromSavedMscFile=TRUE; }
  130. private:
  131. //
  132. // The property pages members
  133. //
  134. CppFaxServerGeneral * m_pFaxServerGeneral;
  135. CppFaxServerReceipts * m_pFaxServerEmail;
  136. CppFaxServerEvents * m_pFaxServerEvents;
  137. CppFaxServerLogging * m_pFaxServerLogging;
  138. CppFaxServerOutbox * m_pFaxServerOutbox;
  139. CppFaxServerInbox * m_pFaxServerInbox;
  140. CppFaxServerSentItems * m_pFaxServerSentItems;
  141. //
  142. // Handles
  143. //
  144. static CColumnsInfo m_ColsInfo;
  145. CFaxServer m_FaxServer;
  146. BOOL m_fAllowOverrideServerName;
  147. BOOL m_IsPrimaryModeSnapin;
  148. BOOL m_IsLaunchedFromSavedMscFile;
  149. //
  150. // event handlers
  151. //
  152. HRESULT OnLaunchClientConsole(bool &bHandled, CSnapInObjectRootBase *pRoot);
  153. HRESULT OnServiceStartCommand(bool &bHandled, CSnapInObjectRootBase *pRoot);
  154. HRESULT OnServiceStopCommand (bool &bHandled, CSnapInObjectRootBase *pRoot);
  155. HRESULT ForceRedrawNode();
  156. };
  157. typedef CNodeWithScopeChildrenList<CFaxServerNode, FALSE>
  158. CBaseFaxNode;
  159. #endif //H_FAXSERVERNODE_H