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
This class is used for the first column of the file table.
NCFileInfo * getFileInfo(int index)
Get the file info.
virtual bool fillList()=0
Fill the std::list of diretcories or files Returns 'true' on success.
virtual bool fillList()
Fill the std::list of files Returns 'true' on success.
virtual void fillHeader()
Fill the column headers of the file table.
void setStartDir(const std::string &start)
Set the start directory.
void setTableType(NCFileSelectionType type)
Set the type of the table widget type: Possible values: NCFileSelection::T_Overview, NCFileSelection::T_Detailed.
NCFileTable(YWidget *parent, YTableHeader *tableHeader, NCFileSelectionType type, const std::string &filter, const std::string &iniDir)
Constructor.
virtual bool createListEntry(NCFileInfo *fileInfo)=0
Creates a line in the package table.
virtual void fillHeader()=0
Fills the header of the table.
void drawList()
Draws the file std::list (has to be called after the loop with addLine() calls)
virtual bool createListEntry(NCFileInfo *fileInfo)
Creates a line in the package table.
The class which provides methods to handle a std::list of files or directories.
std::string getCurrentDir()
Get the current directory return: The currently selected directory.
virtual void fillHeader()
Fill the column headers of the table.
virtual bool createListEntry(NCFileInfo *fileInfo)
Creates a line in the package table.
virtual bool fillList()
Fill the std::list of directories.
virtual void deleteAllItems()
Clears the package std::list.
virtual NCTablePad * myPad() const
Overload myPad to narrow the type.
unsigned int getNumLines()
Get number of lines ( std::list entries )