This viewer allows the user to select from any extant viewer rather than creating a new viewer as does the appChooser class below. More...
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 | |
string const & | application_name () const |
Return a const references to a string which defines the name of the application being implemented in the viewer. This function must always return the same address and the string at that address must never change;. | |
void | commitPasteBuffer () const |
write the paste buffer to the os clipboard. | |
string | description () const |
Get a description of this viewer. Typically, this just returns the name of the directory or the name of the file the viewer is being applied to. However, with FTP viewers, POP3 viewers, etc this may not refer to any real file. | |
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 | |
bool | handle_event (CursorWindow::input_event const *e, CursorWindow::viewport *vp) |
Handle screen repaint commands. | |
virtual void | help () |
Present the user with help information that is specific to this viewer's operation and contains information about system keep bindings, etc. Note that there is a default implementation of this function, but it should be overridden. | |
virtual bool | is_dirty () const |
ViewerManager * | manager () |
void | operator() (CursorWindow::viewport *vp, int cmd) |
Handle screen repaint commands. | |
void | output_row_text (CursorWindow::viewport *vp, int i) |
paste_buffer_type * | paste_buffer () |
Get a pointer to the viewer manager's paste buffer. | |
void | repaint (CursorWindow::viewport *vp) |
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. | |
ViewerSelector (ViewerManager *m) | |
Public Attributes | |
bool | active_ |
first display of viewport info | |
size_t | cur_row_ |
size_t | display_top_ |
row where cursor is sitting | |
int | first_row_ |
row at top of viewport | |
Static Public Attributes | |
static string | app_name |
Protected Attributes | |
ViewerManager * | manager_ |
This viewer allows the user to select from any extant viewer rather than creating a new viewer as does the appChooser class below.
Definition at line 66 of file viewermanager.cxx.
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.
ViewerSelector | ( | ViewerManager * | m | ) |
Definition at line 81 of file viewermanager.cxx.
string const& application_name | ( | ) | const [virtual] |
Return a const references to a string which defines the name of the application being implemented in the viewer. This function must always return the same address and the string at that address must never change;.
Implements Viewer.
Definition at line 100 of file viewermanager.cxx.
void commitPasteBuffer | ( | ) | const [inherited] |
write the paste buffer to the os clipboard.
Definition at line 625 of file viewer.cxx.
string description | ( | ) | const [virtual] |
Get a description of this viewer. Typically, this just returns the name of the directory or the name of the file the viewer is being applied to. However, with FTP viewers, POP3 viewers, etc this may not refer to any real file.
Implements Viewer.
Definition at line 132 of file viewermanager.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 * | e, | |
CursorWindow::viewport * | vp | |||
) | [virtual] |
Handle screen repaint commands.
Implements Viewer.
Definition at line 1288 of file viewermanager.cxx.
void help | ( | ) | [virtual, inherited] |
Present the user with help information that is specific to this viewer's operation and contains information about system keep bindings, etc. Note that there is a default implementation of this function, but it should be overridden.
Reimplemented in ListViewer, CsvViewer, TreeViewer, TableViewer, ScriptTableViewer, TextViewer, and FTPviewer.
Definition at line 583 of file viewer.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 1178 of file viewermanager.cxx.
void output_row_text | ( | CursorWindow::viewport * | vp, | |
int | i | |||
) |
Definition at line 107 of file viewermanager.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.
void repaint | ( | CursorWindow::viewport * | vp | ) |
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.
bool active_ |
first display of viewport info
Definition at line 79 of file viewermanager.cxx.
Definition at line 98 of file viewermanager.cxx.
size_t cur_row_ |
Definition at line 76 of file viewermanager.cxx.
size_t display_top_ |
row where cursor is sitting
Definition at line 77 of file viewermanager.cxx.
int first_row_ |
row at top of viewport
Definition at line 78 of file viewermanager.cxx.
ViewerManager* manager_ [protected, inherited] |