|  | Home |

# QMailStore Class Reference

The QMailStore class represents the main interface for storage and retrieval of messages and folders on the message store. More...

        #include <QMailStore>

This class is under development and is subject to change.

Inherits QObject.

- List of all members, including inherited members

## Public Types

enum | ChangeType { Added, Removed, Updated, ContentsModified }
enum | ErrorCode { NoError, InvalidId, ConstraintFailure, ContentInaccessible, ..., StorageInaccessible }
enum | InitializationState { Uninitialized, InitializationFailed, Initialized }
enum | MessageRemovalOption { NoRemovalRecord, CreateRemovalRecord }
enum | ReturnOption { ReturnAll, ReturnDistinct }

## Public Functions

virtual | ~QMailStore ()
QMailAccount | account ( const QMailAccountId & id ) const
QMailAccountConfiguration | accountConfiguration ( const QMailAccountId & id ) const
quint64 | accountStatusMask ( const QString & name ) const
bool | addAccount ( QMailAccount * account, QMailAccountConfiguration * config )
bool | addFolder ( QMailFolder * folder )
bool | addMessage ( QMailMessage * msg )
bool | addMessage ( QMailMessageMetaData * metaData )
bool | addMessages ( const QList<QMailMessage *> & messages )
bool | addMessages ( const QList<QMailMessageMetaData *> & messages )
bool | addThread ( QMailThread * t )
bool | asynchronousEmission () const
int | countAccounts ( const QMailAccountKey & key = QMailAccountKey() ) const
int | countFolders ( const QMailFolderKey & key = QMailFolderKey() ) const
int | countMessages ( const QMailMessageKey & key = QMailMessageKey() ) const
int | countThreads ( const QMailThreadKey & key = QMailThreadKey() ) const
void | flushIpcNotifications ()
QMailFolder | folder ( const QMailFolderId & id ) const
quint64 | folderStatusMask ( const QString & name ) const
QMailStore::ErrorCode | lastError () const
void | lock ()
QMailMessage | message ( const QMailMessageId & id ) const
QMailMessage | message ( const QString & uid, const QMailAccountId & accountId ) const
QMailMessageMetaData | messageMetaData ( const QMailMessageId & id ) const
QMailMessageMetaData | messageMetaData ( const QString & uid, const QMailAccountId & accountId ) const
const QMailMessageRemovalRecordList | messageRemovalRecords ( const QMailAccountId & accountId, const QMailFolderId & folderId = QMailFolderId() ) const
quint64 | messageStatusMask ( const QString & name ) const
const QMailMessageMetaDataList | messagesMetaData ( const QMailMessageKey & key, const QMailMessageKey::Properties & properties, ReturnOption option = ReturnAll ) const
bool | purgeMessageRemovalRecords ( const QMailAccountId & accountId, const QStringList & serverUids = QStringList() )
const QMailAccountIdList | queryAccounts ( const QMailAccountKey & key = QMailAccountKey(), const QMailAccountSortKey & sortKey = QMailAccountSortKey(), uint limit = 0, uint offset = 0 ) const
const QMailFolderIdList | queryFolders ( const QMailFolderKey & key = QMailFolderKey(), const QMailFolderSortKey & sortKey = QMailFolderSortKey(), uint limit = 0, uint offset = 0 ) const
const QMailMessageIdList | queryMessages ( const QMailMessageKey & key = QMailMessageKey(), const QMailMessageSortKey & sortKey = QMailMessageSortKey(), uint limit = 0, uint offset = 0 ) const
const QMailThreadIdList | queryThreads ( const QMailThreadKey & key = QMailThreadKey(), const QMailThreadSortKey & sortKey = QMailThreadSortKey(), uint limit = 0, uint offset = 0 ) const
bool | registerAccountStatusFlag ( const QString & name )
bool | registerFolderStatusFlag ( const QString & name )
bool | registerMessageStatusFlag ( const QString & name )
bool | removeAccount ( const QMailAccountId & id )
bool | removeAccounts ( const QMailAccountKey & key )
bool | removeFolder ( const QMailFolderId & id, MessageRemovalOption option = NoRemovalRecord )
bool | removeFolders ( const QMailFolderKey & key, MessageRemovalOption option = NoRemovalRecord )
bool | removeMessage ( const QMailMessageId & id, MessageRemovalOption option = NoRemovalRecord )
bool | removeMessages ( const QMailMessageKey & key, MessageRemovalOption option = NoRemovalRecord )
bool | removeThread ( const QMailThreadId & id, MessageRemovalOption option = NoRemovalRecord )
bool | removeThreads ( const QMailThreadKey & key, QMailStore::MessageRemovalOption option = NoRemovalRecord )
void | setRetrievalInProgress ( const QMailAccountIdList & ids )
void | setTransmissionInProgress ( const QMailAccountIdList & ids )
int | sizeOfMessages ( const QMailMessageKey & key = QMailMessageKey() ) const
QMailThread | thread ( const QMailThreadId & id ) const
void | unlock ()
bool | updateAccount ( QMailAccount * account, QMailAccountConfiguration * config = 0 )
bool | updateAccountConfiguration ( QMailAccountConfiguration * config )
bool | updateFolder ( QMailFolder * folder )
bool | updateMessage ( QMailMessage * msg )
bool | updateMessage ( QMailMessageMetaData * metaData )
bool | updateMessages ( const QList<QMailMessage *> & messages )
bool | updateMessages ( const QList<QMailMessageMetaData *> & messages )
bool | updateMessagesMetaData ( const QMailMessageKey & key, const QMailMessageKey::Properties & properties, const QMailMessageMetaData & data )
bool | updateMessagesMetaData ( const QMailMessageKey & key, quint64 status, bool set )
bool | updateThread ( QMailThread * t )

