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.

301 lines
5.3 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1996 - 1998
  3. All rights reserved.
  4. Module Name:
  5. Archlv.hxx
  6. Abstract:
  7. Arch List View Header
  8. Author:
  9. Steve Kiraly (SteveKi) 19-Nov-1996
  10. Revision History:
  11. --*/
  12. #ifndef _ARCHLV_HXX
  13. #define _ARCHLV_HXX
  14. /********************************************************************
  15. Architecture list view control.
  16. ********************************************************************/
  17. class TArchLV {
  18. SIGNATURE( 'arlv' )
  19. ALWAYS_VALID
  20. public:
  21. enum EConstants {
  22. kHeaderMax = 3,
  23. kDefaultHeaderWidth = 40,
  24. };
  25. enum {
  26. kArchitectureColumn,
  27. kVersionColumn,
  28. kInstalledColumn,
  29. kMaxColumns,
  30. };
  31. enum {
  32. //
  33. // Listview item states. Bit 12-15 hold the image state.
  34. //
  35. kStateUnchecked = 1 << 12,
  36. kStateChecked = 2 << 12,
  37. kStateDisabled = 3 << 12,
  38. kStateMask = kStateChecked | kStateUnchecked | kStateDisabled | LVIS_STATEIMAGEMASK,
  39. };
  40. enum {
  41. kDriverWIN95 = 1 << 0,
  42. kDriverX86_0 = 1 << 1,
  43. kDriverX86_1 = 1 << 2,
  44. kDriverX86_2 = 1 << 3,
  45. kDriverX86_3 = 1 << 4,
  46. kDriverMIPS_0 = 1 << 5,
  47. kDriverMIPS_1 = 1 << 6,
  48. kDriverMIPS_2 = 1 << 7,
  49. kDriverALPHA_0 = 1 << 8,
  50. kDriverALPHA_1 = 1 << 9,
  51. kDriverALPHA_2 = 1 << 10,
  52. kDriverALPHA_3 = 1 << 11,
  53. kDriverPPC_1 = 1 << 12,
  54. kDriverPPC_2 = 1 << 13,
  55. };
  56. struct ArchEncode {
  57. INT ArchId;
  58. INT VersionId;
  59. LPWSTR NonLocalizedEnvironment;
  60. LPWSTR NonLocalizedVersion;
  61. DWORD Encode;
  62. };
  63. TArchLV(
  64. VOID
  65. );
  66. ~TArchLV(
  67. VOID
  68. );
  69. BOOL
  70. bSetUI(
  71. HWND hwnd,
  72. WPARAM wmDblClickMsg = 0,
  73. WPARAM wmSingleClickMsg = 0
  74. );
  75. BOOL
  76. bRefreshListView(
  77. IN LPCTSTR pszServerName,
  78. IN LPCTSTR pszDriverName
  79. );
  80. BOOL
  81. bHandleNotifyMessage(
  82. IN UINT uMsg,
  83. IN WPARAM wParam,
  84. IN LPARAM lParam
  85. );
  86. UINT
  87. uGetCheckedItemCount(
  88. VOID
  89. );
  90. BOOL
  91. bGetCheckedItems(
  92. IN UINT uIndex,
  93. IN BOOL *pbInstalled,
  94. IN DWORD *pdwEncode
  95. );
  96. BOOL
  97. bSetCheckDefaultArch(
  98. IN LPCTSTR pszServerName
  99. );
  100. VOID
  101. vSelectItem(
  102. IN UINT iIndex
  103. );
  104. VOID
  105. vNoItemCheck(
  106. VOID
  107. );
  108. static
  109. BOOL
  110. bEncodeToArchAndVersion(
  111. IN DWORD dwEncode,
  112. OUT TString &strArch,
  113. OUT TString &strVersion
  114. );
  115. static
  116. BOOL
  117. bArchAndVersionToEncode(
  118. OUT DWORD *pdwEncode,
  119. IN LPCTSTR pszArchitecture,
  120. IN LPCTSTR pszVersion,
  121. IN BOOL bUseNonLocalizedStrings = FALSE
  122. );
  123. static
  124. BOOL
  125. bGetEncodeFromIndex(
  126. IN UINT uIndex,
  127. OUT DWORD *pdwEncode
  128. );
  129. private:
  130. //
  131. // Architecture data this is a helper class need for
  132. // sorting the list view.
  133. //
  134. class TArchData {
  135. public:
  136. TArchData(
  137. IN LPCTSTR pszArchitecture,
  138. IN LPCTSTR pszVersion,
  139. IN LPCTSTR pszInstalled,
  140. IN DWORD Encode,
  141. IN BOOL bInstalled
  142. );
  143. ~TArchData(
  144. VOID
  145. );
  146. BOOL
  147. bValid(
  148. VOID
  149. );
  150. DLINK( TArchData, ArchData );
  151. TString _strArchitecture;
  152. TString _strVersion;
  153. TString _strInstalled;
  154. DWORD _Encode;
  155. DWORD _bInstalled;
  156. private:
  157. //
  158. // Copying and assignment are not defined.
  159. //
  160. TArchData(
  161. const TArchData &
  162. );
  163. TArchData &
  164. operator =(
  165. const TArchData &
  166. );
  167. };
  168. //
  169. // Copying and assignment are not defined.
  170. //
  171. TArchLV(
  172. const TArchLV &
  173. );
  174. TArchLV &
  175. operator =(
  176. const TArchLV &
  177. );
  178. BOOL
  179. bFillListView(
  180. IN LPCTSTR pszServerName,
  181. IN LPCTSTR pszDriverName
  182. );
  183. LRESULT
  184. iAddToListView(
  185. IN LPCTSTR pszArchitecture,
  186. IN LPCTSTR pszVersion,
  187. IN LPCTSTR pszInstalled,
  188. IN LPARAM lParam
  189. );
  190. VOID
  191. vRelease(
  192. VOID
  193. );
  194. BOOL
  195. bListViewSort(
  196. UINT uColumn
  197. );
  198. static
  199. INT
  200. CALLBACK
  201. iCompareProc(
  202. IN LPARAM lParam1,
  203. IN LPARAM lParam2,
  204. IN LPARAM RefData
  205. );
  206. BOOL
  207. bGetItemData(
  208. IN INT iItem,
  209. IN TArchData **ppArchData
  210. ) const;
  211. BOOL
  212. bListVeiwKeydown(
  213. IN LPARAM lParam
  214. );
  215. VOID
  216. TArchLV::
  217. vItemClicked(
  218. IN INT iItem
  219. );
  220. BOOL
  221. TArchLV::
  222. vCheckItemClicked(
  223. IN LPNMHDR pnmh
  224. );
  225. VOID
  226. vCheckItem(
  227. IN INT iItem,
  228. IN BOOL bCheckState
  229. );
  230. HWND _hwnd;
  231. HWND _hwndLV;
  232. WPARAM _wmDoubleClickMsg;
  233. WPARAM _wmSingleClickMsg;
  234. TBitArray _ColumnSortState;
  235. UINT _uCurrentColumn;
  236. BOOL _bNoItemCheck;
  237. DLINK_BASE( TArchData, ArchDataList, ArchData );
  238. };
  239. #endif