18 #ifndef CUTELYST_APPLICATION_H
19 #define CUTELYST_APPLICATION_H
21 #include <QtCore/QObject>
22 #include <QtCore/QVariant>
23 #include <QtCore/QLocale>
24 #include <QtCore/QVector>
26 #include <Cutelyst/cutelyst_global.h>
32 #define CUTELYST_APPLICATION(x) \
33 Q_PLUGIN_METADATA(x) \
34 Q_INTERFACES(Cutelyst::Application)
48 class ApplicationPrivate;
114 template <
typename T>
117 const auto pluginsConst = plugins();
118 for (
Plugin *plugin : pluginsConst) {
119 auto p = qobject_cast<T>(plugin);
131 QVariantMap config() const noexcept;
146 bool inited() const noexcept;
151 Engine *engine() const noexcept;
162 static const
char *cutelystVersion() noexcept;
225 QString translate(const
QLocale &locale, const
char *context, const
char *sourceText, const
char *disambiguation =
nullptr,
int n = -1) const;
337 virtual
bool postFork();
344 Headers &defaultHeaders() noexcept;
349 void addXCutelystVersionHeader();
358 bool registerPlugin(
Plugin *plugin);
370 bool registerController(
Controller *controller);
379 bool registerView(
View *view);
444 bool setup(
Engine *engine);
454 bool enginePostFork();
456 ApplicationPrivate *d_ptr;
461 #define CutelystApplicationInterface_iid "org.cutelyst.CutelystApplicationInterface"
The Cutelyst Application.
T plugin()
Returns the registered plugin that casts to the template type T.
The Cutelyst Component base class.
Cutelyst Controller base class
Cutelyst View abstract view component
The Cutelyst namespace holds all public Cutelyst API.