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.

175 lines
4.9 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_CONTEXTHELP
  103. STDMETHOD(DfsHelp)();
  104. STDMETHOD(DoNotifyViewChange)(
  105. IN LPDATAOBJECT i_lpDataObject,
  106. IN LONG_PTR i_lArg,
  107. IN LONG_PTR i_lParam
  108. );
  109. // Data members
  110. private:
  111. CDfsSnapinScopeManager* m_pScopeManager; // The corresponding Scope Manager object
  112. CComPtr<IHeaderCtrl2> m_pHeader; // The header control for the result view
  113. CComPtr<IResultData> m_pResultData;
  114. CComPtr<IConsoleVerb> m_pConsoleVerb; // Sets the console verb
  115. CComPtr<IConsole2> m_pConsole;
  116. CComPtr<IControlbar> m_pControlbar; // Callback used to handle toolbars, etc
  117. CMmcDisplay* m_pSelectScopeDisplayObject; // The CMmcDisplay pointer of the scope pane items
  118. // That is currently selected in the view.
  119. CComPtr<IToolbar> m_pMMCAdminToolBar;
  120. CComPtr<IToolbar> m_pMMCRootToolBar;
  121. CComPtr<IToolbar> m_pMMCJPToolBar;
  122. CComPtr<IToolbar> m_pMMCReplicaToolBar;
  123. };
  124. #endif //__DFSRESLT_H_