|  | Home |

# QMailSearchAction Class Reference

The QMailSearchAction class provides the interface for identifying messages that match a set of search criteria. More...

        #include <QMailSearchAction>

This class is under development and is subject to change.

Inherits QMailServiceAction.

- List of all members, including inherited members

## Public Types

enum | SearchSpecification { Local, Remote }

## Public Functions

| QMailSearchAction ( QObject * parent = 0 )
QMailMessageIdList | matchingMessageIds () const

- 4 public functions inherited from QMailServiceAction
- 29 public functions inherited from QObject

## Public Slots

virtual void | cancelOperation ()
void | searchMessages ( const QMailMessageKey & filter, const QString & bodyText, SearchSpecification spec, const QMailMessageSortKey & sort = QMailMessageSortKey() )

- 1 public slot inherited from QMailServiceAction
- 1 public slot inherited from QObject

## Signals

void | messageIdsMatched ( const QMailMessageIdList & ids )

- 4 signals inherited from QMailServiceAction
- 1 signal inherited from QObject

## Static Public Members

QMailMessageKey | temporaryKey ()

- 4 static public members inherited from QObject

### Additional Inherited Members

- 1 property inherited from QObject
- 1 public type inherited from QObject
- 2 protected functions inherited from QMailServiceAction
- 7 protected functions inherited from QObject
- 2 protected variables inherited from QObject

## Detailed Description

The QMailSearchAction class provides the interface for identifying messages that match a set of search criteria.

QMailSearchAction provides the mechanism for messaging clients to request that the message server perform a search for messages that match the supplied search criteria. For criteria pertaining to message meta data, the message server will search within the locally held meta data. For a textual content criterion, the message server will search locally where the message content is held locally, and on the external server for messages whose content has not been retrieved (provided the external service provides a search facility).

## Member Type Documentation

### enum QMailSearchAction::SearchSpecification

This enum type is specify the form of search that the message server should perform.

Constant | Value | Description
--- | --- | ---
`QMailSearchAction::Local` | `0` | Only the message data stored on the local device should be searched.
`QMailSearchAction::Remote` | `1` | The search should be extended to message data stored on external servers.

## Member Function Documentation

### QMailSearchAction::QMailSearchAction ( QObject * parent = 0 )

Constructs a new search action object with the supplied parent.

### void QMailSearchAction::cancelOperation () `[virtual slot]`

Reimplemented from QMailServiceAction::cancelOperation().

Attempts to cancel the last requested search operation.

### QMailMessageIdList QMailSearchAction::matchingMessageIds () const

Returns the list of message identifiers found to match the search criteria. Unless activity() returns Successful, an empty list is returned.

### void QMailSearchAction::messageIdsMatched ( const QMailMessageIdList & ids ) `[signal]`

This signal is emitted when the messages in ids are discovered to match the criteria of the search in progress.

See also matchingMessageIds().

### void QMailSearchAction::searchMessages ( const QMailMessageKey & filter, const QString & bodyText, SearchSpecification spec, const QMailMessageSortKey & sort = QMailMessageSortKey() ) `[slot]`

Requests that the message server identify all messages that match the criteria specified by filter. If bodyText is non-empty, identified messages must also contain the supplied text in their content.

If spec is Remote, then the external service will be requested to perform the search for messages not stored locally.

If sort is not empty, the external service will return matching messages in the ordering indicated by the sort criterion if possible.

### QMailMessageKey QMailSearchAction::temporaryKey () `[static]`

Returns a key matching messages that are temporary messages existing only as the result of a search action.