home *** CD-ROM | disk | FTP | other *** search
- //
- // $Id: ListChoices.h,v 1.1.1.1 2000/06/02 22:23:00 sergey Exp $
- //
-
- #ifndef _ListChoices_h_
- #define _ListChoices_h_
-
-
- namespace UI
- {
- class ListChoices
- {
- public:
- ListChoices();
- ~ListChoices();
-
- // Copy transferring the ownership
- ListChoices(const ListChoices& other);
- ListChoices& operator =(const ListChoices& other);
-
- // operations
-
- void add(const char* text);
-
- // attributes
-
- int count() const { return _count; }
-
- const char* textItem(int index) const;
- const char** textItems() const;
-
- // implementation
- private:
- void createItems();
- void initItems(const char** items, const char* buffer, int count);
- void deleteItems();
-
- bool ensureBufferSize(int size);
- void deleteBuffer();
- int bufferSize() const;
- void copyTextToBuffer(int offset, const char* text);
-
- void cleanUp();
- void release();
-
- // data members
- private:
- int _count;
-
- VoidHand _bufferHandle;
- const char** _items;
- };
- }
- // namespace UI
-
- #endif // _ListChoices_h_
-