TreeFrogFramework  1.18
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 TActionControllercontroller () const
 
const THttpRequesthttpRequest () const
 
- 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, qint64 arg) const
 
QUrl url (const QString &controller, const QString &action, quint64 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, qint64 arg) const
 
QUrl urla (const QString &action, quint64 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, Tf::HttpMethod method=Tf::Get, 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, 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 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()) const
 
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
 
- Public Member Functions inherited from TPrototypeAjaxHelper
virtual ~TPrototypeAjaxHelper ()
 
QString requestFunction (const QUrl &url, const TOption &options, const QString &jsCondition=QString()) const
 
QString updateFunction (const QUrl &url, const QString &id, UpdateBehavior behavior=Replace, const TOption &options=TOption(), bool evalScripts=false, const QString &jsCondition=QString()) const
 
QString periodicalUpdateFunction (const QUrl &url, const QString &id, UpdateBehavior behavior=Replace, const TOption &options=TOption(), bool evalScripts=false, int frequency=2, int decay=1, const QString &jsCondition=QString()) const
 
QString linkToRequest (const QString &text, const QUrl &url, const TOption &options, const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString linkToUpdate (const QString &text, const QUrl &url, const QString &id, UpdateBehavior behavior=Replace, const TOption &options=TOption(), bool evalScripts=false, const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
QString linkToPeriodicalUpdate (const QString &text, const QUrl &url, const QString &id, UpdateBehavior behavior=Replace, const TOption &options=TOption(), bool evalScripts=false, int frequency=2, int decay=1, const QString &jsCondition=QString(), const THtmlAttribute &attributes=THtmlAttribute()) const
 
TOption o (int key, const QVariant &value) const
 
TOption o () const
 
QVariantMap o (const QString &key, const TJavaScriptObject &value) const
 
QVariantMap o (const QString &key, const QVariant &value) const
 

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 THtmlAttribute &attr)
 
QString echo (const QVariant &var)
 
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 THtmlAttribute &attr)
 
QString eh (const QVariant &var)
 
QString renderReact (const QString &component)
 
- Protected Member Functions inherited from TPrototypeAjaxHelper
QString optionsToString (const TOption &options) const
 

Protected Attributes

QString responsebody
 

Friends

class TActionController
 
class TActionMailer
 
class TDirectView
 

Additional Inherited Members

- Public Types inherited from TPrototypeAjaxHelper
enum  UpdateBehavior {
  Replace = 0, InsertBefore, InsertAfter, InsertAtTopOfContent,
  InsertAtBottomOfContent
}
 

Detailed Description

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

Constructor & Destructor Documentation

TActionView::TActionView ( )

Constructor.

virtual TActionView::~TActionView ( )
inlinevirtual

Member Function Documentation

QString TActionView::authenticityToken ( ) const

Returns a authenticity token for CSRF protection.

const TActionController * TActionView::controller ( ) const
inlinevirtual

Implements TActionHelper.

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

Outputs the string str to a view template.

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

Outputs the string str to a view template.

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

Outputs the array str to a view template.

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

Outputs the number n to a view template.

QString TActionView::echo ( long  n,
int  base = 10 
)
inlineprotected
QString TActionView::echo ( ulong  n,
int  base = 10 
)
inlineprotected
QString TActionView::echo ( qlonglong  n,
int  base = 10 
)
inlineprotected
QString TActionView::echo ( qulonglong  n,
int  base = 10 
)
inlineprotected
QString TActionView::echo ( double  d,
char  format = 'g',
int  precision = 6 
)
inlineprotected

Outputs the number d to a view template.

QString TActionView::echo ( const THtmlAttribute attr)
protected

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

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

Outputs the variant variable var to a view template.

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

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

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

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

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

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

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

Outputs the number n to a view template.

QString TActionView::eh ( long  n,
int  base = 10 
)
inlineprotected
QString TActionView::eh ( ulong  n,
int  base = 10 
)
inlineprotected
QString TActionView::eh ( qlonglong  n,
int  base = 10 
)
inlineprotected
QString TActionView::eh ( qulonglong  n,
int  base = 10 
)
inlineprotected
QString TActionView::eh ( double  d,
char  format = 'g',
int  precision = 6 
)
inlineprotected

Outputs the number d to a view template.

QString TActionView::eh ( const THtmlAttribute attr)
protected

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

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

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

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.

const THttpRequest & TActionView::httpRequest ( ) const

Returns the requested HTTP message.

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

Render the partial template given by templateName without layout.

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

Renders the React component on the server.

Calls ReactDOMServer.renderToString() internally.

QString TActionView::toString ( )
pure virtual

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

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

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

QString TActionView::yield ( ) const

Returns a content processed by a action.

Friends And Related Function Documentation

friend class TActionController
friend
friend class TActionMailer
friend
friend class TDirectView
friend

Member Data Documentation

QString TActionView::responsebody
protected

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