libyui-ncurses  2.57.2
NCFileTable Class Reference
Inheritance diagram for NCFileTable:
Collaboration diagram for NCFileTable:

Public Member Functions

 NCFileTable (YWidget *parent, YTableHeader *tableHeader, NCFileSelectionType type, const std::string &filter, const std::string &iniDir)
 Constructor.
 
void setCurrentFile (const std::string &file)
 
bool filterMatch (const std::string &fileName)
 
std::string getCurrentFile ()
 
virtual void fillHeader ()
 Fill the column headers of the file table.
 
virtual bool createListEntry (NCFileInfo *fileInfo)
 Creates a line in the package table.
 
virtual bool fillList ()
 Fill the std::list of files Returns 'true' on success.
 
virtual NCursesEvent wHandleInput (wint_t key)
 Keyboard input handler. More...
 
- Public Member Functions inherited from NCFileSelection
 NCFileSelection (YWidget *parent, YTableHeader *tableHeader, NCFileSelectionType type, const std::string &iniDir)
 Constructor.
 
NCFileInfogetFileInfo (int index)
 Get the file info. More...
 
void setTableType (NCFileSelectionType type)
 Set the type of the table widget type: Possible values: NCFileSelection::T_Overview, NCFileSelection::T_Detailed.
 
virtual void addLine (const std::vector< std::string > &elements, NCFileInfo *fileInfo)
 
unsigned getNumLines ()
 Get number of lines ( std::list entries )
 
void drawList ()
 Draws the file std::list (has to be called after the loop with addLine() calls)
 
virtual void deleteAllItems ()
 Clears the package std::list.
 
std::string getCurrentDir ()
 Get the current directory return: The currently selected directory.
 
void setStartDir (const std::string &start)
 Set the start directory.
 
- Public Member Functions inherited from NCTable
 NCTable (YWidget *parent, YTableHeader *tableHeader, bool multiSelection=false)
 
void setHeader (const std::vector< std::string > &head)
 Set the table header (the first line inside the table) as strings.
 
std::vector< std::string > getHeader () const
 Get the table headers (the first line inside the table) as strings. More...
 
virtual void addItems (const YItemCollection &itemCollection)
 Add items. More...
 
virtual void addItem (YItem *yitem)
 Add one item. More...
 
virtual void addItem (YItem *yitem, NCTableLine::STATE state)
 Add one item with the specified state and redraw the table. More...
 
virtual int getCurrentIndex () const
 Get the index of the current item (the item under the cursor) or -1 if there is none.
 
virtual int getCurrentItem () const
 Get the index of the current item (the item under the cursor) or -1 if there is none, i.e. More...
 
YItem * getCurrentItemPointer ()
 Return a pointer to the current item (the item under the cursor) or 0 if there is none, i.e. More...
 
virtual void setCurrentItem (int index)
 Set the current item to the specified index.
 
virtual void scrollToFirstItem ()
 Scroll to the first item.
 
virtual void selectItem (YItem *yitem, bool selected)
 Select or deselect an item. More...
 
void selectCurrentItem ()
 Select the current item (the item under the cursor). More...
 
virtual void deselectAllItems ()
 Deselect all items. More...
 
virtual int preferredWidth ()
 libyui geometry management: Return the preferred width for this widget. More...
 
virtual int preferredHeight ()
 libyui geometry management: Return the preferred height for this widget. More...
 
virtual void setSize (int newWidth, int newHeight)
 libyui geometry management: Apply the width and height assigned from the parent layout widget. More...
 
virtual void setLabel (const std::string &nlabel)
 Set the label (the caption) above the table. More...
 
virtual void setEnabled (bool do_bv)
 Enable or disable this widget. More...
 
virtual bool setKeyboardFocus ()
 Set the keyboard focus to this widget. More...
 
bool setItemByKey (int key)
 Select an item by its hotkey. More...
 
void SetSepChar (const chtype colSepchar)
 Set the column separator character. More...
 
void SetSepWidth (const unsigned sepwidth)
 Set the separator width. More...
 
void SetHotCol (int hcol)
 Set the hotkey column (?). More...
 
bool bigList () const
 Flag: Is this a big list?
 
void setBigList (bool big)
 Set the "big list" flag.
 
void stripHotkeys ()
 Remove all hotkeys from the pad.
 
void setSortStrategy (NCTableSortStrategyBase *newStrategy)
 Set a sorting strategy. More...
 
NCTableSortStrategyBasesortStrategy () const
 Return the current sorting strategy.
 
- Public Member Functions inherited from NCPadWidget
 NCPadWidget (NCWidget *myparent=0)
 
 NCPadWidget (YWidget *parent)
 
size_t Columns ()
 
