Changeset View
Changeset View
Standalone View
Standalone View
src/pimcommon/genericgrantlee/genericgrantleeformatter.h
Show All 17 Lines | |||||
18 | 18 | | |||
19 | #ifndef GENERICGRANTLEEFORMATTER_H | 19 | #ifndef GENERICGRANTLEEFORMATTER_H | ||
20 | #define GENERICGRANTLEEFORMATTER_H | 20 | #define GENERICGRANTLEEFORMATTER_H | ||
21 | 21 | | |||
22 | #include "pimcommon_export.h" | 22 | #include "pimcommon_export.h" | ||
23 | #include <QObject> | 23 | #include <QObject> | ||
24 | #include <QVariantHash> | 24 | #include <QVariantHash> | ||
25 | 25 | | |||
26 | #include <memory> | ||||
27 | | ||||
26 | namespace PimCommon { | 28 | namespace PimCommon { | ||
27 | class GenericGrantleeFormatterPrivate; | 29 | class GenericGrantleeFormatterPrivate; | ||
28 | class PIMCOMMON_EXPORT GenericGrantleeFormatter : public QObject | 30 | class PIMCOMMON_EXPORT GenericGrantleeFormatter : public QObject | ||
29 | { | 31 | { | ||
30 | Q_OBJECT | 32 | Q_OBJECT | ||
31 | public: | 33 | public: | ||
32 | explicit GenericGrantleeFormatter(QObject *parent = nullptr); | 34 | explicit GenericGrantleeFormatter(QObject *parent = nullptr); | ||
33 | explicit GenericGrantleeFormatter(const QString &defaultHtmlMain, const QString &themePath, QObject *parent = nullptr); | 35 | explicit GenericGrantleeFormatter(const QString &defaultHtmlMain, const QString &themePath, QObject *parent = nullptr); | ||
34 | ~GenericGrantleeFormatter(); | 36 | ~GenericGrantleeFormatter(); | ||
35 | 37 | | |||
36 | void setDefaultHtmlMainFile(const QString &name); | 38 | void setDefaultHtmlMainFile(const QString &name); | ||
37 | 39 | | |||
38 | void changeGrantleePath(const QString &path); | 40 | void changeGrantleePath(const QString &path); | ||
39 | Q_REQUIRED_RESULT QString errorMessage() const; | 41 | Q_REQUIRED_RESULT QString errorMessage() const; | ||
40 | 42 | | |||
41 | Q_REQUIRED_RESULT QString render(const QVariantHash &mapping) const; | 43 | Q_REQUIRED_RESULT QString render(const QVariantHash &mapping) const; | ||
42 | 44 | | |||
43 | //For debug | 45 | //For debug | ||
44 | void setContent(const QString &content); | 46 | void setContent(const QString &content); | ||
45 | void refreshTemplate(); | 47 | void refreshTemplate(); | ||
46 | private: | 48 | private: | ||
47 | GenericGrantleeFormatterPrivate *const d; | 49 | std::unique_ptr<GenericGrantleeFormatterPrivate> const d; | ||
48 | }; | 50 | }; | ||
49 | } | 51 | } | ||
50 | #endif // GENERICGRANTLEEFORMATTER_H | 52 | #endif // GENERICGRANTLEEFORMATTER_H |