GrantleeTheme

genericformatter.h
1 /*
2  Copyright (c) 2016-2020 Laurent Montel <[email protected]>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful, but
10  WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef GRANTLEETHEME_GENERICFORMATTER_H
20 #define GRANTLEETHEME_GENERICFORMATTER_H
21 
22 #include "grantleetheme_export.h"
23 
24 #include <memory>
25 
26 #include <QVariant>
27 
28 class QString;
29 
30 namespace GrantleeTheme {
31 class GenericFormatterPrivate;
32 
34 class GRANTLEETHEME_EXPORT GenericFormatter
35 {
36 public:
38  explicit GenericFormatter(const QString &defaultHtmlMain, const QString &themePath);
40 
41  void setDefaultHtmlMainFile(const QString &name);
42  void setTemplatePath(const QString &path);
43 
45  void setApplicationDomain(const QByteArray &domain);
46 
47  QString render(const QVariantHash &mapping) const;
48  QString errorMessage() const;
49 
51  void setTemplateContent(const QString &content);
52 
53  void reloadTemplate();
54 
55 private:
56  std::unique_ptr<GenericFormatterPrivate> const d;
57 };
58 }
59 
60 #endif // GRANTLEETHEME_GENERICFORMATTER_H
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-2020 The KDE developers.
Generated on Wed Aug 5 2020 23:14:41 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.