MailTransport

transportmanager.h
1 /*
2  SPDX-FileCopyrightText: 2006-2007 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef MAILTRANSPORT_TRANSPORTMANAGER_H
8 #define MAILTRANSPORT_TRANSPORTMANAGER_H
9 
10 #include <mailtransport_export.h>
11 #include <transporttype.h>
12 
13 #include <QList>
14 #include <QObject>
15 
16 namespace KWallet {
17 class Wallet;
18 }
19 
20 namespace MailTransport {
21 class Transport;
22 class TransportJob;
23 class TransportManagerPrivate;
24 
36 class MAILTRANSPORT_EXPORT TransportManager : public QObject
37 {
38  Q_OBJECT
39  Q_CLASSINFO("D-Bus Interface", "org.kde.pim.TransportManager")
40 
41  friend class Transport;
42  friend class TransportManagerPrivate;
43 
44 public:
45 
49  ~TransportManager() override;
50 
54  static TransportManager *self();
55 
61  void loadPasswordsAsync();
62 
72  Transport *transportById(int id, bool def = true) const;
73 
82  Transport *transportByName(const QString &name, bool def = true) const;
83 
89  Q_REQUIRED_RESULT QList<Transport *> transports() const;
90 
94  Q_REQUIRED_RESULT TransportType::List types() const;
95 
101  Transport *createTransport() const;
102 
108  void addTransport(Transport *transport);
109 
118  MAILTRANSPORT_DEPRECATED TransportJob *createTransportJob(int transportId);
119 
129  MAILTRANSPORT_DEPRECATED TransportJob *createTransportJob(const QString &transport);
130 
140  MAILTRANSPORT_DEPRECATED void schedule(TransportJob *job);
141 
146  void createDefaultTransport();
147 
151  IfNoTransportExists
152  };
155 
163  bool showTransportCreationDialog(QWidget *parent, ShowCondition showCondition = Always);
164 
174  bool configureTransport(const QString &identifier, Transport *transport, QWidget *parent);
175 
176  void initializeTransport(const QString &identifier, Transport *transport);
177 public:
181  Q_SCRIPTABLE bool isEmpty() const;
182 
186  Q_SCRIPTABLE QVector<int> transportIds() const;
187 
191  Q_SCRIPTABLE QStringList transportNames() const;
192 
196  Q_SCRIPTABLE QString defaultTransportName() const;
197 
202  Q_SCRIPTABLE int defaultTransportId() const;
203 
208  Q_SCRIPTABLE void setDefaultTransport(int id);
209 
214  Q_SCRIPTABLE void removeTransport(int id);
215 
216  void removePasswordFromWallet(int id);
217 Q_SIGNALS:
222  Q_SCRIPTABLE void transportsChanged();
223 
229  Q_SCRIPTABLE void changesCommitted();
230 
236  void passwordsChanged();
237 
243  void transportRemoved(int id, const QString &name);
244 
251  void transportRenamed(int id, const QString &oldName, const QString &newName);
252 
253 protected:
258  KWallet::Wallet *wallet();
259 
263  void loadPasswords();
264 
269 
270 private:
271 
272  // These are used by our friend, Transport
273  void emitChangesCommitted();
274  void updatePluginList();
275 
276 private:
277  TransportManagerPrivate *const d;
278 
279  Q_PRIVATE_SLOT(d, void slotTransportsChanged())
280 };
281 } // namespace MailTransport
282 
283 #endif // MAILTRANSPORT_TRANSPORTMANAGER_H
Central transport management interface.
ShowCondition
Describes when to show the transport creation dialog.
Show the transport creation dialog unconditionally.
Abstract base class for all mail transport jobs.
Definition: transportjob.h:27
Represents the settings of a specific mail transport.
Definition: transport.h:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Sep 19 2020 23:17:49 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.