#pragma once #include #include #include "../Core/Object.h" #include "../Container/List.h" namespace Atomic { class UISelectItemSource; class UISelectItem : public Object { OBJECT(UISelectItem) public: UISelectItem(Context* context, const String& str = String::EMPTY, const String& id = String::EMPTY, const String& skinImage = String::EMPTY); virtual ~UISelectItem(); void SetString(const String& str) { str_ = str; } void SetID(const String& id); void SetSkinImage(const String& skinImage); void SetSubSource(UISelectItemSource *subSource); tb::TBGenericStringItem* GetTBItem(); private: String str_; // TBID tb::TBID id_; // TBID tb::TBID skinImage_; SharedPtr subSource_; }; class UISelectItemSource : public Object { OBJECT(UISelectItemSource) public: UISelectItemSource(Context* context); virtual ~UISelectItemSource(); void AddItem(UISelectItem* item) { items_.Push(SharedPtr(item)); } // caller's responsibility to clean up tb::TBGenericStringItemSource* GetTBItemSource(); private: List> items_; }; }