Home

QMailMessageServer Class Reference

The QMailMessageServer class provides signals and slots which implement a convenient interface for communicating with the MessageServer process via IPC. More...

    #include <QMailMessageServer>

This class is under development and is subject to change.

Inherits QObject.


Public Functions

QMailMessageServer ( QObject * parent = 0 )
~QMailMessageServer ()

Public Slots

void acknowledgeNewMessages ( const QMailMessageTypeList & types )
void cancelSearch ( quint64 action )
void cancelTransfer ( quint64 action )
void copyMessages ( quint64 action, const QMailMessageIdList & mailList, const QMailFolderId & destinationId )
void createFolder ( quint64 action, const QString & name, const QMailAccountId & accountId, const QMailFolderId & parentId )
void deleteFolder ( quint64 action, const QMailFolderId & folderId )
void deleteMessages ( quint64 action, const QMailMessageIdList & mailList, QMailStore::MessageRemovalOption option )
void exportUpdates ( quint64 action, const QMailAccountId & accountId )
void flagMessages ( quint64 action, const QMailMessageIdList & mailList, quint64 setMask, quint64 unsetMask )
void listActions ()
void moveMessages ( quint64 action, const QMailMessageIdList & mailList, const QMailFolderId & destinationId )
void protocolRequest ( quint64 action, const QMailAccountId & accountId, const QString & request, const QVariant & data )
void renameFolder ( quint64 action, const QMailFolderId & folderId, const QString & name )
void retrieveAll ( quint64 action, const QMailAccountId & accountId )
void retrieveFolderList ( quint64 action, const QMailAccountId & accountId, const QMailFolderId & folderId, bool descending )
void retrieveMessageList ( quint64 action, const QMailAccountId & accountId, const QMailFolderId & folderId, uint minimum, const QMailMessageSortKey & sort )
void retrieveMessagePart ( quint64 action, const QMailMessagePart::Location & partLocation )
void retrieveMessagePartRange ( quint64 action, const QMailMessagePart::Location & partLocation, uint minimum )
void retrieveMessageRange ( quint64 action, const QMailMessageId & messageId, uint minimum )
void retrieveMessages ( quint64 action, const QMailMessageIdList & messageIds, QMailRetrievalAction::RetrievalSpecification spec )
void searchMessages ( quint64 action, const QMailMessageKey & filter, const QString & bodyText, QMailSearchAction::SearchSpecification spec, const QMailMessageSortKey & sort )
void shutdown ()
void synchronize ( quint64 action, const QMailAccountId & accountId )
void transmitMessages ( quint64 action, const QMailAccountId & accountId )

Signals

void actionStarted ( QMailActionData data )
void actionsListed ( const QMailActionDataList & list )
void activityChanged ( quint64 action, QMailServiceAction::Activity activity )
void connectivityChanged ( quint64 action, QMailServiceAction::Connectivity connectivity )
void folderCreated ( quint64 action, const QMailFolderId & folderId )
void folderDeleted ( quint64 action, const QMailFolderId & folderId )
void folderRenamed ( quint64 action, const QMailFolderId & folderId )
void matchingMessageIds ( quint64 action, const QMailMessageIdList & ids )
void messagesCopied ( quint64 action, const QMailMessageIdList & list )
void messagesDeleted ( quint64 action, const QMailMessageIdList & list )
void messagesFailedTransmission ( quint64 action, const QMailMessageIdList & list, QMailServiceAction::Status::ErrorCode error )
void messagesFlagged ( quint64 action, const QMailMessageIdList & list )
void messagesMoved ( quint64 action, const QMailMessageIdList & list )
void messagesTransmitted ( quint64 action, const QMailMessageIdList & list )
void newCountChanged ( const QMailMessageCountMap & counts )
void progressChanged ( quint64 action, uint progress, uint total )
void protocolRequestCompleted ( quint64 action )
void protocolResponse ( quint64 action, const QString & response, const QVariant & data )
void retrievalCompleted ( quint64 action )
void searchCompleted ( quint64 action )
void statusChanged ( quint64 action, const QMailServiceAction::Status status )
void storageActionCompleted ( quint64 action )
void transmissionCompleted ( quint64 action )

Additional Inherited Members


Detailed Description

The QMailMessageServer class provides signals and slots which implement a convenient interface for communicating with the MessageServer process via IPC.

Qt Extended messaging applications can send and receive messages of various types by communicating with the external MessageServer application. The MessageServer application is a separate process, communicating with clients via inter-process messages. QMailMessageServer acts as a proxy object for the server process, providing an interface for communicating with the MessageServer by the use of signals and slots in the client process. It provides Qt signals corresponding to messages received from the MessageServer application, and Qt slots which send messages to the MessageServer when invoked.

For most messaging client applications, the QMailServiceAction objects offer a simpler interface for requesting actions from the messageserver, and assessing their results.

