Messagelib

recipient.h
1 /*
2  SPDX-FileCopyrightText: 2010 Volker Krause <[email protected]>
3  Based in kmail/recipientseditor.h/cpp
4  SPDX-FileCopyrightText: 2004 Cornelius Schumacher <[email protected]>
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>
20 namespace MessageComposer
21 {
22 /** Represents a mail recipient. */
23 class RecipientPrivate;
24 /**
25  * @brief The Recipient class
26  */
27 class MESSAGECOMPOSER_EXPORT Recipient : public KPIM::MultiplyingLineData
28 {
29 public:
32 
33  enum Type { To, Cc, Bcc, ReplyTo, Undefined };
34 
35  Recipient(const QString &email = QString(), Type type = To); // krazy:exclude=explicit
36  ~Recipient() override;
37  void setType(Type type);
38  Q_REQUIRED_RESULT Type type() const;
39 
40  void setEmail(const QString &email);
41  Q_REQUIRED_RESULT QString email() const;
42 
43  void setName(const QString &name);
44  Q_REQUIRED_RESULT QString name() const;
45 
46  Q_REQUIRED_RESULT bool isEmpty() const override;
47  void clear() override;
48 
49  Q_REQUIRED_RESULT static int typeToId(Type type);
50  Q_REQUIRED_RESULT static Type idToType(int id);
51 
52  Q_REQUIRED_RESULT QString typeLabel() const;
53  Q_REQUIRED_RESULT static QString typeLabel(Type type);
54  Q_REQUIRED_RESULT static QStringList allTypeLabels();
55 
56  void setEncryptionAction(const Kleo::Action action);
57  Q_REQUIRED_RESULT Kleo::Action encryptionAction() const;
58 
59  void setKey(const GpgME::Key &key);
60  Q_REQUIRED_RESULT GpgME::Key key() const;
61 
62 private:
63  std::unique_ptr<RecipientPrivate> const d;
64 };
65 }
66 
const QLatin1String name
PartitionTable::TableType type
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
The Recipient class.
Definition: recipient.h:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Dec 2 2021 23:06:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.