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.

162 lines
4.5 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2000-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // TaskTreeView.h
  7. //
  8. // Maintained By:
  9. // David Potter (DavidP) 27-MAR-2001
  10. // Geoffrey Pease (GPease) 22-MAY-2000
  11. //
  12. //////////////////////////////////////////////////////////////////////////////
  13. #pragma once
  14. class CAnalyzePage;
  15. class CCommitPage;
  16. //////////////////////////////////////////////////////////////////////////////
  17. // Type Definitions
  18. //////////////////////////////////////////////////////////////////////////////
  19. //
  20. // This structure is on the lParam of all tree view items.
  21. //
  22. typedef struct _STreeItemLParamData
  23. {
  24. CLSID clsidMajorTaskId;
  25. CLSID clsidMinorTaskId;
  26. BSTR bstrNodeName;
  27. ULONG ulMin;
  28. ULONG ulMax;
  29. ULONG ulCurrent;
  30. HRESULT hr;
  31. BSTR bstrDescription;
  32. FILETIME ftTime;
  33. BSTR bstrReference;
  34. } STreeItemLParamData;
  35. typedef enum _ETASKSTATUS
  36. {
  37. tsUNKNOWN = 0,
  38. tsPENDING, // E_PENDING
  39. tsDONE, // S_OK
  40. tsWARNING, // S_FALSE
  41. tsFAILED, // FAILED( hr )
  42. tsMAX
  43. } ETaskStatus;
  44. //////////////////////////////////////////////////////////////////////////////
  45. //++
  46. //
  47. // class CTaskTreeView
  48. //
  49. // Description:
  50. // Handles the tree view control that displays tasks.
  51. //
  52. //--
  53. //////////////////////////////////////////////////////////////////////////////
  54. class CTaskTreeView
  55. {
  56. friend class CAnalyzePage;
  57. friend class CCommitPage;
  58. private: // data
  59. HWND m_hwndParent;
  60. HWND m_hwndTV;
  61. HWND m_hwndProg;
  62. HWND m_hwndStatus;
  63. HIMAGELIST m_hImgList; // Image list of icons for tree view
  64. ULONG m_ulHighNibble; // Progress bar high nibble count
  65. ULONG m_ulLowNibble; // Progress bar low nibble count
  66. HTREEITEM m_htiSelected; // Selected item in the tree
  67. private: // methods
  68. CTaskTreeView(
  69. HWND hwndParentIn
  70. , UINT uIDTVIn
  71. , UINT uIDProgressIn
  72. , UINT uIDStatusIn
  73. );
  74. virtual ~CTaskTreeView( void );
  75. void
  76. OnNotifyDeleteItem( LPNMHDR pnmhdrIn );
  77. void
  78. OnNotifySelChanged( LPNMHDR pnmhdrIn );
  79. HRESULT
  80. HrInsertTaskIntoTree(
  81. HTREEITEM htiFirstIn
  82. , STreeItemLParamData * ptipdIn
  83. , int nImageIn
  84. , BSTR bstrDescriptionIn
  85. );
  86. HRESULT
  87. HrUpdateProgressBar(
  88. const STreeItemLParamData * ptipdPrevIn
  89. , const STreeItemLParamData * ptipdNewIn
  90. );
  91. HRESULT
  92. HrPropagateChildStateToParents(
  93. HTREEITEM htiChildIn
  94. , int nImageIn
  95. , BOOL fOnlyUpdateProgressIn
  96. );
  97. public: // methods
  98. HRESULT
  99. HrOnInitDialog( void );
  100. HRESULT
  101. HrOnSendStatusReport(
  102. LPCWSTR pcszNodeNameIn
  103. , CLSID clsidTaskMajorIn
  104. , CLSID clsidTaskMinorIn
  105. , ULONG ulMinIn
  106. , ULONG ulMaxIn
  107. , ULONG ulCurrentIn
  108. , HRESULT hrStatusIn
  109. , LPCWSTR pcszDescriptionIn
  110. , FILETIME * pftTimeIn
  111. , LPCWSTR pcszReferenceIn
  112. );
  113. HRESULT
  114. HrAddTreeViewRootItem( UINT idsIn, REFCLSID rclsidTaskIDIn )
  115. {
  116. return THR( HrAddTreeViewItem(
  117. NULL // phtiOut
  118. , idsIn
  119. , rclsidTaskIDIn
  120. , IID_NULL
  121. , TVI_ROOT
  122. ) );
  123. } //*** CTaskTreeView::HrAddTreeViewRootItem()
  124. HRESULT
  125. HrAddTreeViewItem(
  126. HTREEITEM * phtiOut
  127. , UINT idsIn
  128. , REFCLSID rclsidMinorTaskIDIn
  129. , REFCLSID rclsidMajorTaskIDIn = IID_NULL
  130. , HTREEITEM htiParentIn = TVI_ROOT
  131. );
  132. HRESULT
  133. HrOnNotifySetActive( void );
  134. LRESULT
  135. OnNotify( LPNMHDR pnmhdrIn );
  136. HRESULT
  137. HrShowStatusAsDone( void );
  138. HRESULT
  139. HrDisplayDetails( void );
  140. BOOL
  141. FGetItem( HTREEITEM htiIn, STreeItemLParamData ** pptipdOut );
  142. HRESULT
  143. HrFindPrevItem( HTREEITEM * phtiOut );
  144. HRESULT
  145. HrFindNextItem( HTREEITEM * phtiOut );
  146. HRESULT
  147. HrSelectItem( HTREEITEM htiIn );
  148. }; //*** class CTaskTreeView