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.

114 lines
3.2 KiB

  1. #if !defined(AFX_RESULTSPANEITEM_H__7D4A6869_9056_11D2_BD45_0000F87A3912__INCLUDED_)
  2. #define AFX_RESULTSPANEITEM_H__7D4A6869_9056_11D2_BD45_0000F87A3912__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // ResultsPaneItem.h : header file
  7. //
  8. #include <mmc.h>
  9. class CResultsPaneView;
  10. class CResultsPane;
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CResultsPaneItem command target
  13. class CResultsPaneItem : public CCmdTarget
  14. {
  15. DECLARE_DYNCREATE(CResultsPaneItem)
  16. // Construction/Destruction
  17. public:
  18. CResultsPaneItem();
  19. virtual ~CResultsPaneItem();
  20. // Create/Destroy
  21. public:
  22. virtual bool Create(CResultsPaneView* pOwnerView, const CStringArray& saNames, CUIntArray& uiaIconResIds, int iIconIndex);
  23. virtual bool Create(CResultsPaneView* pOwnerView);
  24. virtual void Destroy();
  25. // Owner ResultsView Members
  26. public:
  27. CResultsPaneView* GetOwnerResultsView();
  28. void SetOwnerResultsView(CResultsPaneView* pView);
  29. protected:
  30. CResultsPaneView* m_pOwnerResultsView;
  31. // Display Names Members
  32. public:
  33. virtual CString GetDisplayName(int nIndex = 0);
  34. int GetDisplayNameCount() { return (int)m_saDisplayNames.GetSize(); }
  35. void SetDisplayName(int nIndex, const CString& sName);
  36. void SetDisplayNames(const CStringArray& saNames);
  37. protected:
  38. CStringArray m_saDisplayNames;
  39. // MMC-Related Members
  40. public:
  41. virtual bool InsertItem(CResultsPane* pPane, int iIndex, bool bResizeColumns = false);
  42. virtual bool SetItem(CResultsPane* pPane);
  43. virtual int CompareItem(CResultsPaneItem* pItem, int iColumn = 0);
  44. virtual bool RemoveItem(CResultsPane* pPane);
  45. HRESULTITEM GetItemHandle();
  46. virtual LPGUID GetItemType() { return m_lpguidItemType; }
  47. virtual HRESULT WriteExtensionData(LPSTREAM pStream);
  48. protected:
  49. static LPGUID m_lpguidItemType;
  50. HRESULTITEM m_hResultItem;
  51. // Icon Members
  52. public:
  53. void SetIconIndex(int iIndex);
  54. int GetIconIndex();
  55. UINT GetIconId();
  56. void SetIconIds(CUIntArray& uiaIconResIds);
  57. protected:
  58. CUIntArray m_IconResIds;
  59. int m_iCurrentIconIndex;
  60. // MMC Notify Handlers
  61. public:
  62. virtual HRESULT OnAddMenuItems(LPCONTEXTMENUCALLBACK piCallback,long __RPC_FAR *pInsertionAllowed);
  63. virtual HRESULT OnCommand(CResultsPane* pPane, long lCommandID);
  64. // MFC Operations
  65. public:
  66. // Overrides
  67. // ClassWizard generated virtual function overrides
  68. //{{AFX_VIRTUAL(CResultsPaneItem)
  69. public:
  70. virtual void OnFinalRelease();
  71. //}}AFX_VIRTUAL
  72. // MFC Implementation
  73. protected:
  74. // Generated message map functions
  75. //{{AFX_MSG(CResultsPaneItem)
  76. // NOTE - the ClassWizard will add and remove member functions here.
  77. //}}AFX_MSG
  78. DECLARE_MESSAGE_MAP()
  79. DECLARE_OLECREATE_EX(CResultsPaneItem)
  80. // Generated OLE dispatch map functions
  81. //{{AFX_DISPATCH(CResultsPaneItem)
  82. // NOTE - the ClassWizard will add and remove member functions here.
  83. //}}AFX_DISPATCH
  84. DECLARE_DISPATCH_MAP()
  85. DECLARE_INTERFACE_MAP()
  86. };
  87. typedef CTypedPtrArray<CObArray,CResultsPaneItem*> ResultsPaneItemArray;
  88. /////////////////////////////////////////////////////////////////////////////
  89. //{{AFX_INSERT_LOCATION}}
  90. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  91. #endif // !defined(AFX_RESULTSPANEITEM_H__7D4A6869_9056_11D2_BD45_0000F87A3912__INCLUDED_)