void setLabel (const NClabel &nlabel)
 
- Public Member Functions inherited from NCWidget
void grabSet (NCWidget *ngrab)
 
void grabRelease (NCWidget *ograb)
 
 NCWidget (NCWidget *myparent)
 
 NCWidget (YWidget *parent=0)
 
bool isValid () const
 
bool winExist () const
 
virtual const NCstyle::StylewStyle () const
 
const NCstyle::StWidgetwidgetStyle (bool nonactive=false) const
 
const NCstyle::StWidgetframeStyle () const
 
const NCstyle::StListlistStyle () const
 
wsze wGetDefsze () const
 
wrect wGetSize () const
 
void Update ()
 
void Redraw (bool sub=false)
 
void Recoded ()
 
NC::WState GetState () const
 
void SetState (const NC::WState newstate, bool force=false)
 
virtual bool HasHotkey (int key)
 
virtual bool HasFunctionHotkey (int key) const
 
virtual NCursesEvent wHandleHotkey (wint_t key)
 
void DumpOn (std::ostream &str, std::string prfx) const
 
- Public Member Functions inherited from tnode< NCWidget * >
 tnode (NCWidget * v, self *p=0, bool behind=true)
 New node, added as the last child by default (which is natural). More...
 
 tnode (NCWidget * v, self &p, bool behind=true)
 New node, added as the last child by default (which is natural). More...
 
 tnode (NCWidget * v, self &p, self &s, bool behind=true)
 New node under p, just after s (or before s if behind==false) More...
 
void Disconnect ()
 Disconnect from the parent and siblings, but keep children.
 
bool ReparentTo (self &p, bool behind=true)
 Disconnect from old parent, connect to new parent p. More...
 
bool ReparentTo (self &p, self &s, bool behind=true)
 Disconnect from old parent, connect to new parent p and sibling s. More...
 
NCWidget * & Value () const
 
NCWidget * & operator() () const
 Alias for Value.
 
selfParent ()
 
const selfParent () const
 
selfPsibling ()
 Previous sibling.
 
const selfPsibling () const
 Previous sibling.
 
selfNsibling ()
 Next sibling.
 
const selfNsibling () const
 Next sibling.
 
selfFchild ()
 First child.
 
const selfFchild () const
 First child.
 
selfLchild ()
 Last child.
 
const selfLchild () const
 Last child.
 
bool HasParent () const
 
bool HasSiblings () const
 
bool HasChildren () const
 
bool IsParentOf (const self &c) const
 
bool IsSiblingOf (const self &s) const
 
bool IsChildOf (const self &p) const
 
unsigned Depth () const
 Depth: zero if no parent, otherwise 1 + parent's depth.
 
bool IsDescendantOf (const self &n) const
 
bool IsDescendantOf (const self *n) const
 
selfTop ()
 Root of the tree.
 
const selfTop () const
 
selfNext (bool restart=false)
 Next node: depth first, pre-order. More...
 
selfNext (self *&c, bool restart=false)
 Return Next and assign it to c.
 
const selfNext (bool restart=false) const
 
const selfNext (const self *&c, bool restart=false) const
 
selfPrev (bool restart=false)
 
selfPrev (self *&c, bool restart=false)
 Return Prev and assign it to c.
 
const selfPrev (bool restart=false) const
 
const selfPrev (const self *&c, bool restart=false) const
 

Additional Inherited Members

- Public Types inherited from NCFileSelection
enum  NCFileSelectionType { T_Overview, T_Detailed, T_Unknown }
 
- Protected Types inherited from tnode< NCWidget * >
typedef tnode< NCWidget * > self
 
- Protected Member Functions inherited from NCFileSelection
void setCurrentDir ()
 
std::string getCurrentLine ()
 
NCursesEvent handleKeyEvents (wint_t key)
 
- Protected Member Functions inherited from NCTable
virtual const char * location () const
 Code location for logging. More...
 
virtual NCPadCreatePad ()
 Create an empty pad and set its background.
 
virtual NCTablePadmyPad () const
 Return the TreePad that belongs to this widget. More...
 
virtual void addItem (YItem *yitem, bool preventRedraw, NCTableLine::STATE state=NCTableLine::S_NORMAL)
 Internal overloaded version of addItem(). More...
 
virtual void addPadLine (NCTableLine *parentLine, YItem *yitem, bool preventRedraw, NCTableLine::STATE state=NCTableLine::S_NORMAL)
 Add a pad line (an NCTableLine) for 'yitem' and recurse into any of its children (and grandchildren etc.). More...
 
void rebuildPadLines ()
 Build or rebuild the pad lines: Clear the pad, iterate over all YItems and add a corresponding NCTableLine to the pad. More...
 
