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.

100 lines
3.1 KiB

  1. // stdcdata.h : Declaration of CComponentData
  2. #ifndef __STDCDATA_H_INCLUDED__
  3. #define __STDCDATA_H_INCLUDED__
  4. #include "stdcooki.h"
  5. class CComponentData :
  6. public IComponentData,
  7. public CComObjectRoot,
  8. public ISnapinHelp2
  9. {
  10. BEGIN_COM_MAP(CComponentData)
  11. COM_INTERFACE_ENTRY(IComponentData)
  12. COM_INTERFACE_ENTRY(ISnapinHelp2)
  13. // no taskpads COM_INTERFACE_ENTRY(IComponentData2)
  14. END_COM_MAP()
  15. public:
  16. CComponentData();
  17. ~CComponentData();
  18. // IComponentData
  19. // Note: QueryDataObject and CreateComponent must be defined by subclass
  20. STDMETHOD(Initialize)(LPUNKNOWN pUnknown);
  21. STDMETHOD(CreateComponent)(LPCOMPONENT* ppComponent) = 0;
  22. STDMETHOD(Notify)(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);
  23. STDMETHOD(Destroy)();
  24. STDMETHOD(QueryDataObject)(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT* ppDataObject) = 0;
  25. STDMETHOD(GetDisplayInfo)(SCOPEDATAITEM* pScopeDataItem);
  26. STDMETHOD(CompareObjects)(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB);
  27. /* no taskpads
  28. // IComponentData2
  29. STDMETHOD(ExpandAndGet)(HSCOPEITEM hsiStartFrom,
  30. LPDATAOBJECT pDataObject,
  31. HSCOPEITEM* phScopeItem );
  32. */
  33. // Other stuff
  34. // needed for Initialize()
  35. virtual HRESULT LoadIcons(LPIMAGELIST pImageList, BOOL fLoadLargeIcons) = 0;
  36. // needed for Notify()
  37. virtual HRESULT OnNotifyPreload(LPDATAOBJECT lpDataObject, HSCOPEITEM hRootScopeItem);
  38. virtual HRESULT OnNotifyExpand(LPDATAOBJECT lpDataObject, BOOL bExpanding, HSCOPEITEM hParent);
  39. virtual HRESULT OnNotifyRename(LPDATAOBJECT lpDataObject, LPARAM arg, LPARAM param);
  40. virtual HRESULT OnNotifyDelete(LPDATAOBJECT lpDataObject); // user hit DEL key
  41. virtual HRESULT OnNotifyRelease(LPDATAOBJECT lpDataObject, HSCOPEITEM hItem); // parent node released
  42. virtual HRESULT OnPropertyChange( LPARAM param );
  43. // needed for GetDisplayInfo(), must be defined by subclass
  44. virtual BSTR QueryResultColumnText(CCookie& basecookieref, int nCol ) = 0;
  45. virtual int QueryImage(CCookie& basecookieref, BOOL fOpenImage) = 0;
  46. virtual CCookie& QueryBaseRootCookie() = 0;
  47. inline CCookie* ActiveBaseCookie( CCookie* pcookie )
  48. {
  49. return (NULL == pcookie) ? &QueryBaseRootCookie() : pcookie;
  50. }
  51. INT DoPopup( INT nResourceID,
  52. DWORD dwErrorNumber = 0,
  53. LPCTSTR pszInsertionString = NULL,
  54. UINT fuStyle = MB_OK | MB_ICONSTOP );
  55. LPCONSOLE QueryConsole()
  56. {
  57. ASSERT( NULL != m_pConsole );
  58. return m_pConsole;
  59. }
  60. LPCONSOLENAMESPACE QueryConsoleNameSpace()
  61. {
  62. ASSERT( NULL != m_pConsoleNameSpace );
  63. return m_pConsoleNameSpace;
  64. }
  65. void SetHtmlHelpFileName (const CString &fileName)
  66. {
  67. m_szHtmlHelpFileName = fileName;
  68. }
  69. const CString GetHtmlHelpFileName () const
  70. {
  71. return m_szHtmlHelpFileName;
  72. }
  73. HRESULT GetHtmlHelpFilePath( CString& strref ) const;
  74. // ISnapinHelp2 interface members
  75. STDMETHOD(GetHelpTopic)(LPOLESTR* lpCompiledHelpFile);
  76. STDMETHOD(GetLinkedTopics)(LPOLESTR* lpCompiledHelpFiles);
  77. protected:
  78. CString m_szHtmlHelpFileName;
  79. LPCONSOLE m_pConsole;
  80. LPCONSOLENAMESPACE m_pConsoleNameSpace; // My interface pointer to the namespace
  81. };
  82. #endif // ~__STDCDATA_H_INCLUDED__