|  | Home |

# QMailThreadKey Class Reference

The QMailThreadKey class defines the parameters used for querying a subset of all message threads from the mail store. More...

        #include <QMailThreadKey>

This class is under development and is subject to change.

- List of all members, including inherited members

## Public Types

typedef | ArgumentType
enum | Property { Id, ServerUid, MessageCount, UnreadCount, Custom }

## Public Functions

| QMailThreadKey ()
| QMailThreadKey ( const QMailThreadKey & other )
virtual | ~QMailThreadKey ()
const QList<ArgumentType> & | arguments () const
QMailKey::Combiner | combiner () const
void | deserialize ( Stream & stream )
bool | isEmpty () const
bool | isNegated () const
bool | isNonMatching () const
void | serialize ( Stream & stream ) const
const QList<QMailThreadKey> & | subKeys () const
| operator QVariant () const
bool | operator!= ( const QMailThreadKey & other ) const
QMailThreadKey | operator& ( const QMailThreadKey & other ) const
const QMailThreadKey & | operator&= ( const QMailThreadKey & other )
const QMailThreadKey & | operator= ( const QMailThreadKey & other )
bool | operator== ( const QMailThreadKey & other ) const
QMailThreadKey | operator| ( const QMailThreadKey & other ) const
const QMailThreadKey & | operator|= ( const QMailThreadKey & other )
QMailThreadKey | operator~ () const

## Static Public Members

QMailThreadKey | id ( const QMailThreadId & id, QMailDataComparator::EqualityComparator cmp = QMailDataComparator::Equal )
QMailThreadKey | id ( const QMailThreadIdList & ids, QMailDataComparator::InclusionComparator cmp = QMailDataComparator::Includes )
QMailThreadKey | id ( const QMailThreadKey & key, QMailDataComparator::InclusionComparator cmp = QMailDataComparator::Includes )
QMailThreadKey | nonMatchingKey ()
QMailThreadKey | serverUid ( const QString & uid, QMailDataComparator::EqualityComparator cmp = QMailDataComparator::Equal )
QMailThreadKey | serverUid ( const QString & uid, QMailDataComparator::InclusionComparator cmp )
QMailThreadKey | serverUid ( const QStringList & uids, QMailDataComparator::InclusionComparator cmp = QMailDataComparator::Includes )

## Detailed Description

The QMailThreadKey class defines the parameters used for querying a subset of all message threads from the mail store.

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

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

See also QMailStore and QMailThread.

## Member Type Documentation

### typedef QMailThreadKey::ArgumentType

Defines the type used to represent a single criterion of a message filter.

Synonym for QMailThreadKeyArgument<QMailThreadKey::Property>.

### enum QMailThreadKey::Property

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

Constant | Value | Description
--- | --- | ---
`QMailThreadKey::Id` | `( 1<<0 )` | The ID of the thread.
`QMailThreadKey::ServerUid` | `( 1<<1 )` | The ServerUid of thread.
`QMailThreadKey::MessageCount` | `( 1<<2 )` | The number of messages in the thread
`QMailThreadKey::UnreadCount` | `( 1<<3 )` | The number of unread messages in the thread.
`QMailThreadKey::Custom` | `( 1<<4 )` | For internal use, may be removed.

## Member Function Documentation

### QMailThreadKey::QMailThreadKey ()

Creates a QMailThreadKey without specifying matching parameters.

A default-constructed key (one for which isEmpty() returns true) matches all threads.

See also isEmpty().

### QMailThreadKey::QMailThreadKey ( const QMailThreadKey & other )

Creates a copy of the QMailThreadKey other.

### QMailThreadKey::~QMailThreadKey () `[virtual]`

Destroys this QMailThreadKey.

### const QList<ArgumentType> & QMailThreadKey::arguments () const

Returns the list of arguments to this QMailThreadKey.

### QMailKey::Combiner QMailThreadKey::combiner () const

Returns the combiner used to combine arguments or sub keys of this QMailThreadKey.

### void QMailThreadKey::deserialize ( Stream & stream )

Reads the contents of a QMailThradKey from stream.

### QMailThreadKey QMailThreadKey::id ( const QMailThreadId & id, QMailDataComparator::EqualityComparator cmp = QMailDataComparator::Equal ) `[static]`

Returns a key matching threads whose identifier matches id, according to cmp.

See also QMailFolder::id().

### QMailThreadKey QMailThreadKey::id ( const QMailThreadIdList & ids, QMailDataComparator::InclusionComparator cmp = QMailDataComparator::Includes ) `[static]`

Returns a key matching threads whose identifier is a member of ids, according to cmp.

See also QMailThread::id().

### QMailThreadKey QMailThreadKey::id ( const QMailThreadKey & key, QMailDataComparator::InclusionComparator cmp = QMailDataComparator::Includes ) `[static]`

Returns a key matching thread whose identifier is a member of the set yielded by key, according to cmp.

See also QMailThread::id().

### bool QMailThreadKey::isEmpty () const

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

An empty key matches all threads.

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

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

See also isNonMatching().

### bool QMailThreadKey::isNegated () const

Returns true if the key's criteria should be negated in application.

### bool QMailThreadKey::isNonMatching () const

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

A non-matching key does not match any threads.

The result of ANDing a non-matching key with a matching key is a non-matching key. The result of ORing a non-matching key with a matching key is the original matching key.

The result of combining two non-matching keys is a non-matching key.

See also nonMatchingKey() and isEmpty().

### QMailThreadKey QMailThreadKey::nonMatchingKey () `[static]`

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

See also isNonMatching() and isEmpty().

### void QMailThreadKey::serialize ( Stream & stream ) const

Writes the contents of a QMailThreadKey to a stream.

### QMailThreadKey QMailThreadKey::serverUid ( const QString & uid, QMailDataComparator::EqualityComparator cmp = QMailDataComparator::Equal ) `[static]`

Returns a key matching threads whose serverUid matches uid, according to cmp.

See also QMailThread::serverUid().

### QMailThreadKey QMailThreadKey::serverUid ( const QString & uid, QMailDataComparator::InclusionComparator cmp ) `[static]`

Returns a key matching threads whose serverUid matches the substring uid, according to cmp.

See also QMailThread::serverUid().

### QMailThreadKey QMailThreadKey::serverUid ( const QStringList & uids, QMailDataComparator::InclusionComparator cmp = QMailDataComparator::Includes ) `[static]`

Returns a key matching threads whose serverUid is a member of uids, according to cmp.

See also QMailThread::serverUid().

### const QList<QMailThreadKey> & QMailThreadKey::subKeys () const

Returns the list of sub keys held by this QMailThreadKey.

### QMailThreadKey::operator QVariant () const

Returns the QVariant representation of this QMailFolderKey.

### bool QMailThreadKey::operator!= ( const QMailThreadKey & other ) const

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

### QMailThreadKey QMailThreadKey::operator& ( const QMailThreadKey & other ) const

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

### const QMailThreadKey & QMailThreadKey::operator&= ( const QMailThreadKey & other )

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

### const QMailThreadKey & QMailThreadKey::operator= ( const QMailThreadKey & other )

Assign the value of the QMailThreadKey other to this.

### bool QMailThreadKey::operator== ( const QMailThreadKey & other ) const

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

### QMailThreadKey QMailThreadKey::operator| ( const QMailThreadKey & other ) const

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

### const QMailThreadKey & QMailThreadKey::operator|= ( const QMailThreadKey & other )

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

### QMailThreadKey QMailThreadKey::operator~ () const

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

If this key is empty, the result will be a non-matching key; if this key is non-matching, the result will be an empty key.

See also isEmpty() and isNonMatching().