libyui-ncurses
2.55.0
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
43
class
NCAskForFile
:
public
NCPopup
44
{
45
private
:
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
61
protected
:
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
74
public
:
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
83
/**
84
* Set the default size
85
*/
86
virtual
int
preferredWidth
();
87
virtual
int
preferredHeight();
88
89
/**
90
* Create layout of file selection popup
91
* iniDir: The initial start directory
92
* filter: pattern what files to show
93
* headline: popup headline
94
* editable: file name field editable?
95
*/
96
void
createLayout
(
const
std::string & iniDir,
97
const
std::string & filter,
98
const
std::string & headline,
99
bool
editable );
100
101
/**
102
* Shows the popup with the std::list of directories.
103
*/
104
NCursesEvent
&
showDirPopup
( );
105
106
/**
107
* Show new file information
108
*/
109
void
updateFileList
();
110
111
};
112
113
114
class
NCAskForExistingFile
:
public
NCAskForFile
115
{
116
117
NCAskForExistingFile
& operator=(
const
NCAskForFile
& );
118
NCAskForExistingFile
(
const
NCAskForFile
& );
119
120
public
:
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
129
protected
:
130
131
virtual
std::string getFileName();
132
};
133
134
135
class
NCAskForSaveFileName
:
public
NCAskForFile
136
{
137
138
NCAskForSaveFileName
& operator=(
const
NCAskForFile
& );
139
NCAskForSaveFileName
(
const
NCAskForFile
& );
140
141
public
:
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
150
protected
:
151
152
virtual
std::string getFileName();
153
154
};
155
156
157
158
#endif // NCAskForFile_h
NCFileTable
Definition:
NCFileSelection.h:212
NCAskForFile::preferredWidth
virtual int preferredWidth()
Set the default size.
Definition:
NCAskForFile.cc:242
NCComboBox
Definition:
NCComboBox.h:38
NCPushButton
Definition:
NCPushButton.h:35
NCAskForFile::showDirPopup
NCursesEvent & showDirPopup()
Shows the popup with the std::list of directories.
Definition:
NCAskForFile.cc:212
NCAskForFile::updateFileList
void updateFileList()
Show new file information.
Definition:
NCAskForFile.cc:263
NCCheckBox
Definition:
NCCheckBox.h:35
NCDirectoryTable
Definition:
NCFileSelection.h:255
NCPopup
Definition:
NCPopup.h:34
wpos
Definition:
position.h:110
NCAskForExistingFile
Definition:
NCAskForFile.h:115
NCAskForFile::createLayout
void createLayout(const std::string &iniDir, const std::string &filter, const std::string &headline, bool editable)
Create layout of file selection popup iniDir: The initial start directory filter: pattern what files ...
Definition:
NCAskForFile.cc:107
NCAskForFile
Definition:
NCAskForFile.h:44
NCursesEvent
Definition:
NCurses.h:73
NCAskForSaveFileName
Definition:
NCAskForFile.h:136
NCInputField
Definition:
NCInputField.h:35
src
NCAskForFile.h
Generated by
1.8.18