21#ifndef __ANTARES_UI_COMMON_COMPONENT_SPOTLIGHT_SPOTLIGHT_IITEM_H__
22#define __ANTARES_UI_COMMON_COMPONENT_SPOTLIGHT_SPOTLIGHT_IITEM_H__
30 using Ptr = std::shared_ptr<IItem>;
59 using Ptr = std::shared_ptr<Tag>;
64 template<
class StringT>
65 Tag(
const StringT& t) :
text(wxStringFromUTF8(t))
71 Tag(
const wxString& t) :
text(t)
74 template<
class StringT>
75 Tag(
const StringT& t, uint8_t r, uint8_t g, uint8_t b) :
79 Tag(
const wxChar* t, uint8_t r, uint8_t g, uint8_t b) :
text(t),
color(r, g, b)
82 Tag(
const wxString& t, uint8_t r, uint8_t g, uint8_t b) :
110 template<
class StringT>
118 template<
class StringT>
128 template<
class StringT>
131 template<
class StringT>
164 template<
class StringT>
167 template<
class StringT>
168 void addTag(
const StringT& text, uint8_t r, uint8_t g, uint8_t b);
170 template<
class StringT>
173 template<
class StringT>
174 void addRightTag(
const StringT& text, uint8_t r, uint8_t g, uint8_t b);
213 Yuni::String pSubCaption;
virtual uint width() const
Width of the cell.
virtual uint height() const
Height of the cell.
std::vector< Ptr > Vector
Vector.
Definition iitem.h:61
std::shared_ptr< Tag > Ptr
The most suitable smart pointer.
Definition iitem.h:59
wxString text
Text.
Definition iitem.h:89
Yuni::Color::RGB color
Tag color.
Definition iitem.h:91
bool pSelected
Selected.
Definition iitem.h:217
IItem()
Default constructor.
std::vector< Ptr > Vector
Vector of items.
Definition iitem.h:32
void image(const wxBitmap *bmp)
Set the item's image (pointer, can be null)
void unselect()
Mark the item as not selected.
void caption(const wxString &caption)
Set the caption.
void image(const wxBitmap &bmp)
Set the item's image (reference)
void caption(const StringT &caption)
Set the caption.
void addRightTag(const StringT &text)
Add a new tag on the right.
virtual void draw(wxDC &dc, uint itemHeight, wxRect &bounds, bool selected, const SearchToken::VectorPtr &tokens) const
Draw the item.
const Yuni::String & caption() const
Get the caption.
Tag::Vector pLeftTags
Tags on the left.
Definition iitem.h:221
void clearTags()
Clear all tags.
Tag::Vector pRightTags
Tags on the right.
Definition iitem.h:223
void addRightTag(const StringT &text, uint8_t r, uint8_t g, uint8_t b)
Add a new tag on the right.
Yuni::CString< 64, false > GroupType
Group.
Definition iitem.h:36
void countedAsResult(bool v)
Set if this item should be counted as a result.
const wxBitmap & image() const
Get the item& image.
void select()
Mark the item as selected.
int tag
User-custom tag.
Definition iitem.h:205
void addTag(const StringT &text, uint8_t r, uint8_t g, uint8_t b)
Add a new tag.
std::shared_ptr< IItem > Ptr
Ptr.
Definition iitem.h:30
const GroupType & group() const
Get the group of the item.
wxString pCacheCaption
Cache wxString.
Definition iitem.h:225
bool isSameGroup(const StringT &group) const
Compare with another group.
std::shared_ptr< Vector > VectorPtr
Vector Ptr.
Definition iitem.h:34
bool countedAsResult() const
Get if this item should be counted as a result.
void subcaption(const StringT &caption)
Set the caption.
virtual ~IItem()
Destructor.
wxBitmap pBitmap
Image.
Definition iitem.h:215
void addTag(const StringT &text)
Add a new tag.
bool pCountedAsResult
Flag to determine if this items should be counted as a result.
Definition iitem.h:219
virtual bool canBeSelected() const
Get if the item can be selected.
void group(const StringT &g)
Set the group.
bool selected() const
Get if the item is selected.
Yuni::String pCaption
Caption.
Definition iitem.h:211
const Yuni::String & subcaption() const
Get the sub-caption.
GroupType pGroup
The group.
Definition iitem.h:209
std::shared_ptr< Vector > VectorPtr
Vector ptr.
Definition searchtoken.h:35