• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.11.3 API Reference
  • KDE Home
  • Contact Us
 

mailtransport

  • MailTransport
  • TransportManager
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
MailTransport::TransportManager Class Reference

#include <transportmanager.h>

Inherits QObject.

Inherited by StaticTransportManager.

Public Types

enum  ShowCondition { Always, IfNoTransportExists }
 

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

virtual ~TransportManager ()
 
void addTransport (Transport *transport)
 
bool configureTransport (Transport *transport, QWidget *parent)
 
void createDefaultTransport ()
 
Transport * createTransport () const
 
MAILTRANSPORT_DEPRECATED
TransportJob * 
createTransportJob (int transportId)
 
MAILTRANSPORT_DEPRECATED
TransportJob * 
createTransportJob (const QString &transport)
 
void loadPasswordsAsync ()
 
MAILTRANSPORT_DEPRECATED void schedule (TransportJob *job)
 
bool showTransportCreationDialog (QWidget *parent, ShowCondition showCondition=Always)
 
Transport * transportById (int id, bool def=true) const
 
Transport * transportByName (const QString &name, bool def=true) const
 
QList< Transport * > transports () const
 
TransportType::List types () const
 

Static Public Member Functions

static TransportManager * self ()
 

Protected Member Functions

 TransportManager ()
 
void loadPasswords ()
 
KWallet::Wallet * wallet ()
 

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 55 of file transportmanager.h.

Member Enumeration Documentation

enum MailTransport::TransportManager::ShowCondition

Describes when to show the transport creation dialog.

Enumerator
Always 

Show the transport creation dialog unconditionally.

IfNoTransportExists 

Only show the transport creation dialog if no transport currently exists.

Ask the user if he wants to add a transport in the other case.

Definition at line 168 of file transportmanager.h.

Constructor & Destructor Documentation

TransportManager::~TransportManager ( )
virtual

Destructor.

Definition at line 157 of file transportmanager.cpp.

TransportManager::TransportManager ( )
protected

Singleton class, the only instance resides in the static object sSelf.

Definition at line 124 of file transportmanager.cpp.

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
transportThe Transport object to add.

Definition at line 217 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.

bool TransportManager::configureTransport ( Transport *  transport,
QWidget *  parent 
)

Open a configuration dialog for an existing transport.

Parameters
transportThe transport to configure. It can be a new transport, or one already managed by TransportManager.
parentThe parent widget for the dialog.
Returns
True if the user clicked Ok, false if the user cancelled.
Since
4.4

Definition at line 283 of file transportmanager.cpp.

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 245 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 209 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
transportIdThe transport identifier.
Deprecated:
use MessageQueueJob to queue messages and rely on the Dispatcher Agent to send them.

Definition at line 304 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
transportA string defining a mail transport.
Deprecated:
use MessageQueueJob to queue messages and rely on the Dispatcher Agent to send them.

Definition at line 324 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 377 of file transportmanager.cpp.

QString TransportManager::defaultTransportName ( ) const
slot

Returns the default transport name.

Definition at line 368 of file transportmanager.cpp.

bool TransportManager::isEmpty ( ) const
slot

Returns true if there are no mail transports at all.

Definition at line 345 of file transportmanager.cpp.

void TransportManager::loadPasswords ( )
protected

Loads all passwords synchronously.

Definition at line 608 of file transportmanager.cpp.

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 624 of file transportmanager.cpp.

void MailTransport::TransportManager::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.

void TransportManager::removeTransport ( int  id)
slot

Deletes the specified transport.

Parameters
idThe identifier of the mail transport to remove.

Definition at line 391 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
jobThe completely configured transport job to execute.
Deprecated:
use MessageQueueJob to queue messages and rely on the Dispatcher Agent to send them.

Definition at line 230 of file transportmanager.cpp.

TransportManager * TransportManager::self ( )
static

Returns the TransportManager instance.

Definition at line 163 of file transportmanager.cpp.

void TransportManager::setDefaultTransport ( int  id)
slot

Sets the default transport.

The change will be in effect immediately.

Parameters
idThe identifier of the new default transport.

Definition at line 382 of file transportmanager.cpp.

bool TransportManager::showTransportCreationDialog ( QWidget *  parent,
ShowCondition  showCondition = Always 
)

Shows a dialog for creating and configuring a new transport.

Parameters
parentParent widget of the dialog.
showConditionthe 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 259 of file transportmanager.cpp.

Transport * TransportManager::transportById ( int  id,
bool  def = true 
) const

Returns the Transport object with the given id.

Parameters
idThe identifier of the Transport.
defif 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 172 of file transportmanager.cpp.

Transport * TransportManager::transportByName ( const QString &  name,
bool  def = true 
) const

Returns the transport object with the given name.

Parameters
nameThe transport name.
defif 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 186 of file transportmanager.cpp.

QList< int > TransportManager::transportIds ( ) const
slot

Returns a list of transport identifiers.

Definition at line 350 of file transportmanager.cpp.

QStringList TransportManager::transportNames ( ) const
slot

Returns a list of transport names.

Definition at line 359 of file transportmanager.cpp.

void MailTransport::TransportManager::transportRemoved ( int  id,
const QString &  name 
)
signal

Emitted when a transport is deleted.

Parameters
idThe identifier of the deleted transport.
nameThe 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
idThe identifier of the renamed transport.
oldNameThe old name.
newNameThe new name.
QList< Transport * > TransportManager::transports ( ) const

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 199 of file transportmanager.cpp.

Q_SCRIPTABLE void MailTransport::TransportManager::transportsChanged ( )
signal

Emitted when transport settings have changed (by this or any other TransportManager instance).

TransportType::List TransportManager::types ( ) const

Returns a list of all available transport types.

Definition at line 204 of file transportmanager.cpp.

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 568 of file transportmanager.cpp.


The documentation for this class was generated from the following files:
  • transportmanager.h
  • transportmanager.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:03:02 by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailtransport

Skip menu "mailtransport"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal