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.

93 lines
3.3 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. // ISSUE-2002/03/28-JonN We need to handle NULL better
  45. ASSERT( NULL != m_pComponentData );
  46. return *m_pComponentData;
  47. }
  48. inline CCookie& QueryBaseRootCookie()
  49. {
  50. return QueryBaseComponentDataRef().QueryBaseRootCookie();
  51. }
  52. inline CCookie* ActiveBaseCookie( CCookie* pcookie )
  53. {
  54. return QueryBaseComponentDataRef().ActiveBaseCookie( pcookie );
  55. }
  56. inline INT DoPopup( INT nResourceID,
  57. DWORD dwErrorNumber = 0,
  58. LPCTSTR pszInsertionString = NULL,
  59. UINT fuStyle = MB_OK | MB_ICONSTOP )
  60. {
  61. return QueryBaseComponentDataRef().DoPopup( nResourceID,
  62. dwErrorNumber,
  63. pszInsertionString,
  64. fuStyle );
  65. }
  66. HRESULT LoadColumnsFromArrays( INT objecttype );
  67. protected:
  68. LPCONSOLE m_pConsole;
  69. LPCONSOLEVERB m_pConsoleVerb;
  70. LPHEADERCTRL m_pHeader;
  71. LPRESULTDATA m_pResultData;
  72. LPCONSOLENAMESPACE m_pConsoleNameSpace;
  73. LPIMAGELIST m_pRsltImageList;
  74. private:
  75. CComponentData* m_pComponentData;
  76. };
  77. #endif // ~__STDCMPNT_H_INCLUDED__