New Messages

When a client initiates communication with the MessageServer, the server informs the client of the number and type of 'new' messages, via the newCountChanged() signal. 'New' messages are those that arrive without the client having first requested their retrieval. The client may choose to invalidate the 'new' status of these messages; if the acknowledgeNewMessages() slot is invoked, the count of 'new' messages is reset to zero for the nominated message types. If the count of 'new' messages changes while a client is active, the newCountChanged() signal is emitted with the updated information.

Sending Messages

To send messages, the client should construct instances of the QMailMessage class formulated to contain the desired content. These messages should be stored to the mail store, within the Outbox folder configured for the parent account.

An instance of QMailTransmitAction should be used to request transmission of the outgoing messages.

Retrieving Messages

There are a variety of mechanisms for retrieving messages, at various levels of granularity. In all cases, retrieved messages are added directly to the mail store by the message server, from where clients can retrieve their meta data or content.

An instance of QMailRetrievalAction should be used to request retrievel of folders and messages.

See also QMailServiceAction and QMailStore.


Member Function Documentation

QMailMessageServer::QMailMessageServer ( QObject * parent = 0 )

Constructs a QMailMessageServer object with parent parent, and initiates communication with the MessageServer application.

QMailMessageServer::~QMailMessageServer ()

Destroys the QMailMessageServer object.

void QMailMessageServer::acknowledgeNewMessages ( const QMailMessageTypeList & types )   [slot]

Requests that the MessageServer reset the counts of 'new' messages to zero, for each message type listed in types.

See also newCountChanged().

void QMailMessageServer::actionStarted ( QMailActionData data )   [signal]

Emitted when the action described by data has been started on the messageserver.

void QMailMessageServer::actionsListed ( const QMailActionDataList & list )   [signal]

Emitted when a list of running actions has been retrieved from the server. The list of running actions is described by list.

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

Emitted whenever the MessageServer experiences a change in the activity status of the request identified by action. The request's new status is described by activity.

void QMailMessageServer::cancelSearch ( quint64 action )   [slot]

Requests that the MessageServer cancel any pending search operations for the request identified by action.

This method is obsolete, use cancel transfer instead.

void QMailMessageServer::cancelTransfer ( quint64 action )   [slot]

Requests that the MessageServer cancel any pending transfer operations for the request identified by action.

See also transmitMessages() and retrieveMessages().

void QMailMessageServer::connectivityChanged ( quint64 action, QMailServiceAction::Connectivity connectivity )   [signal]

Emitted whenever the MessageServer has a change in connectivity while servicing the request identified by action. The new server connectivity status is described by connectivity.

void QMailMessageServer::copyMessages ( quint64 action, const QMailMessageIdList & mailList, const QMailFolderId & destinationId )   [slot]

Requests that the MessageServer create a copy of each message listed in mailList in the folder identified by destinationId. The request has the identifier action.

void QMailMessageServer::createFolder ( quint64 action, const QString & name, const QMailAccountId & accountId, const QMailFolderId & parentId )   [slot]

Requests that the MessageServer create a new folder named name, created in the account identified by accountId. If parentId is a valid folder identifier the new folder will be a child of the parent; otherwise the folder will be have no parent and will be created at the highest level.

The request has the identifier action.

See also deleteFolder().

void QMailMessageServer::deleteFolder ( quint64 action, const QMailFolderId & folderId )   [slot]

Requests that the MessageServer delete the folder identified by folderId. Any existing folders or messages contained by the folder will also be deleted. The request has the identifier action.

See also createFolder() and renameFolder().

void QMailMessageServer::deleteMessages ( quint64 action, const QMailMessageIdList & mailList, QMailStore::MessageRemovalOption option )   [slot]

Requests that the MessageServer delete the messages in mailList from the external server, if necessary for the relevant message type. If option is CreateRemovalRecord then a QMailMessageRemovalRecord will be created in the mail store for each deleted message. The request has the identifier action.

Deleting messages using this slot does not initiate communication with any external server; instead the information needed to delete the messages is recorded. Deletion from the external server will occur when messages are next retrieved from that server. Invoking this slot does not remove a message from the mail store.

See also QMailStore::removeMessage().

void QMailMessageServer::exportUpdates ( quint64 action, const QMailAccountId & accountId )   [slot]

Requests that the message server update the external server with changes that have been effected on the local device for account accountId. Local changes to QMailMessage::Read, and QMailMessage::Important message status flags should be exported to the external server, and messages that have been removed using the QMailStore::CreateRemovalRecord option should be removed from the external server. The request has the identifier action.

See also retrievalCompleted().

void QMailMessageServer::flagMessages ( quint64 action, const QMailMessageIdList & mailList, quint64 setMask, quint64 unsetMask )   [slot]

