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.

104 lines
3.6 KiB

  1. #ifndef _SAMPCOMP_H_
  2. #define _SAMPCOMP_H_
  3. #include <mmc.h>
  4. class CComponent : public IComponent, IExtendPropertySheet2, IExtendControlbar, IExtendContextMenu
  5. {
  6. private:
  7. ULONG m_cref;
  8. IConsole* m_ipConsole;
  9. IControlbar* m_ipControlBar;
  10. IToolbar* m_ipToolbar;
  11. IDisplayHelp* m_ipDisplayHelp;
  12. HBITMAP m_hBMapSm;
  13. HBITMAP m_hBMapLg;
  14. class CComponentData *m_pComponentData;
  15. public:
  16. CComponent( CComponentData *parent );
  17. ~CComponent();
  18. ///////////////////////////////
  19. // Interface IUnknown
  20. ///////////////////////////////
  21. STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
  22. STDMETHODIMP_(ULONG) AddRef();
  23. STDMETHODIMP_(ULONG) Release();
  24. ///////////////////////////////
  25. // Interface IComponent
  26. ///////////////////////////////
  27. virtual HRESULT STDMETHODCALLTYPE Initialize( /* [in] */ LPCONSOLE lpConsole );
  28. virtual HRESULT STDMETHODCALLTYPE Notify(
  29. /* [in] */ LPDATAOBJECT lpDataObject,
  30. /* [in] */ MMC_NOTIFY_TYPE event,
  31. /* [in] */ LPARAM arg,
  32. /* [in] */ LPARAM param );
  33. virtual HRESULT STDMETHODCALLTYPE Destroy(/* [in] */ MMC_COOKIE cookie );
  34. virtual HRESULT STDMETHODCALLTYPE QueryDataObject(
  35. /* [in] */ MMC_COOKIE cookie,
  36. /* [in] */ DATA_OBJECT_TYPES type,
  37. /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject );
  38. virtual HRESULT STDMETHODCALLTYPE GetResultViewType(
  39. /* [in] */ MMC_COOKIE cookie,
  40. /* [out] */ LPOLESTR __RPC_FAR *ppViewType,
  41. /* [out] */ long __RPC_FAR *pViewOptions );
  42. virtual HRESULT STDMETHODCALLTYPE GetDisplayInfo( /* [out][in] */ RESULTDATAITEM __RPC_FAR *pResultDataItem );
  43. virtual HRESULT STDMETHODCALLTYPE CompareObjects(
  44. /* [in] */ LPDATAOBJECT lpDataObjectA,
  45. /* [in] */ LPDATAOBJECT lpDataObjectB);
  46. //////////////////////////////////
  47. // Interface IExtendPropertySheet2
  48. //////////////////////////////////
  49. virtual HRESULT STDMETHODCALLTYPE CreatePropertyPages(
  50. /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
  51. /* [in] */ LONG_PTR handle,
  52. /* [in] */ LPDATAOBJECT lpIDataObject);
  53. virtual HRESULT STDMETHODCALLTYPE QueryPagesFor( /* [in] */ LPDATAOBJECT lpDataObject );
  54. virtual HRESULT STDMETHODCALLTYPE GetWatermarks(
  55. /* [in] */ LPDATAOBJECT lpIDataObject,
  56. /* [out] */ HBITMAP __RPC_FAR *lphWatermark,
  57. /* [out] */ HBITMAP __RPC_FAR *lphHeader,
  58. /* [out] */ HPALETTE __RPC_FAR *lphPalette,
  59. /* [out] */ BOOL __RPC_FAR *bStretch );
  60. ///////////////////////////////
  61. // Interface IExtendControlBar
  62. ///////////////////////////////
  63. virtual HRESULT STDMETHODCALLTYPE SetControlbar( /* [in] */ LPCONTROLBAR pControlbar );
  64. virtual HRESULT STDMETHODCALLTYPE ControlbarNotify(
  65. /* [in] */ MMC_NOTIFY_TYPE event,
  66. /* [in] */ LPARAM arg,
  67. /* [in] */ LPARAM param );
  68. ///////////////////////////////
  69. // Interface IExtendContextMenu
  70. ///////////////////////////////
  71. virtual HRESULT STDMETHODCALLTYPE AddMenuItems(
  72. /* [in] */ LPDATAOBJECT piDataObject,
  73. /* [in] */ LPCONTEXTMENUCALLBACK piCallback,
  74. /* [out][in] */ long __RPC_FAR *pInsertionAllowed );
  75. virtual HRESULT STDMETHODCALLTYPE Command(
  76. /* [in] */ long lCommandID,
  77. /* [in] */ LPDATAOBJECT piDataObject );
  78. public:
  79. IToolbar *getToolbar() { return m_ipToolbar; }
  80. };
  81. #endif _SAMPCOMP_H_