- 29 public functions inherited from QObject

## Signals

void | accountContentsModified ( const QMailAccountIdList & ids )
void | accountsAdded ( const QMailAccountIdList & ids )
void | accountsRemoved ( const QMailAccountIdList & ids )
void | accountsUpdated ( const QMailAccountIdList & ids )
void | errorOccurred ( QMailStore::ErrorCode code )
void | folderContentsModified ( const QMailFolderIdList & ids )
void | foldersAdded ( const QMailFolderIdList & ids )
void | foldersRemoved ( const QMailFolderIdList & ids )
void | foldersUpdated ( const QMailFolderIdList & ids )
void | messageContentsModified ( const QMailMessageIdList & ids )
void | messageDataAdded ( const QMailMessageMetaDataList & data )
void | messageDataUpdated ( const QMailMessageMetaDataList & data )
void | messagePropertyUpdated ( const QMailMessageIdList & ids, const QMailMessageKey::Properties & properties, const QMailMessageMetaData & data )
void | messageRemovalRecordsAdded ( const QMailAccountIdList & ids )
void | messageRemovalRecordsRemoved ( const QMailAccountIdList & ids )
void | messageStatusUpdated ( const QMailMessageIdList & ids, quint64 status, bool set )
void | messagesAdded ( const QMailMessageIdList & ids )
void | messagesRemoved ( const QMailMessageIdList & ids )
void | messagesUpdated ( const QMailMessageIdList & ids )
void | retrievalInProgress ( const QMailAccountIdList & ids )
void | threadContentsModified ( const QMailThreadIdList & ids )
void | threadsAdded ( const QMailThreadIdList & ids )
void | threadsRemoved ( const QMailThreadIdList & ids )
void | threadsUpdated ( const QMailThreadIdList & ids )
void | transmissionInProgress ( const QMailAccountIdList & ids )

- 1 signal inherited from QObject

## Static Public Members

InitializationState | initializationState ()
QMailStore * | instance ()

- 4 static public members inherited from QObject

### Additional Inherited Members

- 1 property inherited from QObject
- 1 public slot inherited from QObject
- 1 public type inherited from QObject
- 7 protected functions inherited from QObject
- 2 protected variables inherited from QObject

## Detailed Description

The QMailStore class represents the main interface for storage and retrieval of messages and folders on the message store.

The QMailStore class is accessed through a singleton interface and provides functions for adding, updating and deleting of QMailAccounts, QMailFolders, QMailThreads and QMailMessages on the message store.

QMailStore also provides functions for querying and counting of QMailFolders, QMailAccounts, QMailThreads and QMailMessages when used in conjunction with QMailFolderKey and QMailAccountKey, QMailThreadKey and QMailMessageKey classes.

If a QMailStore operation fails, the lastError() function will return an error code value indicating the failure mode encountered. A successful operation will set the lastError() result to QMailStore::NoError.

Messaging accounts are represented by QMailAccountId objects. The data associated with accounts is separated into two components: QMailAccount objects hold account properties exported to mail store client applications, and QMailAccountConfiguration objects hold data used only by the messageserver and the protocol plugins it loads.

Account objects are accessed via the account(), accountConfiguration(), countAccounts() and queryAccounts() functions. Accounts in the mail store can be manipulated via the addAccount(), updateAccount() and removeAccount() functions. Mail store manipulations affecting accounts are reported via the accountsAdded(), accountsUpdated(), accountContentsModified() and accountsRemoved() signals.

