Messagelib

recipientseditor.h
1 /*
2  SPDX-FileCopyrightText: 2010 Casey Link <[email protected]>
3  SPDX-FileCopyrightText: 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <[email protected]>
4 
5  Refactored from earlier code by:
6  SPDX-FileCopyrightText: 2010 Volker Krause <[email protected]>
7  SPDX-FileCopyrightText: 2004 Cornelius Schumacher <[email protected]>
8 
9  SPDX-License-Identifier: LGPL-2.0-or-later
10 */
11 #ifndef MESSAGECOMPOSER_RECIPIENTSEDITORNG_H
12 #define MESSAGECOMPOSER_RECIPIENTSEDITORNG_H
13 
14 #include "messagecomposer_export.h"
15 
16 #include "recipientline.h"
17 
18 #include <Libkdepim/MultiplyingLineEditor>
19 
20 namespace KMime {
21 namespace Types {
22 class Mailbox;
23 }
24 }
25 namespace MessageComposer {
29 class MESSAGECOMPOSER_EXPORT RecipientLineFactory : public KPIM::MultiplyingLineFactory
30 {
31  Q_OBJECT
32 public:
33  explicit RecipientLineFactory(QObject *parent);
34  KPIM::MultiplyingLine *newLine(QWidget *parent) override;
35  int maximumRecipients() override;
36 };
37 
38 class RecipientsPicker;
39 class RecipientsEditorPrivate;
43 class MESSAGECOMPOSER_EXPORT RecipientsEditor : public KPIM::MultiplyingLineEditor
44 {
45  Q_OBJECT
46 public:
47  explicit RecipientsEditor(QWidget *parent = nullptr);
48  explicit RecipientsEditor(RecipientLineFactory *lineFactory, QWidget *parent = nullptr);
49  ~RecipientsEditor() override;
50 
51  Q_REQUIRED_RESULT Recipient::List recipients() const;
52  Q_REQUIRED_RESULT QSharedPointer<Recipient> activeRecipient() const;
53 
54  Q_REQUIRED_RESULT MessageComposer::RecipientsPicker *picker() const;
55 
56  void setRecipientString(const QVector<KMime::Types::Mailbox> &mailboxes, Recipient::Type);
57  Q_REQUIRED_RESULT QString recipientString(Recipient::Type) const;
58  Q_REQUIRED_RESULT QStringList recipientStringList(Recipient::Type) const;
59 
64  Q_REQUIRED_RESULT bool addRecipient(const QString &recipient, Recipient::Type type);
65 
70  void removeRecipient(const QString &recipient, Recipient::Type type);
71 
75  void setRecentAddressConfig(KConfig *config);
76 
77 public Q_SLOTS:
78  void selectRecipients();
79  void saveDistributionList();
80 
81 protected Q_SLOTS:
82  void slotPickedRecipient(const Recipient &, bool &tooManyAddress);
83  void slotLineAdded(KPIM::MultiplyingLine *);
84  void slotLineDeleted(int pos);
85  void slotCalculateTotal();
86  void addRecipient(RecipientLineNG *, const QString &);
87 
88 protected:
89  bool eventFilter(QObject *object, QEvent *event) override;
90  Q_REQUIRED_RESULT RecipientLineNG *activeLine() const override;
91 
92 private:
93  RecipientsEditorPrivate *const d;
94 };
95 }
96 
97 #endif //MESSAGECOMPOSER_RECIPIENTSEDITORNG_H
The RecipientLineNG class.
Definition: recipientline.h:54
The RecipientLineFactory class.
Simple interface that both EncryptJob and SignEncryptJob implement so the composer can extract some e...
The Recipient class.
Definition: recipient.h:27
The RecipientsEditor class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jul 6 2020 23:12:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.