#include <YTree.h>
Public Member Functions | |
| YTreeItem (YTree *parent, const YCPValue &id, const YCPString &text, const YCPString &iconName, bool open=false) | |
| YTreeItem (YTreeItem *parent, const YCPValue &id, const YCPString &text, const YCPString &iconName, bool open=false) | |
| YTreeItem (YTree *parent, const YCPString &text, const YCPString &iconName, void *data, bool open=false) | |
| YTreeItem (YTreeItem *parent, const YCPString &text, const YCPString &iconName, void *data, bool open=false) | |
| virtual | ~YTreeItem () |
| YTreeItem * | parent () const |
| YTree * | tree () const |
| const YCPString & | getText () const |
| const YCPValue & | getId () const |
| const YTreeItemList & | itemList () const |
| bool | isOpenByDefault () const |
| YTreeItem * | findItemWithId (const YCPValue &id) |
| YTreeItem * | findItemWithText (const YCPString &text) |
| void | setOpen (bool open) |
| bool | isOpen () const |
| void * | data () const |
| void | setData (void *data) |
| YCPString | iconName () const |
| void | setIconName (const YCPString &icon) |
Protected Attributes | |
| YCPValue | _id |
| void * | _data |
| YCPString | _text |
| YCPString | _iconName |
| YTree * | _parentTree |
| YTreeItem * | _parentItem |
| bool | _openByDefault |
| bool | _open |
| YTreeItemList | _items |
Friends | |
| class | YTree |
| YTreeItem::YTreeItem | ( | YTree * | parent, | |
| const YCPValue & | id, | |||
| const YCPString & | text, | |||
| const YCPString & | iconName, | |||
| bool | open = false | |||
| ) |
Regular constructor for root level items.
| YTreeItem::YTreeItem | ( | YTreeItem * | parent, | |
| const YCPValue & | id, | |||
| const YCPString & | text, | |||
| const YCPString & | iconName, | |||
| bool | open = false | |||
| ) |
Regular constructor for items in deeper tree levels.
| YTreeItem::YTreeItem | ( | YTree * | parent, | |
| const YCPString & | text, | |||
| const YCPString & | iconName, | |||
| void * | data, | |||
| bool | open = false | |||
| ) |
Special constructor for root items that take an opaque data pointer for application use: This kind of root item can be used to reference to external objects that are connected with this tree item. Use YTreeItem::data() to retrieve this pointer. Casting will be necessary to make any use of it.
| YTreeItem::YTreeItem | ( | YTreeItem * | parent, | |
| const YCPString & | text, | |||
| const YCPString & | iconName, | |||
| void * | data, | |||
| bool | open = false | |||
| ) |
Special constructor for deeper level items that take an opaque data pointer for application use: This kind of root item can be used to reference to external objects that are connected with this tree item. Use YTreeItem::data() to retrieve this pointer. Casting will be necessary to make any use of it.
| YTreeItem::~YTreeItem | ( | ) | [virtual] |
Destructor.
| YTreeItem* YTreeItem::parent | ( | ) | const [inline] |
| YTree* YTreeItem::tree | ( | ) | const [inline] |
| const YCPString& YTreeItem::getText | ( | ) | const [inline] |
| const YCPValue& YTreeItem::getId | ( | ) | const [inline] |
| const YTreeItemList& YTreeItem::itemList | ( | ) | const [inline] |
| bool YTreeItem::isOpenByDefault | ( | ) | const [inline] |
Recursively search for an item with a given ID. Returns 0 if not found.
Recursively search for an item with a given text. Returns 0 if not found.
| void YTreeItem::setOpen | ( | bool | open | ) | [inline] |
Set this item's "open" flag. The UI has to take care to set this each time the user opens or closes a branch.
| bool YTreeItem::isOpen | ( | ) | const [inline] |
Returns this item's "open" flag.
| void* YTreeItem::data | ( | ) | const [inline] |
Returns the opaque data pointer for applicaton use.
| void YTreeItem::setData | ( | void * | data | ) | [inline] |
Set the opaque data pointer. The application may choose to store internal data here. Watch for dangling pointers!
| YCPString YTreeItem::iconName | ( | ) | const |
Returns the name of this item's icon or an empty string if it doesn't have one.
| void YTreeItem::setIconName | ( | const YCPString & | icon | ) | [inline] |
Sets this item's icon name.
friend class YTree [friend] |
YCPValue YTreeItem::_id [protected] |
void* YTreeItem::_data [protected] |
YCPString YTreeItem::_text [protected] |
YCPString YTreeItem::_iconName [protected] |
YTree* YTreeItem::_parentTree [protected] |
YTreeItem* YTreeItem::_parentItem [protected] |
bool YTreeItem::_openByDefault [protected] |
bool YTreeItem::_open [protected] |
YTreeItemList YTreeItem::_items [protected] |
1.5.0