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.

101 lines
3.2 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. // ISSUE-2002/03/05-JonN should be type LPOLESTR
  45. virtual BSTR QueryResultColumnText(CCookie& basecookieref, int nCol ) = 0;
  46. virtual int QueryImage(CCookie& basecookieref, BOOL fOpenImage) = 0;
  47. virtual CCookie& QueryBaseRootCookie() = 0;
  48. inline CCookie* ActiveBaseCookie( CCookie* pcookie )
  49. {
  50. return (NULL == pcookie) ? &QueryBaseRootCookie() : pcookie;
  51. }
  52. INT DoPopup( INT nResourceID,
  53. DWORD dwErrorNumber = 0,
  54. LPCTSTR pszInsertionString = NULL,
  55. UINT fuStyle = MB_OK | MB_ICONSTOP );
  56. LPCONSOLE QueryConsole()
  57. {
  58. ASSERT( NULL != m_pConsole );
  59. return m_pConsole;
  60. }
  61. LPCONSOLENAMESPACE QueryConsoleNameSpace()
  62. {
  63. ASSERT( NULL != m_pConsoleNameSpace );
  64. return m_pConsoleNameSpace;
  65. }
  66. void SetHtmlHelpFileName (const CString &fileName)
  67. {
  68. m_szHtmlHelpFileName = fileName;
  69. }
  70. const CString GetHtmlHelpFileName () const
  71. {
  72. return m_szHtmlHelpFileName;
  73. }
  74. HRESULT GetHtmlHelpFilePath( CString& strref ) const;
  75. // ISnapinHelp2 interface members
  76. STDMETHOD(GetHelpTopic)(LPOLESTR* lpCompiledHelpFile);
  77. STDMETHOD(GetLinkedTopics)(LPOLESTR* lpCompiledHelpFiles);
  78. protected:
  79. CString m_szHtmlHelpFileName;
  80. LPCONSOLE m_pConsole;
  81. LPCONSOLENAMESPACE m_pConsoleNameSpace; // My interface pointer to the namespace
  82. };
  83. #endif // ~__STDCDATA_H_INCLUDED__