libyui-ncurses-pkg
 
Loading...
Searching...
No Matches
NCPkgTable Class Reference

#include <NCPkgTable.h>

Inheritance diagram for NCPkgTable:
Collaboration diagram for NCPkgTable:

Public Types

enum  NCPkgTableType {
  T_Packages , T_Availables , T_Patches , T_Update ,
  T_PatchPkgs , T_Selections , T_Languages , T_MultiVersion ,
  T_Unknown
}
 
enum  NCPkgTableListAction {
  A_Install , A_Delete , A_Keep , A_UpdateNewer ,
  A_Update , A_Unknown
}
 
enum  NCPkgTableListType { L_Changes , L_Installed , L_Unknown }
 
enum  NCPkgTableInfoType {
  I_Descr , I_Technical , I_Versions , I_Files ,
  I_Deps , I_PatchDescr , I_PatchPkgs
}
 

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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ NCPkgTable()

NCPkgTable::NCPkgTable ( YWidget * parent,
YTableHeader * tableHeader )

Constructor

Member Function Documentation

◆ addLine()

void NCPkgTable::addLine ( ZyppStatus status,
const std::vector< std::string > & elements,
ZyppObj objPtr,
ZyppSel slbPtr )
virtual

This method is called to add a line to the package list.

Parameters
statusThe package status (first column of the table)
elementsA std::vector<std::string> containing the package data
objPtrThe pointer to the packagemanager object
objPtrThe pointer to the selectable object
Returns
void

◆ changeStatus()

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

Parameters
newstatThe new status
slbPtrThe pointer to the object to change
objPtris candidatePtr or what the user selected instead of it.
Returns
bool

◆ confirmRetracted()

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.

◆ createInfoEntry()

bool NCPkgTable::createInfoEntry ( std::string text)

Creates a line in the table shwing an info text.

Parameters
textThe information
Returns
bool

◆ createListEntry()

bool NCPkgTable::createListEntry ( ZyppPkg pkgPtr,
ZyppSel slbPtr )

Creates a line in the package table.

Parameters
pkgPtrThe package pointer
slbPtrThe selectable pointer
Returns
bool

◆ createPatchEntry()

bool NCPkgTable::createPatchEntry ( ZyppPatch pkgPtr,
ZyppSel slbPtr )

Creates a line in the YOU patch table.

Parameters
pkgPtrThe YOU patch pointer
Returns
bool

◆ drawList()

void NCPkgTable::drawList ( )
inline

Draws the package list (has to be called after the loop with addLine() calls)

◆ fillHeader()

void NCPkgTable::fillHeader ( )

Fills the header of the table

Returns
void

◆ getCellContents()

NClabel NCPkgTable::getCellContents ( int index,
int colnum )

Returns the contents of a certain cell in table

Parameters
indexThe table line
columnThe column @eturn NClabel

◆ getDataPointer()

ZyppObj NCPkgTable::getDataPointer ( int index)

Gets the data pointer of a certain package.

Parameters
indexThe index in package table (the line)
Returns
ZyppObj

◆ getNumLines()

unsigned int NCPkgTable::getNumLines ( )
inline

Returns the number of lines in the table (the table size)

Returns
unsigned int

◆ getSelPointer()

ZyppSel NCPkgTable::getSelPointer ( int index)

Gets the selectable pointer of a certain package.

Parameters
indexThe index in package table (the line)
Returns
ZyppSel

◆ getStatus()

ZyppStatus NCPkgTable::getStatus ( int index)

Gets the currently displayed package status.

Parameters
indexThe index in package table (the line)
Returns
ZyppStatus

◆ itemsCleared()

void NCPkgTable::itemsCleared ( )
virtual

Clears the package list

◆ setPackager()

void NCPkgTable::setPackager ( NCPackageSelector * pkg)
inline

Sets the member variable PackageSelector *packager

Parameters
pkgThe PackageSelector pointer
Returns
void

◆ setTableType()

bool NCPkgTable::setTableType ( NCPkgTableType type,
NCPkgStatusStrategy * strategy )
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)

Parameters
typeThe type (see enum NCPkgTableType)
strategyThe certain strategy (available strategies see NCPkgStatusStrategy.h). Has to be allocated with new - is deleted by NCPkgTable.
Returns
bool

◆ showInformation()

bool NCPkgTable::showInformation ( )

Show the corresponding information (e.g. the package description).

Returns
bool

◆ updateTable()

bool NCPkgTable::updateTable ( )

Set the status information if status has changed

Returns
bool

◆ wHandleInput()

NCursesEvent NCPkgTable::wHandleInput ( wint_t key)
virtual

Handles the events concerning the package table (e.g. scroll the list, change the package status, ...)

Parameters
keyThe key which is pressed
Returns
NCursesEvent

Reimplemented in NCPkgFilterPattern.


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