void rebuildHeaderLine ()
 Rebuild the table header line.
 
NCstring alignmentStr (int col)
 Return the NCurses alignment string for the alignment of the specified column: One of "L", "C", "R" (Left, Center, Right).
 
bool hasNestedItems (const YItemCollection &itemCollection) const
 Return 'true' if any item in the item collection has any children, 'false' otherwise.
 
bool hasNestedItems (YItemConstIterator begin, YItemConstIterator end) const
 
virtual void startMultipleChanges ()
 Optimization for NCurses from libyui: Notification that multiple changes are about to come. More...
 
virtual void doneMultipleChanges ()
 Optimization for NCurses from libyui: Notification that multiple changes are now finished. More...
 
void toggleCurrentItem ()
 Toggle the current item between selected and not selected.
 
void cellChanged (const YTableCell *cell)
 Notification that a cell has now changed content: Set that cell's content also in the corresponding table line.
 
void setCell (int index, int col, const std::string &newText)
 Change the cell with item index 'index' and column no. More...
 
void assignIndex (YItemConstIterator begin, YItemConstIterator end)
 Recursively iterate over items and assign each one a unique item index. More...
 
void assignIndex (YItem *item)
 Assign an item a unique index.
 
void interactiveSort ()
 Interactive sorting by a user-selected column: More...
 
void sortItems (int sortCol, bool reverse=false)
 Sort the items by column no. More...
 
void sortYItems (YItemIterator begin, YItemIterator end)
 Sort the YItems between 'begin' and 'end' using the current sort strategy.
 
- Protected Member Functions inherited from NCPadWidget
void startMultidraw ()
 
void stopMultidraw ()
 
bool inMultidraw () const
 
unsigned labelWidth () const
 
virtual void wCreate (const wrect &newrect)
 
virtual void wDelete ()
 
virtual void wRedraw ()
 
virtual void wRecoded ()
 
wsze defPadSze () const
 
virtual void DrawPad ()
 
void InitPad ()
 
void AdjustPad (wsze nsze)
 
void DelPad ()
 
virtual void HScroll (unsigned total, unsigned visible, unsigned start)
 
virtual void VScroll (unsigned total, unsigned visible, unsigned start)
 
virtual void ScrollHead (NCursesWindow &w, unsigned ccol)
 
virtual void AdjustPadSize (wsze &minsze)
 
virtual bool handleInput (wint_t key)
 
- Protected Member Functions inherited from NCWidget
virtual void PreDisconnect ()
 
virtual void PostDisconnect ()
 
virtual void PreReparent ()
 
virtual void PostReparent ()
 
NCursesWindowParentWin ()
 
bool grabFocus ()
 
virtual void grabNotify (NCWidget *)
 
virtual bool wantFocus (NCWidget &ngrab)
 
void wMoveChildTo (NCWidget &child, const wpos &newpos)
 
void wRelocate (const wrect &newrect)
 
void wRelocate (const wpos &newpos, const wsze &newsze)
 
virtual void wMoveTo (const wpos &newpos)
 
virtual void wUpdate (bool forced_br=false)
 
wpos ScreenPos () const
 
- Protected Member Functions inherited from NCursesError
 NCursesError (const char *msg="unknown error",...)
 
 NCursesError (int val, const char *msg="unknown error",...)
 
NCursesErrorNCError (const char *msg="unknown error",...)
 
NCursesErrorNCError (int val, const char *msg="unknown error",...)
 
- Protected Attributes inherited from NCFileSelection
std::string startDir
 
std::string currentDir
 
NCFileSelectionType tableType
 
- Protected Attributes inherited from NCPadWidget
bool hasHeadline
 
bool activeLabelOnly
 
- Protected Attributes inherited from NCWidget
NCWidget *const grabedBy
 
NCursesWindowwin
 (owned)
 
wsze defsze
 
wrect framedim
 
wrect inparent
 
bool noUpdates
 
bool skipNoDimWin
 
NC::WState wstate
 
NClabelhotlabel
 
- Protected Attributes inherited from tnode< NCWidget * >
NCWidgetval
 
- Protected Attributes inherited from NCursesError
int errval_i
 
std::string errmsg_t
 

Detailed Description

Definition at line 211 of file NCFileSelection.h.

Member Function Documentation

◆ wHandleInput()

NCursesEvent NCFileTable::wHandleInput ( wint_t  key)
virtual

Keyboard input handler.

NCurses widget keyboard handler.

This is the starting point for handling key events. From here, key events are propagated to the pad and to the items.

Implemented from NCWidget.

This is the starting point for handling key events. From here, key events are propagated to the pad and to the items.

Reimplemented from NCTable.

Definition at line 521 of file NCFileSelection.cc.


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