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.

275 lines
7.4 KiB

  1. /*++
  2. Module Name:
  3. MmcJP.h
  4. Abstract:
  5. This module contains the definition for CMmcDfsJunctionPoint class. This is an class
  6. for MMC display related calls for the second level node(the DfsJunctionPoint nodes)
  7. --*/
  8. #if !defined(AFX_MMCDFSJP_H__6A7EDAC3_3FAC_11D1_AA1C_00C06C00392D__INCLUDED_)
  9. #define AFX_MMCDFSJP_H__6A7EDAC3_3FAC_11D1_AA1C_00C06C00392D__INCLUDED_
  10. #if _MSC_VER >= 1000
  11. #pragma once
  12. #endif // _MSC_VER >= 1000
  13. #include "DfsCore.h"
  14. #include "MmcDispl.h"
  15. #include "JPProp.h" // For CReplicaSetPropPage
  16. #include "frsProp.h" // For CRealReplicaSetPropPage
  17. // Forward declarations
  18. class CMmcDfsAdmin;
  19. class CMmcDfsRoot;
  20. class CMmcDfsReplica;
  21. class CMmcDfsJunctionPoint : public CMmcDisplay
  22. {
  23. public:
  24. // Constructor
  25. CMmcDfsJunctionPoint (
  26. IN IDfsJunctionPoint* i_pDfsJPObject,
  27. IN CMmcDfsRoot* i_pDfsParentRoot,
  28. IN LPCONSOLENAMESPACE i_lpConsoleNameSpace
  29. );
  30. virtual ~CMmcDfsJunctionPoint();
  31. // For adding context menu items
  32. STDMETHOD(AddMenuItems)(
  33. IN LPCONTEXTMENUCALLBACK i_lpContextMenuCallback,
  34. IN LPLONG i_lpInsertionAllowed
  35. );
  36. // For taking action on a context menu selection.
  37. STDMETHOD(Command)(
  38. IN LONG i_lCommandID
  39. );
  40. // Set the headers for the listview (in the result pane) column
  41. STDMETHOD(SetColumnHeader)(
  42. IN LPHEADERCTRL2 i_piHeaderControl
  43. );
  44. // Return the requested display information for the Result Pane
  45. STDMETHOD(GetResultDisplayInfo)(
  46. IN OUT LPRESULTDATAITEM io_pResultDataItem
  47. );
  48. // Return the requested display information for the Scope Pane
  49. STDMETHOD(GetScopeDisplayInfo)(
  50. IN OUT LPSCOPEDATAITEM io_pScopeDataItem
  51. );
  52. // Add items(or folders), if any to the Scope Pane
  53. STDMETHOD(EnumerateScopePane)(
  54. IN LPCONSOLENAMESPACE i_lpConsoleNameSpace,
  55. IN HSCOPEITEM i_hParent
  56. );
  57. // Add items(or folders), if any to the Result Pane
  58. STDMETHOD(EnumerateResultPane)(
  59. IN OUT IResultData* io_pResultData
  60. );
  61. // Set the console verb settings. Change the state, decide the default verb, etc
  62. STDMETHOD(SetConsoleVerbs)(
  63. IN LPCONSOLEVERB i_lpConsoleVerb
  64. );
  65. // let MMC handle the default verb.
  66. STDMETHOD(DoDblClick)(
  67. ) { return S_FALSE; }
  68. // Delete the current item.
  69. STDMETHOD(DoDelete)(
  70. );
  71. // Checks whether the object has pages to display
  72. STDMETHOD(QueryPagesFor)(
  73. );
  74. // Creates and passes back the pages to be displayed
  75. STDMETHOD(CreatePropertyPages)(
  76. IN LPPROPERTYSHEETCALLBACK i_lpPropSheetCallback,
  77. IN LONG_PTR i_lNotifyHandle
  78. );
  79. STDMETHOD(CreateFrsPropertyPage)(
  80. IN LPPROPERTYSHEETCALLBACK i_lpPropSheetCallback,
  81. IN LONG_PTR i_lNotifyHandle
  82. );
  83. // Used to notify the object that it's properties have changed
  84. STDMETHOD(PropertyChanged)(
  85. );
  86. // Used to set the result view description bar text
  87. STDMETHOD(SetDescriptionBarText)(
  88. IN LPRESULTDATA i_lpResultData
  89. );
  90. STDMETHOD(SetStatusText)(
  91. IN LPCONSOLE2 i_lpConsole
  92. )
  93. {
  94. RETURN_INVALIDARG_IF_NULL(i_lpConsole);
  95. return i_lpConsole->SetStatusText(NULL);
  96. }
  97. // Add an item to the scope pane
  98. STDMETHOD(AddItemToScopePane)(
  99. IN HSCOPEITEM i_hParent
  100. );
  101. // Handle a select event for the node. Handle only toolbar related
  102. // activities here
  103. STDMETHOD(ToolbarSelect)(
  104. IN const LONG i_lArg,
  105. IN IToolbar* i_pToolBar
  106. );
  107. HRESULT CreateToolbar(
  108. IN const LPCONTROLBAR i_pControlbar,
  109. IN const LPEXTENDCONTROLBAR i_lExtendControlbar,
  110. OUT IToolbar** o_pToolBar
  111. );
  112. // Handle a click on the toolbar
  113. STDMETHOD(ToolbarClick)(
  114. IN const LPCONTROLBAR i_pControlbar,
  115. IN const LPARAM i_lParam
  116. );
  117. DISPLAY_OBJECT_TYPE GetDisplayObjectType() { return DISPLAY_OBJECT_TYPE_JUNCTION; }
  118. HRESULT OnRefresh(
  119. );
  120. // helpers
  121. private: // For add Replica
  122. STDMETHOD(OnNewReplica)(
  123. );
  124. // For deleteing Junction Point
  125. STDMETHOD(OnRemoveJP)(IN BOOL bConfirm = TRUE
  126. );
  127. // Ask confirmation from the user
  128. STDMETHOD(ConfirmOperationOnDfsLink)(int idString);
  129. STDMETHOD(CleanScopeChildren)() { return S_OK; }
  130. STDMETHOD(CleanResultChildren)(
  131. );
  132. // Check the replica status
  133. STDMETHOD(OnCheckStatus)(
  134. );
  135. STDMETHOD(ViewChange)(
  136. IResultData* i_pResultData,
  137. LONG_PTR i_lHint
  138. );
  139. STDMETHOD(AddResultPaneItem)(
  140. CMmcDfsReplica* i_pReplicaDispObject
  141. );
  142. STDMETHOD(RemoveReplica)(LPCTSTR i_pszDisplayName);
  143. STDMETHOD(RemoveResultPaneItem)(
  144. CMmcDfsReplica* i_pReplicaDispObject
  145. );
  146. HRESULT ClosePropertySheet(BOOL bSilent);
  147. STDMETHOD(GetEntryPath)(BSTR* o_pbstrEntryPath)
  148. { GET_BSTR(m_bstrEntryPath, o_pbstrEntryPath); }
  149. inline HRESULT GetDomainName(BSTR* pVal)
  150. { return (m_pDfsParentRoot->m_DfsRoot)->get_DomainName(pVal); }
  151. inline HRESULT GetDfsType(long* pVal)
  152. { return (m_pDfsParentRoot->m_DfsRoot)->get_DfsType(pVal); }
  153. BOOL get_ShowFRS() { return m_bShowFRS; }
  154. HRESULT _InitReplicaSet();
  155. HRESULT OnNewReplicaSet();
  156. HRESULT OnShowReplication();
  157. HRESULT OnStopReplication(BOOL bConfirm=FALSE);
  158. HRESULT GetIReplicaSetPtr(IReplicaSet** o_ppiReplicaSet);
  159. BOOL IsNewSchema() { return m_pDfsParentRoot->IsNewSchema(); }
  160. // Constants, Statics, etc
  161. public:
  162. static const int m_iIMAGEINDEX;
  163. static const int m_iOPENIMAGEINDEX;
  164. private:
  165. friend class CMmcDfsRoot;
  166. friend class CMmcDfsReplica;
  167. CComPtr<IConsoleNameSpace> m_lpConsoleNameSpace; // The Callback used to do Scope Pane operations
  168. CComPtr<IConsole2> m_lpConsole; // The Console callback.
  169. HSCOPEITEM m_hScopeItem; // Scopeitem handle
  170. CComBSTR m_bstrEntryPath; // EntryPath;
  171. CComBSTR m_bstrDisplayName; // Display name of the current JP
  172. long m_lJunctionState;
  173. DFS_REPLICA_LIST m_MmcRepList; // The list of replicas
  174. CComPtr<IDfsJunctionPoint> m_pDfsJPObject;
  175. CMmcDfsRoot* m_pDfsParentRoot;
  176. CComPtr<IReplicaSet> m_piReplicaSet;
  177. CReplicaSetPropPage m_PropPage;
  178. CRealReplicaSetPropPage m_frsPropPage;
  179. BOOL m_bShowFRS;
  180. bool m_bDirty; // Tells if a replica is added or removed.
  181. };
  182. #endif // !defined(AFX_MMCDFSJP_H__6A7EDAC3_3FAC_11D1_AA1C_00C06C00392D__INCLUDED_)