|
libyui
3.12.1
|
Item class for YTable items. More...
#include <YTableItem.h>


Public Member Functions | |
| YTableItem () | |
| Default constructor. More... | |
| YTableItem (YTableItem *parent, bool isOpen=false) | |
| Constructor for a nested table item, i.e. More... | |
| YTableItem (const std::string &label_0, const std::string &label_1=std::string(), const std::string &label_2=std::string(), const std::string &label_3=std::string(), const std::string &label_4=std::string(), const std::string &label_5=std::string(), const std::string &label_6=std::string(), const std::string &label_7=std::string(), const std::string &label_8=std::string(), const std::string &label_9=std::string()) | |
| Convenience constructor for a (toplevel) table item without any icons. More... | |
| YTableItem (YTableItem *parent, const std::string &label_0, const std::string &label_1=std::string(), const std::string &label_2=std::string(), const std::string &label_3=std::string(), const std::string &label_4=std::string(), const std::string &label_5=std::string(), const std::string &label_6=std::string(), const std::string &label_7=std::string(), const std::string &label_8=std::string(), const std::string &label_9=std::string()) | |
| Convenience constructor for a nested table item without any icons. | |
| virtual | ~YTableItem () |
| Destructor. More... | |
| virtual const char * | itemClass () const |
| Returns a descriptive name of this widget class for logging, debugging etc. | |
| void | addCell (YTableCell *cell_disown) |
| Add a cell. More... | |
| void | addCell (const std::string &label, const std::string &iconName=std::string(), const std::string &sortKey=std::string()) |
| Create a new cell and add it (even if all 'label', 'iconName' and 'sortKey' are empty). | |
| void | addCells (const std::string &label_0, const std::string &label_1, const std::string &label_2=std::string(), const std::string &label_3=std::string(), const std::string &label_4=std::string(), const std::string &label_5=std::string(), const std::string &label_6=std::string(), const std::string &label_7=std::string(), const std::string &label_8=std::string(), const std::string &label_9=std::string()) |
| Add up to 10 cells without any icons. | |
| void | deleteCells () |
| Delete all cells. | |
| YTableCellIterator | cellsBegin () |
| Return an iterator that points to the first cell of this item. | |
| YTableCellConstIterator | cellsBegin () const |
| YTableCellIterator | cellsEnd () |
| Return an iterator that points after the last cell of this item. | |
| YTableCellConstIterator | cellsEnd () const |
| const YTableCell * | cell (int index) const |
| Return the cell at the specified index (counting from 0 on) or 0 if there is none. | |
| YTableCell * | cell (int index) |
| int | cellCount () const |
| Return the number of cells this item has. | |
| bool | hasCell (int index) const |
| Return 'true' if this item has a cell with the specified index (counting from 0 on), 'false' otherwise. | |
| std::string | label (int index) const |
| Return the label of cell no. More... | |
| std::string | iconName (int index) const |
| Return the icon name of cell no. More... | |
| bool | hasIconName (int index) const |
| Return 'true' if there is a cell with the specified index that has an icon name. | |
| std::string | label () const |
| Just for debugging. | |
| virtual std::string | debugLabel () const |
| Return a descriptive label of this item instance for debugging. More... | |
Public Member Functions inherited from YTreeItem | |
| YTreeItem (const std::string &label, bool isOpen=false) | |
| Constructors for toplevel items. | |
| YTreeItem (const std::string &label, const std::string &iconName, bool isOpen=false) | |
| YTreeItem (YTreeItem *parent, const std::string &label, bool isOpen=false) | |
| Constructors for items that have a parent item. More... | |
| YTreeItem (YTreeItem *parent, const std::string &label, const std::string &iconName, bool isOpen=false) | |
| virtual | ~YTreeItem () |
| Destructor. More... | |
| virtual bool | hasChildren () const |
| Return 'true' if this item has any child items. More... | |
| virtual YItemIterator | childrenBegin () |
| Return an iterator that points to the first child item of this item. More... | |
| virtual YItemConstIterator | childrenBegin () const |
| virtual YItemIterator | childrenEnd () |
| Return an iterator that points after the last child item of this item. More... | |
| virtual YItemConstIterator | childrenEnd () const |
| virtual void | addChild (YItem *item_disown) |
| Add a child item to this item. More... | |
| virtual void | deleteChildren () |
| Delete all child items. | |
| bool | isOpen () const |
| Return 'true' if this tree item should be displayed open (with its children visible) by default. More... | |
| void | setOpen (bool open=true) |
| Change the 'isOpen' flag. | |
| void | setClosed () |
| virtual YTreeItem * | parent () const |
| Returns this item's parent item or 0 if it is a toplevel item. More... | |
Public Member Functions inherited from YItem | |
| YItem (const std::string &label, bool selected=false) | |
| Constructor with just the label and optionally the selected state. | |
| YItem (const std::string &label, const std::string &iconName, bool selected=false) | |
| Constructor with label and icon name and optionally the selected state. | |
| virtual | ~YItem () |
| Destructor. | |
| std::string | label () const |
| Return this item's label. More... | |
| void | setLabel (const std::string &newLabel) |
| Set this item's label. | |
| std::string | iconName () const |
| Return this item's icon name. | |
| bool | hasIconName () const |
| Return 'true' if this item has an icon name. | |
| void | setIconName (const std::string &newIconName) |
| Set this item's icon name. | |
| bool | selected () const |
| Return 'true' if this item is currently selected. | |
| void | setSelected (bool sel=true) |
| Select or unselect this item. More... | |
| int | status () const |
| Return the status of this item. More... | |
| void | setStatus (int newStatus) |
| Set the status of this item. More... | |
| void | setIndex (int index) |
| Set this item's index. | |
| int | index () const |
| Return the index of this item (as set with setIndex() ). | |
| void | setData (void *newData) |
| Set the opaque data pointer for application use. More... | |
| void * | data () const |
| Return the opaque data pointer. | |
| std::string | limitLength (const std::string &text, int limit) const |
| Return a string of maximum 'limit' characters. More... | |
Item class for YTable items.
Each YTableItem corresponds to one row in a YTable.
A YTableItem might have any number of cells (columns within this row), including none. The YTable widget is free to ignore any excess cells if there are more than the YTable widget has columns. The YTable widget is to treat nonexistent cells like empty ones.
Note that while YTable items and their cells can be manipulated through pointers, their visual representation on screen might be updated only upon calling certain methods of the YTable widget. See the YTable reference for details.
Definition at line 61 of file YTableItem.h.
| YTableItem::YTableItem | ( | ) |
Default constructor.
Use addCell() to give it any content.
Definition at line 38 of file YTableItem.cc.
| YTableItem::YTableItem | ( | YTableItem * | parent, |
| bool | isOpen = false |
||
| ) |
Constructor for a nested table item, i.e.
one with a parent item.
Definition at line 45 of file YTableItem.cc.
| YTableItem::YTableItem | ( | const std::string & | label_0, |
| const std::string & | label_1 = std::string(), |
||
| const std::string & | label_2 = std::string(), |
||
| const std::string & | label_3 = std::string(), |
||
| const std::string & | label_4 = std::string(), |
||
| const std::string & | label_5 = std::string(), |
||
| const std::string & | label_6 = std::string(), |
||
| const std::string & | label_7 = std::string(), |
||
| const std::string & | label_8 = std::string(), |
||
| const std::string & | label_9 = std::string() |
||
| ) |
Convenience constructor for a (toplevel) table item without any icons.
This will create up to 10 (0..9) cells. Empty cells for empty labels at the end of the labels are not created, but empty cells in between are.
new YTableItem( "one", "two", "", "", "five" );
will create an item with 5 cells:
cell[0] ==> "one" cell[1] ==> "two" cell[2] ==> "" cell[3] ==> "" cell[4] ==> "five"
Definition at line 53 of file YTableItem.cc.

|
virtual |
Destructor.
This will delete all cells.
Definition at line 104 of file YTableItem.cc.

| void YTableItem::addCell | ( | YTableCell * | cell_disown | ) |
Add a cell.
This item will assume ownership over the cell and delete it when appropriate (when the table is destroyed or when table items are replaced), at which time the pointer will become invalid.
Cells can still be changed after they (and the item they belong to) are added, but in that case, YTable::cellChanged() needs to be called to update the table display accordingly.
Definition at line 127 of file YTableItem.cc.

|
virtual |
Return a descriptive label of this item instance for debugging.
This might be truncated if the original label is too long.
Reimplemented from YItem.
Definition at line 238 of file YTableItem.cc.

| string YTableItem::iconName | ( | int | index | ) | const |
Return the icon name of cell no.
'index' (counting from 0 on) or an empty string if there is no cell with that index.
Definition at line 224 of file YTableItem.cc.

| string YTableItem::label | ( | int | index | ) | const |
Return the label of cell no.
'index' (counting from 0 on) or an empty string if there is no cell with that index.
Definition at line 217 of file YTableItem.cc.
