libyui
Public Member Functions

YTreeItem Class Reference

#include <YTreeItem.h>

Inheritance diagram for YTreeItem:
YItem YMenuItem YWidgetTreeItem

List of all members.

Public Member Functions

 YTreeItem (const string &label, bool isOpen=false)
 YTreeItem (const string &label, const string &iconName, bool isOpen=false)
 YTreeItem (YTreeItem *parent, const string &label, bool isOpen=false)
 YTreeItem (YTreeItem *parent, const string &label, const 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 YTreeItemparent () const

Detailed Description

Item class for tree items.

This class implements children management.


Constructor & Destructor Documentation

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

Constructors for toplevel items.

YTreeItem::YTreeItem ( YTreeItem parent,
const 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 ( ) [virtual]

Destructor.

This will delete all children.


Member Function Documentation

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.

virtual YItemIterator YTreeItem::childrenBegin ( ) [inline, virtual]

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

Reimplemented from YItem.

Reimplemented from YItem.

virtual YItemIterator YTreeItem::childrenEnd ( ) [inline, virtual]

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

Reimplemented from YItem.

Reimplemented from YItem.

void YTreeItem::deleteChildren ( ) [virtual]

Delete all child items.

virtual bool YTreeItem::hasChildren ( ) const [inline, virtual]

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

Reimplemented from YItem.

Reimplemented from YItem.

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.

virtual YTreeItem* YTreeItem::parent ( ) const [inline, virtual]

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

Reimplemented from YItem.

Reimplemented from YItem.

Reimplemented in YMenuItem.

void YTreeItem::setOpen ( bool  open)

Change the 'isOpen' flag.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Friends