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.

279 lines
8.4 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. /*++
  3. Copyright (C) Microsoft Corporation, 1997 - 1999
  4. Module Name:
  5. SnapinNode.h
  6. Abstract:
  7. Header for the CSnapinNode class.
  8. This is our virtual base class for an MMC Snap-in node.
  9. As this is a template class and is all implemented inline,
  10. there is no SnapinNode.cpp for implementation.
  11. Author:
  12. Michael A. Maguire 11/6/97
  13. Revision History:
  14. mmaguire 11/6/97 - created using MMC snap-in wizard
  15. mmaguire 12/15/97 - made into template class
  16. --*/
  17. //////////////////////////////////////////////////////////////////////////////
  18. #if !defined(_SNAPIN_NODE_H_)
  19. #define _SNAPIN_NODE_H_
  20. //////////////////////////////////////////////////////////////////////////////
  21. // BEGIN INCLUDES
  22. //
  23. // where we can find what this class derives from:
  24. //
  25. // Moved to Precompiled files: #include <atlsnap.h>
  26. //
  27. //
  28. // where we can find what this class has or uses:
  29. //
  30. //
  31. // END INCLUDES
  32. //////////////////////////////////////////////////////////////////////////////
  33. //class CComponentData;
  34. template <class T, class TComponentData, class TComponent>
  35. class CSnapinNode : public CSnapInItemImpl< T >
  36. {
  37. protected:
  38. // Constructor/Destructor
  39. CSnapinNode(CSnapInItem * pParentNode, unsigned int helpIndex = 0);
  40. ~CSnapinNode();
  41. public:
  42. // For IDataObject handling.
  43. IDataObject* m_pDataObject;
  44. void InitDataClass(IDataObject* pDataObject, CSnapInItem* pDefault);
  45. // Clipboard formats which IDataObjects on all MMC nodes must support.
  46. static const GUID* m_NODETYPE;
  47. static const TCHAR* m_SZNODETYPE;
  48. static const TCHAR* m_SZDISPLAY_NAME;
  49. static const CLSID* m_SNAPIN_CLASSID;
  50. // Pointer to parent node. This is passed in the call to our
  51. // constructor. Needed so that a node can access its parent.
  52. // For example, when we receive the MMCN_DELETE notification, we might tell
  53. // our parent node to remove us from its list of children.
  54. CSnapInItem * m_pParentNode;
  55. protected:
  56. // Allows us access to snapin-global data.
  57. virtual TComponentData * GetComponentData( void ) = 0;
  58. public:
  59. // Standard MMC functionality -- override if you need to.
  60. STDMETHOD(CreatePropertyPages)(
  61. LPPROPERTYSHEETCALLBACK lpProvider
  62. , LONG_PTR handle
  63. , IUnknown* pUnk
  64. , DATA_OBJECT_TYPES type
  65. );
  66. STDMETHOD(QueryPagesFor)( DATA_OBJECT_TYPES type );
  67. void* GetDisplayName();
  68. STDMETHOD(GetScopePaneInfo)( SCOPEDATAITEM *pScopeDataItem );
  69. STDMETHOD(GetResultPaneInfo)( RESULTDATAITEM *pResultDataItem );
  70. virtual LPOLESTR GetResultPaneColInfo(int nCol);
  71. virtual HRESULT SetVerbs( IConsoleVerb * pConsoleVerb );
  72. // Notify method will call notification handlers below -- shouldn't need to override.
  73. STDMETHOD( Notify ) (
  74. MMC_NOTIFY_TYPE event
  75. , LPARAM arg
  76. , LPARAM param
  77. , IComponentData * pComponentData
  78. , IComponent * pComponent
  79. , DATA_OBJECT_TYPES type
  80. );
  81. // Notification handlers -- override when you want to intercept.
  82. virtual HRESULT OnActivate(
  83. LPARAM arg
  84. , LPARAM param
  85. , IComponentData * pComponentData
  86. , IComponent * pComponent
  87. , DATA_OBJECT_TYPES type
  88. );
  89. virtual HRESULT OnAddImages(
  90. LPARAM arg
  91. , LPARAM param
  92. , IComponentData * pComponentData
  93. , IComponent * pComponent
  94. , DATA_OBJECT_TYPES type
  95. );
  96. virtual HRESULT OnButtonClick(
  97. LPARAM arg
  98. , LPARAM param
  99. , IComponentData * pComponentData
  100. , IComponent * pComponent
  101. , DATA_OBJECT_TYPES type
  102. );
  103. virtual HRESULT OnClick(
  104. LPARAM arg
  105. , LPARAM param
  106. , IComponentData * pComponentData
  107. , IComponent * pComponent
  108. , DATA_OBJECT_TYPES type
  109. );
  110. virtual HRESULT OnContextHelp(
  111. LPARAM arg
  112. , LPARAM param
  113. , IComponentData * pComponentData
  114. , IComponent * pComponent
  115. , DATA_OBJECT_TYPES type
  116. );
  117. virtual HRESULT OnContextMenu(
  118. LPARAM arg
  119. , LPARAM param
  120. , IComponentData * pComponentData
  121. , IComponent * pComponent
  122. , DATA_OBJECT_TYPES type
  123. );
  124. virtual HRESULT OnDoubleClick(
  125. LPARAM arg
  126. , LPARAM param
  127. , IComponentData * pComponentData
  128. , IComponent * pComponent
  129. , DATA_OBJECT_TYPES type
  130. );
  131. virtual HRESULT OnDelete(
  132. LPARAM arg
  133. , LPARAM param
  134. , IComponentData * pComponentData
  135. , IComponent * pComponent
  136. , DATA_OBJECT_TYPES type
  137. , BOOL fSilent = FALSE
  138. );
  139. virtual HRESULT OnExpand(
  140. LPARAM arg
  141. , LPARAM param
  142. , IComponentData * pComponentData
  143. , IComponent * pComponent
  144. , DATA_OBJECT_TYPES type
  145. );
  146. virtual HRESULT OnHelp(
  147. LPARAM arg
  148. , LPARAM param
  149. , IComponentData * pComponentData
  150. , IComponent * pComponent
  151. , DATA_OBJECT_TYPES type
  152. );
  153. virtual HRESULT OnMenuButtonClick(
  154. LPARAM arg
  155. , LPARAM param
  156. , IComponentData * pComponentData
  157. , IComponent * pComponent
  158. , DATA_OBJECT_TYPES type
  159. );
  160. virtual HRESULT OnMinimized(
  161. LPARAM arg
  162. , LPARAM param
  163. , IComponentData * pComponentData
  164. , IComponent * pComponent
  165. , DATA_OBJECT_TYPES type
  166. );
  167. virtual HRESULT OnPaste(
  168. LPARAM arg
  169. , LPARAM param
  170. , IComponentData * pComponentData
  171. , IComponent * pComponent
  172. , DATA_OBJECT_TYPES type
  173. );
  174. virtual HRESULT OnPropertyChange(
  175. LPARAM arg
  176. , LPARAM param
  177. , IComponentData * pComponentData
  178. , IComponent * pComponent
  179. , DATA_OBJECT_TYPES type
  180. );
  181. virtual HRESULT OnQueryPaste(
  182. LPARAM arg
  183. , LPARAM param
  184. , IComponentData * pComponentData
  185. , IComponent * pComponent
  186. , DATA_OBJECT_TYPES type
  187. );
  188. virtual HRESULT OnRefresh(
  189. LPARAM arg
  190. , LPARAM param
  191. , IComponentData * pComponentData
  192. , IComponent * pComponent
  193. , DATA_OBJECT_TYPES type
  194. );
  195. virtual HRESULT OnRemoveChildren(
  196. LPARAM arg
  197. , LPARAM param
  198. , IComponentData * pComponentData
  199. , IComponent * pComponent
  200. , DATA_OBJECT_TYPES type
  201. );
  202. virtual HRESULT OnRename(
  203. LPARAM arg
  204. , LPARAM param
  205. , IComponentData * pComponentData
  206. , IComponent * pComponent
  207. , DATA_OBJECT_TYPES type
  208. );
  209. virtual HRESULT OnSelect(
  210. LPARAM arg
  211. , LPARAM param
  212. , IComponentData * pComponentData
  213. , IComponent * pComponent
  214. , DATA_OBJECT_TYPES type
  215. );
  216. virtual HRESULT OnShow(
  217. LPARAM arg
  218. , LPARAM param
  219. , IComponentData * pComponentData
  220. , IComponent * pComponent
  221. , DATA_OBJECT_TYPES type
  222. );
  223. virtual HRESULT OnViewChange(
  224. LPARAM arg
  225. , LPARAM param
  226. , IComponentData * pComponentData
  227. , IComponent * pComponent
  228. , DATA_OBJECT_TYPES type
  229. );
  230. // Special notification handler -- saves off the currently selected node.
  231. HRESULT PreOnShow(
  232. LPARAM arg
  233. , LPARAM param
  234. , IComponentData * pComponentData
  235. , IComponent * pComponent
  236. , DATA_OBJECT_TYPES type
  237. );
  238. // Taskpad functionality.
  239. STDMETHOD(TaskNotify)(
  240. IDataObject * pDataObject
  241. , VARIANT * pvarg
  242. , VARIANT * pvparam
  243. );
  244. STDMETHOD(EnumTasks)(
  245. IDataObject * pDataObject
  246. , BSTR szTaskGroup
  247. , IEnumTASK** ppEnumTASK
  248. );
  249. };
  250. #endif // _SNAPIN_NODE_H_