Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QMailAccountKey Class Reference
[QtMessagingModule, QtPimModule]

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

    #include <QMailAccountKey>

This class is under development and is subject to change.

Public Types

Public Functions

Static Public Members


Detailed Description

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

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

QMailAccountKey's can be combined using the logical operators (&), (|) and (~) to build more sophisticated queries.

For example:

To create a query for all email accounts:

    QMailAccountKey emailKey(QMailAccountKey::MessageType, QMailMessage::Email);
    QMailAccountIdList results = QMailStore::instance()->queryAccounts(emailKey);

To query all accounts handling SMS or MMS messages:

    QMailAccountKey mmsAccount(QMailAccountKey::MessageType, QMailMessage::Mms);
    QMailAccountKey smsAccount(QMailAccountKey::MessageType, QMailMessage::Sms);
    QMailAccountIdList results = QMailStore::instance()->queryAccounts(mmsAccount | smsAccount);

See also QMailStore and QMailAccount.


Member Type Documentation

enum QMailAccountKey::Property

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

ConstantValueDescription
QMailAccountKey::Id0The ID of the account.
QMailAccountKey::Name1The name of the account.
QMailAccountKey::MessageType2The type of messages handled by the account.
QMailAccountKey::EmailAddress3The email address associated with this account.


Member Function Documentation

QMailAccountKey::QMailAccountKey ()

Create a QMailAccountKey with specifying matching parameters.

A default-constructed key (one for which isEmpty() returns true) matches all accounts. The logical negation of an empty key also matches all accounts.

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.

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

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

QMailAccountKey::QMailAccountKey ( const QMailAccountIdList & ids )

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

QMailAccountKey::QMailAccountKey ( const QMailAccountKey & other )

Create a copy of the QMailAccountKey other.

QMailAccountKey::~QMailAccountKey ()   [virtual]

Destroys this QMailAccountKey.

void QMailAccountKey::deserialize ( Stream & stream )

Reads the contents of a QMailAccountKey from stream.

bool QMailAccountKey::isEmpty () const

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

See also isNonMatching().

bool QMailAccountKey::isNonMatching () const

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

See also isEmpty().

QMailAccountKey QMailAccountKey::nonMatchingKey ()   [static]

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

See also isNonMatching() and isEmpty().

void QMailAccountKey::serialize ( Stream & stream ) const

Writes the contents of a QMailAccountKey to a stream.

QMailAccountKey::operator QVariant () const

Returns the QVariant representation of this QMailAccountKey.

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

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

QMailAccountKey QMailAccountKey::operator& ( const QMailAccountKey & other ) const

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

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

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

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

Assign the value of the QMailAccountKey other to this.

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

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

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

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

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

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

QMailAccountKey QMailAccountKey::operator~ () const

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


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3