Thread (a.k.a. conversation) objects are accessed via the thread(), countThreads() and queryThreads() functions. Accounts in the mail store can be manipulated via the addThread(), updateThread() and removeThread() functions. Mail store manipulations affecting accounts are reported via the threadsAdded(), threadsUpdated(), threadsContentsModified() and threadsRemoved() signals.

Fixed logical groupings of message are modelled as folders, represented by QMailFolderId objects. The data associated with folders is held by instances of the QMailFolder class.

Folder objects are accessed via the folder(), countFolders() and queryFolders() functions. Folders in the mail store can be manipulated via the addFolder(), updateFolder() and removeFolder() functions. Mail store manipulations affecting folders are reported via the foldersAdded(), foldersUpdated(), folderContentsModified() and foldersRemoved() signals.

Messages in the mail store are represented by QMailMessageId objects. The data associated with a message can be retrieved in two forms: QMailMessageMetaData objects contain only the meta data fields associated with a message, and QMailMessage objects contain both the meta data fields and the message content proper.

Message objects are accessed via the message(), messageMetaData(), countMessages() and queryMessages() functions. Additionally, the messagesMetaData() function can be used to retrieve subsets of meta data pertaining to a set of messages. Messages in the mail store can be manipulated via the addMessage(), updateMessage() and removeMessage() functions. Multiple messages can have their meta data fields updated together via the updateMessagesMetaData() function. Mail store manipulations affecting messages are reported via the messagesAdded(), messagesUpdated(), messageContentsModified() and messagesRemoved() signals.

Messages that have been removed can be represented by removal records, which persist only to assist in keeping mail store content synchronized with the content of an external message source. QMailMessageRemovalRecord objects can be accessed via the messageRemovalRecords() function.

See also QMailAccount, QMailFolder, and QMailMessage.

## Member Type Documentation

### enum QMailStore::ChangeType

Defines the type of change made to an object contained by the mail store.

Constant | Value | Description
--- | --- | ---
`QMailStore::Added` | `1` | A new entity was added to the store.
`QMailStore::Removed` | `2` | An existing entity was removed from the store.
`QMailStore::Updated` | `3` | An existing entity was modified.
`QMailStore::ContentsModified` | `4` | An existing entity was affected by a change to a different entity.

### enum QMailStore::ErrorCode

Defines the result of attempting to perform a mail store operation.

Constant | Value | Description
--- | --- | ---
`QMailStore::NoError` | `0` | The operation was successfully performed.
`QMailStore::InvalidId` | `1` | The operation failed due to the specification of an invalid identifier.
`QMailStore::ConstraintFailure` | `2` | The operation failed due to the violation of a database constraint.
`QMailStore::ContentInaccessible` | `3` | The operation failed because the content data cannot be accessed by the mail store.
`QMailStore::NotYetImplemented` | `4` | The operation failed because the mail store does not yet implement the operation.
`QMailStore::ContentNotRemoved` | `5` | The operation failed only because content could not be removed from storage.
`QMailStore::FrameworkFault` | `6` | The operation failed because the mail store encountered an error in performing the operation.
`QMailStore::StorageInaccessible` | `7` | The operation failed because the mail storage mechanism cannot be accessed by the mail store.

### enum QMailStore::InitializationState

This enum defines the initialization states that the mail store can assume.

Constant | Value | Description
--- | --- | ---
`QMailStore::Uninitialized` | `0` | The mail store has not yet been instantiated and initialized.
`QMailStore::InitializationFailed` | `1` | The mail store has been instantiated and initization was unsuccessful.
`QMailStore::Initialized` | `2` | The mail store has been instantiated and successfully initialized.

### enum QMailStore::MessageRemovalOption

Defines whether or not a QMailMessageRemovalRecord is created upon message removal.

Constant | Value | Description
--- | --- | ---
`QMailStore::NoRemovalRecord` | `1` | Do not create a QMailMessageRemovalRecord upon message removal.
`QMailStore::CreateRemovalRecord` | `2` | Create a QMailMessageRemovalRecord upon message removal.

### enum QMailStore::ReturnOption

This enum defines the meta data list return option for QMailStore::messagesMetaData()

Constant | Value | Description
--- | --- | ---
`QMailStore::ReturnAll` | `0` | Return all meta data objects that match the selection criteria, including duplicates.
`QMailStore::ReturnDistinct` | `1` | Return distinct meta data objects that match the selection criteria, excluding duplicates.

## Member Function Documentation

### QMailStore::~QMailStore () `[virtual]`

Destroys this QMailStore object.

### QMailAccount QMailStore::account ( const QMailAccountId & id ) const

Returns the QMailAccount defined by the QMailAccountId id from the store.

### QMailAccountConfiguration QMailStore::accountConfiguration ( const QMailAccountId & id ) const

