libyui-ncurses-pkg  2.43.4.1
 All Classes Functions
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, I_PatchPkgsVersions
}
 

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 ()
 
virtual void cellChanged (int index, int colnum, const std::string &newtext)
 
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 toggleObjStatus ()
 
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 ()
 
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 175 of file NCPkgTable.h.

Constructor & Destructor Documentation

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

Constructor

Definition at line 120 of file NCPkgTable.cc.

Member Function Documentation

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.

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.

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:

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:

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:

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:

void NCPkgTable::drawList ( )
inline

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

Definition at line 264 of file NCPkgTable.h.

void NCPkgTable::fillHeader ( )

Fills the header of the table

Returns
void

Definition at line 448 of file NCPkgTable.cc.

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

Returns the contents of a certain cell in table

Parameters
indexThe table line
columnThe column NClabel
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 875 of file NCPkgTable.cc.

unsigned int NCPkgTable::getNumLines ( )
inline

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

Returns
unsigned int

Definition at line 384 of file NCPkgTable.h.

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 885 of file NCPkgTable.cc.

ZyppStatus NCPkgTable::getStatus ( int  index)

Gets the currently displayed package status.

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

Definition at line 865 of file NCPkgTable.cc.

void NCPkgTable::itemsCleared ( )
virtual

Clears the package list

Definition at line 184 of file NCPkgTable.cc.

void NCPkgTable::setPackager ( NCPackageSelector pkg)
inline

Sets the member variable PackageSelector *packager

Parameters
pkgThe PackageSelector pointer
Returns
void

Definition at line 301 of file NCPkgTable.h.

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 353 of file NCPkgTable.h.

bool NCPkgTable::showInformation ( )

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

Returns
bool

Definition at line 761 of file NCPkgTable.cc.

Here is the call graph for this function:

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:

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 801 of file NCPkgTable.cc.

Here is the call graph for this function:


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