5 #ifndef CUTELYST_APPLICATION_H
6 #define CUTELYST_APPLICATION_H
8 #include <QtCore/QObject>
9 #include <QtCore/QVariant>
10 #include <QtCore/QLocale>
11 #include <QtCore/QVector>
13 #include <Cutelyst/cutelyst_global.h>
19 #define CUTELYST_APPLICATION(x) \
20 Q_PLUGIN_METADATA(x) \
21 Q_INTERFACES(Cutelyst::Application)
35 class ApplicationPrivate;
106 template <
typename T>
109 const auto pluginsConst = plugins();
110 for (
Plugin *plugin : pluginsConst) {
111 auto p = qobject_cast<T>(plugin);
123 QVariantMap config() const noexcept;
138 bool inited() const noexcept;
143 Engine *engine() const noexcept;
154 static const
char *cutelystVersion() noexcept;
217 QString translate(const
QLocale &locale, const
char *context, const
char *sourceText, const
char *disambiguation =
nullptr,
int n = -1) const;
329 virtual
bool postFork();
336 Headers &defaultHeaders() noexcept;
341 void addXCutelystVersionHeader();
350 bool registerPlugin(
Plugin *plugin);
362 bool registerController(
Controller *controller);
371 bool registerView(
View *view);
436 bool setup(
Engine *engine);
446 bool enginePostFork();
448 ApplicationPrivate *d_ptr;
453 #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.