Leaked source code of windows server 2003
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.

48 lines
2.6 KiB

  1. /*
  2. * viewlist.hxx
  3. *
  4. *
  5. * Copyright (c) 1998 Microsoft Corporation
  6. *
  7. * PURPOSE: Defines the CViewItemList class
  8. *
  9. *
  10. * OWNER: vivekj
  11. */
  12. #ifndef _VIEWLIST_HXX
  13. #define _VIEWLIST_HXX
  14. typedef CBaseSnapinItem * t_psnapinitem; // pointer to a snapin
  15. typedef std::vector<t_psnapinitem> CViewItemListBase; // a list of items for this particular view.
  16. typedef std::map<t_psnapinitem, CViewItemListBase::iterator, less<t_psnapinitem> > CViewSortResultsMap;// a map from CBaseSnapinItem * to iterators
  17. typedef std::pair<CBaseSnapinItem * const, CViewItemListBase::iterator> t_sortmapitem; // each item in the map is of this type
  18. class CViewItemList : public CViewItemListBase
  19. {
  20. CBaseSnapinItem * m_pitemSelectedContainer; // The currently selected container
  21. CBaseSnapinItem * PitemSelectedContainer() { return m_pitemSelectedContainer;}
  22. CViewSortResultsMap m_viewsortresultsmap; // a map to cache the view sort results.
  23. CViewSortResultsMap* Pviewsortresultsmap() { return &m_viewsortresultsmap;}
  24. BOOL m_fValid : 1; // is the current view valid?
  25. BOOL FValid() { return m_fValid;}
  26. void Invalidate();
  27. DAT m_datSort; // The field according to which the sort has occurred
  28. DAT DatSort() { return m_datSort;}
  29. BOOL m_fIsSorted; // whether the current sort results are correct.
  30. BOOL FIsSorted() {return m_fIsSorted;}
  31. void Sort(); // sort all the items and create the item map appropriately.
  32. void SaveSortResults(); // save the results of the sort for fast lookup.
  33. inline INT Compare(CBaseSnapinItem * pitem1, CBaseSnapinItem *pitem2);
  34. public:
  35. CViewItemList();
  36. void Initialize(CBaseSnapinItem *pitemSelectedContainer, DAT datPresort, DAT datSort);
  37. };
  38. #endif //_VIEWLIST_HXX