25 #ifndef NCFileSelection_h
26 #define NCFileSelection_h
30 #include "NCPadWidget.h"
31 #include "NCTablePad.h"
37 #include <sys/types.h>
50 struct stat64 * statInfo,
60 std::string _realName;
71 bool isDir() {
return (( S_ISDIR( _mode ) ) ?
true :
false ); }
73 bool isLink() {
return (( S_ISLNK( _mode ) ) ?
true :
false ); }
75 bool isFile() {
return (( S_ISREG( _mode ) ) ?
true :
false ); }
96 NCFileInfo * getFileInfo()
const {
return fileInfo; }
106 enum NCFileSelectionType
124 std::string startDir;
125 std::string currentDir;
126 NCFileSelectionType tableType;
128 void setCurrentDir();
129 std::string getCurrentLine();
139 YTableHeader * tableHeader,
140 NCFileSelectionType type,
141 const std::string & iniDir );
158 virtual void addLine(
const std::vector<std::string> & elements,
215 std::list<std::string> pattern;
216 std::string currentFile;
224 YTableHeader * tableHeader,
225 NCFileSelectionType type,
226 const std::string & filter,
227 const std::string & iniDir );
231 void setCurrentFile(
const std::string & file )
236 bool filterMatch(
const std::string & fileName );
238 std::string getCurrentFile() {
return currentFile; }
258 YTableHeader * tableHeader,
259 NCFileSelectionType type,
260 const std::string & iniDir );
279 #endif // NCFileSelection_h
void drawList()
Draws the file std::list (has to be called after the loop with addLine() calls)
The class which provides methods to handle a std::list of files or directories.
virtual NCTablePad * myPad() const
Return the TreePad that belongs to this widget.
void setTableType(NCFileSelectionType type)
Set the type of the table widget type: Possible values: NCFileSelection::T_Overview,...
NCFileInfo * getFileInfo(int index)
Get the file info.
virtual bool fillList()
Fill the std::list of directories.
virtual bool createListEntry(NCFileInfo *fileInfo)
Creates a line in the package table.
This class is used for the first column of the file table.
virtual bool fillList()=0
Fill the std::list of diretcories or files Returns 'true' on success.
virtual bool createListEntry(NCFileInfo *fileInfo)=0
Creates a line in the package table.
virtual NCursesEvent wHandleInput(wint_t key)
Keyboard input handler.
virtual bool createListEntry(NCFileInfo *fileInfo)
Creates a line in the package table.
void setStartDir(const std::string &start)
Set the start directory.
virtual void fillHeader()
Fill the column headers of the table.
unsigned Lines() const
Return the number of table lines (logical, not screen)
virtual void fillHeader()
Fill the column headers of the file table.
virtual NCursesEvent wHandleInput(wint_t key)
Keyboard input handler.
A table with rows and columns.
std::string getCurrentDir()
Get the current directory return: The currently selected directory.
unsigned getNumLines()
Get number of lines ( std::list entries )
virtual void deleteAllItems()
Clears the package std::list.
virtual bool fillList()
Fill the std::list of files Returns 'true' on success.
virtual void fillHeader()=0
Fills the header of the table.
NCFileTable(YWidget *parent, YTableHeader *tableHeader, NCFileSelectionType type, const std::string &filter, const std::string &iniDir)
Constructor.