home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Mobile / Chip_Mobile_2001.iso / palm / business / printcar / printcar.exe / src / CardList.h < prev    next >
C/C++ Source or Header  |  2000-06-05  |  1KB  |  49 lines

  1. //
  2. //  $Id: CardList.h,v 1.2 2000/06/04 23:23:24 sergey Exp $
  3. //
  4.  
  5. #ifndef _CardList_h_
  6. #define _CardList_h_
  7.  
  8. #include "DB/ResourceDatabase.h"
  9. #include "CardRecord.h"
  10.  
  11.  
  12. //
  13. // This class represents a list of Card items.
  14. // The data will be read from the PrintCardDB.
  15. //
  16. class CardList
  17. {
  18. public:
  19.     CardList();
  20.  
  21. private:
  22.     CardList(const CardList&);
  23.     CardList& operator =(const CardList&);
  24.  
  25. // operations
  26. public:
  27.     int recordCount() const;
  28.     const CardRecord& record(int index) const;
  29.  
  30. // attributes
  31.  
  32.     bool isRecord(int index) const  { return 0 <= index && index < _recordCount; }
  33.  
  34. // implementation
  35. private:
  36.     bool ensureDatabaseOpened() const;
  37.     bool ensureRecordLoaded(int index) const;
  38.  
  39. // data members
  40. private:
  41.     mutable int                     _recordCount;
  42.     mutable int                     _lastIndex;
  43.  
  44.     mutable DB::ResourceDatabase    _database;
  45.     mutable CardRecord              _currentRecord;
  46. };
  47.  
  48. #endif  // _CardList_h_
  49.