API Documentation
Public Member Functions | List of all members
nkWinUi::TreeView::Item Class Reference

Holds information of a tree view item. More...

Public Member Functions

 Item () noexcept
 
virtual ~Item ()
 
ItemaddChild (Item *child)
 
ItemgetChild (unsigned int index) const
 
unsigned int getChildCount () const
 
bool isParent () const
 
void disavowChild (Item *child)
 
void setText (nkMemory::StringView text)
 
void setIcon (Image *image)
 
nkMemory::StringView getText () const
 
ImagegetIcon () const
 
void setParentTree (TreeView *parent)
 
TreeViewgetParentTree () const
 
void setParentItem (Item *item)
 
ItemgetParentItem () const
 
void setAttachedData (void *data)
 
void * getAttachedData () const
 
bool getCollapsed () const
 
virtual void setCollapsed (bool value)
 
void exportIntrospection (nkExport::Node *rootNode)
 

Detailed Description

Holds information of a tree view item.

Constructor & Destructor Documentation

◆ Item()

nkWinUi::TreeView::Item::Item ( )
noexcept

Constructor.

◆ ~Item()

virtual nkWinUi::TreeView::Item::~Item ( )
virtual

Destructor.

Member Function Documentation

◆ addChild()

Item* nkWinUi::TreeView::Item::addChild ( Item child)

Adds a child item.

Parameters
childThe item to add as a child.
Returns
The item provided.

◆ getChild()

Item* nkWinUi::TreeView::Item::getChild ( unsigned int  index) const
Parameters
indexThe index of the item wanted.
Returns
The child associated to given index if available, nullptr else.

◆ getChildCount()

unsigned int nkWinUi::TreeView::Item::getChildCount ( ) const
Returns
The number of children items available.

◆ isParent()

bool nkWinUi::TreeView::Item::isParent ( ) const
Returns
Whether the item has at least oen child (true) or not (false).

◆ disavowChild()

void nkWinUi::TreeView::Item::disavowChild ( Item child)

Makes the item forget about a child.

Parameters
childThe item to forget.

◆ setText()

void nkWinUi::TreeView::Item::setText ( nkMemory::StringView  text)

Sets the text displayed for the item.

Parameters
textThe text to show.

◆ setIcon()

void nkWinUi::TreeView::Item::setIcon ( Image image)

Sets the icon to use at the front of the item's line.

Parameters
imageThe image to use.

◆ getText()

nkMemory::StringView nkWinUi::TreeView::Item::getText ( ) const
Returns
Currently displayed text.

◆ getIcon()

Image* nkWinUi::TreeView::Item::getIcon ( ) const
Returns
The image used as its icon by the item.

◆ setParentTree()

void nkWinUi::TreeView::Item::setParentTree ( TreeView parent)

Sets the parent tree view.

Parameters
parentThe parent window to set.

◆ getParentTree()

TreeView* nkWinUi::TreeView::Item::getParentTree ( ) const
Returns
The parent tree view.

◆ setParentItem()

void nkWinUi::TreeView::Item::setParentItem ( Item item)

Sets the parent item, if any.

Parameters
itemThe parent item to set.

◆ getParentItem()

Item* nkWinUi::TreeView::Item::getParentItem ( ) const
Returns
The current parent item.

◆ setAttachedData()

void nkWinUi::TreeView::Item::setAttachedData ( void *  data)

Sets user data attached to the item.

Parameters
dataThe data to attach.
Remarks
The item does not own the user data attached.

◆ getAttachedData()

void* nkWinUi::TreeView::Item::getAttachedData ( ) const
Returns
Currently attached user data.

◆ getCollapsed()

bool nkWinUi::TreeView::Item::getCollapsed ( ) const
Returns
Whether the item is collapsed (true) or not (false).

◆ setCollapsed()

virtual void nkWinUi::TreeView::Item::setCollapsed ( bool  value)
virtual

Sets whether an item should be collapsed or not. A collapsed item will hide its descending hierarchy from the view, if any.

Parameters
valueWhether the item should be collapsed (true) or not (false).

◆ exportIntrospection()

void nkWinUi::TreeView::Item::exportIntrospection ( nkExport::Node rootNode)

Basic export capabilities.

Parameters
rootNodeThe tree to export into.

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