Cutelyst  1.11.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 
33 class CUTELYST_LIBRARY View : public Component
34 {
35  Q_OBJECT
36 public:
41  explicit View(QObject *parent, const QString &name = QString());
42  virtual ~View();
43 
47  // TODO remove Cutelyst2
48  QString name() const;
49 
53  virtual Modifiers modifiers() const override;
54 
61  virtual QByteArray render(Context *c) const = 0;
62 
63 private:
68  bool doExecute(Context *c) final;
69 };
70 
71 }
72 
73 #endif // VIEW_H
The Cutelyst Component base class.
Definition: component.h:38
The Cutelyst Context.
Definition: context.h:50
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:7
Cutelyst View abstract view component
Definition: view.h:33