Wt examples
3.3.1
|
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... | |
![]() | |
virtual void | setPositionScheme (PositionScheme scheme)=0 |
virtual PositionScheme | positionScheme () const =0 |
virtual void | setOffsets (const WLength &offset, WFlags< Side > sides=All)=0 |
virtual WLength | offset (Side side) const =0 |
virtual void | resize (const WLength &width, const WLength &height) |
virtual WLength | width () const =0 |
virtual WLength | height () const =0 |
virtual void | setMinimumSize (const WLength &width, const WLength &height)=0 |
virtual WLength | minimumWidth () const =0 |
virtual WLength | minimumHeight () const =0 |
virtual void | setMaximumSize (const WLength &width, const WLength &height)=0 |
virtual WLength | maximumWidth () const =0 |
virtual WLength | maximumHeight () const =0 |
virtual void | setLineHeight (const WLength &height)=0 |
virtual WLength | lineHeight () const =0 |
virtual void | setFloatSide (Side s)=0 |
virtual Side | floatSide () const =0 |
virtual void | setClearSides (WFlags< Side > sides)=0 |
virtual WFlags< Side > | clearSides () const =0 |
virtual void | setMargin (const WLength &margin, WFlags< Side > sides=All)=0 |
virtual WLength | margin (Side side) const =0 |
virtual void | setHiddenKeepsGeometry (bool enabled)=0 |
virtual bool | hiddenKeepsGeometry () const =0 |
virtual void | setHidden (bool hidden, const WAnimation &animation=WAnimation())=0 |
virtual bool | isHidden () const =0 |
virtual bool | isVisible () const =0 |
virtual void | setDisabled (bool disabled)=0 |
virtual bool | isDisabled () const =0 |
virtual bool | isEnabled () const =0 |
virtual void | setPopup (bool popup)=0 |
virtual bool | isPopup () const =0 |
virtual void | setInline (bool inlined)=0 |
virtual bool | isInline () const =0 |
virtual void | setDecorationStyle (const WCssDecorationStyle &style)=0 |
virtual WCssDecorationStyle & | decorationStyle ()=0 |
virtual void | setStyleClass (const WString &styleClass)=0 |
virtual WString | styleClass () const =0 |
virtual void | addStyleClass (const WString &styleClass, bool force=false)=0 |
virtual void | removeStyleClass (const WString &styleClass, bool force=false)=0 |
virtual bool | hasStyleClass (const WString &styleClass) const =0 |
virtual void | setVerticalAlignment (AlignmentFlag alignment, const WLength &length=WLength::Auto)=0 |
virtual AlignmentFlag | verticalAlignment () const =0 |
virtual WLength | verticalAlignmentLength () const =0 |
virtual void | setToolTip (const WString &text, TextFormat textFormat=PlainText)=0 |
virtual const WString & | toolTip () const =0 |
virtual void | refresh () |
virtual void | setAttributeValue (const std::string &name, const WString &value)=0 |
virtual WString | attributeValue (const std::string &name) const =0 |
virtual void | setJavaScriptMember (const std::string &name, const std::string &value)=0 |
virtual std::string | javaScriptMember (const std::string &name) const =0 |
virtual void | callJavaScriptMember (const std::string &name, const std::string &args)=0 |
virtual void | load ()=0 |
virtual bool | loaded () const =0 |
virtual void | setTabIndex (int index)=0 |
virtual int | tabIndex () const =0 |
virtual void | setId (const std::string &id)=0 |
virtual WWidget * | find (const std::string &name)=0 |
virtual void | setSelectable (bool selectable)=0 |
virtual void | doJavaScript (const std::string &js)=0 |
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_ |
Additional Inherited Members | |
![]() | |
virtual void | enableAjax ()=0 |
virtual void | propagateSetEnabled (bool enabled)=0 |
virtual void | render (WFlags< RenderFlag > flags) |
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.
Implements Wt::WViewWidget.
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.