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.

81 lines
1.8 KiB

  1. //=======================================================================
  2. //
  3. // Copyright (c) 1998-1999 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // File: Selection.h
  6. //
  7. // Owner: CharlMa
  8. //
  9. // Description:
  10. //
  11. // interface for the CSelection class. It implements
  12. // a collection of type CORP_SELECTION, used to
  13. // record the selected (checked) status of items in the
  14. // corporate catalog.
  15. //
  16. // structure type CORP_SELECTOIN is also defined here
  17. //
  18. //=======================================================================
  19. // Selection.h: interface for the CSelection class.
  20. //
  21. //////////////////////////////////////////////////////////////////////
  22. #ifndef _SELECTION_H_INCLUDED_
  23. typedef struct _CORP_SELECTION
  24. {
  25. PUID puid;
  26. DWORD dwLocale;
  27. enumV3Platform platform;
  28. BOOL bSelected;
  29. int iStatus; //installation status
  30. HRESULT hrError; //installation error code
  31. } CORP_SELECTION, *PCORP_SELECTION;
  32. class CSelections
  33. {
  34. public:
  35. CSelections();
  36. CSelections(int iSize);
  37. ~CSelections();
  38. //
  39. // adjust the collection size
  40. //
  41. HRESULT SetCollectionSize(int iSize);
  42. void Clear(void);
  43. //
  44. // add a new item to the selection collection
  45. //
  46. HRESULT AddItem(PUID puid, DWORD dwLocale, enumV3Platform platform, BOOL bSelected);
  47. HRESULT AddItem(CORP_SELECTION Item);
  48. //
  49. // retrive item information from collection
  50. //
  51. inline int GetCount(void) { return m_iCount; };
  52. PCORP_SELECTION GetItem(int Index);
  53. inline BOOL isItemChecked(int Index)
  54. {return m_pSelections[Index].bSelected; };
  55. //
  56. // modify the selection status of one item
  57. //
  58. HRESULT SetItemSelection(int index, BOOL bSelected);
  59. HRESULT SetItemErrorCode(int index, HRESULT hr);
  60. private:
  61. PCORP_SELECTION m_pSelections;
  62. int m_iSize;
  63. int m_iCount;
  64. };
  65. #define _SELECTION_H_INCLUDED_
  66. #endif // !defined(_SELECTION_H_INCLUDED_)