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.

154 lines
5.8 KiB

  1. /*++
  2. Copyright (C) 1997-1999 Microsoft Corporation
  3. Module Name:
  4. cmponent.h
  5. Abstract:
  6. CComponent handles interactions with the result pane.
  7. MMC calls the IComponent interfaces.
  8. --*/
  9. #ifndef __COMPONENT_H_
  10. #define __COMPONENT_H_
  11. #include "Globals.h"
  12. #include "smlogres.h" // Resource symbols
  13. #include "compData.h"
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CComponent
  16. #ifdef UNICODE
  17. #define PROPSHEETPAGE_V3 PROPSHEETPAGEW_V3
  18. #else
  19. #define PROPSHEETPAGE_V3 PROPSHEETPAGEA_V3
  20. #endif
  21. class CSmPropertyPage;
  22. class CSmLogQuery;
  23. class CSmNode;
  24. class ATL_NO_VTABLE CComponent :
  25. public CComObjectRootEx<CComSingleThreadModel>,
  26. public CComCoClass<CComponent, &CLSID_Component>,
  27. public IComponent,
  28. public IExtendContextMenu,
  29. public IExtendControlbar,
  30. public IExtendPropertySheet
  31. {
  32. public:
  33. CComponent();
  34. virtual ~CComponent();
  35. DECLARE_REGISTRY_RESOURCEID(IDR_COMPONENT)
  36. DECLARE_NOT_AGGREGATABLE(CComponent)
  37. BEGIN_COM_MAP(CComponent)
  38. COM_INTERFACE_ENTRY(IComponent)
  39. COM_INTERFACE_ENTRY(IExtendContextMenu)
  40. COM_INTERFACE_ENTRY(IExtendControlbar)
  41. COM_INTERFACE_ENTRY(IExtendPropertySheet)
  42. END_COM_MAP()
  43. // IComponent interface methods
  44. STDMETHOD(Initialize)(LPCONSOLE lpConsole);
  45. STDMETHOD(Notify)(LPDATAOBJECT lpDataObject, MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);
  46. STDMETHOD(Destroy)(MMC_COOKIE cookie);
  47. STDMETHOD(GetResultViewType)(MMC_COOKIE cookie, LPOLESTR* ppViewType, long* pViewOptions);
  48. STDMETHOD(QueryDataObject)(MMC_COOKIE cookie, DATA_OBJECT_TYPES type, LPDATAOBJECT* ppDataObject);
  49. STDMETHOD(GetDisplayInfo)(RESULTDATAITEM* pResultDataItem);
  50. STDMETHOD(CompareObjects)(LPDATAOBJECT lpDataObjectA, LPDATAOBJECT lpDataObjectB);
  51. // IExtendContextMenu
  52. STDMETHOD(AddMenuItems)( LPDATAOBJECT pDataObject,
  53. LPCONTEXTMENUCALLBACK pCallbackUnknown,
  54. long *pInsertionAllowed
  55. );
  56. STDMETHOD(Command)(long nCommandID, LPDATAOBJECT pDataObject);
  57. // IExtendControlBar
  58. STDMETHOD(SetControlbar)(LPCONTROLBAR pControlbar);
  59. STDMETHOD(ControlbarNotify)(MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param);
  60. // IExtendPropertySheet
  61. STDMETHOD(CreatePropertyPages)( LPPROPERTYSHEETCALLBACK lpProvider,
  62. LONG_PTR handle,
  63. LPDATAOBJECT lpIDataObject
  64. );
  65. STDMETHOD(QueryPagesFor)(LPDATAOBJECT lpDataObject);
  66. // Other public methods
  67. HRESULT SetIComponentData(CComponentData* pData);
  68. private:
  69. enum eToolbarType {
  70. eLog = 1,
  71. eAlert = 2
  72. };
  73. HRESULT OnPaste(LPDATAOBJECT pDataObject, LPARAM arg, LPARAM Param);
  74. HRESULT OnQueryPaste(LPDATAOBJECT pDataObject, LPARAM arg, LPARAM Param);
  75. HRESULT OnShow(LPDATAOBJECT pDataObject, LPARAM arg, LPARAM Param);
  76. HRESULT OnSelect(LPDATAOBJECT pDataObject, LPARAM arg, LPARAM Param);
  77. HRESULT OnAddImages(LPDATAOBJECT pDataObject, LPARAM arg, LPARAM Param);
  78. HRESULT OnRefresh(LPDATAOBJECT pDataObject);
  79. HRESULT OnDelete(LPDATAOBJECT pDataObject, LPARAM arg, LPARAM Param);
  80. HRESULT OnDoubleClick(ULONG ulRecNo,LPDATAOBJECT pDataObject);
  81. HRESULT OnDisplayHelp( LPDATAOBJECT pDataObject );
  82. HRESULT OnViewChange(LPDATAOBJECT pDataObject, LPARAM arg, LPARAM Param);
  83. HRESULT StartLogQuery(LPDATAOBJECT pDataObject);
  84. HRESULT StopLogQuery(LPDATAOBJECT pDataObject, BOOL bWarnOnRestartCancel=TRUE);
  85. HRESULT SaveLogQueryAs(LPDATAOBJECT pDataObject);
  86. HRESULT OnPropertyChange( LPARAM Param );
  87. HRESULT HandleExtToolbars( bool bDeselectAll, LPARAM arg, LPARAM Param );
  88. HRESULT PopulateResultPane ( MMC_COOKIE cookie );
  89. HRESULT RefreshResultPane ( LPDATAOBJECT pDataObject );
  90. HRESULT AddPropertyPage ( LPPROPERTYSHEETCALLBACK, CSmPropertyPage*& );
  91. HRESULT LoadLogToolbarStrings ( MMCBUTTON * Buttons );
  92. HRESULT LoadAlertToolbarStrings ( MMCBUTTON * Buttons );
  93. HRESULT _InvokePropertySheet(ULONG ulRecNo,LPDATAOBJECT pDataObject);
  94. HRESULT InvokePropertySheet(
  95. IPropertySheetProvider *pPrshtProvider,
  96. LPCWSTR wszTitle,
  97. LONG lCookie,
  98. LPDATAOBJECT pDataObject,
  99. IExtendPropertySheet *pPrimary,
  100. USHORT usStartingPage);
  101. LPCONSOLE m_ipConsole; // MMC interface to console
  102. IHeaderCtrl* m_ipHeaderCtrl; // MMC interface to header control
  103. IResultData* m_ipResultData; // MMC interface to result data
  104. IConsoleVerb* m_ipConsoleVerb; // MMC interface to console verb
  105. LPIMAGELIST m_ipImageResult; // MMC interface to result pane images
  106. CComponentData* m_ipCompData; // Parent scope pane object
  107. LPTOOLBAR m_ipToolbarLogger;// Toolbar for result pane view loggers
  108. LPTOOLBAR m_ipToolbarAlerts; // Toolbar for result pane view alerts
  109. LPTOOLBAR m_ipToolbarAttached; // Currently attached toolbar
  110. LPCONTROLBAR m_ipControlbar; // Control bar to hold the tool bars
  111. CSmNode* m_pViewedNode;
  112. HINSTANCE m_hModule; // resource handle for strings
  113. // Store string data (reference) locally until per-line redraw is complete.
  114. CString m_strDisplayInfoName;
  115. CString m_strDisplayInfoComment;
  116. CString m_strDisplayInfoLogFileType;
  117. CString m_strDisplayInfoLogFileName;
  118. CString m_strDisplayInfoQueryType;
  119. CString m_strDisplayInfoDesc;
  120. };
  121. #endif //__COMPONENT_H_