cutelyst
3.9.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
component.h
1
/*
2
* SPDX-FileCopyrightText: (C) 2014-2022 Daniel Nicoletti <dantti12@gmail.com>
3
* SPDX-License-Identifier: BSD-3-Clause
4
*/
5
#ifndef CUTELYST_COMPONENT_H
6
#define CUTELYST_COMPONENT_H
7
8
#include <Cutelyst/cutelyst_global.h>
9
10
#include <QtCore/qobject.h>
11
12
namespace
Cutelyst
{
13
14
class
Application
;
15
class
Context
;
16
class
Controller
;
17
class
Dispatcher
;
18
class
ComponentPrivate;
19
25
class
CUTELYST_LIBRARY
Component
:
public
QObject
26
{
27
Q_OBJECT
28
Q_DECLARE_PRIVATE(
Component
)
29
Q_FLAGS
(Modifiers)
30
public
:
32
enum
Modifier
{
33
None = 0 << 1,
34
OnlyExecute = 1 << 1,
35
BeforeExecute = 2 << 1,
36
AroundExecute = 3 << 1,
37
AfterExecute = 4 << 1,
38
};
39
Q_ENUM(Modifier)
40
Q_DECLARE_FLAGS(Modifiers, Modifier)
41
42
47
explicit
Component
(
QObject
*parent =
nullptr
);
48
virtual
~Component
()
override
;
49
53
virtual
Modifiers modifiers()
const
;
54
58
QString
name()
const
;
59
63
void
setName(
const
QString
&name);
64
68
QString
reverse()
const
;
69
73
void
setReverse(
const
QString
&reverse);
74
81
virtual
bool
init(
Application
*application,
const
QVariantHash &args);
82
86
bool
execute(
Context
*c);
87
88
protected
:
93
explicit
Component
(ComponentPrivate *d,
QObject
*parent =
nullptr
);
94
98
virtual
bool
beforeExecute(
Context
*c);
99
104
virtual
bool
aroundExecute(
Context
*c,
QStack<Component *>
stack);
105
109
virtual
bool
afterExecute(
Context
*c);
110
114
virtual
bool
doExecute(
Context
*c);
115
119
void
applyRoles(
const
QStack<Component *>
&roles);
120
127
virtual
bool
dispatcherReady(
const
Dispatcher
*dispatch,
Controller
*controller);
128
129
protected
:
130
friend
class
Controller
;
131
ComponentPrivate
132
*d_ptr;
133
};
134
135
}
// namespace Cutelyst
136
137
#endif
// CUTELYST_COMPONENT_H
Cutelyst::Application
The Cutelyst Application.
Definition
application.h:43
Cutelyst::Component
The Cutelyst Component base class.
Definition
component.h:26
Cutelyst::Component::Modifier
Modifier
Definition
component.h:32
Cutelyst::Component::Component
Component(QObject *parent=nullptr)
Definition
component.cpp:11
Cutelyst::Context
The Cutelyst Context.
Definition
context.h:39
Cutelyst::Controller
Cutelyst Controller base class
Definition
controller.h:88
Cutelyst::Dispatcher
The Cutelyst Dispatcher.
Definition
dispatcher.h:28
Cutelyst
The Cutelyst namespace holds all public Cutelyst API.
Definition
Mainpage.dox:8
QObject::Q_FLAGS
Q_FLAGS(...)
QObject
QObject::QObject
QObject(QObject *parent)
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QStack
QString
Cutelyst
component.h
Generated on
for cutelyst by
1.16.1