Messagelib

recipient.h
1/*
2 SPDX-FileCopyrightText: 2010 Volker Krause <vkrause@kde.org>
3 Based in kmail/recipientseditor.h/cpp
4 SPDX-FileCopyrightText: 2004 Cornelius Schumacher <schumacher@kde.org>
5
6 SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
7*/
8
9#pragma once
10
11#include "messagecomposer_export.h"
12
13#include <Libkdepim/MultiplyingLine>
14
15#include <Libkleo/Enum>
16#include <gpgme++/key.h>
17
18#include <QSharedPointer>
19#include <QString>
20namespace MessageComposer
21{
22/** Represents a mail recipient. */
23class RecipientPrivate;
24/**
25 * @brief The Recipient class
26 */
27class MESSAGECOMPOSER_EXPORT Recipient : public KPIM::MultiplyingLineData
28{
29public:
32
33 enum Type : uint8_t {
34 To,
35 Cc,
36 Bcc,
37 ReplyTo,
38 Undefined,
39 };
40
41 Recipient(const QString &email = QString(), Type type = To); // krazy:exclude=explicit
42 ~Recipient() override;
43 void setType(Type type);
44 [[nodiscard]] Type type() const;
45
46 void setEmail(const QString &email);
47 [[nodiscard]] QString email() const;
48
49 void setName(const QString &name);
50 [[nodiscard]] QString name() const;
51
52 [[nodiscard]] bool isEmpty() const override;
53 void clear() override;
54
55 [[nodiscard]] static int typeToId(Type type);
56 [[nodiscard]] static Type idToType(int id);
57
58 [[nodiscard]] QString typeLabel() const;
59 [[nodiscard]] static QString typeLabel(Type type);
60 [[nodiscard]] static QStringList allTypeLabels();
61
62 void setEncryptionAction(const Kleo::Action action);
63 [[nodiscard]] Kleo::Action encryptionAction() const;
64
65 void setKey(const GpgME::Key &key);
66 [[nodiscard]] GpgME::Key key() const;
67
68private:
69 std::unique_ptr<RecipientPrivate> const d;
70};
71}
The Recipient class.
Definition recipient.h:28
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.