Returns the configuration details of the QMailAccount defined by the QMailAccountId id from the store.

### void QMailStore::accountContentsModified ( const QMailAccountIdList & ids ) `[signal]`

Signal that is emitted when changes to messages and folders in the mail store affect the content of the accounts in the list ids.

See also messagesAdded(), messagesUpdated(), messagesRemoved(), foldersAdded(), foldersUpdated(), and foldersRemoved().

### quint64 QMailStore::accountStatusMask ( const QString & name ) const

Returns the status bitmask needed to test the result of QMailAccount::status() against the QMailAccount status flag registered with the identifier name.

See also registerAccountStatusFlag() and QMailAccount::statusMask().

### void QMailStore::accountsAdded ( const QMailAccountIdList & ids ) `[signal]`

Signal that is emitted when the accounts in the list ids are added to the store.

See also accountsRemoved() and accountsUpdated().

### void QMailStore::accountsRemoved ( const QMailAccountIdList & ids ) `[signal]`

Signal that is emitted when the accounts in the list ids are removed from the store.

See also accountsAdded() and accountsUpdated().

### void QMailStore::accountsUpdated ( const QMailAccountIdList & ids ) `[signal]`

Signal that is emitted when the accounts in the list ids are updated within the store.

See also accountsAdded() and accountsRemoved().

### bool QMailStore::addAccount ( QMailAccount * account, QMailAccountConfiguration * config )

Adds a new QMailAccount object account into the messsage store, with the configuration details optionally specified by config. Returns `true` if the operation completed successfully, `false` otherwise.

### bool QMailStore::addFolder ( QMailFolder * folder )

Adds a new QMailFolder object folder into the message store, performing respective integrity checks. Returns `true` if the operation completed successfully, `false` otherwise.

### bool QMailStore::addMessage ( QMailMessage * msg )

Adds a new QMailMessage object msg into the message store, performing respective integrity checks. Returns `true` if the operation completed successfully, `false` otherwise.

### bool QMailStore::addMessage ( QMailMessageMetaData * metaData )

Adds a new QMailMessageMetaData object metaData into the message store, performing respective integrity checks. Returns `true` if the operation completed successfully, `false` otherwise.

### bool QMailStore::addMessages ( const QList<QMailMessage *> & messages )

Adds a new QMailMessage object into the message store for each entry in the list messages, performing all respective integrity checks. Returns `true` if the operation completed successfully, `false` otherwise.

### bool QMailStore::addMessages ( const QList<QMailMessageMetaData *> & messages )

Adds a new QMailMessageMetData object into the message store for each entry in the list messages, performing all respective integrity checks. Returns `true` if the operation completed successfully, `false` otherwise.

### bool QMailStore::addThread ( QMailThread * t )

Adds a new QMailThread object t into the message store, performing respective integrity checks. Returns `true` if the operation completed successfully, `false` otherwise.

### bool QMailStore::asynchronousEmission () const

Returns true if the running process is in the act of emitting an asynchronous QMailStore signal caused by another process. This can only be true when called from a slot invoked by a QMailStore signal.

### int QMailStore::countAccounts ( const QMailAccountKey & key = QMailAccountKey() ) const

Returns the count of the number of accounts which pass the filtering criteria defined in QMailAccountKey key. If key is empty a count of all accounts is returned.

### int QMailStore::countFolders ( const QMailFolderKey & key = QMailFolderKey() ) const

Returns the count of the number of folders which pass the filtering criteria defined in QMailFolderKey key. If key is empty a count of all folders is returned.

### int QMailStore::countMessages ( const QMailMessageKey & key = QMailMessageKey() ) const

Returns the count of the number of messages which pass the filtering criteria defined in QMailMessageKey key. If key is empty a count of all messages is returned.

### int QMailStore::countThreads ( const QMailThreadKey & key = QMailThreadKey() ) const

Returns the count of the number of threads which pass the filtering criteria defined in QMailThreadKey key. If key is empty a count of all folders is returned.

### void QMailStore::errorOccurred ( QMailStore::ErrorCode code ) `[signal]`

Signal that is emitted when an error is encountered in processing a QMailStore operation. The error condition is indeicated by code.

See also lastError().

### void QMailStore::flushIpcNotifications ()

Forces any queued event notifications to immediately be synchronously emitted, and processed synchronously by recipient processes.

Any events occurring before flushIpcNotifications() is invoked will be processed by recipient processes before any IPC packets generated after the invocation.

### QMailFolder QMailStore::folder ( const QMailFolderId & id ) const

Returns the QMailFolder defined by the QMailFolderId id from the store.

### void QMailStore::folderContentsModified ( const QMailFolderIdList & ids ) `[signal]`

