cutelyst  3.9.1
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 <Cutelyst/component.h>
9 #include <Cutelyst/cutelyst_global.h>
10 
11 #include <QObject>
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 
54 private:
59  bool doExecute(Context *c) final;
60 
61 protected:
66  explicit View(ViewPrivate *d, QObject *parent, const QString &name);
67 };
68 
69 } // namespace Cutelyst
70 
71 #endif // VIEW_H
The Cutelyst Component base class.
Definition: component.h:25
The Cutelyst Context.
Definition: context.h:38
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:7
Cutelyst View abstract view component
Definition: view.h:21