Home

QMailMessageService Class Reference

The QMailMessageService class provides the interface between the message server and components loaded from plugin libraries. More...

    #include <QMailMessageService>

This class is under development and is subject to change.

Inherits QObject.


Public Functions

QMailMessageService ()
virtual QMailAccountId accountId () const = 0
virtual bool available () const = 0
virtual bool hasSink () const
virtual bool hasSource () const
virtual bool requiresReregistration () const
virtual QString service () const = 0
virtual QMailMessageSink & sink () const
virtual QMailMessageSource & source () const
virtual bool usesConcurrentActions () const

Public Slots

virtual bool cancelOperation ( QMailServiceAction::Status::ErrorCode code, const QString & text ) = 0
bool cancelOperation ()
virtual bool cancelOperation ( QMailServiceAction::Status::ErrorCode code, const QString & text, quint64 action )
bool cancelOperation ( quint64 action )

Signals

void actionCompleted ( bool success )
void actionCompleted ( bool success, quint64 action )
void activityChanged ( QMailServiceAction::Activity activity )
void activityChanged ( QMailServiceAction::Activity activity, quint64 action )
void availabilityChanged ( bool available )
void connectivityChanged ( QMailServiceAction::Connectivity connectivity )
void progressChanged ( uint progress, uint total )
void progressChanged ( uint progress, uint total, quint64 action )
void statusChanged ( const QMailServiceAction::Status status )
void statusChanged ( const QMailServiceAction::Status status, quint64 action )

Protected Functions

void updateStatus ( QMailServiceAction::Status::ErrorCode code, const QString & text = QString(), const QMailAccountId & accountId = QMailAccountId(), const QMailFolderId & folderId = QMailFolderId(), const QMailMessageId & messageId = QMailMessageId(), quint64 action = 0 )
void updateStatus ( int code, const QString & text = QString(), const QMailAccountId & accountId = QMailAccountId(), const QMailFolderId & folderId = QMailFolderId(), const QMailMessageId & messageId = QMailMessageId(), quint64 action = 0 )

Additional Inherited Members


Detailed Description

The QMailMessageService class provides the interface between the message server and components loaded from plugin libraries.

QMailMessageService provides the interface through which the message server daemon communicates with components that provide message access and transmission services. The components are loaded from plugin libraries; the message server process remains ignorant of the messages types they deal with, and the protocols they use to perform their tasks.

The QMailMessageService class provides the signals and functions that message server uses to receive information about the actions of messaging service components. It also provides the source and sink functions that the message server uses to acquire access to the functionality that the service may implement.

Subclasses of QMailMessageService are instantiated by the message server process, one for each enabled account that is configured to use that service. The QMailMessageService interface does not cater for concurrent actions; each instance may only service a single request at any given time. The message server process provides request queueing so that QMailMessageService objects see only a sequential series of requests.


Member Function Documentation

QMailMessageService::QMailMessageService ()

Constructs a messaging service object.

QMailAccountId QMailMessageService::accountId () const   [pure virtual]

Returns the identifier of the account for which this service is configured.

void QMailMessageService::actionCompleted ( bool success )   [signal]

Signal emitted by the service to report the completion of an operation, with result success.

void QMailMessageService::actionCompleted ( bool success, quint64 action )   [signal]

This is an overloaded function.

Concurrent version of actionCompleted() signal.

The generating request has identifier action.

void QMailMessageService::activityChanged ( QMailServiceAction::Activity activity )   [signal]

Signal emitted by the service to report a change in the activity of the service's current operation. The new activity status is described by activity.

Emitting this signal will reset the expiry timer for a service operation in progress.

void QMailMessageService::activityChanged ( QMailServiceAction::Activity activity, quint64 action )   [signal]

This is an overloaded function.

Concurrent version of activityChanged() signal.

The generating request has identifier action.

void QMailMessageService::availabilityChanged ( bool available )   [signal]

Signal emitted by the service to report a change in the availability of the service to available.

See also available().

bool QMailMessageService::available () const   [pure virtual]

Returns true if the service is currently available to process client requests.

bool QMailMessageService::cancelOperation ( QMailServiceAction::Status::ErrorCode code, const QString & text )   [pure virtual slot]

