7 #include <Cutelyst/async.h>
8 #include <Cutelyst/cutelyst_export.h>
9 #include <Cutelyst/request.h>
11 #include <QtCore/QObject>
12 #include <QtCore/QStack>
13 #include <QtCore/QStringList>
14 #include <QtCore/QUrl>
15 #include <QtCore/QVariant>
47 Q_PROPERTY(
Action *action READ action CONSTANT)
51 Q_PROPERTY(
QString actionName READ actionName CONSTANT)
56 Q_PROPERTY(
QString ns READ ns CONSTANT)
61 Q_PROPERTY(
QString namespace READ ns CONSTANT)
66 Q_PROPERTY(
Request *req READ request CONSTANT)
71 Q_PROPERTY(
Request *request READ request CONSTANT)
75 Q_PROPERTY(
Controller *controller READ controller CONSTANT)
79 Q_PROPERTY(
QString controllerName READ controllerName CONSTANT)
86 Q_PROPERTY(QVariantMap config READ config CONSTANT)
90 Q_PROPERTY(
bool state READ state CONSTANT)
110 [[nodiscard]]
bool error()
const noexcept;
116 void appendError(
const QString &error);
127 [[nodiscard]]
bool state()
const noexcept;
133 void setState(
bool state) noexcept;
138 [[nodiscard]]
Engine *engine()
const noexcept;
148 [[nodiscard]]
Response *response()
const noexcept;
153 [[nodiscard]]
Response *res()
const noexcept;
158 [[nodiscard]]
Action *action()
const noexcept;
163 [[nodiscard]]
QString actionName()
const noexcept;
173 [[nodiscard]]
QString ns()
const noexcept;
179 [[nodiscard]]
Request *request()
const noexcept;
184 [[nodiscard]]
Request *req()
const noexcept;
189 [[nodiscard]]
Dispatcher *dispatcher()
const noexcept;
194 [[nodiscard]]
QString controllerName()
const noexcept;
199 [[nodiscard]]
Controller *controller()
const noexcept;
217 [[nodiscard]]
View *customView()
const noexcept;
253 void stash(
const QVariantHash &unite);
266 [[nodiscard]] QVariantHash &stash();
290 bool stashRemove(
const QString &key);
319 [[nodiscard]]
QUrl uriFor(
const QString &path = {},
395 bool detached()
const noexcept;
404 void detach(
Action *action =
nullptr);
421 void detachAsync() noexcept;
489 template <
typename T>
492 const auto pluginsConst = plugins();
493 for (
Plugin *plugin : pluginsConst) {
494 auto p = qobject_cast<T>(plugin);
516 [[nodiscard]]
QLocale locale() const noexcept;
535 void setLocale(const
QLocale &locale);
554 [[nodiscard]] QVariantMap config() const noexcept;
571 [[nodiscard]]
QString translate(const
char *context,
572 const
char *sourceText,
573 const
char *disambiguation =
nullptr,
612 [[nodiscard]] inline
QString qtTrId(const
char *
id,
int n = -1) const;
625 Context(ContextPrivate *priv);
627 friend class Application;
629 friend class ActionChain;
630 friend class DispatchType;
633 friend class Controller;
635 ContextPrivate *d_ptr;
638 Q_DECLARE_PRIVATE(Context)
658 return translate(
nullptr,
id,
nullptr, n);
This class represents a Cutelyst Action.
The Cutelyst application.
The Cutelyst Component base class.
QUrl uriFor(const QString &path={}, const QStringList &args={}, const ParamsMultiMap &queryValues={}) const
QString qtTrId(const char *id, int n=-1) const
QUrl uriForAction(QStringView path, const QStringList &captures={}, const QStringList &args={}, const ParamsMultiMap &queryValues={}) const
Cutelyst Controller base class.
Base class for Cutelyst Plugins.
Abstract View component for Cutelyst.
The Cutelyst namespace holds all public Cutelyst API.