Home · All Classes · Grouped Classes · Annotated · Functions

QMailFolderKey Class Reference

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

    #include <QMailFolderKey>

This class is under development and is subject to change.

Public Types

Public Functions


Detailed Description

The QMailFolderKey class defines the parameters used for querying a subset of all available mail 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");
    QMailIdList results = QMailStore::instance()->queryFolders(inboxKey | smsKey);

To query all subfolders with name "foo" for a given folder parent:

    \\assuming parent has been retrieved from the mail store.
    QMailFolder parent;
    QMailFolderKey nameKey(QMailFolderKey::Name,"foo");
    QMailFolderKey childKey(QMailFolderKey::ParentId,parent.id());
    QMailIdList results = QMailStore::instance()->queryFolders(nameKey & childKey);

See also QMailStore and QMailMessageKey.


Member Type Documentation

enum QMailFolderKey::Operand

Defines the comparison operators that can be used to comapare QMailFolder::Property elements with user sepecified values.

ConstantValueDescription
QMailFolderKey::LessThan0represents the '<' operator.
QMailFolderKey::LessThanEqual1represents the '<=' operator.
QMailFolderKey::GreaterThan2represents the '>' operator.
QMailFolderKey::GreaterThanEqual3represents the '>= operator'.
QMailFolderKey::Equal4represents the '=' operator.
QMailFolderKey::NotEqual5represents the '!=' operator.
QMailFolderKey::Contains6represents 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 flag bit value is set.

enum QMailFolderKey::Property

This enum type describes the queryable data properties of a QMailFolder.

ConstantValueDescription
QMailFolderKey::Id0The ID of the folder.
QMailFolderKey::Name1The name of the folder.
QMailFolderKey::ParentId2the ID of the parent folder for a given folder.


Member Function Documentation

QMailFolderKey::QMailFolderKey ()

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.

QMailFolderKey::QMailFolderKey ( const Property & p, const QVariant & value, const Operand & c = Equal )

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

QMailFolderKey::QMailFolderKey ( const QMailIdList & ids )

Construct a QMailFolderKey which defines a query parameter where folder id's matching those in ids are returned.

QMailFolderKey::QMailFolderKey ( const QMailFolderKey & other )

Create a copy of the QMailFolderKey other.

QMailFolderKey::~QMailFolderKey ()   [virtual]

Destroys this QMailFolderKey.

bool QMailFolderKey::isEmpty () const

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

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

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

QMailFolderKey QMailFolderKey::operator& ( const QMailFolderKey & other ) const

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

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

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

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

Assign the value of the QMailFolderKey other to this.

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

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

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

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

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

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

QMailFolderKey QMailFolderKey::operator~ () const

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


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3