Signal that is emitted when changes to messages in the mail store affect the content of the folders in the list ids.

See also messagesAdded(), messagesUpdated(), and messagesRemoved().

### quint64 QMailStore::folderStatusMask ( const QString & name ) const

Returns the status bitmask needed to test the result of QMailFolder::status() against the QMailFolder status flag registered with the identifier name.

See also registerFolderStatusFlag() and QMailFolder::statusMask().

### void QMailStore::foldersAdded ( const QMailFolderIdList & ids ) `[signal]`

Signal that is emitted when the folders in the list ids are added to the mail store.

See also foldersRemoved() and foldersUpdated().

### void QMailStore::foldersRemoved ( const QMailFolderIdList & ids ) `[signal]`

Signal that is emitted when the folders in the list ids are removed from the mail store.

See also foldersAdded() and foldersUpdated().

### void QMailStore::foldersUpdated ( const QMailFolderIdList & ids ) `[signal]`

Signal that is emitted when the folders in the list ids are updated within the mail store.

See also foldersAdded() and foldersRemoved().

### InitializationState QMailStore::initializationState () `[static]`

Returns the initialization state of the QMailStore.

### QMailStore * QMailStore::instance () `[static]`

Returns the single instance of the QMailStore class.

If necessary, the store will be instantiated and initialized.

See also initializationState().

### QMailStore::ErrorCode QMailStore::lastError () const

Returns the code of the last error condition reported by the QMailStore.

### void QMailStore::lock ()

Locks QMailStore, preventing all write operations from taking place. Will block until all write operations have completed and it can get a lock. Read-only operations will be permitted as normal.To resume normal operation unlock() must be called.

Note: This method only needs to be used in exceptional circumstances, such as when directly accessing the content of QMailStore files e.g. for backing up data.

See also unlock().

### QMailMessage QMailStore::message ( const QMailMessageId & id ) const

Returns the QMailMessage defined by the QMailMessageId id from the store.

### QMailMessage QMailStore::message ( const QString & uid, const QMailAccountId & accountId ) const

Returns the QMailMessage defined by the unique identifier uid from the account with id accountId.

### void QMailStore::messageContentsModified ( const QMailMessageIdList & ids ) `[signal]`

Signal that is emitted when the content of the messages in list ids is updated.

See also messagesUpdated().

### void QMailStore::messageDataAdded ( const QMailMessageMetaDataList & data ) `[signal]`

Signal that is emitted when messages are added to the mail store using addMessage(), addMessages() or an overload of one of these functions. data is a list of the metadata of the added messages.

See also addMessages().

### void QMailStore::messageDataUpdated ( const QMailMessageMetaDataList & data ) `[signal]`

Signal that is emitted when messages within the mail store are updated using using updateMessages(), updateMessages(), addMessage(), addMessages() or an overload of one of these functions. data is a list of the metadata of the updated messages.

### QMailMessageMetaData QMailStore::messageMetaData ( const QMailMessageId & id ) const

Returns the meta data for the message identified by the QMailMessageId id from the store.

### QMailMessageMetaData QMailStore::messageMetaData ( const QString & uid, const QMailAccountId & accountId ) const

Returns the meta data for the message identified by the unique identifier uid from the account with id accountId.

### void QMailStore::messagePropertyUpdated ( const QMailMessageIdList & ids, const QMailMessageKey::Properties & properties, const QMailMessageMetaData & data ) `[signal]`

Signal that is emitted when messages within the mail store are updated using updateMessagesMetaData(const QMailMessageKey&, const QMailMessageKey::Properties& properties, const QMailMessageMetaData& data). ids is a list of ids of messages that have been updated, message properties defined in properties have been updated using the respective element contained in the data.

### const QMailMessageRemovalRecordList QMailStore::messageRemovalRecords ( const QMailAccountId & accountId, const QMailFolderId & folderId = QMailFolderId() ) const

Retrieves a list of QMailMessageRemovalRecord objects containing information about messages that have been removed from local storage. Records are retrieved for messages whose account IDs match accountId and optionally, whose folder IDs match folderId. This information is primarily for synchronization of local changes to remote message storage services such as IMAP servers.

Returns a list of QMailMessageRemovalRecord objects if successfully completed, or an empty list for an error or no data.

### void QMailStore::messageRemovalRecordsAdded ( const QMailAccountIdList & ids ) `[signal]`

Signal that is emitted when QMailMessageRemovalRecords are added to the store, affecting the accounts listed in ids.

See also messageRemovalRecordsRemoved().

### void QMailStore::messageRemovalRecordsRemoved ( const QMailAccountIdList & ids ) `[signal]`

Signal that is emitted when QMailMessageRemovalRecords are removed from the store, affecting the accounts listed in ids.