Invoked by the message server to attempt cancellation of any request currently in progress. Return true to indicate cancellation of the request attempt.

The error type is code, and the error is described by text.

bool QMailMessageService::cancelOperation ()   [slot]

Invoked by the message server to attempt cancellation of any request currently in progress. Return true to indicate cancellation of the request attempt.

bool QMailMessageService::cancelOperation ( QMailServiceAction::Status::ErrorCode code, const QString & text, quint64 action )   [virtual slot]

This function overloads cancelOperation().

Concurrent version of cancelOperation().

The request has the identifier action.

bool QMailMessageService::cancelOperation ( quint64 action )   [slot]

This is an overloaded function.

Concurrent version of cancelOperation().

The request to be cancelled has identifier action.

void QMailMessageService::connectivityChanged ( QMailServiceAction::Connectivity connectivity )   [signal]

Signal emitted by the service to report a change in the connectivity of the service. The new connectivity status is described by connectivity.

Emitting this signal will reset the expiry timer for a service operation in progress.

bool QMailMessageService::hasSink () const   [virtual]

Returns true if this service exports a QMailMessageSink interface.

bool QMailMessageService::hasSource () const   [virtual]

Returns true if this service exports a QMailMessageSource interface.

void QMailMessageService::progressChanged ( uint progress, uint total )   [signal]

Signal emitted by the service to report a change in the progress of the service's current operation; total indicates the extent of the operation to be performed, progress indicates the current degree of completion.

Emitting this signal will reset the expiry timer for a service operation in progress.

void QMailMessageService::progressChanged ( uint progress, uint total, quint64 action )   [signal]

This is an overloaded function.

Concurrent version of progressChanged() signal.

The generating request has identifier action.

bool QMailMessageService::requiresReregistration () const   [virtual]

Returns true if requests to reregister the service should be honored; otherwise returns false.

An attempt to reregister the service is made when the account for which this service is configured is modified, or when an action associated with the service expires.

QString QMailMessageService::service () const   [pure virtual]

Returns the identifier of this service.

QMailMessageSink & QMailMessageService::sink () const   [virtual]

Returns the QMailMessageSink interface exported by the service, if there is one.

See also hasSink().

QMailMessageSource & QMailMessageService::source () const   [virtual]

Returns the QMailMessageSource interface exported by the service, if there is one.

See also hasSource().

void QMailMessageService::statusChanged ( const QMailServiceAction::Status status )   [signal]

Signal emitted by the service to report a change in the status of the service's current operation. The new status is described by status.

Emitting this signal will reset the expiry timer for a service operation in progress.

void QMailMessageService::statusChanged ( const QMailServiceAction::Status status, quint64 action )   [signal]

This is an overloaded function.

Concurrent version of statusChanged() signal.

The generating request has identifier action.

void QMailMessageService::updateStatus ( QMailServiceAction::Status::ErrorCode code, const QString & text = QString(), const QMailAccountId & accountId = QMailAccountId(), const QMailFolderId & folderId = QMailFolderId(), const QMailMessageId & messageId = QMailMessageId(), quint64 action = 0 )   [protected]

Emits the statusChanged() signal with the Status object constructed from code, text, accountId, folderId, messageId and action.

If possible, a standardized error message is determined from code, and prepended to the error message.

void QMailMessageService::updateStatus ( int code, const QString & text = QString(), const QMailAccountId & accountId = QMailAccountId(), const QMailFolderId & folderId = QMailFolderId(), const QMailMessageId & messageId = QMailMessageId(), quint64 action = 0 )   [protected]

Emits the statusChanged() signal with the Status object constructed from code, text, accountId, folderId and messageId.

If possible, a standardized error message is determined from code, and prepended to the error message.

bool QMailMessageService::usesConcurrentActions () const   [virtual]

Returns true if the service supports concurrent servicing of requests; otherwise returns false.

By default QMailMessageService objects are only expected to service a single request at a time. The message server will queue requests as necessary and dispatch them when the service is available.

However if a service implementation is able to handle multiple requests in parallel then it should override this function returning true.


Copyright © 2010 QtSoftware
Messaging Framework