Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QMailStore Class Reference
[QtMessagingModule, QtPimModule]

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.

Public Types

Public Functions

  • virtual ~QMailStore ()
  • QMailAccount account ( const QMailAccountId & id ) const
  • bool addAccount ( QMailAccount * account, AccountConfiguration * config = 0 )
  • bool addFolder ( QMailFolder * folder )
  • bool addMessage ( QMailMessage * msg )
  • bool addMessage ( QMailMessageMetaData * metaData )
  • bool asynchronousEmission () const
  • int countAccounts ( const QMailAccountKey & key = QMailAccountKey() ) const
  • int countFolders ( const QMailFolderKey & key = QMailFolderKey() ) const
  • int countMessages ( const QMailMessageKey & key = QMailMessageKey() ) const
  • QMailFolder folder ( const QMailFolderId & id ) const
  • quint64 folderStatusMask ( const QString & name ) const
  • bool initialized () const
  • 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 QString & fromMailbox = QString() ) 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() ) const
  • const QMailFolderIdList queryFolders ( const QMailFolderKey & key = QMailFolderKey(), const QMailFolderSortKey & sortKey = QMailFolderSortKey() ) const
  • const QMailMessageIdList queryMessages ( const QMailMessageKey & key = QMailMessageKey(), const QMailMessageSortKey & sortKey = QMailMessageSortKey() ) const
  • 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 restoreToPreviousFolder ( const QMailMessageId & id )
  • bool restoreToPreviousFolder ( const QMailMessageKey & key )
  • int sizeOfMessages ( const QMailMessageKey & key = QMailMessageKey() ) const
  • bool updateAccount ( QMailAccount * account, AccountConfiguration * config = 0 )
  • bool updateFolder ( QMailFolder * folder )
  • bool updateMessage ( QMailMessage * msg )
  • bool updateMessage ( QMailMessageMetaData * metaData )
  • bool updateMessagesMetaData ( const QMailMessageKey & key, const QMailMessageKey::Properties & properties, const QMailMessageMetaData & data )
  • bool updateMessagesMetaData ( const QMailMessageKey & key, quint64 status, bool set )
  • 29 public functions inherited from QObject

Signals

Static Public Members

  • 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 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.

See also QMailMessage, QMailFolder, QMailMessageKey, QMailFolderKey, and QMailAccountKey.


Member Type Documentation

enum QMailStore::MessageRemovalOption

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

ConstantValueDescription
QMailStore::NoRemovalRecord1Do not create a QMailMessageRemovalRecord upon message removal.
QMailStore::CreateRemovalRecord2Create a QMailMessageRemovalRecord upon message removal.

enum QMailStore::ReturnOption

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

ConstantValueDescription
QMailStore::ReturnAll0Return all meta data objects that match the selection criteria, including duplicates.
QMailStore::ReturnDistinct1Return 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 QMailAcount defined by a 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().

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, AccountConfiguration * config = 0 )

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 )

This is an overloaded member function, provided for convenience.

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::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.

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 a QMailFolderId id from the message 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().

bool QMailStore::initialized () const

Returns true if the QMailStore object was correctly initialized.

QMailStore * QMailStore::instance ()   [static]

Returns an instance of the QMailStore object.

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

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

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

This is an overloaded member function, provided for convenience.

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

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

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

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

This is an overloaded member function, provided for convenience.

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

const QMailMessageRemovalRecordList QMailStore::messageRemovalRecords ( const QMailAccountId & accountId, const QString & fromMailbox = QString() ) const

Retrieves a list of QMailMessageRemovalRecord objects containing information about messages that have been removed from local storage. Records are retrived for messages whose account Id's match accountId and whose optional mailbox matches fromMailbox. 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::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.

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() ) 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.

const QMailFolderIdList QMailStore::queryFolders ( const QMailFolderKey & key = QMailFolderKey(), const QMailFolderSortKey & sortKey = QMailFolderSortKey() ) 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.

const QMailMessageIdList QMailStore::queryMessages ( const QMailMessageKey & key = QMailMessageKey(), const QMailMessageSortKey & sortKey = QMailMessageSortKey() ) 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.

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.

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.

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.

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.

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.

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.

bool QMailStore::restoreToPreviousFolder ( const QMailMessageId & id )

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.

bool QMailStore::restoreToPreviousFolder ( const QMailMessageKey & key )

This is an overloaded member function, provided for convenience.

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.

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.

bool QMailStore::storeInitialized ()   [static]

Returns true if the QMailStore was correctly initialized.

bool QMailStore::updateAccount ( QMailAccount * account, AccountConfiguration * 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::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 )

This is an overloaded member function, provided for convenience.

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::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 )

This is an overloaded member function, provided for convenience.

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.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 69
  2. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 27
  3. Une nouvelle ère d'IHM 3D pour les automobiles, un concept proposé par Digia et implémenté avec Qt 3
  4. Qt Creator 2.5 est sorti en beta, l'EDI supporte maintenant plus de fonctionnalités de C++11 2
  5. Vingt sociétés montrent leurs décodeurs basés sur Qt au IPTV World Forum, en en exploitant diverses facettes (déclaratif, Web, widgets) 0
  6. PySide devient un add-on Qt et rejoint le Qt Project et le modèle d'open gouvernance 1
  7. Thread travailleur avec Qt en utilisant les signaux et les slots, un article de Christophe Dumez traduit par Thibaut Cuvelier 1
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 101
  2. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 51
  3. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 69
  4. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 27
  5. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 11
Page suivante
  1. Linus Torvalds : le "C++ est un langage horrible", en justifiant le choix du C pour le système de gestion de version Git 100
  2. Comment prendre en compte l'utilisateur dans vos applications ? Pour un développeur, « 90 % des utilisateurs sont des idiots » 229
  3. Quel est LE livre que tout développeur doit lire absolument ? Celui qui vous a le plus marqué et inspiré 96
  4. Apple cède et s'engage à payer des droits à Nokia, le conflit des brevets entre les deux firmes s'achève 158
  5. Nokia porte à nouveau plainte contre Apple pour violation de sept nouveaux brevets 158
  6. Quel est le code dont vous êtes le plus fier ? Pourquoi l'avez-vous écrit ? Et pourquoi vous a-t-il donné autant de satisfaction ? 83
  7. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 101
Page suivante

Le Qt Labs au hasard

Logo

Le moteur de rendu OpenGL

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web