cutelyst  3.7.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-2022 Daniel Nicoletti <dantti12@gmail.com>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 #ifndef VIEW_H
6 #define VIEW_H
7 
8 #include <QObject>
9 
10 #include <Cutelyst/cutelyst_global.h>
11 #include <Cutelyst/component.h>
12 
13 namespace Cutelyst {
14 
15 class Context;
16 class ViewPrivate;
17 
21 class CUTELYST_LIBRARY View : public Component
22 {
23  Q_OBJECT
24  Q_DECLARE_PRIVATE(View)
25 public:
30  explicit View(QObject *parent, const QString &name);
31  virtual ~View() override = default;
32 
36  virtual Modifiers modifiers() const override;
37 
44  virtual QByteArray render(Context *c) const = 0;
45 
52  void setMinimalSizeToDeflate(qint32 minSize = -1);
53 private:
58  bool doExecute(Context *c) final;
59 
60 protected:
64  explicit View(ViewPrivate *d, QObject *parent, const QString &name);
65 };
66 
67 }
68 
69 #endif // VIEW_H
The Cutelyst Component base class.
Definition: component.h:26
The Cutelyst Context.
Definition: context.h:39
Cutelyst View abstract view component
Definition: view.h:22
virtual QByteArray render(Context *c) const =0
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:8