libyui
3.0.10
|
#include <YTableItem.h>
Public Member Functions | |
YTableCell (const std::string &label, const std::string &iconName="") | |
YTableCell (YTableItem *parent, int column, const std::string &label, const std::string &iconName="") | |
virtual | ~YTableCell () |
std::string | label () const |
void | setLabel (const std::string &newLabel) |
std::string | iconName () const |
bool | hasIconName () const |
void | setIconName (const std::string &newIconName) |
YTableItem * | parent () const |
int | column () const |
int | itemIndex () const |
void | reparent (YTableItem *parent, int column) |
One cell (one column in one row) of a YTableItem. Each cell has a label (a user visible text) and optionally an icon (*).
Note that cells don't have individual IDs; they have just an index. The first cell in an item is cell(0). In an ideal world, each YTableItem would have exactly as many cells as there are columns in the YTable, but these classes make no such assumptions. A YTableItem might have any number of cells, including none.
The YTable widget is free to ignore any excess cells if there are more than the YTable widget has columns. If there are less cells than the table has columns, the nonexistent cells will be treated as empty.
(*) Not all UIs can handle icons. UIs that can't handle them will simply ignore any icons specified for YTableCells. Thus, applications should either check the UI capabilities if it can handle icons or use icons only as an additional visual cue that still has a text counterpart (so the user can still make sense of the table content when no icons are visible).
Definition at line 212 of file YTableItem.h.
YTableCell::YTableCell | ( | const std::string & | label, |
const std::string & | iconName = "" |
||
) | [inline] |
Constructor with label and optional icon name for cells that don't have a parent item yet (that will be added to a parent later with setParent()).
Definition at line 220 of file YTableItem.h.
YTableCell::YTableCell | ( | YTableItem * | parent, |
int | column, | ||
const std::string & | label, | ||
const std::string & | iconName = "" |
||
) | [inline] |
Constructor with parent, column no., label and optional icon name for cells that are created with a parent.
Definition at line 231 of file YTableItem.h.
virtual YTableCell::~YTableCell | ( | ) | [inline, virtual] |
Destructor. Not strictly needed inside this class, but useful for derived classes. Since this is the only virtual method of this class, the cost of this is a vtable for this class and a pointer to the vtable in each instance.
Definition at line 247 of file YTableItem.h.
int YTableCell::column | ( | ) | const [inline] |
Return this cell's column no. (counting from 0on) or -1 if it doesn't have a parent yet.
Definition at line 292 of file YTableItem.h.
bool YTableCell::hasIconName | ( | ) | const [inline] |
Return 'true' if this cell has an icon name.
Definition at line 272 of file YTableItem.h.
std::string YTableCell::iconName | ( | ) | const [inline] |
Return this cell's icon name.
Definition at line 267 of file YTableItem.h.
int YTableCell::itemIndex | ( | ) | const [inline] |
Convenience function: Return this cell's parent item's index within its table widget or -1 if there is no parent item or no parent table.
Definition at line 298 of file YTableItem.h.
std::string YTableCell::label | ( | ) | const [inline] |
Return this cells's label. This is what the user sees in a dialog, so this will usually be a translated text.
Definition at line 253 of file YTableItem.h.
YTableItem* YTableCell::parent | ( | ) | const [inline] |
Return this cell's parent item or 0 if it doesn't have one yet.
Definition at line 286 of file YTableItem.h.
void YTableCell::reparent | ( | YTableItem * | parent, |
int | column | ||
) |
Set this cell's parent item and column no. if it doesn't have a parent yet.
This method will throw an exception if the cell already has a parent.
Definition at line 171 of file YTableItem.cc.
void YTableCell::setIconName | ( | const std::string & | newIconName | ) | [inline] |
Set this cell's icon name.
If this is called after the corresponding table item (table row) is added to the table widget, call YTable::cellChanged() to notify the table widget about the fact. Only then will the display be updated.
Definition at line 281 of file YTableItem.h.
void YTableCell::setLabel | ( | const std::string & | newLabel | ) | [inline] |
Set this cell's label.
If this is called after the corresponding table item (table row) is added to the table widget, call YTable::cellChanged() to notify the table widget about the fact. Only then will the display be updated.
Definition at line 262 of file YTableItem.h.