Wt examples
3.3.6
|
View class for source code. More...
#include <SourceView.h>
Public Member Functions | |
SourceView (int fileNameRole, int contentRole, int filePathRole) | |
Constructor. More... | |
virtual | ~SourceView () |
Destructor. More... | |
bool | setIndex (const Wt::WModelIndex &index) |
Sets the model index. More... | |
virtual Wt::WWidget * | renderView () |
Returns the widget that renders the view. More... | |
Private Member Functions | |
std::string | imageExtension (const std::string &fileName) |
Private Attributes | |
Wt::WModelIndex | index_ |
The index that is currently displayed. More... | |
int | fileNameRole_ |
The role that is currently displayed. More... | |
int | contentRole_ |
int | filePathRole_ |
Wt::WMemoryResource * | imageResource_ |
View class for source code.
A view class is used so that no server-side memory is used while displaying a potentially large file.
Definition at line 26 of file SourceView.h.
SourceView::SourceView | ( | int | fileNameRole, |
int | contentRole, | ||
int | filePathRole | ||
) |
Constructor.
The fileNameRole will be used to retrieve data from a file to be displayed. If no data is set for this role, then contentRole should hold the data as a string.
Definition at line 20 of file SourceView.C.
|
virtual |
|
private |
Definition at line 204 of file SourceView.C.
|
virtual |
Returns the widget that renders the view.
Returns he view contents: renders the file to a WText widget. WViewWidget deletes this widget after every rendering step.
Definition at line 95 of file SourceView.C.
bool SourceView::setIndex | ( | const Wt::WModelIndex & | index | ) |
Sets the model index.
Returns true whether the view will be rerendered. The view will only be rerendered if the index contains new data.
Definition at line 30 of file SourceView.C.
|
private |
Definition at line 61 of file SourceView.h.
|
private |
The role that is currently displayed.
Definition at line 60 of file SourceView.h.
|
private |
Definition at line 62 of file SourceView.h.
|
private |
Definition at line 64 of file SourceView.h.
|
private |
The index that is currently displayed.
Definition at line 57 of file SourceView.h.