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.

92 lines
3.1 KiB

  1. // stdcmpnt.h : Declaration of CComponent
  2. #ifndef __STDCMPNT_H_INCLUDED__
  3. #define __STDCMPNT_H_INCLUDED__
  4. #include "stdcooki.h" // CCookie
  5. #include "stdcdata.h" // CComponentData
  6. class CComponent :
  7. public CComObjectRoot,
  8. public IComponent
  9. {
  10. public:
  11. CComponent();
  12. virtual ~CComponent();
  13. BEGIN_COM_MAP(CComponent)
  14. COM_INTERFACE_ENTRY(IComponent)
  15. END_COM_MAP()
  16. // IComponent
  17. STDMETHOD(Initialize)(LPCONSOLE lpConsole);
  18. STDMETHOD(Notify)(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);
  19. STDMETHOD(Destroy)(MMC_COOKIE cookie);
  20. STDMETHOD(QueryDataObject)(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT* ppDataObject);
  21. STDMETHOD(GetResultViewType)(MMC_COOKIE cookie, LPOLESTR* ppViewType, long* pViewOptions);
  22. STDMETHOD(GetDisplayInfo)(RESULTDATAITEM* pResultDataItem);
  23. STDMETHOD(CompareObjects)(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB);
  24. // support methods for IComponent
  25. virtual HRESULT ReleaseAll();
  26. virtual HRESULT OnPropertyChange( LPARAM param );
  27. virtual HRESULT OnViewChange( LPDATAOBJECT lpDataObject, LPARAM data, LPARAM hint );
  28. virtual HRESULT OnNotifyRefresh( LPDATAOBJECT lpDataObject );
  29. virtual HRESULT OnNotifyDelete( LPDATAOBJECT lpDataObject );
  30. virtual HRESULT OnNotifyColumnClick( LPDATAOBJECT lpDataObject, LPARAM iColumn, LPARAM uFlags );
  31. virtual HRESULT OnNotifySelect( LPDATAOBJECT lpDataObject, BOOL fSelected );
  32. virtual HRESULT OnNotifyActivate( LPDATAOBJECT lpDataObject, BOOL fActivated );
  33. virtual HRESULT OnNotifyAddImages( LPDATAOBJECT lpDataObject, LPIMAGELIST lpImageList, HSCOPEITEM hSelectedItem );
  34. virtual HRESULT OnNotifyClick( LPDATAOBJECT lpDataObject );
  35. virtual HRESULT OnNotifyDblClick( LPDATAOBJECT lpDataObject );
  36. virtual HRESULT Show(CCookie* pcookie, LPARAM arg, HSCOPEITEM hScopeItem) = 0;
  37. virtual HRESULT OnNotifyContextHelp (LPDATAOBJECT pDataObject);
  38. virtual HRESULT OnNotifySnapinHelp (LPDATAOBJECT pDataObject);
  39. HRESULT ShowHelpTopic( LPCWSTR lpcwszHelpTopic );
  40. HRESULT InsertResultCookies( CCookie& refparentcookie );
  41. void SetComponentDataPtr(CComponentData* pComponentData);
  42. CComponentData& QueryBaseComponentDataRef()
  43. {
  44. ASSERT( NULL != m_pComponentData );
  45. return *m_pComponentData;
  46. }
  47. inline CCookie& QueryBaseRootCookie()
  48. {
  49. return QueryBaseComponentDataRef().QueryBaseRootCookie();
  50. }
  51. inline CCookie* ActiveBaseCookie( CCookie* pcookie )
  52. {
  53. return QueryBaseComponentDataRef().ActiveBaseCookie( pcookie );
  54. }
  55. inline INT DoPopup( INT nResourceID,
  56. DWORD dwErrorNumber = 0,
  57. LPCTSTR pszInsertionString = NULL,
  58. UINT fuStyle = MB_OK | MB_ICONSTOP )
  59. {
  60. return QueryBaseComponentDataRef().DoPopup( nResourceID,
  61. dwErrorNumber,
  62. pszInsertionString,
  63. fuStyle );
  64. }
  65. HRESULT LoadColumnsFromArrays( INT objecttype );
  66. protected:
  67. LPCONSOLE m_pConsole;
  68. LPCONSOLEVERB m_pConsoleVerb;
  69. LPHEADERCTRL m_pHeader;
  70. LPRESULTDATA m_pResultData;
  71. LPCONSOLENAMESPACE m_pConsoleNameSpace;
  72. LPIMAGELIST m_pRsltImageList;
  73. private:
  74. CComponentData* m_pComponentData;
  75. };
  76. #endif // ~__STDCMPNT_H_INCLUDED__