See also messageRemovalRecordsAdded().

### quint64 QMailStore::messageStatusMask ( const QString & name ) const

Returns the status bitmask needed to test the result of QMailMessage::status() against the QMailMessage status flag registered with the identifier name.

See also registerMessageStatusFlag() and QMailMessage::statusMask().

### void QMailStore::messageStatusUpdated ( const QMailMessageIdList & ids, quint64 status, bool set ) `[signal]`

Signal that is emitted when messages within the mail store are updated using updateMessagesMetaData(const QMailMessageKey&, quint64, bool). ids is a list of ids of messages that have been updated, status is the status flags set according to set.

### void QMailStore::messagesAdded ( const QMailMessageIdList & ids ) `[signal]`

Signal that is emitted when the messages in the list ids are added to the mail store.

See also messagesRemoved() and messagesUpdated().

### const QMailMessageMetaDataList QMailStore::messagesMetaData ( const QMailMessageKey & key, const QMailMessageKey::Properties & properties, ReturnOption option = ReturnAll ) const

Retrieves a list of QMailMessageMetaData objects containing meta data elements specified by properties, for messages which match the criteria defined by key. If option is `ReturnAll` then duplicate objects are included in the list; otherwise duplicate objects are excluded from the returned list.

Returns a list of QMailMessageMetaData objects if successfully completed, or an empty list for an error or no data.

Note: Custom fields cannot be queried by this function.

### void QMailStore::messagesRemoved ( const QMailMessageIdList & ids ) `[signal]`

Signal that is emitted when the messages in the list ids are removed from the mail store.

See also messagesAdded() and messagesUpdated().

### void QMailStore::messagesUpdated ( const QMailMessageIdList & ids ) `[signal]`

Signal that is emitted when the messages in the list ids are updated within the mail store.

See also messagesAdded() and messagesRemoved().

### bool QMailStore::purgeMessageRemovalRecords ( const QMailAccountId & accountId, const QStringList & serverUids = QStringList() )

Erases message deletion records from the account with id accountId and server uid listed in serverUids. If serverUids is empty, all message deletion records for the specified account are deleted.

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

### const QMailAccountIdList QMailStore::queryAccounts ( const QMailAccountKey & key = QMailAccountKey(), const QMailAccountSortKey & sortKey = QMailAccountSortKey(), uint limit = 0, uint offset = 0 ) const

Returns the QMailAccountIds of accounts in the store. If key is not empty only accounts matching the parameters set by key will be returned, otherwise all accounts identifiers will be returned. If sortKey is not empty, the identifiers will be sorted by the parameters set by sortKey. If limit is non-zero, then no more than limit matching account IDs should be returned. If offset is non-zero, then the first offset matching IDs should be omitted from the returned list.

Note: if the implementation cannot support the limit and offset parameters, it should not attempt to perform a query where either of these values is non-zero; instead, it should return an empty list and set lastError() to QMailStore::NotYetImplemented.

### const QMailFolderIdList QMailStore::queryFolders ( const QMailFolderKey & key = QMailFolderKey(), const QMailFolderSortKey & sortKey = QMailFolderSortKey(), uint limit = 0, uint offset = 0 ) const

Returns the QMailFolderIds of folders in the message store. If key is not empty only folders matching the parameters set by key will be returned, otherwise all folder identifiers will be returned. If sortKey is not empty, the identifiers will be sorted by the parameters set by sortKey. If limit is non-zero, then no more than limit matching folder IDs should be returned. If offset is non-zero, then the first offset matching IDs should be omitted from the returned list.

Note: if the implementation cannot support the limit and offset parameters, it should not attempt to perform a query where either of these values is non-zero; instead, it should return an empty list and set lastError() to QMailStore::NotYetImplemented.

### const QMailMessageIdList QMailStore::queryMessages ( const QMailMessageKey & key = QMailMessageKey(), const QMailMessageSortKey & sortKey = QMailMessageSortKey(), uint limit = 0, uint offset = 0 ) const

Returns the QMailMessageIds of messages in the message store. If key is not empty only messages matching the parameters set by key will be returned, otherwise all message identifiers will be returned. If sortKey is not empty, the identifiers will be sorted by the parameters set by sortKey. If limit is non-zero, then no more than limit matching message IDs should be returned. If offset is non-zero, then the first offset matching IDs should be omitted from the returned list.

Note: if the implementation cannot support the limit and offset parameters, it should not attempt to perform a query where either of these values is non-zero; instead, it should return an empty list and set lastError() to QMailStore::NotYetImplemented.

### const QMailThreadIdList QMailStore::queryThreads ( const QMailThreadKey & key = QMailThreadKey(), const QMailThreadSortKey & sortKey = QMailThreadSortKey(), uint limit = 0, uint offset = 0 ) const

