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  · 

QMailMessageKey Class Reference
[QtMessagingModule, QtPimModule]

The QMailMessageKey class defines the parameters used for querying a subset of all available messages from the mail store. More...

    #include <QMailMessageKey>

This class is under development and is subject to change.

Public Types

  • enum Property { Id, Type, ParentFolderId, Sender, ..., PreviousParentFolderId }

Public Functions

Static Public Members


Detailed Description

The QMailMessageKey class defines the parameters used for querying a subset of all available messages from the mail store.

A QMailMessageKey is composed of a message property, an optional comparison operator and a comparison value. The QMailMessageKey class is used in conjunction with the QMailStore::queryMessages() and QMailStore::countMessages() functions to filter results which meet the criteria defined by the key.

QMailMessageKeys can be combined using the logical operators (&), (|) and (~) to create more refined queries.

For example:

To create a query for all messages sent from "joe@user.com" with subject "meeting":

    QMailMessageKey subjectKey(QMailMessageKey::Subject,"meeting");
    QMailMessageKey senderKey(QMailMessageKey::Sender,"joe@user.com")
    QMailMessageIdList results = QMailStore::instance()->queryMessages(subjectKey & senderKey);

To query all unread messages from a specific folder:

    QMailMessageIdList unreadMessagesInFolder(const QMailFolderId& folderId)
    {
        QMailMessageKey parentFolderKey(QMailMessageKey::ParentFolderId, folderId);
        QMailMessageKey unreadKey(QMailMessageKey::Status, QMailMessage::Read, QMailDataComparator::Excludes);

        return QMailStore::instance()->queryMessages(parentFolderKey & unreadKey);
    }

See also QMailStore and QMailMessage.


Member Type Documentation

enum QMailMessageKey::Property
flags QMailMessageKey::Properties

This enum type describes the data query properties of a QMailMessage.

ConstantValueDescription
QMailMessageKey::Id0x0001The ID of the message.
QMailMessageKey::Type0x0002The type of the message.
QMailMessageKey::ParentFolderId0x0004The parent folder ID this message is contained in.
QMailMessageKey::Sender0x0008The message sender address string.
QMailMessageKey::Recipients0x0010The message recipient address string.
QMailMessageKey::Subject0x0020The message subject string.
QMailMessageKey::TimeStamp0x0040The message timestamp
QMailMessageKey::Status0x0080The message status flags.
QMailMessageKey::FromMailbox0x0200The imap mailbox the message was downloaded from.
QMailMessageKey::ServerUid0x0400The IMAP server UID of the message.
QMailMessageKey::Size0x0800The size of the message.
QMailMessageKey::ParentAccountId0x1000The ID of the account the message was downloaded from.
QMailMessageKey::AncestorFolderIds0x2000The set of IDs of folders which are direct or indirect parents of this message.
QMailMessageKey::ContentType0x4000The type of data contained within the message.
QMailMessageKey::PreviousParentFolderId0x8000The parent folder ID this message was contained in, prior to moving to the current parent folder.

The Properties type is a typedef for QFlags<Property>. It stores an OR combination of Property values.


Member Function Documentation

QMailMessageKey::QMailMessageKey ()

Constructor which creates a default-constructed key (one for which isEmpty() returns true) that matches all messages. The logical negation of an empty key also matches all messages.

The result of combining an empty key with a non-empty key is the same as the original non-empty key. This is true regardless of whether the combination is formed by a logical AND or a logical OR operation.

The result of combining two empty keys is an empty key.

QMailMessageKey::QMailMessageKey ( Property p, const QVariant & value, QMailDataComparator::Comparator c = QMailDataComparator::Equal )

Construct a QMailMessageKey which defines a query parameter where QMailMessage::Property p is compared using comparison operator c with a value value.

QMailMessageKey::QMailMessageKey ( const QMailMessageIdList & ids )

Construct a QMailMessageKey which defines a query parameter where messages whose identifiers are in ids are returned.

QMailMessageKey::QMailMessageKey ( const QMailMessageKey & other )

Create a copy of the QMailMessageKey other.

QMailMessageKey::~QMailMessageKey ()   [virtual]

Destroys the QMailMessageKey

void QMailMessageKey::deserialize ( Stream & stream )

Reads the contents of a QMailMessageKey from stream.

bool QMailMessageKey::isEmpty () const

Returns true if the key remains empty after default construction; otherwise returns false.

See also isNonMatching().

bool QMailMessageKey::isNonMatching () const

Returns true if the key is a non-matching key; otherwise returns false.

See also isEmpty().

QMailMessageKey QMailMessageKey::nonMatchingKey ()   [static]

Returns a key that does not match any messages (unlike an empty key).

See also isNonMatching() and isEmpty().

void QMailMessageKey::serialize ( Stream & stream ) const

Writes the contents of a QMailMessageKey to a stream.

QMailMessageKey::operator QVariant () const

Returns the QVariant representation of this QMailMessageKey.

bool QMailMessageKey::operator!= ( const QMailMessageKey & other ) const

Returns true if the value of this key is not the same as the key other. Returns false otherwise.

QMailMessageKey QMailMessageKey::operator& ( const QMailMessageKey & other ) const

Returns a key that is the logical AND of this key and the value of key other.

QMailMessageKey & QMailMessageKey::operator&= ( const QMailMessageKey & other )

Performs a logical AND with this key and the key other and assigns the result to this key.

QMailMessageKey & QMailMessageKey::operator= ( const QMailMessageKey & other )

Assign the value of the QMailMessageKey other to this.

bool QMailMessageKey::operator== ( const QMailMessageKey & other ) const

Returns true if the value of this key is the same as the key other. Returns false otherwise.

QMailMessageKey QMailMessageKey::operator| ( const QMailMessageKey & other ) const

Returns a key that is the logical OR of this key and the value of key other.

QMailMessageKey & QMailMessageKey::operator|= ( const QMailMessageKey & other )

Performs a logical OR with this key and the key other and assigns the result to this key.

QMailMessageKey QMailMessageKey::operator~ () const

Returns a key that is the logical NOT of the value of this key.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

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