|  | Home |

# QMailDisconnected Class Reference

The QMailDisconnected class provides functions to work with external servers using the disconnected mode of operation. More...

        #include <QMailDisconnected>

This class is under development and is subject to change.

- List of all members, including inherited members

## Static Public Members

void | clearPreviousFolder ( QMailMessageMetaData * message )
void | copyPreviousFolder ( const QMailMessageMetaData & source, QMailMessageMetaData * dest )
void | copyToFolder ( const QMailMessageIdList & ids, const QMailFolderId & folderId )
void | copyToStandardFolder ( const QMailMessageIdList & ids, QMailFolder::StandardFolder standardFolder )
QMailMessageKey | destinationKey ( const QMailFolderId & folderId )
void | flagMessage ( const QMailMessageId & id, quint64 setMask, quint64 unsetMask, const QString & description )
void | flagMessages ( const QMailMessageIdList & ids, quint64 setMask, quint64 unsetMask, const QString & description )
void | moveToFolder ( const QMailMessageIdList & ids, const QMailFolderId & folderId )
void | moveToFolder ( QMailMessageMetaData * message, const QMailFolderId & folderId )
void | moveToStandardFolder ( const QMailMessageIdList & ids, QMailFolder::StandardFolder standardFolder )
QMailMessageKey::Properties | parentFolderProperties ()
QMap<QMailFolderId, QMailMessageIdList> | restoreMap ( const QMailMessageIdList & messageIds )
void | restoreToPreviousFolder ( const QMailMessageId & id )
void | restoreToPreviousFolder ( const QMailMessageKey & key )
void | rollBackUpdates ( const QMailAccountId & mailAccountId )
QMailFolderId | sourceFolderId ( const QMailMessageMetaData & metaData )
QMailMessageKey | sourceKey ( const QMailFolderId & folderId )
bool | updatesOutstanding ( const QMailAccountId & mailAccountId )

## Detailed Description

The QMailDisconnected class provides functions to work with external servers using the disconnected mode of operation.

Functions are provided such as moveToFolder() and flagMessage() to update the state of the mail store without requiring that the update be immediately propagated to any external servers affected by that update. A function rollBackUpdates() is provided to allow clients to roll back changes that have been applied to the mail store but not yet synchronized with an external server.

QMailDisconnected also provides functions such as sourceKey() and sourceFolderId() to query the state of a folder or message as it was at the time of the last synchronization with the external server associated with the folder or message.

Additionally QMailDisconnected provides functions to work with messages containing disconnected state such as clearPreviousFolder(), copyPreviousFolder() and restoreMap().

Finally pending disconnected operations may be propagaged to an external server, that is synchronized with an external server using QMailRetrievalAction::exportUpdates().

## Member Function Documentation

### void QMailDisconnected::clearPreviousFolder ( QMailMessageMetaData * message ) `[static]`

Clears all data related to the disconnected state of the message.

### void QMailDisconnected::copyPreviousFolder ( const QMailMessageMetaData & source, QMailMessageMetaData * dest ) `[static]`

Copies all message data related to disconnected state from source into dest.

### void QMailDisconnected::copyToFolder ( const QMailMessageIdList & ids, const QMailFolderId & folderId ) `[static]`

Disconnected copies the list of messages identified by ids into the folder identified by folderId, setting standard folder flags as appropriate.

The copy operation will be propagated to the server by a successful call to QMailRetrievalAction::exportUpdates().

This function must only be used on messages for which the entire content of the message and all parts of the message is available in the message store; otherwise the behavior is undefined.

See also QMailMessagePartContainer::contentAvailable().

### void QMailDisconnected::copyToStandardFolder ( const QMailMessageIdList & ids, QMailFolder::StandardFolder standardFolder ) `[static]`

Disconnected copies the list of messages identified by ids into the standard folder standardFolder, setting standard folder flags as appropriate.

The copy operation will be propagated to the server by a successful call to QMailRetrievalAction::exportUpdates().

This function must only be used on messages for which the entire content of the message and all parts of the message is available in the message store; otherwise the behavior is undefined.

See also QMailMessagePartContainer::contentAvailable().

### QMailMessageKey QMailDisconnected::destinationKey ( const QMailFolderId & folderId ) `[static]`

Returns a key matching messages that are scheduled to be moved into the folder identified by folderId, when the next synchronization of the account containing that folder occurs.

