libyui-ncurses
 
Loading...
Searching...
No Matches
NCAskForFile.h
1/*
2 Copyright (C) 2000-2012 Novell, Inc
3 This library is free software; you can redistribute it and/or modify
4 it under the terms of the GNU Lesser General Public License as
5 published by the Free Software Foundation; either version 2.1 of the
6 License, or (at your option) version 3.0 of the License. This library
7 is distributed in the hope that it will be useful, but WITHOUT ANY
8 WARRANTY; without even the implied warranty of MERCHANTABILITY or
9 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10 License for more details. You should have received a copy of the GNU
11 Lesser General Public License along with this library; if not, write
12 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13 Floor, Boston, MA 02110-1301 USA
14*/
15
16
17/*-/
18
19 File: NCAskForFile.h
20
21 Author: Gabriele Strattner <gs@suse.de>
22
23/-*/
24
25#ifndef NCAskForFile_h
26#define NCAskForFile_h
27
28#include <iosfwd>
29
30#include <vector>
31#include <string>
32
33#include "NCPopup.h"
34#include "NCLabel.h"
35#include "NCFileSelection.h"
36#include "NCPushButton.h"
37#include "NCComboBox.h"
38#include "NCCheckBox.h"
39#include "NCInputField.h"
40
41
42
43class NCAskForFile : public NCPopup
44{
45private:
46
47 NCAskForFile & operator=( const NCAskForFile & );
48 NCAskForFile( const NCAskForFile & );
49
50
51 NCPushButton * okButton;
52 NCPushButton * cancelButton;
53 NCComboBox * dirName; // the selected directory
54 NCDirectoryTable *dirList; // the directory list
55 NCCheckBox *detailed; // the 'Details' checkbox
56
57 bool getCheckBoxValue( NCCheckBox * detailed );
58
59 std::string iniFileName; // initial file name
60
61protected:
62
63 NCFileTable *fileList; // the file list
64 NCInputField *fileName;
65
66 virtual bool postAgain();
67
68 virtual NCursesEvent wHandleInput( wint_t ch );
69
70 virtual std::string getFileName() = 0;
71
72 std::string checkIniDir( std::string startDir );
73
74public:
75
76 NCAskForFile( const wpos & at,
77 const std::string & startDir,
78 const std::string & filter,
79 const std::string & headline );
80
81 virtual ~NCAskForFile() = 0;
82
86 virtual int preferredWidth();
87 virtual int preferredHeight();
88
96 void createLayout( const std::string & iniDir,
97 const std::string & filter,
98 const std::string & headline,
99 bool editable );
100
105
109 void updateFileList();
110
111};
112
113
114class NCAskForExistingFile : public NCAskForFile
115{
116
117 NCAskForExistingFile & operator=( const NCAskForFile & );
118 NCAskForExistingFile( const NCAskForFile & );
119
120public:
121
122 NCAskForExistingFile( const wpos & at,
123 const std::string & startDir,
124 const std::string & filter,
125 const std::string & headline );
126
127 virtual ~NCAskForExistingFile() {}
128
129protected:
130
131 virtual std::string getFileName();
132};
133
134
135class NCAskForSaveFileName : public NCAskForFile
136{
137
138 NCAskForSaveFileName & operator=( const NCAskForFile & );
139 NCAskForSaveFileName( const NCAskForFile & );
140
141public:
142
143 NCAskForSaveFileName( const wpos & at,
144 const std::string & startDir,
145 const std::string & filter,
146 const std::string & headline );
147
148 virtual ~NCAskForSaveFileName() {}
149
150protected:
151
152 virtual std::string getFileName();
153
154};
155
156
157
158#endif // NCAskForFile_h
void createLayout(const std::string &iniDir, const std::string &filter, const std::string &headline, bool editable)
Definition NCAskForFile.cc:107
virtual int preferredWidth()
Definition NCAskForFile.cc:242
NCursesEvent & showDirPopup()
Definition NCAskForFile.cc:212
void updateFileList()
Definition NCAskForFile.cc:263
Definition NCCheckBox.h:35
Definition NCComboBox.h:38
Definition NCFileSelection.h:255
Definition NCFileSelection.h:212
Definition NCInputField.h:35
Definition NCPushButton.h:35
Definition NCurses.h:73
Screen position pair in the order line, column: (L, C)
Definition position.h:110