Messagelib

headerstyle.h
1/* -*- c++ -*-
2 headerstyle.h
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#pragma once
13
14#include "messageviewer_export.h"
15
16#include <Akonadi/MessageStatus>
17#include <KMime/Message>
18#include <memory.h>
19
20class QString;
21
22namespace MimeTreeParser
23{
24class NodeHelper;
25}
26
27namespace GrantleeTheme
28{
29class Theme;
30}
31
32namespace MessageViewer
33{
34class HeaderStrategy;
35class HeaderStylePrivate;
36
37/** This class encapsulates the visual appearance of message
38 headers. Together with HeaderStrategy, which determines
39 which of the headers present in the message be shown, it is
40 responsible for the formatting of message headers.
41
42 @short Encapsulates visual appearance of message headers.
43 @author Marc Mutz <mutz@kde.org>
44 @see HeaderStrategy
45**/
46class MESSAGEVIEWER_EXPORT HeaderStyle
47{
48protected:
50
51public:
52 virtual ~HeaderStyle();
53 //
54 // Methods for handling the styles:
55 //
56 virtual const char *name() const = 0;
57
58 //
59 // HeaderStyle interface:
60 //
61 virtual QString format(KMime::Message *message) const = 0;
62
63 void setHeaderStrategy(const HeaderStrategy *strategy);
64 [[nodiscard]] const HeaderStrategy *headerStrategy() const;
65
66 void setVCardName(const QString &vCardName);
67 [[nodiscard]] QString vCardName() const;
68
69 void setPrinting(bool printing);
70 [[nodiscard]] bool isPrinting() const;
71
72 void setTopLevel(bool topLevel);
73 [[nodiscard]] bool isTopLevel() const;
74
75 void setNodeHelper(MimeTreeParser::NodeHelper *nodeHelper);
76 [[nodiscard]] MimeTreeParser::NodeHelper *nodeHelper() const;
77
78 void setAllowAsync(bool allowAsync);
79 [[nodiscard]] bool allowAsync() const;
80
81 void setSourceObject(QObject *sourceObject);
82 [[nodiscard]] QObject *sourceObject() const;
83
84 void setMessageStatus(Akonadi::MessageStatus status);
85 [[nodiscard]] Akonadi::MessageStatus messageStatus() const;
86
87 void setTheme(const GrantleeTheme::Theme &theme);
88 [[nodiscard]] GrantleeTheme::Theme theme() const;
89
90 [[nodiscard]] bool readOnlyMessage() const;
91 void setReadOnlyMessage(bool readOnlyMessage);
92
93 [[nodiscard]] bool showEmoticons() const;
94 void setShowEmoticons(bool b);
95
96 void setAttachmentHtml(const QString &html);
97 [[nodiscard]] QString attachmentHtml() const;
98
99private:
100 std::unique_ptr<HeaderStylePrivate> const d;
101};
102}
The HeaderStrategy class.
This class encapsulates the visual appearance of message headers.
Definition headerstyle.h:47
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.