mailtransport
MailTransport::TransportManager Class Reference
#include <transportmanager.h>

Detailed Description
Takes care of loading and storing mail transport settings and creating of transport jobs.Definition at line 43 of file transportmanager.h.
Public Slots | |
Q_SCRIPTABLE int | defaultTransportId () const |
Q_SCRIPTABLE QString | defaultTransportName () const |
Q_SCRIPTABLE bool | isEmpty () const |
Q_SCRIPTABLE void | removeTransport (int id) |
Q_SCRIPTABLE void | setDefaultTransport (int id) |
Q_SCRIPTABLE QList< int > | transportIds () const |
Q_SCRIPTABLE QStringList | transportNames () const |
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 () |
Public Member Functions | |
void | addTransport (Transport *transport) |
void | createDefaultTransport () |
Transport * | createTransport () const |
TransportJob * | createTransportJob (const QString &transport) |
TransportJob * | createTransportJob (int transportId) |
void | loadPasswordsAsync () |
void | schedule (TransportJob *job) |
Transport * | transportById (int id, bool def=true) const |
Transport * | transportByName (const QString &name, bool def=true) const |
QList< Transport * > | transports () const |
virtual | ~TransportManager () |
Static Public Member Functions | |
static TransportManager * | self () |
Protected Member Functions | |
void | loadPasswords () |
KWallet::Wallet * | wallet () |
Constructor & Destructor Documentation
TransportManager::~TransportManager | ( | ) | [virtual] |
Member Function Documentation
void TransportManager::addTransport | ( | Transport * | transport | ) |
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 163 of file transportmanager.cpp.
Q_SCRIPTABLE void MailTransport::TransportManager::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.
void TransportManager::createDefaultTransport | ( | ) |
Tries to create a transport based on KEMailSettings.
If the data in KEMailSettings is incomplete, no transport is created.
Definition at line 186 of file transportmanager.cpp.
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 155 of file transportmanager.cpp.
TransportJob * TransportManager::createTransportJob | ( | const QString & | transport | ) |
Creates a mail transport job for the given transport identifer, or transport name.
Returns 0 if the specified transport is invalid.
- Parameters:
-
transport A string defining a mail transport.
Definition at line 216 of file transportmanager.cpp.
TransportJob * TransportManager::createTransportJob | ( | int | transportId | ) |
Creates a mail transport job for the given transport identifier.
Returns 0 if the specified transport is invalid.
- Parameters:
-
transportId The transport identifier.
Definition at line 200 of file transportmanager.cpp.
int TransportManager::defaultTransportId | ( | ) | const [slot] |
Returns the default transport identifier.
Invalid if there are no transports at all.
Definition at line 269 of file transportmanager.cpp.
QString TransportManager::defaultTransportName | ( | ) | const [slot] |
bool TransportManager::isEmpty | ( | ) | const [slot] |
Returns true if there are no mail transports at all.
Definition at line 237 of file transportmanager.cpp.
void TransportManager::loadPasswords | ( | ) | [protected] |
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 449 of file transportmanager.cpp.
void MailTransport::TransportManager::passwordsChanged | ( | ) | [signal] |
Emitted when passwords have been loaded from the wallet.
void TransportManager::removeTransport | ( | int | id | ) | [slot] |
Deletes the specified transport.
- Parameters:
-
id The identifier of the mail transport to remove.
Definition at line 283 of file transportmanager.cpp.
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.
Definition at line 171 of file transportmanager.cpp.
TransportManager * TransportManager::self | ( | ) | [static] |
void TransportManager::setDefaultTransport | ( | int | id | ) | [slot] |
Sets the default transport.
The change will be in effect immediately.
- Parameters:
-
id The identifier of the new default transport.
Definition at line 274 of file transportmanager.cpp.
Transport * TransportManager::transportById | ( | int | id, | |
bool | def = true | |||
) | const |
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 123 of file transportmanager.cpp.
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 137 of file transportmanager.cpp.
QList< int > TransportManager::transportIds | ( | ) | const [slot] |
QStringList TransportManager::transportNames | ( | ) | const [slot] |
void MailTransport::TransportManager::transportRemoved | ( | int | id, | |
const QString & | name | |||
) | [signal] |
Emitted when a transport is deleted.
- Parameters:
-
id The identifier of the deleted transport. name The name of the deleted transport.
void MailTransport::TransportManager::transportRenamed | ( | int | id, | |
const QString & | oldName, | |||
const QString & | newName | |||
) | [signal] |
Emitted when a transport has been renamed.
- Parameters:
-
id The identifier of the renamed transport. oldName The old name. newName The new name.
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 150 of file transportmanager.cpp.
Q_SCRIPTABLE void MailTransport::TransportManager::transportsChanged | ( | ) | [signal] |
Emitted when transport settings have changed (by this or any other TransportManager instance).
KWallet::Wallet * TransportManager::wallet | ( | ) | [protected] |
Returns a pointer to an open wallet if available, 0 otherwise.
The wallet is opened synchronously if necessary.
Definition at line 394 of file transportmanager.cpp.
The documentation for this class was generated from the following files: