libyui-ncurses-pkg
|
#include <NCPkgTable.h>
Public Member Functions | |
NCPkgTable (YWidget *parent, YTableHeader *tableHeader) | |
virtual void | addLine (ZyppStatus status, const std::vector< std::string > &elements, ZyppObj objPtr, ZyppSel slbPtr) |
void | drawList () |
virtual void | itemsCleared () |
NClabel | getCellContents (int index, int colnum) |
virtual NCursesEvent | wHandleInput (wint_t key) |
void | setPackager (NCPackageSelector *pkg) |
bool | changeStatus (ZyppStatus newstat, const ZyppSel &slbPtr, ZyppObj objPtr, bool singleChange) |
bool | changeObjStatus (int key) |
bool | changeListObjStatus (NCPkgTableListAction key) |
bool | cycleObjStatus () |
bool | updateTable () |
ZyppStatus | getStatus (int index) |
bool | setTableType (NCPkgTableType type, NCPkgStatusStrategy *strategy) |
NCPkgTableType | getTableType () |
ZyppObj | getDataPointer (int index) |
ZyppSel | getSelPointer (int index) |
unsigned int | getNumLines () |
void | fillHeader () |
bool | createListEntry (ZyppPkg pkgPtr, ZyppSel slbPtr) |
bool | createPatchEntry (ZyppPatch pkgPtr, ZyppSel slbPtr) |
bool | createInfoEntry (std::string text) |
bool | showInformation () |
bool | confirmRetracted (ZyppObj pkg, ZyppSel sel) |
void | setVisibleInfo (NCPkgTableInfoType info) |
NCPkgTableInfoType | VisibleInfo () |
bool | fillAvailableList (ZyppSel slb) |
bool | fillSummaryList (NCPkgTableListType type) |
void | updateInfo (ZyppObj pkgPtr, ZyppSel slbPtr, NCPkgTableInfoType mode) |
The package table class. Provides methods to fill the table, set the status info and so on. Has a connection to the PackageSelector which is used to do changes which affect other widgets.
NCPkgTable::NCPkgTable | ( | YWidget * | parent, |
YTableHeader * | tableHeader | ||
) |
Constructor
|
virtual |
This method is called to add a line to the package list.
status | The package status (first column of the table) |
elements | A std::vector<std::string> containing the package data |
objPtr | The pointer to the packagemanager object |
objPtr | The pointer to the selectable object |
bool NCPkgTable::changeStatus | ( | ZyppStatus | newstat, |
const ZyppSel & | slbPtr, | ||
ZyppObj | objPtr, | ||
bool | singleChange | ||
) |
Informs the package manager about the status change of the currently selected package and updates the states of all packages in the list
newstat | The new status |
slbPtr | The pointer to the object to change |
objPtr | is candidatePtr or what the user selected instead of it. |
bool NCPkgTable::confirmRetracted | ( | ZyppObj | pkg, |
ZyppSel | sel | ||
) |
Ask the user for confirmation of installing a retracted package. This returns 'true' if the user confirmed, 'false' if not.
bool NCPkgTable::createInfoEntry | ( | std::string | text | ) |
Creates a line in the table shwing an info text.
text | The information |
bool NCPkgTable::createListEntry | ( | ZyppPkg | pkgPtr, |
ZyppSel | slbPtr | ||
) |
Creates a line in the package table.
pkgPtr | The package pointer |
slbPtr | The selectable pointer |
bool NCPkgTable::createPatchEntry | ( | ZyppPatch | pkgPtr, |
ZyppSel | slbPtr | ||
) |
Creates a line in the YOU patch table.
pkgPtr | The YOU patch pointer |
|
inline |
Draws the package list (has to be called after the loop with addLine() calls)
void NCPkgTable::fillHeader | ( | ) |
Fills the header of the table
NClabel NCPkgTable::getCellContents | ( | int | index, |
int | colnum | ||
) |
Returns the contents of a certain cell in table
index | The table line |
column | The column @eturn NClabel |
ZyppObj NCPkgTable::getDataPointer | ( | int | index | ) |
Gets the data pointer of a certain package.
index | The index in package table (the line) |
|
inline |
Returns the number of lines in the table (the table size)
ZyppSel NCPkgTable::getSelPointer | ( | int | index | ) |
Gets the selectable pointer of a certain package.
index | The index in package table (the line) |
ZyppStatus NCPkgTable::getStatus | ( | int | index | ) |
Gets the currently displayed package status.
index | The index in package table (the line) |
|
virtual |
Clears the package list
|
inline |
Sets the member variable PackageSelector *packager
pkg | The PackageSelector pointer |
|
inline |
Sets the type of the table and the status strategy (which means call particular methods to set/get the status for different zypp::ResObjects (zypp::Patch, zypp::Package or available zypp::Package)
type | The type (see enum NCPkgTableType) |
strategy | The certain strategy (available strategies see NCPkgStatusStrategy.h). Has to be allocated with new - is deleted by NCPkgTable. |
bool NCPkgTable::showInformation | ( | ) |
Show the corresponding information (e.g. the package description).
bool NCPkgTable::updateTable | ( | ) |
Set the status information if status has changed
|
virtual |
Handles the events concerning the package table (e.g. scroll the list, change the package status, ...)
key | The key which is pressed |
Reimplemented in NCPkgFilterPattern.