An FTPviewer is a Viewer meant for displaying and editing files and directories exported by an ftp server. It a large extent, it looks and feels like a directory viewer -- except that the files and directories being displayed are on a remote system. The ftp viewer also maintains a reference to a 'current directory' on the local machine where files on the remote machine will be stored when you 'get' a file. Analogously, files in the local directory may be 'put' to the remote system. More...
#include <ftpviewer.h>
Classes | |
struct | Impl |
Public Types | |
enum | cmd_constant { activate, deactivate, resize } |
values that will be passed to the function call operator method. More... | |
typedef CursorWindow::input_event | input_event |
typename alias | |
typedef std::list< std::string > | paste_buffer_type |
The data type of the paste buffer. | |
typedef CursorWindow::row_col | row_col |
typename alias | |
typedef CursorWindow::viewport | viewport |
Returns true if there are unsaved edit changes in this viewer. the default return value is false. Override this function if your viewer has the ability to have unsaved edit changes -- most don't. | |
Public Member Functions | |
std::string const & | application_name () const |
The name to prompt the user with in the ViewerManager::appChooser menu. | |
void | commitPasteBuffer () const |
write the paste buffer to the os clipboard. | |
std::string | description () const |
Return the name of the application to use when describing this viewer in the ViewerManager::appChooser or in the ViewerManager::ViewerSelector. | |
virtual bool | fetchAllLines (std::list< std::string > &output) |
An optional method that fetches all the lines in this viewer object into a caller supplied list of strings. | |
void | fetchPasteBuffer () |
read the paste buffer from the os clipboard | |
FTPviewer (ViewerManager *vm, FileName const &local_directory, std::string const &remote_host, std::string const &userid, std::string const &password, std::string const &remote_directory=std::string()) | |
virtual bool | handle_event (CursorWindow::input_event const *event, CursorWindow::viewport *viewport) |
Handle screen repaint commands. | |
virtual void | help () |
Handle input events. | |
virtual bool | is_dirty () const |
ViewerManager * | manager () |
virtual void | operator() (CursorWindow::viewport *vp, int cmd) |
Handle screen repaint commands. | |
paste_buffer_type * | paste_buffer () |
Get a pointer to the viewer manager's paste buffer. | |
virtual void | set_row_col_hint (size_t line, size_t column, bool repaint=false) |
The set_row_col_hint() method lets you specify the location where the cursor should be positioned. It is called a 'hint' because mistakes in the calling parameters are silently ignored. Also, obedience to the hint is optional. The 'repaint' parameter indicates that the screen should be immediately updated to reflect the change. | |
~FTPviewer () | |
Static Public Member Functions | |
static Viewer * | app (ViewerManager *vm, std::string &fullname) |
Public Attributes | |
std::auto_ptr< Impl > | impl_ |
implemenation data not needing to be visible to users. | |
Static Public Attributes | |
static std::string | app_name |
Application "hook" function for the DirectoryViewer class. Use it as a parameter to add_app, like this: | |
Protected Attributes | |
ViewerManager * | manager_ |
An FTPviewer is a Viewer meant for displaying and editing files and directories exported by an ftp server. It a large extent, it looks and feels like a directory viewer -- except that the files and directories being displayed are on a remote system. The ftp viewer also maintains a reference to a 'current directory' on the local machine where files on the remote machine will be stored when you 'get' a file. Analogously, files in the local directory may be 'put' to the remote system.
When creating an FTPviewer, you must supply:
You may only get, put, and navigate directories on the remote machine.
To create an ftp viewer, use the static member function,
FTPviewer::app(ViewerManager*, std::string local_directory)
It will prompt the user for the needed information. You must supply the local directory as a parameter.
Definition at line 43 of file ftpviewer.h.
typedef CursorWindow::input_event input_event [inherited] |
typedef std::list<std::string> paste_buffer_type [inherited] |
typedef CursorWindow::row_col row_col [inherited] |
typedef CursorWindow::viewport viewport [inherited] |
enum cmd_constant [inherited] |
values that will be passed to the function call operator method.
activate |
means you have been activated |
deactivate |
some other viewport has taken focus |
resize |
only the size has changed |
Definition at line 793 of file cursorwindow.h.
FTPviewer | ( | ViewerManager * | vm, | |
FileName const & | local_directory, | |||
std::string const & | remote_host, | |||
std::string const & | userid, | |||
std::string const & | password, | |||
std::string const & | remote_directory = std::string() | |||
) |
~FTPviewer | ( | ) |
Definition at line 167 of file ftpviewer.cxx.
Viewer * app | ( | ViewerManager * | vm, | |
std::string & | fullname | |||
) | [static] |
std::string const& application_name | ( | ) | const [virtual] |
The name to prompt the user with in the ViewerManager::appChooser menu.
Implements Viewer.
Definition at line 124 of file ftpviewer.h.
void commitPasteBuffer | ( | ) | const [inherited] |
write the paste buffer to the os clipboard.
Definition at line 625 of file viewer.cxx.
string description | ( | ) | const [virtual] |
Return the name of the application to use when describing this viewer in the ViewerManager::appChooser or in the ViewerManager::ViewerSelector.
Implements Viewer.
Definition at line 182 of file ftpviewer.cxx.
bool fetchAllLines | ( | std::list< std::string > & | output | ) | [virtual, inherited] |
An optional method that fetches all the lines in this viewer object into a caller supplied list of strings.
[out] | output | The location to store all the lines from this viewer. |
Reimplemented in ListViewer.
Definition at line 705 of file viewer.cxx.
void fetchPasteBuffer | ( | ) | [inherited] |
read the paste buffer from the os clipboard
Definition at line 661 of file viewer.cxx.
bool handle_event | ( | CursorWindow::input_event const * | event, | |
CursorWindow::viewport * | viewport | |||
) | [virtual] |
Handle screen repaint commands.
vp | ||
cmd |
Implements Viewer.
Definition at line 118 of file ftpviewer.cxx.
void help | ( | ) | [virtual] |
Handle input events.
event | ||
viewport | Present the user with help information that is specific to this viewer's operation and contains information about system keep bindings, etc. |
Reimplemented from Viewer.
Definition at line 126 of file ftpviewer.cxx.
bool is_dirty | ( | ) | const [virtual, inherited] |
Reimplemented in TableViewer.
Definition at line 611 of file viewer.cxx.
ViewerManager* manager | ( | ) | [inherited] |
void operator() | ( | CursorWindow::viewport * | vp, | |
int | cmd | |||
) | [virtual] |
Handle screen repaint commands.
Implements Viewer.
Definition at line 108 of file ftpviewer.cxx.
Viewer::paste_buffer_type * paste_buffer | ( | ) | [inherited] |
Get a pointer to the viewer manager's paste buffer.
Definition at line 601 of file viewer.cxx.
virtual void set_row_col_hint | ( | size_t | line, | |
size_t | column, | |||
bool | repaint = false | |||
) | [virtual, inherited] |
The set_row_col_hint() method lets you specify the location where the cursor should be positioned. It is called a 'hint' because mistakes in the calling parameters are silently ignored. Also, obedience to the hint is optional. The 'repaint' parameter indicates that the screen should be immediately updated to reflect the change.
Again, obedience to this function is entirely optional and most viewers will ignore it.
The line and column numbers are 0 base! Contrary to normal user's expectations, so account for this in any input calculations you make.
Definition at line 202 of file viewer.h.
Application "hook" function for the DirectoryViewer class. Use it as a parameter to add_app, like this:
vm.add_app(DirectoryViewer::app, "DirectoryViewer");
Definition at line 119 of file ftpviewer.h.
implemenation data not needing to be visible to users.
Pointer to the implementation data
Definition at line 75 of file ftpviewer.h.
ViewerManager* manager_ [protected, inherited] |