Requests that the MessageServer flag each message listed in mailList by setting the status flags set in setMask, and unsetting the status flags set in unsetMask. The request has the identifier action.

The protocol must ensure that the local message records are appropriately modified, although the external changes may be buffered and effected at the next invocation of exportUpdates().

void QMailMessageServer::folderCreated ( quint64 action, const QMailFolderId & folderId )   [signal]

Emitted when the folder identified by folderId has been created, in response to the request identified by action.

See also createFolder().

void QMailMessageServer::folderDeleted ( quint64 action, const QMailFolderId & folderId )   [signal]

Emitted when the folder identified by folderId has been deleted, in response to the request identified by action.

See also deleteFolder().

void QMailMessageServer::folderRenamed ( quint64 action, const QMailFolderId & folderId )   [signal]

Emitted when the folder identified by folderId has been renamed, in response to the request identified by action.

See also renameFolder().

void QMailMessageServer::listActions ()   [slot]

Requests that the MessageServer emits a list of currently executing actions

void QMailMessageServer::matchingMessageIds ( quint64 action, const QMailMessageIdList & ids )   [signal]

Emitted after the successful completion of the search operation identified by action; ids contains the list of message identifiers located by the search.

See also searchMessages().

void QMailMessageServer::messagesCopied ( quint64 action, const QMailMessageIdList & list )   [signal]

Emitted when the messages identified by list have been copied to the destination folder on the external service, in response to the request identified by action.

See also copyMessages().

void QMailMessageServer::messagesDeleted ( quint64 action, const QMailMessageIdList & list )   [signal]

Emitted when the messages identified by list have been deleted from the mail store, in response to the request identified by action.

See also deleteMessages().

void QMailMessageServer::messagesFailedTransmission ( quint64 action, const QMailMessageIdList & list, QMailServiceAction::Status::ErrorCode error )   [signal]

Emitted when a failed attempt has been made to transmit messages identified by list to the external server, in response to the request identified by action.

The error is described by error.

See also transmitMessages().

void QMailMessageServer::messagesFlagged ( quint64 action, const QMailMessageIdList & list )   [signal]

Emitted when the messages identified by list have been flagged with the specified set of status flags, in response to the request identified by action.

See also flagMessages().

void QMailMessageServer::messagesMoved ( quint64 action, const QMailMessageIdList & list )   [signal]

Emitted when the messages identified by list have been moved to the destination folder on the external service, in response to the request identified by action.

See also moveMessages().

void QMailMessageServer::messagesTransmitted ( quint64 action, const QMailMessageIdList & list )   [signal]

Emitted when the messages identified by list have been transmitted to the external server, in response to the request identified by action.

See also transmitMessages().

void QMailMessageServer::moveMessages ( quint64 action, const QMailMessageIdList & mailList, const QMailFolderId & destinationId )   [slot]

Requests that the MessageServer move each message listed in mailList from its current location to the folder identified by destinationId. The request has the identifier action.

void QMailMessageServer::newCountChanged ( const QMailMessageCountMap & counts )   [signal]

Emitted when the count of 'new' messages changes; the new count is described by counts.

See also acknowledgeNewMessages().

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

Emitted when the progress of the request identified by action changes; total indicates the extent of the operation to be performed, progress indicates the current degree of completion.

void QMailMessageServer::protocolRequest ( quint64 action, const QMailAccountId & accountId, const QString & request, const QVariant & data )   [slot]

Requests that the MessageServer forward the protocol-specific request request to the QMailMessageSource configured for the account identified by accountId. The request, identified by action, may have associated data, in a protocol-specific form.

void QMailMessageServer::protocolRequestCompleted ( quint64 action )   [signal]

Emitted when the protocol request identified by action is completed.

See also protocolRequest().

void QMailMessageServer::protocolResponse ( quint64 action, const QString & response, const QVariant & data )   [signal]

Emitted when the protocol request identified by action generates the response response, with the associated data.

See also protocolRequest().

void QMailMessageServer::renameFolder ( quint64 action, const QMailFolderId & folderId, const QString & name )   [slot]

Requests that the MessageServer rename the folder identified by folderId to name. The request has the identifier action.

See also createFolder().

void QMailMessageServer::retrievalCompleted ( quint64 action )   [signal]

Emitted when the retrieval operation identified by action is completed.

void QMailMessageServer::retrieveAll ( quint64 action, const QMailAccountId & accountId )   [slot]

Requests that the message server retrieve the meta data for all messages available for the account accountId. The request has the identifier action.

See also retrievalCompleted().

void QMailMessageServer::retrieveFolderList ( quint64 action, const QMailAccountId & accountId, const QMailFolderId & folderId, bool descending )   [slot]

Requests that the message server retrieve the list of folders available for the account accountId. If folderId is valid, the folders within that folder should be retrieved. If descending is true, the search should also recursively retrieve the folders available within the previously retrieved folders. The request has the identifier action.

