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. // Compont.h : Declaration of the CComponent
  2. #ifndef __COMPONENT_H_
  3. #define __COMPONENT_H_
  4. #include "resource.h" // main symbols
  5. class CScopeNode;
  6. class CComponentData;
  7. /////////////////////////////////////////////////////////////////////////////
  8. // CComponent
  9. class ATL_NO_VTABLE CComponent :
  10. public CComObjectRootEx<CComSingleThreadModel>,
  11. // public CComCoClass<CComponent, &CLSID_Component>,
  12. public IComponent,
  13. public IExtendContextMenu,
  14. public IExtendControlbar,
  15. public IResultOwnerData,
  16. public IExtendPropertySheet2
  17. {
  18. public:
  19. CComponent() : m_pCompData(NULL)
  20. {
  21. }
  22. DECLARE_NOT_AGGREGATABLE(CComponent)
  23. BEGIN_COM_MAP(CComponent)
  24. COM_INTERFACE_ENTRY(IComponent)
  25. COM_INTERFACE_ENTRY(IExtendContextMenu)
  26. COM_INTERFACE_ENTRY(IExtendControlbar)
  27. COM_INTERFACE_ENTRY(IResultOwnerData)
  28. COM_INTERFACE_ENTRY(IExtendPropertySheet2)
  29. END_COM_MAP()
  30. public:
  31. // IComponent
  32. STDMETHOD(Initialize)(LPCONSOLE lpConsole);
  33. STDMETHOD(Notify)(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);
  34. STDMETHOD(Destroy)(MMC_COOKIE cookie);
  35. STDMETHOD(GetResultViewType)(MMC_COOKIE cookie, LPOLESTR* ppViewType, long* pViewOptions);
  36. STDMETHOD(QueryDataObject)(MMC_COOKIE cookie, DATA_OBJECT_TYPES type,
  37. LPDATAOBJECT* ppDataObject);
  38. STDMETHOD(GetDisplayInfo)(RESULTDATAITEM* pResultDataItem);
  39. STDMETHOD(CompareObjects)(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB);
  40. // IExtendContextMenu
  41. STDMETHOD(AddMenuItems)(LPDATAOBJECT pDataObject, LPCONTEXTMENUCALLBACK pCallback, long* plAllowed);
  42. STDMETHOD(Command)(long lCommand, LPDATAOBJECT pDataObject);
  43. // IExtendPropertySheet2 methods
  44. STDMETHOD(QueryPagesFor)(LPDATAOBJECT lpDataObject);
  45. STDMETHOD(CreatePropertyPages)(LPPROPERTYSHEETCALLBACK lpProvider,LONG_PTR handle, LPDATAOBJECT lpIDataObject);
  46. STDMETHOD(GetWatermarks)(LPDATAOBJECT lpIDataObject, HBITMAP* lphWatermark,
  47. HBITMAP* lphHeader, HPALETTE* lphPalette, BOOL* bStretch);
  48. // IExtendControlbar
  49. STDMETHOD(SetControlbar)(LPCONTROLBAR pControlbar);
  50. STDMETHOD(ControlbarNotify)(MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);
  51. // IResultOwnerData
  52. STDMETHOD(FindItem)(LPRESULTFINDINFO pFindInfo, int* pnFoundIndex) { return E_NOTIMPL; }
  53. STDMETHOD(CacheHint)(int nStartIndex, int nEndIndex) { return E_NOTIMPL; }
  54. STDMETHOD(SortItems)(int nColumn, DWORD dwSortOptions, LPARAM lUserParam);
  55. public:
  56. void SetComponentData(CComponentData* pCompData)
  57. {
  58. ASSERT(pCompData != NULL);
  59. m_pCompData = pCompData;
  60. }
  61. void ClearRowItems();
  62. void AddRowItems(RowItemVector& vRowItems);
  63. IHeaderCtrl* GetHeaderCtrl() { return m_spHeaderCtrl; }
  64. IConsole2* GetConsole() { return m_spConsole; }
  65. IToolbar* GetToolbar() { return m_spToolbar; }
  66. private:
  67. IConsole2Ptr m_spConsole;
  68. IResultDataPtr m_spResultData;
  69. IHeaderCtrlPtr m_spHeaderCtrl;
  70. IControlbarPtr m_spControlbar;
  71. IToolbarPtr m_spToolbar;
  72. CComponentData* m_pCompData;
  73. RowItemVector m_vRowItems;
  74. CComPtr<CScopeNode> m_spCurScopeNode;
  75. };
  76. #endif //__COMPONENT_H_