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.

133 lines
5.2 KiB

  1. /*======================================================================================//
  2. | Process Control //
  3. | //
  4. |Copyright (c) 1998 Sequent Computer Systems, Incorporated. All rights reserved. //
  5. | //
  6. |File Name: Component.h //
  7. | //
  8. |Description: Class definition for CComponent, implements IComponent interface //
  9. | //
  10. |Created: Paul Skoglund 07-1998 //
  11. | //
  12. |Rev History: //
  13. | //
  14. |=======================================================================================*/
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CComponent: CComponent handles interactions with the result pane. MMC
  17. // calls the IComponent interfaces.
  18. //
  19. // This is a part of the MMC SDK.
  20. // Copyright (C) 1997 Microsoft Corporation
  21. // All rights reserved.
  22. //
  23. // This source code is only intended as a supplement to the
  24. // MMC SDK Reference and related
  25. // electronic documentation provided with the library.
  26. // See these sources for detailed information regarding the
  27. // MMC Library product.
  28. //
  29. #ifndef __COMPONENT_H_
  30. #define __COMPONENT_H_
  31. #include "Globals.h"
  32. #include "ComponentData.h"
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CComponent
  35. class ATL_NO_VTABLE CComponent :
  36. public CComObjectRootEx<CComSingleThreadModel>,
  37. public IComponent,
  38. #ifdef USE_IRESULTDATACOMPARE
  39. public IResultDataCompare,
  40. #endif
  41. public IExtendContextMenu,
  42. public IExtendPropertySheet2
  43. {
  44. public:
  45. CComponent();
  46. ~CComponent();
  47. DECLARE_NOT_AGGREGATABLE(CComponent)
  48. BEGIN_COM_MAP(CComponent)
  49. COM_INTERFACE_ENTRY(IComponent)
  50. #ifdef USE_IRESULTDATACOMPARE
  51. COM_INTERFACE_ENTRY(IResultDataCompare)
  52. #endif
  53. COM_INTERFACE_ENTRY(IExtendContextMenu)
  54. COM_INTERFACE_ENTRY(IExtendPropertySheet2)
  55. END_COM_MAP()
  56. // IComponent interface methods
  57. public:
  58. STDMETHOD(Initialize)(LPCONSOLE ipConsole);
  59. STDMETHOD(Notify)(LPDATAOBJECT ipDataObject, MMC_NOTIFY_TYPE Event, LPARAM Arg, LPARAM Param);
  60. STDMETHOD(Destroy)(MMC_COOKIE cookie);
  61. STDMETHOD(GetResultViewType)(MMC_COOKIE cookie, LPOLESTR* ppViewType, long* pViewOptions);
  62. STDMETHOD(QueryDataObject)(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT* ppDataObject);
  63. STDMETHOD(GetDisplayInfo)(RESULTDATAITEM* pResultDataItem);
  64. STDMETHOD(CompareObjects)(LPDATAOBJECT ipDataObjectA, LPDATAOBJECT ipDataObjectB);
  65. #ifdef USE_IRESULTDATACOMPARE
  66. // IResultDataCompare
  67. public:
  68. STDMETHOD(Compare) (LPARAM lUserParam, MMC_COOKIE cookieA, MMC_COOKIE cookieB, int * pnResult );
  69. #endif
  70. // IExtendContextMenu
  71. public:
  72. STDMETHOD(AddMenuItems)( LPDATAOBJECT ipDataObject,
  73. LPCONTEXTMENUCALLBACK pCallback,
  74. long *pInsertionAllowed);
  75. STDMETHOD(Command)(long nCommandID, LPDATAOBJECT ipDataObject);
  76. // IExtendPropertySheet2
  77. public:
  78. STDMETHOD(CreatePropertyPages)( LPPROPERTYSHEETCALLBACK lpProvider,
  79. LONG_PTR handle,
  80. LPDATAOBJECT ipDataObject
  81. );
  82. STDMETHOD(QueryPagesFor)(LPDATAOBJECT ipDataObject);
  83. STDMETHOD(GetWatermarks)(LPDATAOBJECT ipDataObject, HBITMAP * lphWatermark, HBITMAP * lphHeader, HPALETTE * lphPalette, BOOL* bStretch);
  84. public:
  85. void SetComponentData(CComponentData* pCompData);
  86. private:
  87. IConsole2* m_ipConsole2; // MMC interface to console
  88. IHeaderCtrl2* m_ipHeaderCtrl2; // MMC interface to header control
  89. IResultData* m_ipResultData; // MMC interface to result data
  90. IConsoleVerb* m_ipConsoleVerb; // MMC interface to console verb
  91. IConsoleNameSpace2* m_ipConsoleNameSpace2; // MMC interface to console name space
  92. IDisplayHelp* m_ipDisplayHelp; // MMC interface to display help
  93. CComponentData* m_pCompData; // Parent scope pane object
  94. HBITMAP m_hbmp16x16;
  95. HBITMAP m_hbmp32x32;
  96. HSCOPEITEM m_hSelectedScope; // handle to selected scopeitem or null if nothing selected...
  97. BOOL m_bInitializedAndNotDestroyed;
  98. private:
  99. HRESULT OnShow(LPDATAOBJECT ipDataObject, BOOL bSelected, HSCOPEITEM hID);
  100. HRESULT OnSelect(LPDATAOBJECT ipDataObject, LPARAM Arg, LPARAM Param);
  101. HRESULT OnAddImages(LPDATAOBJECT ipDataObject, IImageList *ipImageList, HSCOPEITEM hID);
  102. HRESULT OnRefresh(LPDATAOBJECT ipDataObject);
  103. HRESULT OnPropertyChange( BOOL bScopeItem, LPARAM Param );
  104. };
  105. #endif //__COMPONENT_H_