Returns the QMailThreadIds of threads in the message store. If key is not empty only threads matching the parameters set by key will be returned, otherwise all thread identifiers will be returned. If sortKey is not empty, the identifiers will be sorted by the parameters set by sortKey. If limit is non-zero, then no more than limit matching thread IDs should be returned. If offset is non-zero, then the first offset matching IDs should be omitted from the returned list.

Note: if the implementation cannot support the limit and offset parameters, it should not attempt to perform a query where either of these values is non-zero; instead, it should return an empty list and set lastError() to QMailStore::NotYetImplemented.

### bool QMailStore::registerAccountStatusFlag ( const QString & name )

Registers a status flag for QMailAccount objects, with the identifier name. Returns true if the flag is already registered, or if it is successfully registered; otherwise returns false.

See also accountStatusMask().

### bool QMailStore::registerFolderStatusFlag ( const QString & name )

Registers a status flag for QMailFolder objects, with the identifier name. Returns true if the flag is already registered, or if it is successfully registered; otherwise returns false.

See also folderStatusMask().

### bool QMailStore::registerMessageStatusFlag ( const QString & name )

Registers a status flag for QMailMessage objects, with the identifier name. Returns true if the flag is already registered, or if it is successfully registered; otherwise returns false.

See also messageStatusMask().

### bool QMailStore::removeAccount ( const QMailAccountId & id )

Removes a QMailAccount with QMailAccountId id from the store. Also removes any folder, message and message removal records associated with the removed account. Returns `true` if the operation completed successfully, `false` otherwise.

Note: Using a QMailAccount instance after it has been removed from the store will result in undefined behavior.

### bool QMailStore::removeAccounts ( const QMailAccountKey & key )

Removes all QMailAccounts identified by the key key from the store. Also removes any folder, message and message removal records associated with the removed account. Returns `true` if the operation completed successfully, `false` otherwise.

Note: Using a QMailAccount instance after it has been removed from the store will result in undefined behavior.

### bool QMailStore::removeFolder ( const QMailFolderId & id, MessageRemovalOption option = NoRemovalRecord )

Removes a QMailFolder with QMailFolderId id from the message store. Also removes any sub-folders of the identified folder, and any messages contained in any of the folders removed. If option is QMailStore::CreateRemovalRecord then removal records will be created for each removed message. Returns `true` if the operation completed successfully, `false` otherwise.

Note: Using a QMailFolder instance after it has been removed from the store will result in undefined behavior.

### bool QMailStore::removeFolders ( const QMailFolderKey & key, MessageRemovalOption option = NoRemovalRecord )

Removes all QMailFolders identified by the key key from the message store. Also removes any sub-folders of the removed folders, and any messages contained in any of the folders removed. If option is QMailStore::CreateRemovalRecord then removal records will be created for each removed message. Returns `true` if the operation completed successfully, `false` otherwise.

Note: Using a QMailFolder instance after it has been removed from the store will result in undefined behavior.

### bool QMailStore::removeMessage ( const QMailMessageId & id, MessageRemovalOption option = NoRemovalRecord )

Removes a QMailMessage with QMailMessageId id from the message store. If option is QMailStore::CreateRemovalRecord then a removal record will be created for the removed message. Returns `true` if the operation completed successfully, `false` otherwise.

Note: Using a QMailMessage instance after it has been removed from the store will result in undefined behavior.

### bool QMailStore::removeMessages ( const QMailMessageKey & key, MessageRemovalOption option = NoRemovalRecord )

Removes all QMailMessages identified by the key key from the message store. If option is QMailStore::CreateRemovalRecord then removal records will be created for each removed message. Returns `true` if the operation completed successfully, `false` otherwise.

Note: Using a QMailMessage instance after it has been removed from the store will result in undefined behavior.

### bool QMailStore::removeThread ( const QMailThreadId & id, MessageRemovalOption option = NoRemovalRecord )

Removes all QMailThreads identified by the id id from the message store. If option is QMailStore::CreateRemovalRecord then removal records will be created for each removed thread. Returns `true` if the operation completed successfully, `false` otherwise.

Note: Using a QMailThreads instance after it has been removed from the store will result in undefined behavior.

### bool QMailStore::removeThreads ( const QMailThreadKey & key, QMailStore::MessageRemovalOption option = NoRemovalRecord )

Removes all QMailThreads identified by the key key from the message store. If option is QMailStore::CreateRemovalRecord then removal records will be created for each removed thread. Returns `true` if the operation completed successfully, `false` otherwise.

Note: Using a QMailThreads instance after it has been removed from the store will result in undefined behavior.

