TreeFrogFramework  2.8
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
TActionView Class Referenceabstract

#include <tactionview.h>

Inheritance diagram for TActionView:
Inheritance graph
[legend]
Collaboration diagram for TActionView:
Collaboration graph
[legend]

Public Member Functions

 TActionView ()
 
virtual ~TActionView ()
 
virtual QString toString ()=0
 
QString yield () const
 
QString renderPartial (const QString &templateName, const QVariantMap &vars=QVariantMap()) const
 
QString authenticityToken () const
 
QVariant variant (const QString &name) const
 
bool hasVariant (const QString &name) const
 
const QVariantMap & allVariants () const
 
const TAbstractControllercontroller () const override
 
const THttpRequesthttpRequest () const
 
void reset ()
 
- Public Member Functions inherited from TActionHelper
virtual ~TActionHelper ()
 
QUrl url (const QString &controller=QString(), const QString &action=QString(), const QStringList &args=QStringList(), const QVariantMap &query=QVariantMap()) const
 
QUrl url (const QString &controller, const QString &action, const QStringList &args, const QString &query) const
 
QUrl url (const QString &controller, const QString &action, int arg) const
 
QUrl url (const QString &controller, const QString &action, uint arg) const
 
QUrl url (const QString &controller, const QString &action, int64_t arg) const
 
QUrl url (const QString &controller, const QString &action, uint64_t arg) const
 
QUrl url (const QString &controller, const QString &action, const QString &arg) const
 
QUrl url (const QString &controller, const QString &action, const QVariant &arg) const
 
QUrl url (const QString &controller, const QString &action, const QVariantMap &query) const
 
QUrl urla (const QString &action=QString(), const QStringList &args=QStringList(), const QVariantMap &query=QVariantMap()) const
 
QUrl urla (const QString &action, const QStringList &args, const QString &query) const
 
QUrl urla (const QString &action, int arg) const
 
QUrl urla (const QString &action, uint arg) const
 
QUrl urla (const QString &action, int64_t arg) const
 
QUrl urla (const QString &action, uint64_t arg) const
 
QUrl urla (const QString &action, const QString &arg) const
 
QUrl urla (const QString &action, const QVariant &arg) const
 
QUrl urla (const QString &action, const QVariantMap &query) const
 
QUrl urlq (const QVariantMap &query) const
 
QUrl urlq (const QString &query) const
 
- Public Member Functions inherited from TViewHelper
virtual ~TViewHelper ()
 
