Messagelib

headerstyle.cpp
1/* -*- c++ -*-
2 headerstyle.cpp
3
4 This file is part of KMail, the KDE mail client.
5 SPDX-FileCopyrightText: 2003 Marc Mutz <mutz@kde.org>
6
7 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
8
9 SPDX-License-Identifier: GPL-2.0-or-later
10*/
11
12#include "headerstyle.h"
13#include <GrantleeTheme/GrantleeTheme>
14
15using namespace MessageViewer;
16//
17// HeaderStyle abstract base:
18//
19class MessageViewer::HeaderStylePrivate
20{
21public:
22 HeaderStylePrivate() = default;
23
25 const HeaderStrategy *mStrategy = nullptr;
26 QString mVCardName;
27 QString mAttachmentHtml;
28 MimeTreeParser::NodeHelper *mNodeHelper = nullptr;
29 QObject *mSourceObject = nullptr;
30 Akonadi::MessageStatus mMessageStatus;
31 bool mPrinting = false;
32 bool mTopLevel = true;
33 bool mAllowAsync = false;
34 bool mReadOnlyMessage = false;
35 bool mShowEmoticons = true;
36};
37
38HeaderStyle::HeaderStyle()
39 : d(new MessageViewer::HeaderStylePrivate)
40{
41}
42
43HeaderStyle::~HeaderStyle() = default;
44
45void HeaderStyle::setAttachmentHtml(const QString &html)
46{
47 d->mAttachmentHtml = html;
48}
49
50QString HeaderStyle::attachmentHtml() const
51{
52 return d->mAttachmentHtml;
53}
54
55void HeaderStyle::setHeaderStrategy(const HeaderStrategy *strategy)
56{
57 d->mStrategy = strategy;
58}
59
60const HeaderStrategy *HeaderStyle::headerStrategy() const
61{
62 return d->mStrategy;
63}
64
65void HeaderStyle::setVCardName(const QString &vCardName)
66{
67 d->mVCardName = vCardName;
68}
69
70QString HeaderStyle::vCardName() const
71{
72 return d->mVCardName;
73}
74
75void HeaderStyle::setPrinting(bool printing)
76{
77 d->mPrinting = printing;
78}
79
80bool HeaderStyle::isPrinting() const
81{
82 return d->mPrinting;
83}
84
85void HeaderStyle::setTopLevel(bool topLevel)
86{
87 d->mTopLevel = topLevel;
88}
89
90bool HeaderStyle::isTopLevel() const
91{
92 return d->mTopLevel;
93}
94
95void HeaderStyle::setNodeHelper(MimeTreeParser::NodeHelper *nodeHelper)
96{
97 d->mNodeHelper = nodeHelper;
98}
99
100MimeTreeParser::NodeHelper *HeaderStyle::nodeHelper() const
101{
102 return d->mNodeHelper;
103}
104
105void HeaderStyle::setAllowAsync(bool allowAsync)
106{
107 d->mAllowAsync = allowAsync;
108}
109
110bool HeaderStyle::allowAsync() const
111{
112 return d->mAllowAsync;
113}
114
115void HeaderStyle::setSourceObject(QObject *sourceObject)
116{
117 d->mSourceObject = sourceObject;
118}
119
120QObject *HeaderStyle::sourceObject() const
121{
122 return d->mSourceObject;
123}
124
125void HeaderStyle::setMessageStatus(Akonadi::MessageStatus status)
126{
127 d->mMessageStatus = status;
128}
129
130Akonadi::MessageStatus HeaderStyle::messageStatus() const
131{
132 return d->mMessageStatus;
133}
134
135void HeaderStyle::setTheme(const GrantleeTheme::Theme &theme)
136{
137 d->mTheme = theme;
138}
139
140GrantleeTheme::Theme HeaderStyle::theme() const
141{
142 return d->mTheme;
143}
144
145bool HeaderStyle::readOnlyMessage() const
146{
147 return d->mReadOnlyMessage;
148}
149
150void HeaderStyle::setReadOnlyMessage(bool readOnlyMessage)
151{
152 d->mReadOnlyMessage = readOnlyMessage;
153}
154
155bool HeaderStyle::showEmoticons() const
156{
157 return d->mShowEmoticons;
158}
159
160void HeaderStyle::setShowEmoticons(bool b)
161{
162 d->mShowEmoticons = b;
163}
The HeaderStrategy class.
Q_SCRIPTABLE CaptureState status()
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.