18 #ifndef CUTELYST_COMPONENT_H
19 #define CUTELYST_COMPONENT_H
21 #include <QtCore/qobject.h>
23 #include <Cutelyst/cutelyst_global.h>
31 class ComponentPrivate;
48 BeforeExecute = 2 << 1,
49 AroundExecute = 3 << 1,
50 AfterExecute = 4 << 1,
53 Q_DECLARE_FLAGS(Modifiers, Modifier)
60 explicit Component(QObject *parent =
nullptr);
66 virtual Modifiers modifiers()
const;
76 void setName(
const QString &name);
81 QString reverse()
const;
86 void setReverse(
const QString &reverse);
94 virtual bool init(
Application *application,
const QVariantHash &args);
105 explicit Component(ComponentPrivate *d, QObject *parent =
nullptr);
110 virtual bool beforeExecute(
Context *c);
116 virtual bool aroundExecute(
Context *c, QStack<Component *> stack);
121 virtual bool afterExecute(
Context *c);
126 virtual bool doExecute(
Context *c);
131 void applyRoles(
const QStack<Component *> &roles);
143 ComponentPrivate *d_ptr;
148 #endif // CUTELYST_COMPONENT_H