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.

202 lines
5.8 KiB

  1. #if !defined(AFX_SCOPEPANEITEM_H__7D4A6863_9056_11D2_BD45_0000F87A3912__INCLUDED_)
  2. #define AFX_SCOPEPANEITEM_H__7D4A6863_9056_11D2_BD45_0000F87A3912__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // ScopePaneItem.h : header file
  7. //
  8. #include <mmc.h>
  9. class CScopePane;
  10. class CResultsPaneView;
  11. class CScopePaneItem;
  12. class CResultsPane;
  13. typedef CTypedPtrArray<CObArray,CScopePaneItem*> ScopePaneItemArray;
  14. typedef int (*SPIFINDPROC) (const ScopePaneItemArray& ScopeItems, LPARAM param);
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CScopePaneItem command target
  17. class CScopePaneItem : public CCmdTarget
  18. {
  19. DECLARE_DYNCREATE(CScopePaneItem)
  20. // Construction/Destruction
  21. public:
  22. CScopePaneItem();
  23. virtual ~CScopePaneItem();
  24. // Create/Destroy
  25. public:
  26. virtual bool Create(CScopePane* pScopePane, CScopePaneItem* pParentItem);
  27. virtual void Destroy();
  28. // Scope Pane Members
  29. public:
  30. CScopePane* GetScopePane() const;
  31. void SetScopePane(CScopePane* pScopePane);
  32. protected:
  33. CScopePane* m_pScopePane;
  34. // Parent Scope Item Members
  35. public:
  36. CScopePaneItem* GetParent() const;
  37. void SetParent(CScopePaneItem* pParentItem);
  38. // v-marfin 59237 : Display new data collectors with generated unique name
  39. CString GetUniqueDisplayName(CString sProposedName);
  40. protected:
  41. CScopePaneItem* m_pParent;
  42. // Child Scope Item Members
  43. public:
  44. int GetChildCount() const;
  45. CScopePaneItem* GetChild(int iIndex);
  46. int AddChild(CScopePaneItem* pChildItem);
  47. void RemoveChild(int iIndex);
  48. void RemoveChild(CScopePaneItem* pChildItem);
  49. void DestroyChild(CScopePaneItem* pChild);
  50. int FindChild(SPIFINDPROC pFindProc, LPARAM param);
  51. protected:
  52. ScopePaneItemArray m_Children;
  53. // Results Pane View Members
  54. public:
  55. virtual CResultsPaneView* CreateResultsPaneView();
  56. CResultsPaneView* GetResultsPaneView()const;
  57. protected:
  58. CResultsPaneView* m_pResultsPaneView;
  59. // MMC-Related Item Members
  60. public:
  61. virtual bool InsertItem(int iIndex);
  62. virtual bool DeleteItem();
  63. virtual bool SetItem();
  64. void SelectItem();
  65. void ExpandItem(BOOL bExpand = TRUE);
  66. void SortItems();
  67. void ShowItem();
  68. void HideItem();
  69. bool IsItemVisible() const;
  70. HSCOPEITEM GetItemHandle();
  71. void SetItemHandle(HSCOPEITEM hItem);
  72. LPGUID GetItemType();
  73. virtual HRESULT WriteExtensionData(LPSTREAM pStream);
  74. protected:
  75. HSCOPEITEM m_hItemHandle;
  76. LPGUID m_lpguidItemType;
  77. bool m_bVisible;
  78. // Display Name Members
  79. public:
  80. CString GetDisplayName(int nIndex = 0);
  81. virtual CStringArray& GetDisplayNames();
  82. void SetDisplayName(int nIndex, const CString& sName);
  83. void SetDisplayNames(const CStringArray& saNames);
  84. protected:
  85. CStringArray m_saDisplayNames;
  86. // Icon Members
  87. public:
  88. void SetIconIndex(int iIndex);
  89. int GetIconIndex();
  90. UINT GetIconId();
  91. CUIntArray& GetIconIds();
  92. void SetOpenIconIndex(int iIndex);
  93. int GetOpenIconIndex();
  94. UINT GetOpenIconId();
  95. protected:
  96. CUIntArray m_IconResIds;
  97. int m_iCurrentIconIndex;
  98. CUIntArray m_OpenIconResIds;
  99. int m_iCurrentOpenIconIndex;
  100. // Property Sheet Members
  101. public:
  102. bool IsPropertySheetOpen(bool bSearchChildren = false);
  103. bool InvokePropertySheet();
  104. // Context Menu Members
  105. public:
  106. // v-marfin 59644 : Modified prototype to allow passing to selected item count
  107. bool InvokeContextMenu(const CPoint& pt, int iSelectedCount= -1);
  108. // Help Topic
  109. public:
  110. CString GetHelpTopic() const;
  111. void SetHelpTopic(const CString& sTopic);
  112. protected:
  113. CString m_sHelpTopic;
  114. // Messaging Members
  115. public:
  116. virtual LRESULT MsgProc(UINT msg, WPARAM wparam, LPARAM lparam);
  117. // MMC Notify Handlers
  118. public:
  119. virtual HRESULT OnActivate(BOOL bActivated);
  120. virtual HRESULT OnAddImages(CResultsPane* pPane);
  121. virtual HRESULT OnAddMenuItems(LPCONTEXTMENUCALLBACK piCallback,long __RPC_FAR *pInsertionAllowed);
  122. virtual HRESULT OnBtnClick(MMC_CONSOLE_VERB verb);
  123. virtual HRESULT OnCommand(long lCommandID);
  124. virtual HRESULT OnContextHelp();
  125. virtual HRESULT OnCutOrMove();
  126. virtual HRESULT OnCreatePropertyPages(LPPROPERTYSHEETCALLBACK lpProvider, INT_PTR handle);
  127. virtual HRESULT OnDelete(BOOL bConfirm=TRUE); // v-marfin 60298
  128. virtual HRESULT OnExpand(BOOL bExpand);
  129. virtual HRESULT OnGetDisplayInfo(int nColumnIndex, LPTSTR* ppString);
  130. virtual HRESULT OnGetResultViewType(CString& sViewType,long& lViewOptions);
  131. virtual HRESULT OnListpad(BOOL bAttachingListCtrl);
  132. virtual HRESULT OnMinimized(BOOL bMinimized);
  133. virtual HRESULT OnPaste(LPDATAOBJECT pSelectedItems, LPDATAOBJECT* ppCopiedItems);
  134. virtual HRESULT OnPropertyChange(LPARAM lParam);
  135. virtual HRESULT OnQueryPagesFor();
  136. virtual HRESULT OnQueryPaste(LPDATAOBJECT pDataObject);
  137. virtual HRESULT OnRefresh();
  138. virtual HRESULT OnRemoveChildren();
  139. virtual HRESULT OnRename(const CString& sNewName);
  140. virtual HRESULT OnRestoreView(MMC_RESTORE_VIEW* pRestoreView, BOOL* pbHandled);
  141. virtual HRESULT OnSelect(CResultsPane* pPane,BOOL bSelected);
  142. virtual HRESULT OnShow(CResultsPane* pPane, BOOL bSelecting);
  143. // MFC Operations
  144. public:
  145. // Overrides
  146. // ClassWizard generated virtual function overrides
  147. //{{AFX_VIRTUAL(CScopePaneItem)
  148. public:
  149. virtual void OnFinalRelease();
  150. //}}AFX_VIRTUAL
  151. // MFC Implementation
  152. protected:
  153. // Generated message map functions
  154. //{{AFX_MSG(CScopePaneItem)
  155. // NOTE - the ClassWizard will add and remove member functions here.
  156. //}}AFX_MSG
  157. DECLARE_MESSAGE_MAP()
  158. DECLARE_OLECREATE_EX(CScopePaneItem)
  159. // Generated OLE dispatch map functions
  160. //{{AFX_DISPATCH(CScopePaneItem)
  161. // NOTE - the ClassWizard will add and remove member functions here.
  162. //}}AFX_DISPATCH
  163. DECLARE_DISPATCH_MAP()
  164. DECLARE_INTERFACE_MAP()
  165. };
  166. /////////////////////////////////////////////////////////////////////////////
  167. //{{AFX_INSERT_LOCATION}}
  168. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  169. #endif // !defined(AFX_SCOPEPANEITEM_H__7D4A6863_9056_11D2_BD45_0000F87A3912__INCLUDED_)