GrantleeTheme

genericformatter.h
1/*
2 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "grantleetheme_export.h"
10
11#include <memory>
12
13#include <QVariant>
14
15class QString;
16
17namespace GrantleeTheme
18{
19class GenericFormatterPrivate;
20
21/** Convenience class for using a Grantlee theme. */
22class GRANTLEETHEME_EXPORT GenericFormatter
23{
24public:
26 explicit GenericFormatter(const QString &defaultHtmlMain, const QString &themePath);
28
29 void setDefaultHtmlMainFile(const QString &name);
30 void setTemplatePath(const QString &path);
31
32 /** Translation domain for the Grantlee localizer. */
33 void setApplicationDomain(const QByteArray &domain);
34
35 QString render(const QVariantHash &mapping) const;
36 QString errorMessage() const;
37
38 /** Set template content from a string rather than a file. */
39 void setTemplateContent(const QString &content);
40
41 void reloadTemplate();
42
43private:
44 std::unique_ptr<GenericFormatterPrivate> const d;
45};
46}
Convenience class for using a Grantlee theme.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.