5#ifndef CUTELYST_APPLICATION_H
6#define CUTELYST_APPLICATION_H
8#include <Cutelyst/cutelyst_global.h>
10#include <QtCore/QLocale>
11#include <QtCore/QObject>
12#include <QtCore/QVariant>
13#include <QtCore/QVector>
19#define CUTELYST_APPLICATION(x) \
20 Q_PLUGIN_METADATA(x) \
21 Q_INTERFACES(Cutelyst::Application)
35class ApplicationPrivate;
106 template <
typename T>
109 const auto pluginsConst =
plugins();
123 QVariantMap config() const noexcept;
138 bool inited() const noexcept;
143 Engine *engine() const noexcept;
154 static const
char *cutelystVersion() noexcept;
219 const
char *sourceText,
220 const
char *disambiguation =
nullptr,
251 void loadTranslations(const
QString &filename,
287 const
QString &prefix = QStringLiteral(
"."),
288 const
QString &suffix = QStringLiteral(
".qm"));
350 virtual
bool postFork();
357 Headers &defaultHeaders() noexcept;
362 void addXCutelystVersionHeader();
371 bool registerPlugin(
Plugin *plugin);
383 bool registerController(
Controller *controller);
392 bool registerView(
View *view);
452 friend class Context;
469 ApplicationPrivate *d_ptr;
474#define CutelystApplicationInterface_iid "org.cutelyst.CutelystApplicationInterface"
The Cutelyst Application.
Engine * engine() const noexcept
void shuttingDown(Cutelyst::Application *app)
QVector< Controller * > controllers() const noexcept
void afterDispatch(Cutelyst::Context *c)
bool setup(Engine *engine)
Called by the Engine to setup the internal data.
void handleRequest(Cutelyst::EngineRequest *request)
Called by the Engine to handle a new Request object.
void beforePrepareAction(Cutelyst::Context *c, bool *skipMethod)
Application(QObject *parent=nullptr)
void setConfig(const QString &key, const QVariant &value)
Dispatcher * dispatcher() const noexcept
void beforeDispatch(Cutelyst::Context *c)
void preForked(Cutelyst::Application *app)
QVector< Plugin * > plugins() const noexcept
bool enginePostFork()
Called by the Engine once post fork happened.
QVector< DispatchType * > dispatchers() const noexcept
T plugin()
Returns the registered plugin that casts to the template type T.
QVariant config(const QString &key, const QVariant &defaultValue={}) const
View * view(const QString &name) const
void postForked(Cutelyst::Application *app)
The Cutelyst Component base class.
Cutelyst Controller base class
Cutelyst View abstract view component
The Cutelyst namespace holds all public Cutelyst API.
QObject * parent() const const
T qobject_cast(QObject *object)