See also QMailRetrievalAction::exportUpdates().

### void QMailDisconnected::flagMessage ( const QMailMessageId & id, quint64 setMask, quint64 unsetMask, const QString & description ) `[static]`

Disconnected flags the list a message identified by id, setting the flags specified by the bit mask setMask to on and setting the flags set by the bit mask unsetMask to off.

For example this function may be used to mark a message as important or 'move to trash' a message.

The flagging operation will be propagated to the server by a successful call to QMailRetrievalAction::exportUpdates().

During synchronization with the server a status message with contents description may be emitted.

### void QMailDisconnected::flagMessages ( const QMailMessageIdList & ids, quint64 setMask, quint64 unsetMask, const QString & description ) `[static]`

Disconnected flags the list of messages identified by ids, setting the flags specified by the bit mask setMask to on and setting the flags set by the bit mask unsetMask to off.

For example this function may be used to mark messages as important or 'move to trash' messages.

The flagging operation will be propagated to the server by a successful call to QMailRetrievalAction::exportUpdates().

During synchronization with the server a status message with contents description may be emitted.

### void QMailDisconnected::moveToFolder ( const QMailMessageIdList & ids, const QMailFolderId & folderId ) `[static]`

Disconnected moves the list of messages identified by ids into the folder identified by folderId, setting standard folder flags as appropriate.

Moving to another accounts are not supported.

The move operation will be propagated to the server by a successful call to QMailRetrievalAction::exportUpdates().

### void QMailDisconnected::moveToFolder ( QMailMessageMetaData * message, const QMailFolderId & folderId ) `[static]`

Disconnected updates message to be moved to the folder identified folderId. This function does NOT update the message in QMailStore, QMailStore::updateMessage() should be used to ensure that changes are to propagated to the server.

Moving to another account is not supported.

### void QMailDisconnected::moveToStandardFolder ( const QMailMessageIdList & ids, QMailFolder::StandardFolder standardFolder ) `[static]`

Disconnected moves the list of messages identified by ids into the standard folder standardFolder, setting standard folder flags as appropriate.

The move operation will be propagated to the server by a successful call to QMailRetrievalAction::exportUpdates().

### QMailMessageKey::Properties QMailDisconnected::parentFolderProperties () `[static]`

Returns a bit mask matching all QMailMessageKey properties related to disconnected state.

### QMap<QMailFolderId, QMailMessageIdList> QMailDisconnected::restoreMap ( const QMailMessageIdList & messageIds ) `[static]`

Returns a map of originating folders for a list of messages that are in the disconnected moved state as identified by messageIds.

The map contains a key for each originating folder, and for each key the value is a list of messages moved out of the folder.

### void QMailDisconnected::restoreToPreviousFolder ( const QMailMessageId & id ) `[static]`

Updates the QMailMessage with QMailMessageId id to move the message back to the previous folder it was contained by.

Returns `true` if the operation completed successfully, `false` otherwise.

### void QMailDisconnected::restoreToPreviousFolder ( const QMailMessageKey & key ) `[static]`

Updates all QMailMessages identified by the key key to move the messages back to the previous folder they were contained by.

Returns `true` if the operation completed successfully, `false` otherwise.

### void QMailDisconnected::rollBackUpdates ( const QMailAccountId & mailAccountId ) `[static]`

Rolls back all disconnected move and copy operations that have been applied to the message store since the most recent synchronization of the message with the account specified by mailAccountId.

See also updatesOutstanding().

### QMailFolderId QMailDisconnected::sourceFolderId ( const QMailMessageMetaData & metaData ) `[static]`

Return the QMailFolderId of the folder that contained the message metaData at the time the most recent synchronization of the message with the originating external server occurred.

See also QMailMessageMetaData::parentFolderId().

### QMailMessageKey QMailDisconnected::sourceKey ( const QMailFolderId & folderId ) `[static]`

Returns a key matching messages whose parent folder's identifier was equal to folderId, at the time the most recent synchronization of the message with the originating external server occurred.

See also QMailMessageKey::parentFolderId().

### bool QMailDisconnected::updatesOutstanding ( const QMailAccountId & mailAccountId ) `[static]`

Returns true if disconnected operations have been applied to the message store since the most recent synchronization with the account specified by mailAccountId.

Otherwise returns false.

See also rollBackUpdates().