|  | Home |

# QMailFolderSortKey Class Reference

The QMailFolderSortKey class defines the parameters used for sorting a subset of queried folders from the mail store. More...

        #include <QMailFolderSortKey>

This class is under development and is subject to change.

- List of all members, including inherited members

## Public Types

typedef | ArgumentType
enum | Property { Id, Path, ParentFolderId, ParentAccountId, ..., ServerUndiscoveredCount }

## Public Functions

| QMailFolderSortKey ()
| QMailFolderSortKey ( const QMailFolderSortKey & other )
virtual | ~QMailFolderSortKey ()
const QList<ArgumentType> & | arguments () const
void | deserialize ( Stream & stream )
bool | isEmpty () const
void | serialize ( Stream & stream ) const
bool | operator!= ( const QMailFolderSortKey & other ) const
QMailFolderSortKey | operator& ( const QMailFolderSortKey & other ) const
QMailFolderSortKey & | operator&= ( const QMailFolderSortKey & other )
QMailFolderSortKey & | operator= ( const QMailFolderSortKey & other )
bool | operator== ( const QMailFolderSortKey & other ) const

## Static Public Members

QMailFolderSortKey | displayName ( Qt::SortOrder order = Qt::AscendingOrder )
QMailFolderSortKey | id ( Qt::SortOrder order = Qt::AscendingOrder )
QMailFolderSortKey | parentAccountId ( Qt::SortOrder order = Qt::AscendingOrder )
QMailFolderSortKey | parentFolderId ( Qt::SortOrder order = Qt::AscendingOrder )
QMailFolderSortKey | path ( Qt::SortOrder order = Qt::AscendingOrder )
QMailFolderSortKey | serverCount ( Qt::SortOrder order = Qt::AscendingOrder )
QMailFolderSortKey | serverUndiscoveredCount ( Qt::SortOrder order = Qt::AscendingOrder )
QMailFolderSortKey | serverUnreadCount ( Qt::SortOrder order = Qt::AscendingOrder )
QMailFolderSortKey | status ( quint64 mask, Qt::SortOrder order = Qt::DescendingOrder )

## Detailed Description

The QMailFolderSortKey class defines the parameters used for sorting a subset of queried folders from the mail store.

A QMailFolderSortKey is composed of a folder property to sort and a sort order. The QMailFolderSortKey class is used in conjunction with the QMailStore::queryFolders() function to sort folder results according to the criteria defined by the sort key.

For example: To create a query for all folders sorted by the path in ascending order:

        QMailFolderSortKey sortKey(QMailFolderSortKey::path(Qt::Ascending));
        QMailIdList results = QMailStore::instance()->queryFolders(QMailFolderKey(), sortKey);

See also QMailStore and QMailFolderKey.

## Member Type Documentation

### typedef QMailFolderSortKey::ArgumentType

Defines the type used to represent a single sort criterion of a folder sort key.

### enum QMailFolderSortKey::Property

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

Constant | Value | Description
--- | --- | ---
`QMailFolderSortKey::Id` | `0` | The ID of the folder.
`QMailFolderSortKey::Path` | `1` | The path of the folder in native form.
`QMailFolderSortKey::ParentFolderId` | `2` | The ID of the parent folder for a given folder.
`QMailFolderSortKey::ParentAccountId` | `3` | The ID of the parent account for a given folder.
`QMailFolderSortKey::DisplayName` | `4` | The name of the folder, designed for display to users.
`QMailFolderSortKey::Status` | `5` | The status value of the folder.
`QMailFolderSortKey::ServerCount` | `6` | The number of messages reported to be on the server for the folder.
`QMailFolderSortKey::ServerUnreadCount` | `7` | The number of unread messages reported to be on the server for the folder.
`QMailFolderSortKey::ServerUndiscoveredCount` | `8` | The number of undiscovered messages reported to be on the server for the folder.

## Member Function Documentation

### QMailFolderSortKey::QMailFolderSortKey ()

Create a QMailFolderSortKey with specifying matching parameters.

A default-constructed key (one for which isEmpty() returns true) sorts no folders.

The result of combining an empty key with a non-empty key is the same as the original non-empty key.

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

### QMailFolderSortKey::QMailFolderSortKey ( const QMailFolderSortKey & other )

Create a copy of the QMailFolderSortKey other.

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

Destroys this QMailFolderSortKey.

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

Returns the list of arguments to this QMailFolderSortKey.

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

Reads the contents of a QMailFolderSortKey from stream.

### QMailFolderSortKey QMailFolderSortKey::displayName ( Qt::SortOrder order = Qt::AscendingOrder ) `[static]`

Returns a key that sorts folders by their display name, according to order.

See also QMailFolder::displayName().

### QMailFolderSortKey QMailFolderSortKey::id ( Qt::SortOrder order = Qt::AscendingOrder ) `[static]`

Returns a key that sorts folders by their identifiers, according to order.

See also QMailFolder::id().

### bool QMailFolderSortKey::isEmpty () const

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

### QMailFolderSortKey QMailFolderSortKey::parentAccountId ( Qt::SortOrder order = Qt::AscendingOrder ) `[static]`

Returns a key that sorts folders by their parent accounts' identifiers, according to order.

See also QMailFolder::parentAccountId().

### QMailFolderSortKey QMailFolderSortKey::parentFolderId ( Qt::SortOrder order = Qt::AscendingOrder ) `[static]`

Returns a key that sorts folders by their parent folders' identifiers, according to order.

See also QMailFolder::parentFolderId().

### QMailFolderSortKey QMailFolderSortKey::path ( Qt::SortOrder order = Qt::AscendingOrder ) `[static]`

Returns a key that sorts folders by their paths, according to order.

See also QMailFolder::path().

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

Writes the contents of a QMailFolderSortKey to a stream.

### QMailFolderSortKey QMailFolderSortKey::serverCount ( Qt::SortOrder order = Qt::AscendingOrder ) `[static]`

Returns a key that sorts folders by their message count on server, according to order.

See also QMailFolder::status().

### QMailFolderSortKey QMailFolderSortKey::serverUndiscoveredCount ( Qt::SortOrder order = Qt::AscendingOrder ) `[static]`

Returns a key that sorts folders by their message undiscovered count on server, according to order.

See also QMailFolder::status().

### QMailFolderSortKey QMailFolderSortKey::serverUnreadCount ( Qt::SortOrder order = Qt::AscendingOrder ) `[static]`

Returns a key that sorts folders by their message unread count on server, according to order.

See also QMailFolder::status().

### QMailFolderSortKey QMailFolderSortKey::status ( quint64 mask, Qt::SortOrder order = Qt::DescendingOrder ) `[static]`

Returns a key that sorts folders by comparing their status value bitwise ANDed with mask, according to order.

See also QMailFolder::status().

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

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

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

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

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

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

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

Assign the value of the QMailFolderSortKey other to this.

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

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