See also retrievalCompleted().

void QMailMessageServer::retrieveMessageList ( quint64 action, const QMailAccountId & accountId, const QMailFolderId & folderId, uint minimum, const QMailMessageSortKey & sort )   [slot]

Requests that the message server retrieve the list of messages available for the account accountId. If folderId is valid, then only messages within that folder should be retrieved; otherwise messages within all folders in the account should be retrieved. If a folder messages are being retrieved from contains at least minimum messages then the messageserver should ensure that at least minimum messages are available from the mail store for that folder; otherwise if the folder contains less than minimum messages the messageserver should ensure all the messages for that folder are available from the mail store.

If sort is not empty, the external service will discover the listed messages in the ordering indicated by the sort criterion, if possible.

The request has the identifier action.

See also retrievalCompleted().

void QMailMessageServer::retrieveMessagePart ( quint64 action, const QMailMessagePart::Location & partLocation )   [slot]

Requests that the message server retrieve the message part that is indicated by the location partLocation. The request has the identifier action.

See also retrievalCompleted().

void QMailMessageServer::retrieveMessagePartRange ( quint64 action, const QMailMessagePart::Location & partLocation, uint minimum )   [slot]

Requests that the message server retrieve a subset of the message part that is indicated by the location partLocation. The messageserver should ensure that at least minimum bytes are available from the mail store. The request has the identifier action.

See also retrievalCompleted().

void QMailMessageServer::retrieveMessageRange ( quint64 action, const QMailMessageId & messageId, uint minimum )   [slot]

Requests that the message server retrieve a subset of the message messageId, such that at least minimum bytes are available from the mail store. The request has the identifier action.

See also retrievalCompleted().

void QMailMessageServer::retrieveMessages ( quint64 action, const QMailMessageIdList & messageIds, QMailRetrievalAction::RetrievalSpecification spec )   [slot]

Requests that the message server retrieve data regarding the messages identified by messageIds.

If spec is QMailRetrievalAction::Flags, then the message server should detect if the read or important status of messages identified by messageIds has changed on the server or if the messages have been removed on the server. The QMailMessage::ReadElsewhere, QMailMessage::ImportantElsewhere and QMailMessage::Removed status flags of messages will be updated to reflect the status of the message on the server.

If spec is QMailRetrievalAction::MetaData, then the message server should retrieve the meta data of the each message listed in messageIds.

If spec is QMailRetrievalAction::Content, then the message server should retrieve the entirety of each message listed in messageIds.

The request has the identifier action.

See also retrievalCompleted().

void QMailMessageServer::searchCompleted ( quint64 action )   [signal]

Emitted when the search operation identified by action is completed.

See also searchMessages().

void QMailMessageServer::searchMessages ( quint64 action, const QMailMessageKey & filter, const QString & bodyText, QMailSearchAction::SearchSpecification spec, const QMailMessageSortKey & sort )   [slot]

Requests that the MessageServer search for messages that meet the criteria encoded in filter. If bodyText is non-empty, messages must also contain the specified text in their content to be considered matching. If spec is Remote then the MessageServer will extend the search to consider messages held at external servers that are not present on the local device. If sort is not empty, the external service will return matching messages in the ordering indicated by the sort criterion if possible.

The request has the identifier action.

The identifiers of all matching messages are returned via matchingMessageIds() after the search is completed.

See also matchingMessageIds().

void QMailMessageServer::shutdown ()   [slot]

Requests that the MessageServer shutdown and terminate

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

Emitted whenever the MessageServer experiences a status change that may be of interest to the client, while servicing the request identified by action. The new server status is described by status.

void QMailMessageServer::storageActionCompleted ( quint64 action )   [signal]

Emitted when the storage operation identified by action is completed.

See also deleteMessages(), copyMessages(), moveMessages(), and flagMessages().

void QMailMessageServer::synchronize ( quint64 action, const QMailAccountId & accountId )   [slot]

Requests that the message server synchronize the messages and folders in the account identified by accountId. Newly discovered messages should have their meta data retrieved, local changes to QMailMessage::Read, and QMailMessage::Important message status flags should be exported to the external server, and messages that have been removed locally using the QMailStore::CreateRemovalRecord option should be removed from the external server. The request has the identifier action.

See also retrievalCompleted().

void QMailMessageServer::transmissionCompleted ( quint64 action )   [signal]

Emitted when the transmit operation identified by action is completed.

See also transmitMessages().

void QMailMessageServer::transmitMessages ( quint64 action, const QMailAccountId & accountId )   [slot]

Requests that the MessageServer application transmit any messages belonging to the account identified by accountId that are currently in the Outbox folder. The request has the identifier action.

See also transmissionCompleted().


Copyright © 2010 QtSoftware
Messaging Framework