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.

259 lines
7.3 KiB

  1. /*++
  2. Module Name:
  3. MmcAdmin.h
  4. Abstract:
  5. This module contains the definition for CMmcDfsAdmin. This is an class
  6. for MMC display related calls for the static node(the DFS Admin root node)
  7. Also contains code use to wrap a list of Dfs Roots.
  8. --*/
  9. #if !defined(AFX_MMCDFSADMIN_H__2CC64E54_3BF4_11D1_AA17_00C06C00392D__INCLUDED_)
  10. #define AFX_MMCDFSADMIN_H__2CC64E54_3BF4_11D1_AA17_00C06C00392D__INCLUDED_
  11. #if _MSC_VER >= 1000
  12. #pragma once
  13. #endif // _MSC_VER >= 1000
  14. #include "MmcDispl.h"
  15. #include "connect.h"
  16. #include "MmcRoot.h"
  17. #include "DfsCore.h"
  18. #include <list>
  19. using namespace std;
  20. class CMmcDfsAdmin;
  21. class CDfsSnapinScopeManager;
  22. // This structure defines a node of the list of Dfs Roots
  23. // added to the snapin. This is maintained internally by the CMmcDfsAdmin
  24. class DFS_ROOT_NODE
  25. {
  26. public:
  27. DFS_ROOT_NODE(CMmcDfsRoot* i_pMmcDfsRoot, BSTR i_bstrRootEntryPath)
  28. {
  29. m_pMmcDfsRoot = i_pMmcDfsRoot;
  30. m_bstrRootEntryPath = i_bstrRootEntryPath;
  31. };
  32. ~DFS_ROOT_NODE()
  33. {
  34. SAFE_RELEASE(m_pMmcDfsRoot);
  35. };
  36. CComBSTR m_bstrRootEntryPath; // Root Entry path of the Dfs Volume
  37. CMmcDfsRoot* m_pMmcDfsRoot; // DfsRoot class for MMC display
  38. };
  39. typedef list<DFS_ROOT_NODE*> DFS_ROOT_LIST;
  40. class CMmcDfsAdmin : public CMmcDisplay
  41. {
  42. public:
  43. CMmcDfsAdmin( CDfsSnapinScopeManager* pScopeManager );
  44. virtual ~CMmcDfsAdmin();
  45. // For adding context menu items
  46. STDMETHOD(AddMenuItems)(
  47. IN LPCONTEXTMENUCALLBACK i_lpContextMenuCallback,
  48. IN LPLONG i_lpInsertionAllowed
  49. );
  50. // For taking action on a context menu selection.
  51. STDMETHOD(Command)(
  52. IN LONG i_lCommandID
  53. );
  54. // Set the headers for the listview (in the result pane) column
  55. STDMETHOD(SetColumnHeader)(
  56. IN LPHEADERCTRL2 i_piHeaderControl
  57. ) { return E_NOTIMPL; } // the static node will dispay the messageview in the result pane
  58. // Return the requested display information for the Result Pane
  59. STDMETHOD(GetResultDisplayInfo)(
  60. IN OUT LPRESULTDATAITEM io_pResultDataItem
  61. ) { return S_OK; };
  62. // Return the requested display information for the Scope Pane
  63. STDMETHOD(GetScopeDisplayInfo)(
  64. IN OUT LPSCOPEDATAITEM io_pScopeDataItem
  65. ) { return S_OK; };
  66. // Add all the items to the Scope Pane
  67. STDMETHOD(EnumerateScopePane)(
  68. IN LPCONSOLENAMESPACE i_lpConsoleNameSpace,
  69. IN HSCOPEITEM i_hParent
  70. );
  71. // Add items(or folders), if any to the Result Pane
  72. STDMETHOD(EnumerateResultPane)(
  73. IN OUT IResultData* io_pResultData
  74. ) { return S_OK; };
  75. // Returns the pointer to the list of DfsRoots currently added to the Snapin.
  76. STDMETHOD(GetList)(
  77. OUT DFS_ROOT_LIST** o_pList
  78. );
  79. // This method checks if DfsRoot is already added to the list.
  80. STDMETHOD(IsAlreadyInList)(
  81. IN BSTR i_bstrDfsRootServerName,
  82. OUT CMmcDfsRoot **o_ppMmcDfsRoot = NULL
  83. );
  84. // Delete the node from m_RootList
  85. STDMETHOD(DeleteMmcRootNode)(
  86. IN CMmcDfsRoot* i_pMmcDfsRoot
  87. );
  88. // Add a Dfs root to the list and scope pane
  89. STDMETHOD(AddDfsRoot)(
  90. IN BSTR i_bstrDfsRootName
  91. );
  92. // Add a Dfs root to the list.
  93. STDMETHOD(AddDfsRootToList)(
  94. IN IDfsRoot* i_pDfsRoot, // IDfsRoot pointer of the DfsRoot.
  95. IN ULONG i_ulLinkFilterMaxLimit = FILTERDFSLINKS_MAXLIMIT_DEFAULT,
  96. IN FILTERDFSLINKS_TYPE i_lLinkFilterType = FILTERDFSLINKS_TYPE_NO_FILTER,
  97. IN BSTR i_bstrLinkFilterName = NULL
  98. );
  99. // Set the console verb settings. Change the state, decide the default verb, etc
  100. STDMETHOD(SetConsoleVerbs)(
  101. IN LPCONSOLEVERB i_lpConsoleVerb
  102. );
  103. // let MMC handle the default verb.
  104. STDMETHOD(DoDblClick)(
  105. ) { return S_FALSE; }
  106. // Delete the current item.
  107. STDMETHOD(DoDelete)(
  108. ) { return S_FALSE; };
  109. // Checks whether the object has pages to display
  110. STDMETHOD(QueryPagesFor)(
  111. ) { return S_FALSE; };
  112. // Creates and passes back the pages to be displayed
  113. STDMETHOD(CreatePropertyPages)(
  114. IN LPPROPERTYSHEETCALLBACK i_lpPropSheetCallback,
  115. IN LONG_PTR i_lNotifyHandle
  116. ) { return E_UNEXPECTED; };
  117. // Used to notify the object that it's properties have changed
  118. STDMETHOD(PropertyChanged)(
  119. ) { return E_UNEXPECTED; };
  120. // Used to set the result view description bar text
  121. STDMETHOD(SetDescriptionBarText)(
  122. IN LPRESULTDATA i_lpResultData
  123. );
  124. STDMETHOD(SetStatusText)(
  125. IN LPCONSOLE2 i_lpConsole
  126. )
  127. {
  128. RETURN_INVALIDARG_IF_NULL(i_lpConsole);
  129. return i_lpConsole->SetStatusText(NULL);
  130. }
  131. // Handle a select event for the node. Handle only toolbar related
  132. // activities here
  133. STDMETHOD(ToolbarSelect)(
  134. IN const LONG i_lArg,
  135. IN IToolbar* i_pToolBar
  136. );
  137. // Handle a click on the toolbar
  138. STDMETHOD(ToolbarClick)(
  139. IN const LPCONTROLBAR i_pControlbar,
  140. IN const LPARAM i_lParam
  141. );
  142. STDMETHOD(RemoveFromMMC)() { return S_OK; }
  143. STDMETHOD(CleanScopeChildren)(
  144. VOID
  145. );
  146. STDMETHOD(CleanResultChildren)(
  147. ) { return S_OK; };
  148. STDMETHOD(ViewChange)(
  149. IResultData* i_pResultData,
  150. LONG_PTR i_lHint
  151. ) { return S_OK; };
  152. // Getters/Setters
  153. public:
  154. // Get the value of the dirty flag
  155. bool GetDirty() { return m_bDirty; }
  156. // Set the value of the dirty flag
  157. void SetDirty(IN bool i_bDirty) { m_bDirty = i_bDirty; }
  158. HRESULT PutConsolePtr(
  159. IN const LPCONSOLE2 i_lpConsole
  160. ) { m_lpConsole = i_lpConsole; return S_OK; }
  161. STDMETHOD(OnNewDfsRoot)(
  162. );
  163. DISPLAY_OBJECT_TYPE GetDisplayObjectType(
  164. )
  165. {
  166. return DISPLAY_OBJECT_TYPE_ADMIN;
  167. };
  168. HRESULT CreateToolbar(
  169. IN const LPCONTROLBAR i_pControlbar,
  170. IN const LPEXTENDCONTROLBAR i_lExtendControlbar,
  171. OUT IToolbar** o_pToolBar
  172. );
  173. HRESULT OnRefresh();
  174. virtual HRESULT OnAddImages(
  175. IImageList *pImageList,
  176. HSCOPEITEM hsi
  177. ) { return S_OK; } // no listview on the static node
  178. // Helper methods
  179. private:
  180. // Menu Command handlers
  181. STDMETHOD(OnConnectTo)(
  182. );
  183. STDMETHOD(GetEntryPath)(
  184. BSTR* o_pbstrEntryPath
  185. ) { return E_NOTIMPL;};
  186. // Data members
  187. private:
  188. DFS_ROOT_LIST m_RootList; // The list of Dfs Roots added to the snap-in
  189. HSCOPEITEM m_hItemParent; // Parent of all nodes added in the Scope Pane
  190. CComPtr<IConsoleNameSpace> m_lpConsoleNameSpace; // The Callback used to do Scope Pane operations
  191. CComPtr<IConsole2> m_lpConsole; // The Console callback. The mother of all mmc interfaces
  192. bool m_bDirty; // Dirty flag used while saving the console
  193. public:
  194. CDfsSnapinScopeManager* m_pScopeManager; // The corresponding Scope Manager object
  195. };
  196. #endif // !defined(AFX_MMCDFSADMIN_H__2CC64E54_3BF4_11D1_AA17_00C06C00392D__INCLUDED_)