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

KDE's Doxygen guidelines are available online.