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.

263 lines
14 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. inode.h
  5. Abstract:
  6. This header contains the abstract base node class for
  7. the snapin.
  8. Environment:
  9. WIN32 User Mode
  10. Author:
  11. Darwin Ouyang (t-darouy) 30-Sept-1997
  12. --*/
  13. #ifndef __INODE_H_
  14. #define __INODE_H_
  15. #include "resource.h"
  16. class CFaxDataObject; // forward declaration
  17. class CFaxComponentData;
  18. class CFaxComponent;
  19. // the CInternalNode class provides a framework in which the various
  20. // types of subcontainers in the snapin will implement various methods.
  21. //
  22. // all the subcontainers in the scope and result panes inherit from this class
  23. //
  24. // the global Notify method in CFaxComponent and CFaxComponentData and others
  25. // will delegate to the implementations specified by the children of this class.
  26. // using the cookie as an identifier. (currently a cast to pointer, but can be changed
  27. // to a lookup table when/if a long < pointer type (64-bit world).
  28. //
  29. // this class will supply a default implementation of some of the methods via virtual functions
  30. class CInternalNode
  31. {
  32. public:
  33. // constructor
  34. CInternalNode( CInternalNode * pParent, CFaxComponentData * pCompData )
  35. {
  36. m_pParentINode = pParent;
  37. m_pCompData = pCompData;
  38. }
  39. ~CInternalNode()
  40. {
  41. }
  42. // *********************************************8
  43. // These methods call those defined below.
  44. //
  45. // This moves common code together in the inode class
  46. // and makes the descendents simpler, since they only
  47. // implement the methods they need to override the
  48. // default implementations for.
  49. // IComponentData
  50. virtual HRESULT STDMETHODCALLTYPE ScopeNotify(
  51. /* [in] */ CFaxComponentData * pCompData,
  52. /* [in] */ CFaxDataObject * lpDataObject,
  53. /* [in] */ MMC_NOTIFY_TYPE event,
  54. /* [in] */ LPARAM arg,
  55. /* [in] */ LPARAM param);
  56. virtual HRESULT STDMETHODCALLTYPE ScopeGetDisplayInfo(
  57. /* [in] */ CFaxComponentData * pCompData,
  58. /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem);
  59. virtual HRESULT STDMETHODCALLTYPE ScopeQueryDataObject(
  60. /* [in] */ CFaxComponentData * pCompData,
  61. /* [in] */ MMC_COOKIE cookie,
  62. /* [in] */ DATA_OBJECT_TYPES type,
  63. /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
  64. // IComponent
  65. virtual HRESULT STDMETHODCALLTYPE ResultNotify(
  66. /* [in] */ CFaxComponent * pComp,
  67. /* [in] */ CFaxDataObject * lpDataObject,
  68. /* [in] */ MMC_NOTIFY_TYPE event,
  69. /* [in] */ LPARAM arg,
  70. /* [in] */ LPARAM param);
  71. virtual HRESULT STDMETHODCALLTYPE ResultGetDisplayInfo(
  72. /* [in] */ CFaxComponent * pComp,
  73. /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem);
  74. virtual HRESULT STDMETHODCALLTYPE ResultGetResultViewType(
  75. /* [in] */ CFaxComponent * pComp,
  76. /* [in] */ MMC_COOKIE cookie,
  77. /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
  78. /* [out] */ long __RPC_FAR *pViewOptions);
  79. virtual HRESULT STDMETHODCALLTYPE ResultQueryDataObject(
  80. /* [in] */ CFaxComponent * pComp,
  81. /* [in] */ MMC_COOKIE cookie,
  82. /* [in] */ DATA_OBJECT_TYPES type,
  83. /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
  84. // ***********************************************************
  85. // ExtendPropertySheet event handlers - default implementations
  86. // we need seperate versions for IComponentData and IComponent
  87. // in your code if you want differing behavior
  88. // in the scope and results panes.
  89. //
  90. // You can simply delegate one implementation to the other
  91. // if you want the same behavior in both panes
  92. // IExtendPropertySheet for IComponentData
  93. virtual HRESULT STDMETHODCALLTYPE ComponentDataPropertySheetCreatePropertyPages(
  94. /* [in] */ CFaxComponentData * pCompData,
  95. /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
  96. /* [in] */ LONG_PTR handle,
  97. /* [in] */ CFaxDataObject * lpIDataObject);
  98. virtual HRESULT STDMETHODCALLTYPE ComponentDataPropertySheetQueryPagesFor(
  99. /* [in] */ CFaxComponentData * pCompData,
  100. /* [in] */ CFaxDataObject * lpDataObject);
  101. // IExtendPropertySheet for IComponent
  102. virtual HRESULT STDMETHODCALLTYPE ComponentPropertySheetCreatePropertyPages(
  103. /* [in] */ CFaxComponent * pComp,
  104. /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
  105. /* [in] */ LONG_PTR handle,
  106. /* [in] */ CFaxDataObject * lpIDataObject);
  107. virtual HRESULT STDMETHODCALLTYPE ComponentPropertySheetQueryPagesFor(
  108. /* [in] */ CFaxComponent * pComp,
  109. /* [in] */ CFaxDataObject * lpDataObject);
  110. // ***********************************************************
  111. // ExtendContextMenu event handlers - default implementations
  112. // we need seperate versions for IComponentData and IComponent
  113. // in your code if you want differing behavior
  114. // in the scope and results panes.
  115. //
  116. // You can simply delegate one implementation to the other
  117. // if you want the same behavior in both panes
  118. // IExtendContextMenu for IComponentData
  119. virtual HRESULT STDMETHODCALLTYPE ComponentDataContextMenuAddMenuItems(
  120. /* [in] */ CFaxComponentData * pCompData,
  121. /* [in] */ CFaxDataObject * piDataObject,
  122. /* [in] */ LPCONTEXTMENUCALLBACK piCallback,
  123. /* [out][in] */ long __RPC_FAR *pInsertionAllowed);
  124. virtual HRESULT STDMETHODCALLTYPE ComponentDataContextMenuCommand(
  125. /* [in] */ CFaxComponentData * pCompData,
  126. /* [in] */ long lCommandID,
  127. /* [in] */ CFaxDataObject * piDataObject);
  128. // IExtendContextMenu for IComponent
  129. virtual HRESULT STDMETHODCALLTYPE ComponentContextMenuAddMenuItems(
  130. /* [in] */ CFaxComponent * pComp,
  131. /* [in] */ CFaxDataObject * piDataObject,
  132. /* [in] */ LPCONTEXTMENUCALLBACK piCallback,
  133. /* [out][in] */ long __RPC_FAR *pInsertionAllowed);
  134. virtual HRESULT STDMETHODCALLTYPE ComponentContextMenuCommand(
  135. /* [in] */ CFaxComponent * pComp,
  136. /* [in] */ long lCommandID,
  137. /* [in] */ CFaxDataObject * piDataObject);
  138. // ***********************************************************
  139. // IDataObject event handlers - default implementations
  140. // do nothing
  141. virtual HRESULT DataObjectRegisterFormats();
  142. virtual HRESULT DataObjectGetDataHere( FORMATETC __RPC_FAR *pFormatEtc, IStream * pstm );
  143. // *******************************************
  144. // member functions
  145. //
  146. // these are implemented by the descendents of CInternalNode and define
  147. // the behavior of the node.
  148. // returns the GUID of this node type - MUST BE IMPLEMENTED
  149. virtual const GUID * GetNodeGUID() = 0;
  150. // returns the display name - MUST BE IMPLEMENTED
  151. virtual const LPTSTR GetNodeDisplayName() = 0;
  152. virtual const LPTSTR GetNodeDescription();
  153. // returns the cookie of the node - MUST BE IMPLEMENTED
  154. virtual const LONG_PTR GetCookie() = 0;
  155. // gets the right this pointer - MUST BE IMPLEMENTED
  156. virtual CInternalNode * GetThis() = 0;
  157. // returns the image indices - not required yet, but will be in the future
  158. virtual const int GetNodeDisplayImage() { return IDI_NODEICON; }
  159. virtual const int GetNodeDisplayOpenImage() { return IDI_NODEICON; }
  160. // sets the parent pointer
  161. virtual void SetParentNode( CInternalNode * toSet) { m_pParentINode = toSet; }
  162. // gets the parent pointer
  163. virtual CInternalNode * GetParentNode() { return m_pParentINode; }
  164. // *****************************************************
  165. // scope pane event handlers
  166. // override these as necessary to handle console events
  167. virtual HRESULT ScopeOnExpand(CFaxComponentData * pCompData, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  168. virtual HRESULT ScopeOnDelete(CFaxComponentData * pCompData, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  169. virtual HRESULT ScopeOnRename(CFaxComponentData * pCompData, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  170. virtual HRESULT ScopeOnPropertyChange(CFaxComponentData * pCompData, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  171. // *****************************************************
  172. // result pane event handlers
  173. // override these as necessary to handle console events
  174. virtual HRESULT ResultOnActivate(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  175. virtual HRESULT ResultOnAddImages(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  176. virtual HRESULT ResultOnButtonClick(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  177. virtual HRESULT ResultOnClick(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  178. virtual HRESULT ResultOnDoubleClick(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  179. virtual HRESULT ResultOnDelete(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  180. virtual HRESULT ResultOnExpand(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  181. virtual HRESULT ResultOnMinimized(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  182. virtual HRESULT ResultOnPropertyChange(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  183. virtual HRESULT ResultOnQueryPaste(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  184. virtual HRESULT ResultOnRemoveChildren(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  185. virtual HRESULT ResultOnRename(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  186. virtual HRESULT ResultOnSelect(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  187. virtual HRESULT ResultOnShow(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  188. virtual HRESULT ResultOnViewChange(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM arg, LPARAM param);
  189. // *****************************************************
  190. // Controlbar event handlers
  191. // override these as necessary to handle control bar events
  192. // for IComponent (Result pane nodes)
  193. virtual HRESULT ControlBarOnBtnClick(CFaxComponent* pComp, CFaxDataObject * lpDataObject, LPARAM param );
  194. virtual HRESULT ControlBarOnSelect(CFaxComponent* pComp, LPARAM arg, CFaxDataObject * lpDataObject );
  195. // for IComponentData (Scope pane nodes)
  196. virtual HRESULT ControlBarOnBtnClick2(CFaxComponentData* pCompData, CFaxDataObject * lpDataObject, LPARAM param );
  197. virtual HRESULT ControlBarOnSelect2(CFaxComponentData* pCompData, LPARAM arg, CFaxDataObject * lpDataObject );
  198. public:
  199. CInternalNode * m_pParentINode; // my parent
  200. CFaxComponentData * m_pCompData; // owning IComponentData
  201. };
  202. #endif