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 #ifndef MESSAGECOMPOSER_RECIPIENT_H
10 #define MESSAGECOMPOSER_RECIPIENT_H
11 
12 #include "messagecomposer_export.h"
13 
14 #include <Libkdepim/MultiplyingLine>
15 
16 #include <gpgme++/key.h>
17 #include <Libkleo/Enum>
18 
19 #include <QString>
20 #include <QSharedPointer>
21 namespace MessageComposer {
23 class RecipientPrivate;
27 class MESSAGECOMPOSER_EXPORT Recipient : public KPIM::MultiplyingLineData
28 {
29 public:
32 
33  enum Type {
34  To, Cc, Bcc, ReplyTo, Undefined
35  };
36 
37  Recipient(const QString &email = QString(), Type type = To); //krazy:exclude=explicit
38  ~Recipient() override;
39  void setType(Type type);
40  Q_REQUIRED_RESULT Type type() const;
41 
42  void setEmail(const QString &email);
43  Q_REQUIRED_RESULT QString email() const;
44 
45  void setName(const QString &name);
46  Q_REQUIRED_RESULT QString name() const;
47 
48  Q_REQUIRED_RESULT bool isEmpty() const override;
49  void clear() override;
50 
51  Q_REQUIRED_RESULT static int typeToId(Type type);
52  Q_REQUIRED_RESULT static Type idToType(int id);
53 
54  Q_REQUIRED_RESULT QString typeLabel() const;
55  Q_REQUIRED_RESULT static QString typeLabel(Type type);
56  Q_REQUIRED_RESULT static QStringList allTypeLabels();
57 
58  void setEncryptionAction(const Kleo::Action action);
59  Q_REQUIRED_RESULT Kleo::Action encryptionAction() const;
60 
61  void setKey(const GpgME::Key &key);
62  Q_REQUIRED_RESULT GpgME::Key key() const;
63 
64 private:
65  RecipientPrivate *const d;
66 };
67 }
68 
69 #endif
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-2020 The KDE developers.
Generated on Wed Aug 12 2020 23:12:56 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.