cutelyst 3.9.1
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
clearsilver.h
1/*
2 * SPDX-FileCopyrightText: (C) 2013-2022 Daniel Nicoletti <dantti12@gmail.com>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef CLEARSILVER_H
6#define CLEARSILVER_H
7
8#include <Cutelyst/View>
9
10#include <QObject>
11#include <QStringList>
12
13namespace Cutelyst {
14
15class ClearSilverPrivate;
16class CUTELYST_VIEW_CLEARSILVER_EXPORT ClearSilver final : public View
17{
19 Q_DECLARE_PRIVATE(ClearSilver)
20public:
24 explicit ClearSilver(QObject *parent = nullptr, const QString &name = QString());
25
26 Q_PROPERTY(QStringList includePaths READ includePaths WRITE setIncludePaths NOTIFY changed)
30 QStringList includePaths() const;
31
35 void setIncludePaths(const QStringList &paths);
36
38 QString templateExtension READ templateExtension WRITE setTemplateExtension NOTIFY changed)
42 QString templateExtension() const;
43
47 void setTemplateExtension(const QString &extension);
48
49 Q_PROPERTY(QString wrapper READ wrapper WRITE setWrapper NOTIFY changed)
53 QString wrapper() const;
54
59 void setWrapper(const QString &name);
60
61 QByteArray render(Context *c) const final;
62
64 void changed();
65};
66
67} // namespace Cutelyst
68
69#endif // CLEARSILVER_H
void setTemplateExtension(const QString &extension)
Sets the template extension, defaults to ".html".
void setWrapper(const QString &name)
Sets the template wrapper name, the template will be rendered into content variable in which the wrap...
ClearSilver(QObject *parent=nullptr, const QString &name=QString())
Constructs a ClearSilver object with the given parent and name.
void setIncludePaths(const QStringList &paths)
Sets the list of include paths which will be looked for when resolving templates files.
QByteArray render(Context *c) const final
QString name() const
Definition component.cpp:33
The Cutelyst Context.
Definition context.h:39
View(QObject *parent, const QString &name)
Definition view.cpp:18
The Cutelyst namespace holds all public Cutelyst API.
Definition Mainpage.dox:8
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
QObject * parent() const const