cutelyst 4.0.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
view.h
1/*
2 * SPDX-FileCopyrightText: (C) 2013-2023 Daniel Nicoletti <dantti12@gmail.com>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#pragma once
6
7#include <Cutelyst/component.h>
8#include <Cutelyst/cutelyst_global.h>
9
10#include <QObject>
11
12namespace Cutelyst {
13
14class Context;
15class ViewPrivate;
16
20class CUTELYST_LIBRARY View : public Component
21{
22 Q_OBJECT
23 Q_DECLARE_PRIVATE(View)
24public:
29 explicit View(QObject *parent, const QString &name);
30 virtual ~View() override = default;
31
35 Modifiers modifiers() const override;
36
43 [[nodiscard]] virtual QByteArray render(Context *c) const = 0;
44
51 void setMinimalSizeToDeflate(qint32 minSize = -1);
52
53private:
58 bool doExecute(Context *c) final;
59
60protected:
65 explicit View(ViewPrivate *d, QObject *parent, const QString &name);
66};
67
68} // namespace Cutelyst
The Cutelyst Component base class.
Definition: component.h:26
The Cutelyst Context.
Definition: context.h:38
Cutelyst View abstract view component
Definition: view.h:21
virtual QByteArray render(Context *c) const =0
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:8