17 virtual QString className()
const;
18 virtual QString
name()
const = 0;
20 virtual QStringList
arguments()
const {
return QStringList(); }
23 virtual const TSession &session()
const;
24 virtual QString getRenderingData(
const QString &templateName,
const QVariantMap &vars = QVariantMap());
26 virtual void setFlash(
const QString &name,
const QVariant &value);
27 void exportVariant(
const QString &name,
const QVariant &value,
bool overwrite =
true);
28 virtual bool isUserLoggedIn()
const;
29 const TActionContext *
context()
const {
return _context; }
30 TActionContext *
context() {
return _context; }
31 void setContext(TActionContext *context) { _context = context; }
36 virtual bool addCookie(
const TCookie &cookie);
37 virtual bool addCookie(
const QByteArray &name,
const QByteArray &value,
const QDateTime &expire = QDateTime(),
const QString &path = QString(),
const QString &domain = QString(),
bool secure =
false,
bool httpOnly =
false,
const QByteArray &sameSite =
"Lax");
38 virtual bool addCookie(
const QByteArray &name,
const QByteArray &value, int64_t maxAge,
const QString &path = QString(),
const QString &domain = QString(),
bool secure =
false,
bool httpOnly =
false,
const QByteArray &sameSite =
"Lax");
41 QVariant variant(
const QString &name)
const;
42 void exportVariants(
const QVariantMap &map);
43 void exportValidationErrors(
const TFormValidator &validator,
const QString &prefix = QString(
"err_"));
44 bool hasVariant(
const QString &name)
const;
45 const QVariantMap &
allVariants()
const {
return _exportVars; }
46 QString viewClassName(
const QString &action = QString())
const;
47 QString viewClassName(
const QString &contoller,
const QString &action)
const;
50 QVariantMap _exportVars;
51 TActionContext *_context {
nullptr};
55 friend class TDirectView;
65 return QString(metaObject()->className());
70 return _exportVars.value(name);
75 return _exportVars.contains(name);
The TAbstractController class is the abstract base class of controllers, providing functionality comm...
Definition: tabstractcontroller.h:13
virtual QStringList arguments() const
Definition: tabstractcontroller.h:20
virtual ~TAbstractController()
Definition: tabstractcontroller.h:16
static QThread * currentThread()
Definition: tabstractcontroller.h:32
bool hasVariant(const QString &name) const
Returns true if a variable with the name is exported for views; otherwise returns false.
Definition: tabstractcontroller.h:73
void setContext(TActionContext *context)
Definition: tabstractcontroller.h:31
const QVariantMap & allVariants() const
Returns all the exported variables.
Definition: tabstractcontroller.h:45
virtual QByteArray authenticityToken() const
Definition: tabstractcontroller.h:25
const TActionContext * context() const
Definition: tabstractcontroller.h:29
QVariant variant(const QString &name) const
Returns the exported variable with the value associated with the name.
Definition: tabstractcontroller.h:68
TActionContext * context()
Definition: tabstractcontroller.h:30
virtual QString name() const =0
This function is reimplemented in subclasses to return a controller name.
virtual void reset()
Definition: tabstractcontroller.h:39
virtual QString activeAction() const =0
This function is reimplemented in subclasses to return a active action name.
The TCookie class holds one network cookie.
Definition: tcookie.h:7
The THttpRequest class contains request information for HTTP.
Definition: thttprequest.h:34
The TSession class holds information associated with individual visitors.
Definition: tsession.h:7
#define T_CORE_EXPORT
Definition: tdeclexport.h:28
#define T_DISABLE_COPY(Class)
Definition: tdeclexport.h:37
#define T_DISABLE_MOVE(Class)
Definition: tdeclexport.h:41