### void QMailStore::retrievalInProgress ( const QMailAccountIdList & ids ) `[signal]`

Signal that is emitted when the set of accounts currently retrieving from external sources is modified to ids. Accounts listed in ids are likely to be the source of numerous mail store signals; some clients may wish to ignore updates associated with these accounts whilst they are engaged in retrieving.

See also setRetrievalInProgress() and transmissionInProgress().

### void QMailStore::setRetrievalInProgress ( const QMailAccountIdList & ids )

Sets the list of accounts currently retrieving from external sources to be ids.

See also retrievalInProgress().

### void QMailStore::setTransmissionInProgress ( const QMailAccountIdList & ids )

Sets the list of accounts currently transmitting to external sources to be ids.

See also transmissionInProgress().

### int QMailStore::sizeOfMessages ( const QMailMessageKey & key = QMailMessageKey() ) const

Returns the total size of the messages which pass the filtering criteria defined in QMailMessageKey key. If key is empty the total size of all messages is returned.

### QMailThread QMailStore::thread ( const QMailThreadId & id ) const

Returns the QMailThread defined by QMailThreadId id from the store.

### void QMailStore::threadContentsModified ( const QMailThreadIdList & ids ) `[signal]`

Signal that is emitted when changes to messages in the mail store affect the content of the threads in the list ids.

See also messagesAdded(), messagesUpdated(), and messagesRemoved().

### void QMailStore::threadsAdded ( const QMailThreadIdList & ids ) `[signal]`

Signal that is emitted when the threads in the list ids are added to the store.

See also threadsRemoved() and threadsUpdated().

### void QMailStore::threadsRemoved ( const QMailThreadIdList & ids ) `[signal]`

Signal that is emitted when the threads in the list ids are removed from the store.

See also threadsAdded() and threadsUpdated().

### void QMailStore::threadsUpdated ( const QMailThreadIdList & ids ) `[signal]`

Signal that is emitted when the threads in the list ids are updated within the store.

See also threadsAdded() and threadsRemoved().

### void QMailStore::transmissionInProgress ( const QMailAccountIdList & ids ) `[signal]`

Signal that is emitted when the set of accounts currently transmitting to external sources is modified to ids. Accounts listed in ids are likely to be the source of numerous mail store signals; some clients may wish to ignore updates associated with these accounts whilst they are engaged in transmitting.

See also setTransmissionInProgress() and retrievalInProgress().

### void QMailStore::unlock ()

Unlocks QMailStore, allowing write operations to resume. This must only be used after a lock() call and from the same process in which lock() was called.

See also lock().

### bool QMailStore::updateAccount ( QMailAccount * account, QMailAccountConfiguration * config = 0 )

Updates the existing QMailAccount account on the store, with the configuration details optionally specified by config. Returns `true` if the operation completed successfully, `false` otherwise.

### bool QMailStore::updateAccountConfiguration ( QMailAccountConfiguration * config )

Updates the configuration details of the referenced account to contain config. Returns `true` if the operation completed successfully, `false` otherwise.

See also QMailAccountConfiguration::id().

### bool QMailStore::updateFolder ( QMailFolder * folder )

Updates the existing QMailFolder folder on the message store. Returns `true` if the operation completed successfully, `false` otherwise.

### bool QMailStore::updateMessage ( QMailMessage * msg )

Updates the existing QMailMessage msg on the message store. Returns `true` if the operation completed successfully, or `false` otherwise.

### bool QMailStore::updateMessage ( QMailMessageMetaData * metaData )

Updates the meta data of the existing message on the message store, to match metaData. Returns `true` if the operation completed successfully, or `false` otherwise.

### bool QMailStore::updateMessages ( const QList<QMailMessage *> & messages )

Updates the existing QMailMessage in the message store, for each message listed in messages. Returns `true` if the operation completed successfully, or `false` otherwise.

### bool QMailStore::updateMessages ( const QList<QMailMessageMetaData *> & messages )

Updates the meta data of the existing message in the message store, to match each of the messages listed in messages. Returns `true` if the operation completed successfully, or `false` otherwise.

### bool QMailStore::updateMessagesMetaData ( const QMailMessageKey & key, const QMailMessageKey::Properties & properties, const QMailMessageMetaData & data )

Updates the message properties defined in properties to match the respective element contained in the data, for all messages which match the criteria defined by key.

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

### bool QMailStore::updateMessagesMetaData ( const QMailMessageKey & key, quint64 status, bool set )

Updates message status flags set in status according to set, for messages which match the criteria defined by key.

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

### bool QMailStore::updateThread ( QMailThread * t )

Updates existing QMailThread t in the message store. Returns `true` if the operation completed successfully, `false` otherwise.