Logo Search packages:      
Sourcecode: qmf version File versions  Download package

Public Types | Signals | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends

QMailStore Class Reference

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

Collaboration diagram for QMailStore:
Collaboration graph
[legend]

List of all members.

Public Types

enum  ChangeType { Added = 1, Removed, Updated, ContentsModified }
enum  ErrorCode {
  NoError = 0, InvalidId, ConstraintFailure, ContentInaccessible,
  NotYetImplemented, ContentNotRemoved, FrameworkFault, StorageInaccessible
}
enum  InitializationState { Uninitialized = 0, InitializationFailed, Initialized }
enum  MessageRemovalOption { NoRemovalRecord = 1, CreateRemovalRecord }
enum  ReturnOption { ReturnAll = 0, ReturnDistinct }

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 messagesAdded (const QMailMessageIdList &ids)
void messagesRemoved (const QMailMessageIdList &ids)
void messageStatusUpdated (const QMailMessageIdList &ids, quint64 status, bool set)
void messagesUpdated (const QMailMessageIdList &ids)
void retrievalInProgress (const QMailAccountIdList &ids)
void transmissionInProgress (const QMailAccountIdList &ids)

Public Member Functions

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 *f)
bool addMessage (QMailMessage *m)
bool addMessage (QMailMessageMetaData *m)
bool addMessages (const QList< QMailMessageMetaData * > &m)
bool addMessages (const QList< QMailMessage * > &m)
bool asynchronousEmission () const
int countAccounts (const QMailAccountKey &key=QMailAccountKey()) const
int countFolders (const QMailFolderKey &key=QMailFolderKey()) const
int countMessages (const QMailMessageKey &key=QMailMessageKey()) 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 &parentAccountId, const QMailFolderId &parentFolderId=QMailFolderId()) const
const QMailMessageMetaDataList messagesMetaData (const QMailMessageKey &key, const QMailMessageKey::Properties &properties, ReturnOption option=ReturnAll) const
quint64 messageStatusMask (const QString &name) const
bool purgeMessageRemovalRecords (const QMailAccountId &parentAccountId, const QStringList &serverUid=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
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)
void setRetrievalInProgress (const QMailAccountIdList &ids)
void setTransmissionInProgress (const QMailAccountIdList &ids)
int sizeOfMessages (const QMailMessageKey &key=QMailMessageKey()) const
void unlock ()
bool updateAccount (QMailAccount *account, QMailAccountConfiguration *config=0)
bool updateAccountConfiguration (QMailAccountConfiguration *config)
bool updateFolder (QMailFolder *f)
bool updateMessage (QMailMessage *m)
bool updateMessage (QMailMessageMetaData *m)
bool updateMessages (const QList< QMailMessage * > &m)
bool updateMessages (const QList< QMailMessageMetaData * > &m)
bool updateMessagesMetaData (const QMailMessageKey &key, quint64 messageStatus, bool set)
bool updateMessagesMetaData (const QMailMessageKey &key, const QMailMessageKey::Properties &properties, const QMailMessageMetaData &data)
virtual ~QMailStore ()

Static Public Member Functions

static QMailFolderId getFolderId (quint64 value)
static QMailMessageId getId (quint64 value)
static InitializationState initializationState ()
static QMailStoreinstance ()

Private Member Functions

void clearContent ()
QMailMessageMetaDataList dataList (const QList< QMailMessage * > &messages, const QMailMessageIdList &ids)
QMailMessageMetaDataList dataList (const QList< QMailMessageMetaData * > &messages, const QMailMessageIdList &ids)
QMailMessageMetaData dataToTransfer (const QMailMessageMetaData *message)
void emitAccountNotification (ChangeType type, const QMailAccountIdList &ids)
void emitErrorNotification (QMailStore::ErrorCode code)
void emitFolderNotification (ChangeType type, const QMailFolderIdList &ids)
void emitMessageDataNotification (const QMailMessageIdList &ids, quint64 status, bool set)
void emitMessageDataNotification (ChangeType type, const QMailMessageMetaDataList &data)
void emitMessageDataNotification (const QMailMessageIdList &ids, const QMailMessageKey::Properties &properties, const QMailMessageMetaData &data)
void emitMessageNotification (ChangeType type, const QMailMessageIdList &ids)
void emitRemovalRecordNotification (ChangeType type, const QMailAccountIdList &ids)
void emitRetrievalInProgress (const QMailAccountIdList &ids)
void emitTransmissionInProgress (const QMailAccountIdList &ids)
QMap< QString, QString > messageCustomFields (const QMailMessageId &id)
 QMailStore ()
bool updateMessages (const QList< QPair< QMailMessageMetaData *, QMailMessage * > > &)

Private Attributes

QMailStoreImplementationd

Friends

class QMailMessageMetaDataPrivate
class QMailStoreImplementationBase
class QMailStorePrivate
class tst_QMailStore
class tst_QMailStoreKeys

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 and QMailMessages on the message store.

QMailStore also provides functions for querying and counting of QMailFolders, QMailAccounts and QMailMessages when used in conjunction with QMailMessageKey, QMailFolderKey and QMailAccountKey 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.

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, QMailMessage

Definition at line 65 of file qmailstore.h.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index