QString linkTo (const QString &text, const QUrl &url, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString linkTo (const QString &text, const QUrl &url, Tf::HttpMethod method, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString linkTo (const QString &text, const QUrl &url, Tf::HttpMethod method, const QString &jsCondition, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString linkToPopup (const QString &text, const QUrl &url, const QString &windowTitle=QString(), const QSize &size=QSize(), const QPoint &topLeft=QPoint(), const QString &windowStyle=QString(), const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString linkToIf (bool condition, const QString &text, const QUrl &url, Tf::HttpMethod method=Tf::Get, const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString linkToUnless (bool condition, const QString &text, const QUrl &url, Tf::HttpMethod method=Tf::Get, const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString linkToFunction (const QString &text, const QString &function, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString buttonToFunction (const QString &text, const QString &function, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString anchor (const QString &text, const QUrl &url, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString anchor (const QString &text, const QUrl &url, Tf::HttpMethod method, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString anchor (const QString &text, const QUrl &url, Tf::HttpMethod method=Tf::Get, const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString anchorPopup (const QString &text, const QUrl &url, const QString &windowTitle=QString(), const QSize &size=QSize(), const QPoint &topLeft=QPoint(), const QString &windowStyle=QString(), const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString anchorIf (bool condition, const QString &text, const QUrl &url, Tf::HttpMethod method=Tf::Get, const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString anchorUnless (bool condition, const QString &text, const QUrl &url, Tf::HttpMethod method=Tf::Get, const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString anchorFunction (const QString &text, const QString &function, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString formTag (const QUrl &url, Tf::HttpMethod method=Tf::Post, bool multipart=false, const THtmlAttribute &attributes=THtmlAttribute())
 
QString inputTag (const QString &type, const QString &name, const QVariant &value, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString inputTextTag (const QString &name, const QVariant &value, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString inputFileTag (const QString &name, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString inputPasswordTag (const QString &name, const QVariant &value, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString inputHiddenTag (const QString &name, const QVariant &value, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString checkBoxTag (const QString &name, const QVariant &value, bool checked=false, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString checkBoxTag (const QString &name, const QString &value, const QStringList &checkedValues, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString checkBoxTag (const QString &name, const QVariant &value, const QVariantList &checkedValues, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString checkBoxTag (const QString &name, const QVariant &value, const QVariant &checkedValue, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString radioButtonTag (const QString &name, const QVariant &value, bool checked=false, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString radioButtonTag (const QString &name, const QVariant &value, const QVariant &checkedValue, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString selectTag (const QString &name, int size=1, bool multiple=false, const THtmlAttribute &attributes=THtmlAttribute())
 
QString optionTag (const QString &text, const QVariant &value, bool selected=false, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString optionTags (const QStringList &valueList, const QVariant &selectedValue=QVariant(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString optionTags (const QVariantList &valueList, const QVariant &selectedValue=QVariant(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString optionTags (const QList< QPair< QString, QVariant >> &valueList, const QVariant &selectedValue=QVariant(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString inputAuthenticityTag () const
 
QString textAreaTag (const QString &name, int rows, int cols, const QString &content=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString submitTag (const QString &value, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString submitImageTag (const QString &src, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString resetTag (const QString &value, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString imageTag (const QString &src, const QSize &size=QSize(), const QString &alt=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString imageTag (const QString &src, bool withTimestamp, const QSize &size=QSize(), const QString &alt=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString imageTag (const QString &src, const THtmlAttribute &attributes) const
 
QString inlineImageTag (const QFileInfo &file, const QString &mediaType, const QSize &size=QSize(), const QString &alt=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString inlineImageTag (const QFileInfo &file, const QString &mediaType, const THtmlAttribute &attributes) const
 
QString inlineImageTag (const QByteArray &data, const QString &mediaType, const QSize &size=QSize(), const QString &alt=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString inlineImageTag (const QByteArray &data, const QString &mediaType, const THtmlAttribute &attributes) const
 
QString imageLinkTo (const QUrl &url, const QString &src, bool withTimestamp, const QString &alt=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString imageLinkTo (const QUrl &url, const QString &src, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString styleSheetTag (const QString &src, const THtmlAttribute &attributes) const
 
QString styleSheetTag (const QString &src, bool withTimestamp=true, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString scriptTag (const QString &src, const THtmlAttribute &attributes) const
 
QString scriptTag (const QString &src, bool withTimestamp=true, const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString tag (const QString &name, const THtmlAttribute &attributes)
 
QString tag (const QString &name, const THtmlAttribute &attributes, bool selfClose)
 
QString tag (const QString &name, const THtmlAttribute &attributes, const QString &content) const
 
QString selfClosingTag (const QString &name, const THtmlAttribute &attributes) const
 
QString endTag (const QString &name) const
 
QString endTag ()
 
QString allEndTags ()
 
QString imagePath (const QString &src, bool withTimestamp=true) const
 
QString cssPath (const QString &src, bool withTimestamp=true) const
 
QString jsPath (const QString &src, bool withTimestamp=true) const
 
QString srcPath (const QString &src, const QString &dir, bool withTimestamp=true) const
 
THtmlAttribute a (const QString &key, const QString &value) const
 
THtmlAttribute a () const
 
void clear ()
 

Protected Member Functions

QString echo (const QString &str)
 
QString echo (const char *str)
 
QString echo (const QByteArray &str)
 
QString echo (int n, int base=10)
 
QString echo (long n, int base=10)
 
QString echo (ulong n, int base=10)
 
QString echo (qlonglong n, int base=10)
 
QString echo (qulonglong n, int base=10)
 
QString echo (double d, char format='g', int precision=6)
 
QString echo (const QJsonObject &object)
 
QString echo (const QJsonArray &array)
 
QString echo (const QJsonDocument &doc)
 
QString echo (const THtmlAttribute &attr)
 
QString echo (const QVariant &var)
 
QString echo (const QVariantMap &map)
 
QString eh (const QString &str)
 
QString eh (const char *str)
 
QString eh (const QByteArray &str)
 
QString eh (int n, int base=10)
 
QString eh (long n, int base=10)
 
QString eh (ulong n, int base=10)
 
QString eh (qlonglong n, int base=10)
 
QString eh (qulonglong n, int base=10)
 
QString eh (double d, char format='g', int precision=6)
 
QString eh (const QJsonObject &object)
 
QString eh (const QJsonArray &array)
 
QString eh (const QJsonDocument &doc)
 
QString eh (const THtmlAttribute &attr)
 
QString eh (const QVariant &var)
 
QString eh (const QVariantMap &map)
 
QString renderReact (const QString &component)
 

Protected Attributes

QString responsebody
 

Friends

class TActionController
 
class TActionMailer
 
class TDirectView
 

Detailed Description

The TActionView class is the abstract base class of views, providing functionality common to view.

Constructor & Destructor Documentation

◆ TActionView()

TActionView::TActionView ( )

Constructor.

◆ ~TActionView()

virtual TActionView::~TActionView ( )
inlinevirtual

Member Function Documentation

◆ allVariants()

const QVariantMap & TActionView::allVariants ( ) const
inline

◆ authenticityToken()

QString TActionView::authenticityToken ( ) const

Returns a authenticity token for CSRF protection.

◆ controller()

const TAbstractController * TActionView::controller ( ) const
inlineoverridevirtual

Implements TActionHelper.

◆ echo() [1/15]

QString TActionView::echo ( const char *  str)
inlineprotected

Outputs the string str to a view template.

◆ echo() [2/15]

QString TActionView::echo ( const QByteArray &  str)
inlineprotected

Outputs the array str to a view template.

◆ echo() [3/15]

QString TActionView::echo ( const QJsonArray &  array)
inlineprotected

◆ echo() [4/15]

QString TActionView::echo ( const QJsonDocument &  doc)
inlineprotected

◆ echo() [5/15]

QString TActionView::echo ( const QJsonObject &  object)
inlineprotected

◆ echo() [6/15]

QString TActionView::echo ( const QString &  str)
inlineprotected

Outputs the string str to a view template.

◆ echo() [7/15]

QString TActionView::echo ( const QVariant &  var)
protected

Outputs the variant variable var to a view template.

◆ echo() [8/15]

QString TActionView::echo ( const QVariantMap &  map)
protected

Outputs the variantmap variable map to a view template.

◆ echo() [9/15]

QString TActionView::echo ( const THtmlAttribute attr)
protected

Outputs the string of the HTML attribute attr to a view template.

◆ echo() [10/15]

QString TActionView::echo ( double  d,
char  format = 'g',
int  precision = 6 
)
inlineprotected

Outputs the number d to a view template.

◆ echo() [11/15]

QString TActionView::echo ( int  n,
int  base = 10 
)
inlineprotected

Outputs the number n to a view template.

◆ echo() [12/15]

QString TActionView::echo ( long  n,
int  base = 10 
)
inlineprotected

◆ echo() [13/15]

QString TActionView::echo ( qlonglong  n,
int  base = 10 
)
inlineprotected

◆ echo() [14/15]

QString TActionView::echo ( qulonglong  n,
int  base = 10 
)
inlineprotected

◆ echo() [15/15]

QString TActionView::echo ( ulong  n,
int  base = 10 
)
inlineprotected

◆ eh() [1/15]

QString TActionView::eh ( const char *  str)
inlineprotected

Outputs a escaped string of the str to a view template.

◆ eh() [2/15]

QString TActionView::eh ( const QByteArray &  str)
inlineprotected

Outputs a escaped array of the str to a view template.

◆ eh() [3/15]

QString TActionView::eh ( const QJsonArray &  array)
inlineprotected

◆ eh() [4/15]

QString TActionView::eh ( const QJsonDocument &  doc)
inlineprotected

◆ eh() [5/15]

QString TActionView::eh ( const QJsonObject &  object)
inlineprotected

◆ eh() [6/15]

QString TActionView::eh ( const QString &  str)
inlineprotected

Outputs a escaped string of the str to a view template.

◆ eh() [7/15]

QString TActionView::eh ( const QVariant &  var)
protected

Outputs a escaped string of the variant variable var to a view template.

◆ eh() [8/15]

QString TActionView::eh ( const QVariantMap &  map)
protected

Outputs a escaped string of the variantmap variable map to a view template.

◆ eh() [9/15]

QString TActionView::eh ( const THtmlAttribute attr)
protected

Outputs a escaped string of the HTML attribute attr to a view template.

◆ eh() [10/15]

QString TActionView::eh ( double  d,
char  format = 'g',
int  precision = 6 
)
inlineprotected

Outputs the number d to a view template.

◆ eh() [11/15]

QString TActionView::eh ( int  n,
int  base = 10 
)
inlineprotected

Outputs the number n to a view template.

◆ eh() [12/15]

QString TActionView::eh ( long  n,
int  base = 10 
)
inlineprotected

◆ eh() [13/15]

QString TActionView::eh ( qlonglong  n,
int  base = 10 
)
inlineprotected

◆ eh() [14/15]

QString TActionView::eh ( qulonglong  n,
int  base = 10 
)
inlineprotected

◆ eh() [15/15]

QString TActionView::eh ( ulong  n,
int  base = 10 
)
inlineprotected

◆ hasVariant()

bool TActionView::hasVariant ( const QString &  name) const
inline

Returns true if the QVariantMap variable for a view contains an item with the name; otherwise returns false.

◆ httpRequest()

const THttpRequest & TActionView::httpRequest ( ) const

Returns the requested HTTP message.

◆ renderPartial()

QString TActionView::renderPartial ( const QString &  templateName,
const QVariantMap &  vars = QVariantMap() 
) const

Render the partial template given by templateName without layout.

◆ renderReact()

QString TActionView::renderReact ( const QString &  component)
protected

Renders the React component on the server.

Calls ReactDOMServer.renderToString() internally.

◆ reset()

void TActionView::reset ( )

◆ toString()

QString TActionView::toString ( )
pure virtual

This function is reimplemented in subclasses to return a string to render a view.

◆ variant()

QVariant TActionView::variant ( const QString &  name) const
inline

Returns the value associated with the name in the QVariantMap variable for a view.

◆ yield()

QString TActionView::yield ( ) const

Returns a content processed by a action.

Friends And Related Function Documentation

◆ TActionController

friend class TActionController
friend

◆ TActionMailer

friend class TActionMailer
friend

◆ TDirectView

friend class TDirectView
friend

Member Data Documentation

◆ responsebody

QString TActionView::responsebody
protected

The documentation for this class was generated from the following files: