Wt examples
3.3.8
|
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... | |
![]() | |
WViewWidget (WContainerWidget *parent=0) | |
void | update () |
virtual void | load () |
virtual void | render (WFlags< RenderFlag > flags) |
virtual void | refresh () |
![]() | |
WWebWidget (WContainerWidget *parent=0) | |
virtual void | setPositionScheme (PositionScheme scheme) |
virtual PositionScheme | positionScheme () const |
virtual void | setOffsets (const WLength &offset, WFlags< Side > sides=All) |
virtual WLength | offset (Side s) const |
virtual void | resize (const WLength &width, const WLength &height) |
virtual WLength | width () const |
virtual WLength | height () const |
virtual void | setMinimumSize (const WLength &width, const WLength &height) |
virtual WLength | minimumWidth () const |
virtual WLength | minimumHeight () const |
virtual void | setMaximumSize (const WLength &width, const WLength &height) |
virtual WLength | maximumWidth () const |
virtual WLength | maximumHeight () const |
virtual void | setLineHeight (const WLength &height) |
virtual WLength | lineHeight () const |
virtual void | setFloatSide (Side s) |
virtual Side | floatSide () const |
virtual void | setClearSides (WFlags< Side > sides) |
virtual WFlags< Side > | clearSides () const |
virtual void | setMargin (const WLength &margin, WFlags< Side > sides=All) |
virtual WLength | margin (Side side) const |
virtual void | setHiddenKeepsGeometry (bool enabled) |
virtual bool | hiddenKeepsGeometry () const |
virtual void | setHidden (bool hidden, const WAnimation &animation=WAnimation()) |
virtual bool | isHidden () const |
virtual bool | isVisible () const |
virtual void | setDisabled (bool disabled) |
virtual bool | isDisabled () const |
virtual bool | isEnabled () const |
virtual void | setPopup (bool popup) |
virtual bool | isPopup () const |
virtual void | setInline (bool isInline) |
virtual bool | isInline () const |
virtual void | setDecorationStyle (const WCssDecorationStyle &style) |
virtual WCssDecorationStyle & | decorationStyle () |
virtual void | setStyleClass (const WString &styleClass) |
virtual WString | styleClass () const |
virtual void | addStyleClass (const WString &styleClass, bool force=false) |
virtual void | removeStyleClass (const WString &styleClass, bool force=false) |
virtual bool | hasStyleClass (const WString &styleClass) const |
virtual void | setVerticalAlignment (AlignmentFlag alignment, const WLength &length=WLength()) |
virtual AlignmentFlag | verticalAlignment () const |
virtual WLength | verticalAlignmentLength () const |
virtual void | setToolTip (const WString &text, TextFormat textFormat=PlainText) |
virtual void | setDeferredToolTip (bool enable, TextFormat textFormat=PlainText) |
virtual WString | toolTip () const |
virtual void | setAttributeValue (const std::string &name, const WString &value) |
virtual WString | attributeValue (const std::string &name) const |
virtual void | setJavaScriptMember (const std::string &name, const std::string &value) |
virtual std::string | javaScriptMember (const std::string &name) const |
virtual void | callJavaScriptMember (const std::string &name, const std::string &args) |
virtual bool | loaded () const |
virtual void | setId (const std::string &id) |
virtual WWidget * | find (const std::string &name) |
virtual WWidget * | findById (const std::string &id) |
virtual void | setSelectable (bool selectable) |
virtual void | doJavaScript (const std::string &javascript) |
virtual const std::string | id () const |
void | setLoadLaterWhenInvisible (bool) |
std::string | htmlTagName () const |
void | setHtmlTagName (const std::string &tag) |
const std::vector< WWidget * > & | children () const |
Signal & | childrenChanged () |
virtual void | setCanReceiveFocus (bool enabled) |
virtual bool | canReceiveFocus () const |
virtual bool | setFirstFocus () |
virtual void | setFocus (bool focus) |
virtual bool | hasFocus () const |
virtual void | setTabIndex (int index) |
virtual int | tabIndex () const |
EventSignal & | blurred () |
EventSignal & | focussed () |
virtual bool | scrollVisibilityEnabled () const WT_CXX11ONLY(finaloverride) |
virtual void | setScrollVisibilityEnabled (bool enabled) WT_CXX11ONLY(finaloverride) |
virtual int | scrollVisibilityMargin () const WT_CXX11ONLY(finaloverride) |
virtual void | setScrollVisibilityMargin (int margin) WT_CXX11ONLY(finaloverride) |
virtual Signal< bool > & | scrollVisibilityChanged () WT_CXX11ONLY(finaloverride) |
virtual bool | isScrollVisible () const WT_CXX11ONLY(finaloverride) |
virtual void | setThemeStyleEnabled (bool enabled) |
virtual bool | isThemeStyleEnabled () const |
![]() | |
virtual | ~WWidget () |
WWidget * | parent () const |
virtual void | removeChild (WObject *child) |
void | setWidth (const WLength &width) |
void | setHeight (const WLength &height) |
virtual void | positionAt (const WWidget *widget, Orientation orientation=Vertical) |
virtual void | toggleStyleClass (const WString &styleClass, bool add, bool force=false) |
std::string | jsRef () const |
void | setFocus () |
virtual void | acceptDrops (const std::string &mimeType, const WString &hoverStyleClass=WString()) |
virtual void | stopAcceptDrops (const std::string &mimeType) |
virtual void | setObjectName (const std::string &name) |
virtual void | htmlText (std::ostream &out) |
bool | isRendered () const |
void | hide () |
void | animateHide (const WAnimation &animation) |
void | show () |
void | animateShow (const WAnimation &animation) |
void | enable () |
void | disable () |
bool | layoutSizeAware () const |
![]() | |
WObject (WObject *parent=0) | |
virtual | ~WObject () |
virtual std::string | objectName () const |
void | resetLearnedSlots () |
void | resetLearnedSlot (void(T::*method)()) |
WStatelessSlot * | implementStateless (void(T::*method)()) |
WStatelessSlot * | implementStateless (void(T::*method)(), void(T::*undoMethod)()) |
void | isNotStateless () |
WStatelessSlot * | implementJavaScript (void(T::*method)(), const std::string &jsCode) |
void | addChild (WObject *child) |
const std::vector< WObject * > & | children () const |
WObject * | parent () const |
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 | |
![]() | |
typedef void(WObject::* | Method) () |
![]() | |
static WString | escapeText (const WString &text, bool newlinesToo=false) |
static std::string & | escapeText (std::string &text, bool newlinestoo=false) |
static bool | removeScript (WString &text) |
static std::string | jsStringLiteral (const std::string &v, char delimiter= '\'') |
![]() | |
static WString | tr (const char *key) |
![]() | |
virtual void | propagateSetEnabled (bool enabled) |
virtual void | enableAjax () |
virtual WStatelessSlot * | getStateless (Method method) |
![]() | |
void | setLayoutSizeAware (bool sizeAware) |
virtual void | layoutSizeChanged (int width, int height) |
WWidget (WContainerWidget *parent=0) | |
virtual void | dropEvent (WDropEvent dropEvent) |
virtual int | boxPadding (Orientation orientation) const |
virtual int | boxBorder (Orientation orientation) const |
void | scheduleRender (WFlags< RepaintFlag > flags=0) |
![]() | |
static WObject * | sender () |
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.