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.

228 lines
6.5 KiB

  1. /*++
  2. Module Name:
  3. DfsScope.h
  4. Abstract:
  5. This module contains the declaration for CDfsSnapinScopeManager.
  6. This class implements IComponentData and other related interfaces
  7. --*/
  8. #ifndef __DFSSCOPE_H_
  9. #define __DFSSCOPE_H_
  10. #include "resource.h" // main symbols
  11. #include "MMCAdmin.h" // For CMMCDfsAdmin
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CDfsSnapinScopeManager
  14. class ATL_NO_VTABLE CDfsSnapinScopeManager :
  15. public CComObjectRootEx<CComSingleThreadModel>,
  16. public CComCoClass<CDfsSnapinScopeManager, &CLSID_DfsSnapinScopeManager>,
  17. public IComponentData,
  18. public IExtendContextMenu,
  19. public IPersistStream,
  20. public ISnapinAbout,
  21. public ISnapinHelp2,
  22. public IExtendPropertySheet2
  23. {
  24. public:
  25. //DECLARE_REGISTRY_RESOURCEID(IDR_DFSSNAPINSCOPEMANAGER)
  26. static HRESULT UpdateRegistry(BOOL bRegister);
  27. BEGIN_COM_MAP(CDfsSnapinScopeManager)
  28. COM_INTERFACE_ENTRY(IComponentData)
  29. COM_INTERFACE_ENTRY(IExtendContextMenu)
  30. COM_INTERFACE_ENTRY(IPersistStream)
  31. COM_INTERFACE_ENTRY(ISnapinAbout)
  32. COM_INTERFACE_ENTRY(ISnapinHelp2)
  33. COM_INTERFACE_ENTRY(IExtendPropertySheet2)
  34. END_COM_MAP()
  35. CDfsSnapinScopeManager();
  36. virtual ~CDfsSnapinScopeManager();
  37. //IComponentData Methods
  38. STDMETHOD(Initialize)(
  39. IN LPUNKNOWN i_pUnknown
  40. );
  41. STDMETHOD(CreateComponent)(
  42. OUT LPCOMPONENT* o_ppComponent
  43. );
  44. STDMETHOD(Notify)(
  45. IN LPDATAOBJECT i_lpDataObject,
  46. IN MMC_NOTIFY_TYPE i_Event,
  47. IN LPARAM i_lArg,
  48. IN LPARAM i_lParam
  49. );
  50. STDMETHOD(Destroy)();
  51. STDMETHOD(QueryDataObject)(
  52. IN MMC_COOKIE i_lCookie,
  53. IN DATA_OBJECT_TYPES i_DataObjectType,
  54. OUT LPDATAOBJECT* o_ppDataObject
  55. );
  56. STDMETHOD(GetDisplayInfo)(
  57. IN OUT SCOPEDATAITEM* io_pScopeDataItem
  58. );
  59. STDMETHOD(CompareObjects)(
  60. IN LPDATAOBJECT lpDataObjectA,
  61. IN LPDATAOBJECT lpDataObjectB
  62. );
  63. // IExtendContextMenu methods. Definition in ICtxMenu.cpp
  64. STDMETHOD (AddMenuItems)(
  65. IN LPDATAOBJECT i_lpDataObject,
  66. IN LPCONTEXTMENUCALLBACK i_lpContextMenuCallback,
  67. IN LPLONG i_lpInsertionAllowed
  68. );
  69. STDMETHOD (Command)(
  70. IN LONG i_lCommandID,
  71. IN LPDATAOBJECT i_lpDataObject
  72. );
  73. // IPersistStream Implementation
  74. STDMETHOD (GetClassID)(
  75. OUT struct _GUID* o_pClsid
  76. );
  77. // Use to check if the object has been changed since last save
  78. STDMETHOD (IsDirty)(
  79. );
  80. // Use to load the snap-in from a saved file
  81. STDMETHOD (Load)(
  82. IN LPSTREAM i_pStream
  83. );
  84. // Use to save the snap-in to a file
  85. STDMETHOD (Save)(
  86. OUT LPSTREAM o_pStream,
  87. IN BOOL i_bClearDirty
  88. );
  89. STDMETHOD (GetSizeMax)(
  90. OUT ULARGE_INTEGER* o_pulSize
  91. );
  92. // ISnapinAbout methods
  93. STDMETHOD (GetSnapinDescription)(
  94. OUT LPOLESTR* o_lpszDescription
  95. );
  96. STDMETHOD (GetProvider)(
  97. OUT LPOLESTR* o_lpszName
  98. );
  99. STDMETHOD (GetSnapinVersion)(
  100. OUT LPOLESTR* o_lpszVersion
  101. );
  102. STDMETHOD (GetSnapinImage)(
  103. OUT HICON* o_hSnapIcon
  104. );
  105. STDMETHOD (GetStaticFolderImage)(
  106. OUT HBITMAP* o_hSmallImage,
  107. OUT HBITMAP* o_hSmallImageOpen,
  108. OUT HBITMAP* o_hLargeImage,
  109. OUT COLORREF* o_cMask
  110. );
  111. // ISnapinHelp2
  112. STDMETHOD (GetHelpTopic)(
  113. OUT LPOLESTR* o_lpszCompiledHelpFile
  114. );
  115. STDMETHOD (GetLinkedTopics)(
  116. OUT LPOLESTR* o_lpszCompiledHelpFiles
  117. );
  118. // IExtendPropertySheet
  119. // Called to create the pages
  120. STDMETHOD (CreatePropertyPages)(
  121. IN LPPROPERTYSHEETCALLBACK i_lpPropSheetProvider,
  122. IN LONG_PTR i_lhandle,
  123. IN LPDATAOBJECT i_lpIDataObject
  124. );
  125. // Called to check, if the snapin was to display the pages
  126. STDMETHOD (QueryPagesFor)(
  127. IN LPDATAOBJECT i_lpIDataObject
  128. );
  129. // Called to get water mar images for property pages.
  130. STDMETHOD (GetWatermarks)(
  131. IN LPDATAOBJECT pDataObject,
  132. IN HBITMAP* lphWatermark,
  133. IN HBITMAP* lphHeader,
  134. IN HPALETTE* lphPalette,
  135. IN BOOL* bStretch
  136. );
  137. // Utility functions
  138. public:
  139. // Get the Display Object from the IDataObject
  140. STDMETHOD(GetDisplayObject)(
  141. IN LPDATAOBJECT i_lpDataObject,
  142. OUT CMmcDisplay** o_ppMmcDisplay
  143. );
  144. private:
  145. // Handle the notify event for MMCN_EXPAND
  146. STDMETHOD(DoNotifyExpand)(
  147. IN LPDATAOBJECT i_lpDataObject,
  148. IN BOOL i_bExpanding,
  149. IN HSCOPEITEM i_hParent
  150. );
  151. // Read a particular field from the version information block.
  152. STDMETHOD(ReadFieldFromVersionInfo)(
  153. IN LPTSTR i_lpszField,
  154. OUT LPOLESTR* o_lpszFieldValue
  155. );
  156. protected:
  157. CMmcDfsAdmin* m_pMmcDfsAdmin; // The Class used for display and for dfsroot list.
  158. CComPtr<IConsoleNameSpace> m_pScope; // Pointer to the Scope Pane.
  159. CComPtr<IConsole2> m_pConsole; // Pointer to the Console.
  160. HBITMAP m_hLargeBitmap;
  161. HBITMAP m_hSmallBitmap;
  162. HBITMAP m_hSmallBitmapOpen;
  163. HICON m_hSnapinIcon;
  164. HBITMAP m_hWatermark;
  165. HBITMAP m_hHeader;
  166. };
  167. #endif //__DFSSCOPE_H_