Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QMailFolderKey class defines the parameters used for querying a subset of all available folders from the mail store. More...
#include <QMailFolderKey>
This class is under development and is subject to change.
The QMailFolderKey class defines the parameters used for querying a subset of all available folders from the mail store.
A QMailFolderKey is composed of a folder property, an optional comparison operator and a comparison value. The QMailFolderKey class is used in conjunction with the QMailStore::queryFolders() and QMailStore::countFolders() functions to filter results which meet the criteria defined by the key.
QMailFolderKey's can be combined using the logical operators (&), (|) and (~) to build more sophisticated queries.
For example:
To create a query for all folders named "inbox" or "sms":
QMailFolderKey inboxKey(QMailFolderKey::Name, "inbox"); QMailFolderKey smsKey(QMailFolderKey::Name, "sms"); QMailFolderIdList results = QMailStore::instance()->queryFolders(inboxKey | smsKey);
To query all folders with name "foo" for a specified account:
QMailFolderIdList fooFolders(const QMailAccountId& accountId) { QMailFolderKey nameKey(QMailFolderKey::Name, "foo"); QMailFolderKey accountKey(QMailFolderKey::ParentAccountId, accountId); return QMailStore::instance()->queryFolders(nameKey & accountKey); }
See also QMailStore and QMailFolder.
This enum type describes the queryable data properties of a QMailFolder.
Constant | Value | Description |
---|---|---|
QMailFolderKey::Id | 0 | The ID of the folder. |
QMailFolderKey::Name | 1 | The name of the folder in native form. |
QMailFolderKey::ParentId | 2 | The ID of the parent folder for a given folder. |
QMailFolderKey::ParentAccountId | 3 | The ID of the parent account for this folder. |
QMailFolderKey::DisplayName | 4 | The name of the folder, designed for display to users. |
QMailFolderKey::Status | 5 | The status value of the folder. |
QMailFolderKey::AncestorFolderIds | 6 | The set of IDs of folders which are direct or indirect parents of this folder. |
Create a QMailFolderKey with specifying matching parameters.
A default-constructed key (one for which isEmpty() returns true) matches all folders. The logical negation of an empty key also matches all folders.
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 QMailFolderKey which defines a query parameter where QMailFolder::Property p is compared using comparison operator c with a value value.
Construct a QMailFolderKey which defines a query parameter where folder id's matching those in ids are returned.
Create a copy of the QMailFolderKey other.
Destroys this QMailFolderKey.
Reads the contents of a QMailFolderKey from stream.
Returns true if the key remains empty after default construction; otherwise returns false.
See also isNonMatching().
Returns true if the key is a non-matching key; otherwise returns false.
See also isEmpty().
Returns a key that does not match any folders (unlike an empty key).
See also isNonMatching() and isEmpty().
Writes the contents of a QMailFolderKey to a stream.
Returns the QVariant representation of this QMailFolderKey.
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 QMailFolderKey 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 © 2009 Nokia | Trademarks | Qt Extended 4.4.3 |