| Home · All Classes · Grouped Classes · Annotated · Functions | ![]() |
The QMailMessageKey class defines the parameters used for querying a subset of all available mail messages from the mail store. More...
#include <QMailMessageKey>
This class is under development and is subject to change.
The QMailMessageKey class defines the parameters used for querying a subset of all available mail 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.
QMailMessageKey's can be combined using the logical operators (&), (|) and (~) to create more refined queries.
For example: To create a query for all message's sent from "joe@user.com" with subject "meeting":
QMailMessageKey subjectKey(QMailMessageKey::Subject,"meeting");
QMailMessageKey senderKey(QMailMessageKey::Sender,"joe@user.com")
QMailIdList results = QMailStore::instance()->queryMessages(subjectKey & senderKey);
To query all unread messages from a specific folder parent:
\\assuming parent has been retrieved from the mail store.
QMailFolder parent;
QMailMessageKey parentFolderKey(QMailMessageKey::ParentFolderId,parent.id())
QMailMessageKey readKey(QMailMessageKey::Status,QMailMessage::Read,QMailMessageKey::Contains);
QMailIdList results = QMailStore::instance()->queryMessages(parentFolderKey & ~readKey);
See also QMailStore and QMailFolderKey.
Defines the comparison operators that can be used to comapare QMailMessage::Property elements with user sepecified values.
| Constant | Value | Description |
|---|---|---|
| QMailMessageKey::LessThan | 0 | represents the '<' operator. |
| QMailMessageKey::LessThanEqual | 1 | represents the '<=' operator. |
| QMailMessageKey::GreaterThan | 2 | represents the '>' operator. |
| QMailMessageKey::GreaterThanEqual | 3 | represents the '>= operator'. |
| QMailMessageKey::Equal | 4 | represents the '=' operator. |
| QMailMessageKey::NotEqual | 5 | represents the '!=' operator. |
| QMailMessageKey::Contains | 6 | represents an operation in which an associated property is checked to see if it contains a provided value. For most property types this will perform a string based check. For Status type properties this will perform a check to see if a status bit value is set. |
This enum type describes the data query properties of a QMailMessage.
| Constant | Value | Description |
|---|---|---|
| QMailMessageKey::Id | 0x0001 | The ID of the message. |
| QMailMessageKey::Type | 0x0002 | The type of the message. |
| QMailMessageKey::ParentFolderId | 0x0004 | The parent folder ID this message is contained in. |
| QMailMessageKey::Sender | 0x0008 | The message sender address string. |
| QMailMessageKey::Recipients | 0x0010 | The message recipient address string. |
| QMailMessageKey::Subject | 0x0020 | The message subject string. |
| QMailMessageKey::TimeStamp | 0x0040 | The message timestamp |
| QMailMessageKey::Status | 0x0080 | The message status flags. |
| QMailMessageKey::FromAccount | 0x0100 | The name of the account the mesasge was downloaded from. |
| QMailMessageKey::FromMailbox | 0x0200 | The imap mailbox the message was downloaded from. |
| QMailMessageKey::ServerUid | 0x0400 | The IMAP server UID of the message. |
| QMailMessageKey::Size | 0x0800 | The size of the message. |
The Properties type is a typedef for QFlags<Property>. It stores an OR combination of Property values.
Create a QMailFolderKey with specifying matching parameters.
A default-constructed key (one for which isEmpty() returns true) 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.
Construct a QMailMessageKey which defines a query parameter where QMailMessage::Property p is compared using comparison operator c with a value value.
Construct a QMailMessageKey which defines a query parameter where message id's matching those in idList are returned.
Create a copy of the QMailMessageKey other.
Destroys the QMailMessageKey
Returns true if the key remains empty after default construction; otherwise returns false.
Returns true if the value of this key is not the same as the key other. Returns false otherwise.
Returns a key that is the logical AND of this key and the value of key other.
Performs a logical AND with this key and the key other and assigns the result to this key.
Assign the value of the QMailMessageKey other to this.
Returns true if the value of this key is the same as the key other. Returns false otherwise.
Returns a key that is the logical OR of this key and the value of key other.
Performs a logical OR with this key and the key other and assigns the result to this key.
Returns a key that is the logical NOT of the value of this key.
| Copyright © 2008 Nokia | Trademarks | Qtopia 4.3.3 |