libyui
 
Loading...
Searching...
No Matches
YTreeItem Class Reference

#include <YTreeItem.h>

Inheritance diagram for YTreeItem:
Collaboration diagram for YTreeItem:

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 const char * itemClass () const
 
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=true)
 
void setClosed ()
 
virtual YTreeItemparent () const
 
- Public Member Functions inherited from YItem
 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)
 
int status () const
 
void setStatus (int newStatus)
 
void setIndex (int index)
 
int index () const
 
void setData (void *newData)
 
void * data () const
 
virtual std::string debugLabel () const
 
std::string limitLength (const std::string &text, int limit) const
 

Detailed Description

Item class for tree items.

This class implements children management.

Constructor & Destructor Documentation

◆ YTreeItem() [1/2]

YTreeItem::YTreeItem ( const std::string & label,
bool isOpen = false )

Constructors for toplevel items.

◆ YTreeItem() [2/2]

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.

◆ ~YTreeItem()

YTreeItem::~YTreeItem ( )
virtual

Destructor.

This will delete all children.

Member Function Documentation

◆ addChild()

void YTreeItem::addChild ( YItem * item_disown)
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.

◆ childrenBegin() [1/2]

virtual YItemIterator YTreeItem::childrenBegin ( )
inlinevirtual

Return an iterator that points to the first child item of this item.

Reimplemented from YItem.

Reimplemented from YItem.

◆ childrenBegin() [2/2]

virtual YItemConstIterator YTreeItem::childrenBegin ( ) const
inlinevirtual

Reimplemented from YItem.

◆ childrenEnd() [1/2]

virtual YItemIterator YTreeItem::childrenEnd ( )
inlinevirtual

Return an iterator that points after the last child item of this item.

Reimplemented from YItem.

Reimplemented from YItem.

◆ childrenEnd() [2/2]

virtual YItemConstIterator YTreeItem::childrenEnd ( ) const
inlinevirtual

Reimplemented from YItem.

◆ deleteChildren()

void YTreeItem::deleteChildren ( )
virtual

Delete all child items.

◆ hasChildren()

virtual bool YTreeItem::hasChildren ( ) const
inlinevirtual

Return 'true' if this item has any child items.

Reimplemented from YItem.

Reimplemented from YItem.

◆ isOpen()

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.

◆ itemClass()

virtual const char * YTreeItem::itemClass ( ) const
inlinevirtual

Returns a descriptive name of this widget class for logging, debugging etc.

Reimplemented from YItem.

Reimplemented in YTableItem.

◆ parent()

virtual YTreeItem * YTreeItem::parent ( ) const
inlinevirtual

Returns this item's parent item or 0 if it is a toplevel item.

Reimplemented from YItem.

Reimplemented from YItem.

Reimplemented in YMenuItem.

◆ setOpen()

void YTreeItem::setOpen ( bool open = true)

Change the 'isOpen' flag.


The documentation for this class was generated from the following files: