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 {
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  Q_REQUIRED_RESULT Type type() const;
45 
46  void setEmail(const QString &email);
47  Q_REQUIRED_RESULT QString email() const;
48 
49  void setName(const QString &name);
50  Q_REQUIRED_RESULT QString name() const;
51 
52  Q_REQUIRED_RESULT bool isEmpty() const override;
53  void clear() override;
54 
55  Q_REQUIRED_RESULT static int typeToId(Type type);
56  Q_REQUIRED_RESULT static Type idToType(int id);
57 
58  Q_REQUIRED_RESULT QString typeLabel() const;
59  Q_REQUIRED_RESULT static QString typeLabel(Type type);
60  Q_REQUIRED_RESULT static QStringList allTypeLabels();
61 
62  void setEncryptionAction(const Kleo::Action action);
63  Q_REQUIRED_RESULT Kleo::Action encryptionAction() const;
64 
65  void setKey(const GpgME::Key &key);
66  Q_REQUIRED_RESULT GpgME::Key key() const;
67 
68 private:
69  std::unique_ptr<RecipientPrivate> const d;
70 };
71 }
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-2023 The KDE developers.
Generated on Wed Jun 7 2023 04:02:49 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.