GrantleeTheme

genericformatter.h
1 /*
2  SPDX-FileCopyrightText: 2016-2022 Laurent Montel <[email protected]>
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 
15 class QString;
16 
17 namespace GrantleeTheme
18 {
19 class GenericFormatterPrivate;
20 
21 /** Convenience class for using a Grantlee theme. */
22 class GRANTLEETHEME_EXPORT GenericFormatter
23 {
24 public:
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 
43 private:
44  std::unique_ptr<GenericFormatterPrivate> const d;
45 };
46 }
47 
Convenience class for using a Grantlee theme.
KCALUTILS_EXPORT QString errorMessage(const KCalendarCore::Exception &exception)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Wed Sep 28 2022 04:06:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.