Messagelib

messagepartrenderermanager.h
1/*
2 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8#include "messageviewer_export.h"
9#include <QObject>
10
11#include <KTextTemplate/Template>
12
13#include <QMetaType>
14
15#include <functional>
16
17namespace GrantleeTheme
18{
19class Engine;
20}
21
22namespace MessageViewer
23{
24class GlobalContext;
25
26using KTextTemplateCallback = std::function<void(KTextTemplate::OutputStream *)>;
27/**
28 * @brief The MessagePartRendererManager class
29 */
30class MESSAGEVIEWER_EXPORT MessagePartRendererManager : public QObject
31{
32 Q_OBJECT
33public:
35 static MessagePartRendererManager *self();
36 [[nodiscard]] KTextTemplate::Template loadByName(const QString &name);
37 [[nodiscard]] KTextTemplate::Context createContext();
38
39private:
40 explicit MessagePartRendererManager(QObject *parent = nullptr);
41 MESSAGEVIEWER_NO_EXPORT void initializeRenderer();
42 GrantleeTheme::Engine *m_engine = nullptr;
43 GlobalContext *const m_globalContext;
44};
45}
46
47Q_DECLARE_METATYPE(MessageViewer::KTextTemplateCallback)
The MessagePartRendererManager class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.