Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

NCAskForFile.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                                                                      |
00003 |                      __   __    ____ _____ ____                      |
00004 |                      \ \ / /_ _/ ___|_   _|___ \                     |
00005 |                       \ V / _` \___ \ | |   __) |                    |
00006 |                        | | (_| |___) || |  / __/                     |
00007 |                        |_|\__,_|____/ |_| |_____|                    |
00008 |                                                                      |
00009 |                               core system                            |
00010 |                                                        (C) SuSE GmbH |
00011 \----------------------------------------------------------------------/
00012 
00013    File:       NCAskForFile.h
00014 
00015    Author:     Gabriele Strattner <gs@suse.de>
00016    Maintainer: Michael Andres <ma@suse.de>
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 //      CLASS NAME : NCAskForFile
00039 //
00040 //      DESCRIPTION :
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;               // the selected directory
00052     NCDirectoryTable *dirList;          // the directory list
00053     NCCheckBox *detailed;               // the 'Details' checkbox
00054     
00055     bool getCheckBoxValue( NCCheckBox * detailed );
00056 
00057     string iniFileName;                 // initial file name
00058     
00059 protected:
00060 
00061     NCFileTable *fileList;              // the file list
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 //      CLASS NAME : NCAskForExistingFile
00116 //
00117 //      DESCRIPTION :
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 //      CLASS NAME : NCAskForSaveFileName
00141 //
00142 //      DESCRIPTION :
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

Generated on Wed Nov 12 04:52:32 2008 for yast2-ncurses by  doxygen 1.3.9.1