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.

131 lines
5.4 KiB

  1. /*======================================================================================//
  2. | Process Control //
  3. | //
  4. |Copyright (c) 1998 Sequent Computer Systems, Incorporated. All rights reserved. //
  5. | //
  6. |File Name: ComponentData.h //
  7. | //
  8. |Description: Class definition for CComponentData, implements IComponentData interface //
  9. | //
  10. |Created: Paul Skoglund 07-1998 //
  11. | //
  12. |Rev History: //
  13. | //
  14. |=======================================================================================*/
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CComponentData: CComponentData handles interactions with the result pane. MMC
  17. // calls the IComponentData 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. #ifndef __COMPONENTDATA_H_
  29. #define __COMPONENTDATA_H_
  30. #include "Globals.h"
  31. class CBaseNode;
  32. class CRootFolder;
  33. class CComponent;
  34. class ATL_NO_VTABLE CComponentData :
  35. public CComObjectRootEx<CComSingleThreadModel>,
  36. public CComCoClass<CComponentData, &CLSID_ComponentData>,
  37. public IComponentData,
  38. public IExtendContextMenu,
  39. public IExtendPropertySheet2,
  40. public IPersistStream,
  41. public ISnapinHelp2
  42. {
  43. public:
  44. CComponentData();
  45. ~CComponentData();
  46. // Note: we can't use DECLARE_REGISTRY_RESOURCEID(IDR_PROCCON)
  47. // because we need to be able to localize some of the strings we
  48. // write into the registry.
  49. static HRESULT STDMETHODCALLTYPE UpdateRegistry (BOOL bRegister) {
  50. return UpdateRegistryHelper(IDR_PROCCON, bRegister);
  51. }
  52. DECLARE_NOT_AGGREGATABLE(CComponentData)
  53. BEGIN_COM_MAP(CComponentData)
  54. COM_INTERFACE_ENTRY(IComponentData)
  55. COM_INTERFACE_ENTRY(IExtendContextMenu)
  56. COM_INTERFACE_ENTRY(IExtendPropertySheet2)
  57. COM_INTERFACE_ENTRY(IPersistStream)
  58. COM_INTERFACE_ENTRY(ISnapinHelp)
  59. COM_INTERFACE_ENTRY(ISnapinHelp2)
  60. END_COM_MAP()
  61. // IComponentData methods
  62. public:
  63. STDMETHOD(CompareObjects)(LPDATAOBJECT ipDataObjectA, LPDATAOBJECT ipDataObjectB);
  64. STDMETHOD(GetDisplayInfo)(LPSCOPEDATAITEM pItem);
  65. STDMETHOD(QueryDataObject)(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT * ppDataObject);
  66. STDMETHOD(Notify)(LPDATAOBJECT ipDataObject, MMC_NOTIFY_TYPE Event, LPARAM Arg, LPARAM Param);
  67. STDMETHOD(CreateComponent)(LPCOMPONENT * ppComponent);
  68. STDMETHOD(Initialize)(LPUNKNOWN pUnknown);
  69. STDMETHOD(Destroy)();
  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. // IPersistStream
  85. public:
  86. STDMETHOD(GetClassID)(CLSID *pClassID);
  87. STDMETHOD(IsDirty)();
  88. STDMETHOD(Load)(IStream *pStm);
  89. STDMETHOD(Save)(IStream *pStm, BOOL fClearDirty);
  90. STDMETHOD(GetSizeMax)(ULARGE_INTEGER *pcbSize);
  91. // ISnapinHelp2
  92. public:
  93. STDMETHOD(GetHelpTopic) (LPOLESTR* lpCompiledHelpFile);
  94. STDMETHOD(GetLinkedTopics) (LPOLESTR* lpCompiledHelpFiles);
  95. private:
  96. IConsoleNameSpace2 *m_ipConsoleNameSpace2; // Pointer to the IConsoleNameSpace2 interface
  97. IConsole2 *m_ipConsole2; // Pointer to the IConsole2 interface
  98. IImageList *m_ipScopeImage; // Pointer to the scope's ImageList interface
  99. HBITMAP m_hbmpSNodes16; // Strip to 16x16 images
  100. HBITMAP m_hbmpSNodes32; // Strip to 32x32 images
  101. CRootFolder *m_ptrRootNode; // newed in constructor...Initialize is too late
  102. // QueryDataObject() can be used prior to Initialize()
  103. BOOL m_Initialized; // TRUE implies Initialize() method returned S_OK
  104. HBITMAP m_hWatermark1; // property sheet watermark
  105. HBITMAP m_hHeader1; // property sheet header
  106. HRESULT OnPropertyChange( BOOL bScopeItem, LPARAM Param );
  107. };
  108. #endif //__COMPONENTDATA_H_