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

KDE's Doxygen guidelines are available online.