libyui-ncurses-pkg  2.48.9
NCPkgTable Class Reference

The package table class. More...

#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)
 Constructor.
 
virtual void addLine (ZyppStatus status, const std::vector< std::string > &elements, ZyppObj objPtr, ZyppSel slbPtr)
 This method is called to add a line to the package list. More...
 
void drawList ()
 Draws the package list (has to be called after the loop with addLine() calls)
 
virtual void itemsCleared ()
 Clears the package list.
 
virtual void cellChanged (int index, int colnum, const std::string &newtext)
 Changes the contents of a certain cell in table. More...
 
NClabel getCellContents (int index, int colnum)
 Returns the contents of a certain cell in table. More...
 
virtual NCursesEvent wHandleInput (wint_t key)
 Handles the events concerning the package table (e.g. More...
 
void setPackager (NCPackageSelector *pkg)
 Sets the member variable PackageSelector *packager. More...
 
bool 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. More...
 
bool changeObjStatus (int key)
 
bool changeListObjStatus (NCPkgTableListAction key)
 
bool toggleObjStatus ()
 
bool updateTable ()
 Set the status information if status has changed. More...
 
ZyppStatus getStatus (int index)
 Gets the currently displayed package status. More...
 
bool setTableType (NCPkgTableType type, NCPkgStatusStrategy *strategy)
 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) More...
 
NCPkgTableType getTableType ()
 
ZyppObj getDataPointer (int index)
 Gets the data pointer of a certain package. More...
 
ZyppSel getSelPointer (int index)
 Gets the selectable pointer of a certain package. More...
 
unsigned int getNumLines ()
 Returns the number of lines in the table (the table size) More...
 
void fillHeader ()
 Fills the header of the table. More...
 
bool createListEntry (ZyppPkg pkgPtr, ZyppSel slbPtr)
 Creates a line in the package table. More...
 
bool createPatchEntry (ZyppPatch pkgPtr, ZyppSel slbPtr)
 Creates a line in the YOU patch table. More...
 
bool createInfoEntry (std::string text)
 Creates a line in the table shwing an info text. More...
 
bool showInformation ()
 Show the corresponding information (e.g. More...
 
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.

Definition at line 207 of file NCPkgTable.h.

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

Definition at line 156 of file NCPkgTable.cc.

◆ cellChanged()

void NCPkgTable::cellChanged ( int  index,
int  colnum,
const std::string &  newtext 
)
virtual

Changes the contents of a certain cell in table.

Parameters
indexThe table line
columnThe column
newtextThe new text void

Definition at line 198 of file NCPkgTable.cc.

◆ 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

Definition at line 212 of file NCPkgTable.cc.

Here is the call graph for this function:

◆ createInfoEntry()

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

Creates a line in the table shwing an info text.

Parameters
textThe information
Returns
bool

Definition at line 704 of file NCPkgTable.cc.

Here is the call graph for this function:

◆ createListEntry()

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

Creates a line in the package table.

Parameters
pkgPtrThe package pointer
slbPtrThe selectable pointer
Returns
bool

Definition at line 550 of file NCPkgTable.cc.

Here is the call graph for this function:

◆ createPatchEntry()

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

Creates a line in the YOU patch table.

Parameters
pkgPtrThe YOU patch pointer
Returns
bool

Definition at line 723 of file NCPkgTable.cc.

Here is the call graph for this function:

◆ fillHeader()

void NCPkgTable::fillHeader ( )

Fills the header of the table.

Returns
void

Definition at line 448 of file NCPkgTable.cc.

◆ getCellContents()

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

Returns the contents of a certain cell in table.

Parameters
indexThe table line
columnThe column 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

Definition at line 874 of file NCPkgTable.cc.

◆ getNumLines()

unsigned int NCPkgTable::getNumLines ( )
inline

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

Returns
unsigned int

Definition at line 415 of file NCPkgTable.h.

◆ getSelPointer()

ZyppSel NCPkgTable::getSelPointer ( int  index)

Gets the selectable pointer of a certain package.

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

Definition at line 884 of file NCPkgTable.cc.

◆ getStatus()

ZyppStatus NCPkgTable::getStatus ( int  index)

Gets the currently displayed package status.

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

Definition at line 864 of file NCPkgTable.cc.

◆ setPackager()

void NCPkgTable::setPackager ( NCPackageSelector pkg)
inline

Sets the member variable PackageSelector *packager.

Parameters
pkgThe PackageSelector pointer
Returns
void

Definition at line 332 of file NCPkgTable.h.

◆ 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

Definition at line 384 of file NCPkgTable.h.

◆ showInformation()

bool NCPkgTable::showInformation ( )

Show the corresponding information (e.g.

the package description).

Returns
bool

Definition at line 762 of file NCPkgTable.cc.

Here is the call graph for this function:

◆ updateTable()

bool NCPkgTable::updateTable ( )

Set the status information if status has changed.

Returns
bool

Definition at line 369 of file NCPkgTable.cc.

Here is the call graph for this function:

◆ 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.

Definition at line 800 of file NCPkgTable.cc.

Here is the call graph for this function:

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