A Viewer for the symbol table stored in a CppTagDB as created by the program, cpptagdb.exe. More...
#include <symbolviewer.h>
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 | |
void | addChild (TreeViewerNode &parent, CppTagDB::SymbolInfo const &) |
Note that the databaseFilename can be either of the following forms: | |
virtual std::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. | |
virtual std::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 | |
void | flatten () |
virtual bool | handle_event (CursorWindow::input_event const *e, CursorWindow::viewport *vp) |
Handle input events -- and return true if the event is meant to terminate the viewer -- and make it go away. When handling key events -- either FunctionKey or DataKey, you will want to consult the CursorWindow::func mapping to figure out if the key corresponds to 'system wide' edit function. For example,. | |
virtual void | help () |
The interface to the help system. | |
void | helpHeader (std::list< std::string > &help_text) |
Add symbol viewer specific help info to the help text list. | |
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. | |
void | setApplicationName (std::string const &name) |
void | setRootDir (FileName const &dirname) |
Set the root directory for file opens. | |
SymbolViewer (ViewerManager *vm, std::string databaseFilename) | |
TreeViewerNode & | topNode () |
Get pointer to the top node. | |
Static Public Member Functions | |
static Viewer * | app (ViewerManager *vm, std::string &fullname) |
Application "hook" function for the SymbolViewer class. Use it as a parameter to add_app, like this: | |
Public Attributes | |
std::string | application_name_ |
Protected Attributes | |
ViewerManager * | manager_ |
Private Attributes | |
CppTagDB::Info | database_ |
FileName | databaseName_ |
A Viewer for the symbol table stored in a CppTagDB as created by the program, cpptagdb.exe.
Definition at line 68 of file symbolviewer.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.
SymbolViewer | ( | ViewerManager * | vm, | |
std::string | databaseFilename | |||
) |
Definition at line 22 of file symbolviewer.cxx.
void addChild | ( | TreeViewerNode & | parent, | |
CppTagDB::SymbolInfo const & | symbol | |||
) |
Note that the databaseFilename can be either of the following forms:
These formats are interpreted as follows:
Definition at line 206 of file symbolviewer.cxx.
Viewer * app | ( | ViewerManager * | vm, | |
std::string & | fullname | |||
) | [static] |
Application "hook" function for the SymbolViewer class. Use it as a parameter to add_app, like this:
vm.add_app(SymbolViewer::app, "CppTagDBViewer");
Reimplemented from TreeViewer.
Definition at line 290 of file symbolviewer.cxx.
std::string const & application_name | ( | ) | const [virtual, inherited] |
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 1064 of file treeviewer.cxx.
void commitPasteBuffer | ( | ) | const [inherited] |
write the paste buffer to the os clipboard.
Definition at line 625 of file viewer.cxx.
std::string description | ( | ) | const [virtual, inherited] |
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 1077 of file treeviewer.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.
void flatten | ( | ) | [inherited] |
bool handle_event | ( | CursorWindow::input_event const * | e, | |
CursorWindow::viewport * | vp | |||
) | [virtual, inherited] |
Handle input events -- and return true if the event is meant to terminate the viewer -- and make it go away. When handling key events -- either FunctionKey or DataKey, you will want to consult the CursorWindow::func mapping to figure out if the key corresponds to 'system wide' edit function. For example,.
int edit_func = vp->window()->func[e->value_]; switch(edit_func) { case CursorWindow::func_up: // the up arrow key
Choose this approach instead of looking at the key values directly to allow for consistence in system wide input remapping that occurs when the application modifies the CursorWindow::func map. Note that the CursorWindow::func_data is returned for all keys not mapped into one of the other named func_* keys.
Usage note: If your handle event creates a new viewport that covers this viewport, make sure that your current viewport doesn't draw anything until the next repaint request. Otherwise, your screen will get very jumbled up!
Implements Viewer.
Definition at line 391 of file treeviewer.cxx.
void help | ( | ) | [virtual, inherited] |
The interface to the help system.
Reimplemented from Viewer.
Definition at line 1093 of file treeviewer.cxx.
void helpHeader | ( | std::list< std::string > & | help_text | ) | [virtual] |
Add symbol viewer specific help info to the help text list.
Reimplemented from TreeViewer.
Definition at line 302 of file symbolviewer.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, inherited] |
Handle screen repaint commands.
Implements Viewer.
Definition at line 143 of file treeviewer.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.
void setApplicationName | ( | std::string const & | name | ) | [inherited] |
void setRootDir | ( | FileName const & | dirname | ) | [inherited] |
Set the root directory for file opens.
Definition at line 461 of file treeviewer.h.
TreeViewerNode & topNode | ( | ) | [inherited] |
Get pointer to the top node.
Definition at line 405 of file treeviewer.h.
std::string application_name_ [inherited] |
Definition at line 167 of file treeviewer.h.
CppTagDB::Info database_ [private] |
Definition at line 75 of file symbolviewer.h.
FileName databaseName_ [private] |
Definition at line 73 of file symbolviewer.h.
ViewerManager* manager_ [protected, inherited] |