Go to the documentation of this file.
91 virtual const char *
itemClass()
const {
return "YItem"; }
97 std::string
label()
const {
return _label; }
102 void setLabel(
const std::string & newLabel ) { _label = newLabel; }
117 void setIconName(
const std::string & newIconName ) { _iconName = newIconName; }
143 void setStatus(
int newStatus ) { _status = newStatus; }
153 int index()
const {
return _index; }
163 void setData(
void * newData ) { _data = newData; }
168 void *
data()
const {
return _data; }
230 std::string
limitLength(
const std::string & text,
int limit )
const;
236 std::string _iconName;
249 std::ostream & operator<<( std::ostream & stream,
const YItem * item );
std::string label() const
Return this item's label.
void setData(void *newData)
Set the opaque data pointer for application use.
void setIndex(int index)
Set this item's index.
YItemCollection::iterator YItemIterator
Mutable iterator over YItemCollection.
std::vector< YItem * > YItemCollection
Collection of pointers to YItem.
int index() const
Return the index of this item (as set with setIndex() ).
virtual YItemIterator childrenBegin()
Return an iterator that points to the first child item of this item.
bool selected() const
Return 'true' if this item is currently selected.
std::string iconName() const
Return this item's icon name.
bool hasIconName() const
Return 'true' if this item has an icon name.
void setIconName(const std::string &newIconName)
Set this item's icon name.
virtual YItem * parent() const
Return this item's parent item or 0 if it is a toplevel item.
void * data() const
Return the opaque data pointer.
virtual bool hasChildren() const
Return 'true' if this item has any child items.
YItem(const std::string &label, bool selected=false)
Constructor with just the label and optionally the selected state.
virtual std::string debugLabel() const
Return a descriptive label of this item instance for debugging.
int status() const
Return the status of this item.
void setSelected(bool sel=true)
Select or unselect this item.
void setLabel(const std::string &newLabel)
Set this item's label.
virtual YItemIterator childrenEnd()
Return an iterator that points after the last child item of this item.
std::string limitLength(const std::string &text, int limit) const
Return a string of maximum 'limit' characters.
YItem(const std::string &label, const std::string &iconName, bool selected=false)
Constructor with label and icon name and optionally the selected state.
void setStatus(int newStatus)
Set the status of this item.
virtual const char * itemClass() const
Returns a descriptive name of this widget class for logging, debugging etc.
virtual ~YItem()
Destructor.
YItemCollection::const_iterator YItemConstIterator
Const iterator over YItemCollection.
Simple item class for SelectionBox, ComboBox, MultiSelectionBox etc.