MailTransport::TransportManager
#include <transportmanager.h>
Public Types | |
enum | ShowCondition { Always , IfNoTransportExists } |
Signals | |
Q_SCRIPTABLE void | changesCommitted () |
void | passwordsChanged () |
void | transportRemoved (int id, const QString &name) |
void | transportRenamed (int id, const QString &oldName, const QString &newName) |
Q_SCRIPTABLE void | transportsChanged () |
Protected Member Functions | |
TransportManager () | |
void | loadPasswords () |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Additional Inherited Members | |
Properties inherited from QObject | |
objectName | |
Public Attributes inherited from QObject | |
typedef | QObjectList |
Detailed Description
Central transport management interface.
This class manages the creation, configuration, and removal of mail transports, as well as the loading and storing of mail transport settings.
It also handles the creation of transport jobs, although that behaviour is deprecated and you are encouraged to use MessageQueueJob.
- See also
- MessageQueueJob.
Definition at line 34 of file transportmanager.h.
Member Enumeration Documentation
◆ ShowCondition
Describes when to show the transport creation dialog.
Definition at line 140 of file transportmanager.h.
Constructor & Destructor Documentation
◆ ~TransportManager()
|
override |
Destructor.
Definition at line 124 of file transportmanager.cpp.
◆ TransportManager()
|
protected |
Singleton class, the only instance resides in the static object sSelf.
Definition at line 103 of file transportmanager.cpp.
Member Function Documentation
◆ addTransport()
Adds the given transport.
The object ownership is transferred to TransportMananger, ie. you must not delete transport
.
- Parameters
-
transport The Transport object to add.
Definition at line 183 of file transportmanager.cpp.
◆ changesCommitted
|
signal |
Internal signal to synchronize all TransportManager instances.
This signal is emitted by the instance writing the changes. You probably want to use transportsChanged() instead.
◆ configureTransport()
bool TransportManager::configureTransport | ( | const QString & | identifier, |
Transport * | transport, | ||
QWidget * | parent ) |
Open a configuration dialog for an existing transport.
- Parameters
-
identifier The identifier. transport The transport to configure. It can be a new transport, or one already managed by TransportManager. parent The parent widget for the dialog.
- Returns
- True if the user clicked Ok, false if the user cancelled.
- Since
- 4.4
Definition at line 245 of file transportmanager.cpp.
◆ createTransport()
Transport * TransportManager::createTransport | ( | ) | const |
Creates a new, empty Transport object.
The object is owned by the caller. If you want to add the Transport permanently (eg. after configuring it) call addTransport().
Definition at line 175 of file transportmanager.cpp.
◆ createTransportJob() [1/2]
TransportJob * TransportManager::createTransportJob | ( | const QString & | transport | ) |
Creates a mail transport job for the given transport identifier, or transport name.
Returns 0 if the specified transport is invalid.
- Parameters
-
transport A string defining a mail transport.
- Deprecated
- use MessageQueueJob to queue messages and rely on the Dispatcher Agent to send them.
Definition at line 270 of file transportmanager.cpp.
◆ createTransportJob() [2/2]
TransportJob * TransportManager::createTransportJob | ( | Transport::Id | transportId | ) |
Creates a mail transport job for the given transport identifier.
Returns 0 if the specified transport is invalid.
- Parameters
-
transportId The transport identifier.
- Deprecated
- use MessageQueueJob to queue messages and rely on the Dispatcher Agent to send them.
Definition at line 254 of file transportmanager.cpp.
◆ defaultTransportId()
int TransportManager::defaultTransportId | ( | ) | const |
Returns the default transport identifier.
Invalid if there are no transports at all.
Definition at line 325 of file transportmanager.cpp.
◆ defaultTransportName()
QString TransportManager::defaultTransportName | ( | ) | const |
Returns the default transport name.
Definition at line 316 of file transportmanager.cpp.
◆ initializeTransport()
Definition at line 237 of file transportmanager.cpp.
◆ isEmpty()
bool TransportManager::isEmpty | ( | ) | const |
Returns true if there are no mail transports at all.
Definition at line 291 of file transportmanager.cpp.
◆ loadPasswords()
|
protected |
Loads all passwords synchronously.
Definition at line 508 of file transportmanager.cpp.
◆ loadPasswordsAsync()
void TransportManager::loadPasswordsAsync | ( | ) |
Tries to load passwords asynchronously from KWallet if needed.
The passwordsChanged() signal is emitted once the passwords have been loaded. Nothing happens if the passwords were already available.
Definition at line 531 of file transportmanager.cpp.
◆ passwordsChanged
|
signal |
Emitted when passwords have been loaded from the wallet.
If you made a deep copy of a transport, you should call updatePasswordState() for the cloned transport to ensure its password is updated as well.
◆ removePasswordFromWallet()
void TransportManager::removePasswordFromWallet | ( | Transport::Id | id | ) |
Definition at line 339 of file transportmanager.cpp.
◆ removeTransport()
void TransportManager::removeTransport | ( | int | id | ) |
Deletes the specified transport.
- Parameters
-
id The identifier of the mail transport to remove.
Definition at line 346 of file transportmanager.cpp.
◆ schedule()
void TransportManager::schedule | ( | TransportJob * | job | ) |
Executes the given transport job.
This is the preferred way to start transport jobs. It takes care of asynchronously loading passwords from KWallet if necessary.
- Parameters
-
job The completely configured transport job to execute.
- Deprecated
- use MessageQueueJob to queue messages and rely on the Dispatcher Agent to send them.
Definition at line 197 of file transportmanager.cpp.
◆ self()
|
static |
Returns the TransportManager instance.
Definition at line 129 of file transportmanager.cpp.
◆ setDefaultTransport()
void TransportManager::setDefaultTransport | ( | int | id | ) |
Sets the default transport.
The change will be in effect immediately.
- Parameters
-
id The identifier of the new default transport.
Definition at line 330 of file transportmanager.cpp.
◆ showTransportCreationDialog()
bool TransportManager::showTransportCreationDialog | ( | QWidget * | parent, |
ShowCondition | showCondition = Always ) |
Shows a dialog for creating and configuring a new transport.
- Parameters
-
parent Parent widget of the dialog. showCondition the condition under which the dialog is shown at all
- Returns
- True if a new transport has been created and configured.
- Since
- 4.4
Definition at line 214 of file transportmanager.cpp.
◆ transportById()
Returns the Transport object with the given id.
- Parameters
-
id The identifier of the Transport. def if set to true, the default transport will be returned if the specified Transport object could not be found, 0 otherwise.
- Returns
- A Transport object for immediate use. It might become invalid as soon as the event loop is entered again due to remote changes. If you need to store a Transport object, store the transport identifier instead.
Definition at line 138 of file transportmanager.cpp.
◆ transportByName()
Returns the transport object with the given name.
- Parameters
-
name The transport name. def if set to true, the default transport will be returned if the specified Transport object could not be found, 0 otherwise.
- Returns
- A Transport object for immediate use, see transportById() for limitations.
Definition at line 152 of file transportmanager.cpp.
◆ transportIds()
QList< int > TransportManager::transportIds | ( | ) | const |
Returns a list of transport identifiers.
Definition at line 296 of file transportmanager.cpp.
◆ transportNames()
QStringList TransportManager::transportNames | ( | ) | const |
Returns a list of transport names.
Definition at line 306 of file transportmanager.cpp.
◆ transportRemoved
Emitted when a transport is deleted.
- Parameters
-
id The identifier of the deleted transport. name The name of the deleted transport.
◆ transportRenamed
|
signal |
Emitted when a transport has been renamed.
- Parameters
-
id The identifier of the renamed transport. oldName The old name. newName The new name.
◆ transports()
Returns a list of all available transports.
Note: The Transport objects become invalid as soon as a change occur, so they are only suitable for immediate use.
Definition at line 165 of file transportmanager.cpp.
◆ transportsChanged
|
signal |
Emitted when transport settings have changed (by this or any other TransportManager instance).
◆ types()
TransportType::List TransportManager::types | ( | ) | const |
Returns a list of all available transport types.
Definition at line 170 of file transportmanager.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:37 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.