00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef NCAskForFile_h
00020 #define NCAskForFile_h
00021
00022 #include <iosfwd>
00023
00024 #include <vector>
00025 #include <string>
00026
00027 #include "NCPopup.h"
00028 #include "NCLabel.h"
00029 #include "NCFileSelection.h"
00030 #include "NCPushButton.h"
00031 #include "NCComboBox.h"
00032 #include "NCCheckBox.h"
00033 #include "NCTextEntry.h"
00034
00035
00037
00038
00039
00040
00041
00042 class NCAskForFile : public NCPopup {
00043
00044 NCAskForFile & operator=( const NCAskForFile & );
00045 NCAskForFile ( const NCAskForFile & );
00046
00047 private:
00048
00049 NCPushButton * okButton;
00050 NCPushButton * cancelButton;
00051 NCComboBox * dirName;
00052 NCDirectoryTable *dirList;
00053 NCCheckBox *detailed;
00054
00055 bool getCheckBoxValue( NCCheckBox * detailed );
00056
00057 string iniFileName;
00058
00059 protected:
00060
00061 NCFileTable *fileList;
00062 NCTextEntry *fileName;
00063
00064 virtual bool postAgain();
00065
00066 virtual NCursesEvent wHandleInput( wint_t ch );
00067
00068 virtual string getFileName() = 0;
00069
00070 string checkIniDir( string startDir );
00071
00072 public:
00073
00074 NCAskForFile( const wpos at,
00075 const YCPString & startDir,
00076 const YCPString & filter,
00077 const YCPString & headline );
00078
00079 virtual ~NCAskForFile() = 0;
00080
00084 virtual long nicesize(YUIDimension dim);
00085
00094 void createLayout( const YCPString & iniDir,
00095 const YCPString & filter,
00096 const YCPString & headline,
00097 bool editable );
00098
00103 NCursesEvent & showDirPopup( );
00104
00109 void updateFileList();
00110
00111 };
00112
00114
00115
00116
00117
00118
00119 class NCAskForExistingFile : public NCAskForFile {
00120
00121 NCAskForExistingFile & operator=( const NCAskForFile & );
00122 NCAskForExistingFile ( const NCAskForFile & );
00123
00124 public:
00125
00126 NCAskForExistingFile( const wpos at,
00127 const YCPString & startDir,
00128 const YCPString & filter,
00129 const YCPString & headline );
00130
00131 virtual ~NCAskForExistingFile() {}
00132
00133 protected:
00134
00135 virtual string getFileName();
00136 };
00137
00139
00140
00141
00142
00143
00144 class NCAskForSaveFileName : public NCAskForFile {
00145
00146 NCAskForSaveFileName & operator=( const NCAskForFile & );
00147 NCAskForSaveFileName ( const NCAskForFile & );
00148
00149 public:
00150
00151 NCAskForSaveFileName( const wpos at,
00152 const YCPString & startDir,
00153 const YCPString & filter,
00154 const YCPString & headline );
00155
00156 virtual ~NCAskForSaveFileName() {}
00157
00158 protected:
00159
00160 virtual string getFileName();
00161
00162 };
00163
00165
00166
00167 #endif // NCAskForFile_h