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

  1. //
  2. //  $Id: ListChoices.h,v 1.1.1.1 2000/06/02 22:23:00 sergey Exp $
  3. //
  4.  
  5. #ifndef _ListChoices_h_
  6. #define _ListChoices_h_
  7.  
  8.  
  9. namespace UI
  10. {
  11.     class ListChoices
  12.     {
  13.     public:
  14.         ListChoices();
  15.         ~ListChoices();
  16.  
  17.         // Copy transferring the ownership
  18.         ListChoices(const ListChoices& other);
  19.         ListChoices& operator =(const ListChoices& other);
  20.  
  21.     // operations
  22.  
  23.         void add(const char* text);
  24.  
  25.     // attributes
  26.  
  27.         int count() const { return _count; }
  28.  
  29.         const char* textItem(int index) const;
  30.         const char** textItems() const;
  31.  
  32.     // implementation
  33.     private:
  34.         void createItems();
  35.         void initItems(const char** items, const char* buffer, int count);
  36.         void deleteItems();
  37.  
  38.         bool ensureBufferSize(int size);
  39.         void deleteBuffer();
  40.         int bufferSize() const;
  41.         void copyTextToBuffer(int offset, const char* text);
  42.  
  43.         void cleanUp();
  44.         void release();
  45.  
  46.     // data members
  47.     private:
  48.         int _count;
  49.  
  50.         VoidHand _bufferHandle;
  51.         const char** _items;
  52.     };
  53. }
  54. // namespace UI
  55.  
  56. #endif // _ListChoices_h_
  57.