Messagelib

messageviewerrenderer.cpp
1/*
2 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
3
4 Code based on ARHParser.jsm from dkim_verifier (Copyright (c) Philippe Lieser)
5 (This software is licensed under the terms of the MIT License.)
6
7 SPDX-License-Identifier: LGPL-2.0-or-later
8*/
9
10#include "messageviewerrenderer.h"
11#include "viewer/csshelper.h"
12using namespace MessageViewer;
13MessageViewerRenderer::MessageViewerRenderer() = default;
14
15MessageViewerRenderer::~MessageViewerRenderer()
16{
17 delete mCSSHelper;
18}
19
20CSSHelper *MessageViewerRenderer::cssHelper() const
21{
22 return mCSSHelper;
23}
24
25QWidget *MessageViewerRenderer::currentWidget() const
26{
27 return mCurrentWidget;
28}
29
30void MessageViewerRenderer::setCurrentWidget(QWidget *currentWidget)
31{
32 mCurrentWidget = currentWidget;
33}
34
35void MessageViewerRenderer::recreateCssHelper()
36{
37 const HeaderStylePlugin *oldHeaderStylePlugin = nullptr;
38 if (mCSSHelper) {
39 oldHeaderStylePlugin = mCSSHelper->headerPlugin();
40 }
41 delete mCSSHelper;
42 mCSSHelper = new CSSHelper(mCurrentWidget);
43 if (oldHeaderStylePlugin) {
44 mCSSHelper->setHeaderPlugin(oldHeaderStylePlugin);
45 }
46}
The CSSHelper class.
Definition csshelper.h:22
The HeaderStylePlugin class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:33:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.