Cutelyst  2.13.0
view.h
1 /*
2  * Copyright (C) 2013-2017 Daniel Nicoletti <dantti12@gmail.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 #ifndef VIEW_H
19 #define VIEW_H
20 
21 #include <QObject>
22 
23 #include <Cutelyst/cutelyst_global.h>
24 #include <Cutelyst/component.h>
25 
26 namespace Cutelyst {
27 
28 class Context;
29 class ViewPrivate;
30 
34 class CUTELYST_LIBRARY View : public Component
35 {
36  Q_OBJECT
37  Q_DECLARE_PRIVATE(View)
38 public:
43  explicit View(QObject *parent, const QString &name);
44  virtual ~View() override = default;
45 
49  virtual Modifiers modifiers() const override;
50 
57  virtual QByteArray render(Context *c) const = 0;
58 
65  void setMinimalSizeToDeflate(qint32 minSize = -1);
66 private:
71  bool doExecute(Context *c) final;
72 
73 protected:
77  explicit View(ViewPrivate *d, QObject *parent, const QString &name);
78 };
79 
80 }
81 
82 #endif // VIEW_H
Cutelyst::Context
The Cutelyst Context.
Definition: context.h:50
Cutelyst::Component
The Cutelyst Component base class.
Definition: component.h:38
Cutelyst::View
Cutelyst View abstract view component
Definition: view.h:34
Cutelyst
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:7