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.

121 lines
3.2 KiB

  1. //=============================================================================
  2. // File: lviewcat.cpp
  3. // Author: a-jammar
  4. // Covers: CDataListCategory
  5. //
  6. // Copyright (c) 1998-1999 Microsoft Corporation
  7. //
  8. // This sublass of CDataCategory is use specifically when the data to be
  9. // displayed in a list view. Only data specific to the list view categories
  10. // is implemented here - for general category implementation, see the code for
  11. // CDataCategory in category.cpp. For usage details, see gather.h.
  12. //=============================================================================
  13. #include "stdafx.h"
  14. #include "gather.h"
  15. //-----------------------------------------------------------------------------
  16. // The constructor and destructor are typical. Actual values are put into
  17. // the member variables by CDataGatherer, which creates these objects.
  18. //-----------------------------------------------------------------------------
  19. CDataListCategory::CDataListCategory()
  20. {
  21. }
  22. CDataListCategory::~CDataListCategory()
  23. {
  24. }
  25. //-----------------------------------------------------------------------------
  26. // These methods are specific to the list view version of the category. We
  27. // implement all of these methods by simply calling through to the gatherer.
  28. //-----------------------------------------------------------------------------
  29. DWORD CDataListCategory::GetColumnCount()
  30. {
  31. ASSERT(m_pGatherer);
  32. if (m_pGatherer)
  33. {
  34. m_pGatherer->SetLastError(GATH_ERR_NOERROR);
  35. return m_pGatherer->GetColumnCount(m_dwID);
  36. }
  37. return 0;
  38. }
  39. DWORD CDataListCategory::GetRowCount()
  40. {
  41. ASSERT(m_pGatherer);
  42. if (m_pGatherer)
  43. {
  44. m_pGatherer->SetLastError(GATH_ERR_NOERROR);
  45. return m_pGatherer->GetRowCount(m_dwID);
  46. }
  47. return 0;
  48. }
  49. BOOL CDataListCategory::GetColumnCaption(DWORD nColumn, CString &strCaption)
  50. {
  51. ASSERT(m_pGatherer);
  52. if (m_pGatherer)
  53. {
  54. m_pGatherer->SetLastError(GATH_ERR_NOERROR);
  55. return m_pGatherer->GetColumnCaption(m_dwID, nColumn, strCaption);
  56. }
  57. return FALSE;
  58. }
  59. BOOL CDataListCategory::GetColumnWidth(DWORD nColumn, DWORD &cxWidth)
  60. {
  61. ASSERT(m_pGatherer);
  62. if (m_pGatherer)
  63. {
  64. m_pGatherer->SetLastError(GATH_ERR_NOERROR);
  65. return m_pGatherer->GetColumnWidth(m_dwID, nColumn, cxWidth);
  66. }
  67. return FALSE;
  68. }
  69. BOOL CDataListCategory::GetColumnSort(DWORD nColumn, MSIColumnSortType & sorttype)
  70. {
  71. ASSERT(m_pGatherer);
  72. if (m_pGatherer)
  73. {
  74. m_pGatherer->SetLastError(GATH_ERR_NOERROR);
  75. return m_pGatherer->GetColumnSort(m_dwID, nColumn, sorttype);
  76. }
  77. return FALSE;
  78. }
  79. BOOL CDataListCategory::GetValue(DWORD nRow, DWORD nColumn, CString &strValue, DWORD &dwValue)
  80. {
  81. ASSERT(m_pGatherer);
  82. if (m_pGatherer)
  83. {
  84. m_pGatherer->SetLastError(GATH_ERR_NOERROR);
  85. return m_pGatherer->GetValue(m_dwID, nRow, nColumn, strValue, dwValue);
  86. }
  87. return FALSE;
  88. }
  89. BOOL CDataListCategory::GetColumnDataComplexity(DWORD nColumn, DataComplexity & complexity)
  90. {
  91. ASSERT(m_pGatherer);
  92. if (m_pGatherer)
  93. {
  94. m_pGatherer->SetLastError(GATH_ERR_NOERROR);
  95. return m_pGatherer->GetColumnDataComplexity(m_dwID, nColumn, complexity);
  96. }
  97. return FALSE;
  98. }
  99. BOOL CDataListCategory::GetRowDataComplexity(DWORD nRow, DataComplexity & complexity)
  100. {
  101. ASSERT(m_pGatherer);
  102. if (m_pGatherer)
  103. {
  104. m_pGatherer->SetLastError(GATH_ERR_NOERROR);
  105. return m_pGatherer->GetRowDataComplexity(m_dwID, nRow, complexity);
  106. }
  107. return FALSE;
  108. }