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.

189 lines
5.0 KiB

  1. /*++
  2. Module Name:
  3. DfsReslt.h
  4. Abstract:
  5. This module contains the declaration for CDfsSnapinResultManager.
  6. --*/
  7. #ifndef __DFSRESLT_H_
  8. #define __DFSRESLT_H_
  9. #include "resource.h" // main symbols
  10. #include <mmc.h>
  11. #include "mmcdispl.h"
  12. class ATL_NO_VTABLE CDfsSnapinResultManager :
  13. public CComObjectRootEx<CComSingleThreadModel>,
  14. public CComCoClass<CDfsSnapinResultManager, &CLSID_DfsSnapinResultManager>,
  15. public IComponent,
  16. public IExtendContextMenu,
  17. public IExtendControlbar
  18. {
  19. public:
  20. DECLARE_REGISTRY_RESOURCEID(IDR_DFSSNAPINRESULTMANAGER)
  21. BEGIN_COM_MAP(CDfsSnapinResultManager)
  22. COM_INTERFACE_ENTRY(IComponent)
  23. COM_INTERFACE_ENTRY(IExtendContextMenu)
  24. COM_INTERFACE_ENTRY(IExtendControlbar)
  25. END_COM_MAP()
  26. friend class CDfsSnapinScopeManager;
  27. CDfsSnapinResultManager():m_pScopeManager(NULL),
  28. m_pSelectScopeDisplayObject(NULL)
  29. {
  30. }
  31. virtual ~CDfsSnapinResultManager()
  32. {
  33. }
  34. // IComponent Methods
  35. STDMETHOD(Initialize)(
  36. IN LPCONSOLE i_lpConsole
  37. );
  38. STDMETHOD(Notify)(
  39. IN LPDATAOBJECT i_lpDataObject,
  40. IN MMC_NOTIFY_TYPE i_Event,
  41. IN LPARAM i_lArg,
  42. IN LPARAM i_lParam
  43. );
  44. STDMETHOD(Destroy)(
  45. IN MMC_COOKIE i_lCookie
  46. );
  47. STDMETHOD(GetResultViewType)(
  48. IN MMC_COOKIE i_lCookie,
  49. OUT LPOLESTR* o_ppViewType,
  50. OUT LPLONG o_lpViewOptions
  51. );
  52. STDMETHOD(QueryDataObject)(
  53. IN MMC_COOKIE i_lCookie,
  54. IN DATA_OBJECT_TYPES i_DataObjectType,
  55. OUT LPDATAOBJECT* o_ppDataObject
  56. );
  57. STDMETHOD(GetDisplayInfo)(
  58. IN OUT RESULTDATAITEM* io_pResultDataItem
  59. );
  60. STDMETHOD(CompareObjects)(
  61. IN LPDATAOBJECT i_lpDataObjectA,
  62. IN LPDATAOBJECT i_lpDataObjectB
  63. );
  64. // IExtendContextMenu methods.
  65. // For adding context menu items
  66. STDMETHOD (AddMenuItems)(
  67. IN LPDATAOBJECT i_lpDataObject,
  68. IN LPCONTEXTMENUCALLBACK i_lpContextMenuCallback,
  69. IN LPLONG i_lpInsertionAllowed
  70. );
  71. // For taking action on a context menu selection.
  72. STDMETHOD (Command)(
  73. IN LONG i_lCommandID,
  74. IN LPDATAOBJECT i_lpDataObject
  75. );
  76. // IExtendControlbar methods
  77. // Used to set the control bar
  78. STDMETHOD (SetControlbar)(
  79. IN LPCONTROLBAR i_pControlbar
  80. );
  81. // A notify to the control bar
  82. STDMETHOD (ControlbarNotify)(
  83. IN MMC_NOTIFY_TYPE i_Event,
  84. IN LPARAM i_lArg,
  85. IN LPARAM i_lParam
  86. );
  87. // helpers
  88. private:
  89. void DetachAllToolbars();
  90. // Handling the Notify event for Select
  91. STDMETHOD(DoNotifySelect)(
  92. IN LPDATAOBJECT i_lpDataObject,
  93. IN BOOL i_bSelect,
  94. IN HSCOPEITEM i_hParent
  95. );
  96. // Handling the Notify event for Show
  97. STDMETHOD(DoNotifyShow)(
  98. IN LPDATAOBJECT i_lpDataObject,
  99. IN BOOL i_bShow,
  100. IN HSCOPEITEM i_hParent
  101. );
  102. // Handling the notify method for MMCN_DBLCLICK
  103. STDMETHOD(DoNotifyDblClick)(
  104. IN LPDATAOBJECT i_lpDataObject
  105. );
  106. // Handling the notify method for MMCN_DELETE
  107. STDMETHOD(DoNotifyDelete)(
  108. IN LPDATAOBJECT i_lpDataObject
  109. );
  110. // Handling the notify method for MMCN_CONTEXTHELP
  111. STDMETHOD(DfsHelp)();
  112. STDMETHOD(DoNotifyViewChange)(
  113. IN LPDATAOBJECT i_lpDataObject,
  114. IN LONG_PTR i_lArg,
  115. IN LONG_PTR i_lParam
  116. );
  117. STDMETHOD(DoNotifyRefresh)(
  118. IN LPDATAOBJECT i_lpDataObject
  119. );
  120. // Data members
  121. private:
  122. CDfsSnapinScopeManager* m_pScopeManager; // The corresponding Scope Manager object
  123. CComPtr<IHeaderCtrl2> m_pHeader; // The header control for the result view
  124. CComPtr<IResultData> m_pResultData;
  125. CComPtr<IConsoleVerb> m_pConsoleVerb; // Sets the console verb
  126. CComPtr<IConsole2> m_pConsole;
  127. CComPtr<IControlbar> m_pControlbar; // Callback used to handle toolbars, etc
  128. CMmcDisplay* m_pSelectScopeDisplayObject; // The CMmcDisplay pointer of the scope pane items
  129. // That is currently selected in the view.
  130. CComPtr<IToolbar> m_pMMCAdminToolBar;
  131. CComPtr<IToolbar> m_pMMCRootToolBar;
  132. CComPtr<IToolbar> m_pMMCJPToolBar;
  133. CComPtr<IToolbar> m_pMMCReplicaToolBar;
  134. };
  135. #endif //__DFSRESLT_H_