libyui
2.42.5
|
#include <YTreeItem.h>
Public Member Functions | |
YTreeItem (const std::string &label, bool isOpen=false) | |
YTreeItem (const std::string &label, const std::string &iconName, bool isOpen=false) | |
YTreeItem (YTreeItem *parent, const std::string &label, bool isOpen=false) | |
YTreeItem (YTreeItem *parent, const std::string &label, const std::string &iconName, bool isOpen=false) | |
virtual | ~YTreeItem () |
virtual bool | hasChildren () const |
virtual YItemIterator | childrenBegin () |
virtual YItemConstIterator | childrenBegin () const |
virtual YItemIterator | childrenEnd () |
virtual YItemConstIterator | childrenEnd () const |
virtual void | addChild (YItem *item_disown) |
virtual void | deleteChildren () |
bool | isOpen () const |
void | setOpen (bool open) |
virtual YTreeItem * | parent () const |
![]() | |
YItem (const std::string &label, bool selected=false) | |
YItem (const std::string &label, const std::string &iconName, bool selected=false) | |
virtual | ~YItem () |
std::string | label () const |
void | setLabel (const std::string &newLabel) |
std::string | iconName () const |
bool | hasIconName () const |
void | setIconName (const std::string &newIconName) |
bool | selected () const |
void | setSelected (bool sel=true) |
void | setIndex (int index) |
int | index () const |
void | setData (void *newData) |
void * | data () const |
Item class for tree items.
This class implements children management.
Definition at line 37 of file YTreeItem.h.
YTreeItem::YTreeItem | ( | const std::string & | label, |
bool | isOpen = false |
||
) |
Constructors for toplevel items.
Definition at line 28 of file YTreeItem.cc.
YTreeItem::YTreeItem | ( | YTreeItem * | parent, |
const std::string & | label, | ||
bool | isOpen = false |
||
) |
Constructors for items that have a parent item.
They will automatically register this item with the parent item. The parent assumes ownership of this item and will delete it in its (the parent's) destructor.
Definition at line 47 of file YTreeItem.cc.
|
virtual |
|
virtual |
Add a child item to this item.
Note that the constructors that accept a parent pointer will automatically add themselves to their parent, so applications will normally not have to call this function.
Definition at line 78 of file YTreeItem.cc.
|
inlinevirtual |
Return an iterator that points to the first child item of this item.
Reimplemented from YItem.
Reimplemented from YItem.
Definition at line 85 of file YTreeItem.h.
|
inlinevirtual |
Return an iterator that points after the last child item of this item.
Reimplemented from YItem.
Reimplemented from YItem.
Definition at line 93 of file YTreeItem.h.
|
virtual |
Delete all child items.
Definition at line 84 of file YTreeItem.cc.
|
inlinevirtual |
Return 'true' if this item has any child items.
Reimplemented from YItem.
Reimplemented from YItem.
Definition at line 78 of file YTreeItem.h.
bool YTreeItem::isOpen | ( | ) | const |
Return 'true' if this tree item should be displayed open (with its children visible) by default.
Notice that this will always return 'false' for tree items without children.
Definition at line 99 of file YTreeItem.cc.
|
inlinevirtual |
Returns this item's parent item or 0 if it is a toplevel item.
Reimplemented from YItem.
Reimplemented from YItem.
Reimplemented in YMenuItem.
Definition at line 129 of file YTreeItem.h.
void YTreeItem::setOpen | ( | bool | open | ) |
Change the 'isOpen' flag.
Definition at line 105 of file YTreeItem.cc.