|  | Home |

# QMailServiceAction Class Reference

The QMailServiceAction class provides the interface for requesting actions from external message services. More...

        #include <QMailServiceAction>

This class is under development and is subject to change.

Inherits QObject.

Inherited by QMailActionInfo, QMailActionObserver, QMailProtocolAction, QMailRetrievalAction, QMailSearchAction, QMailStorageAction, and QMailTransmitAction.

- List of all members, including inherited members

## Public Types

class | Status `(preliminary)`
enum | Activity { Pending, InProgress, Successful, Failed }
enum | Connectivity { Offline, Connecting, Connected, Disconnected }

## Public Functions

Activity | activity () const
Connectivity | connectivity () const
QPair<uint, uint> | progress () const
const Status | status () const

- 29 public functions inherited from QObject

## Public Slots

virtual void | cancelOperation ()

- 1 public slot inherited from QObject

## Signals

void | activityChanged ( QMailServiceAction::Activity a )
void | connectivityChanged ( QMailServiceAction::Connectivity c )
void | progressChanged ( uint value, uint total )
void | statusChanged ( const QMailServiceAction::Status & s )

- 1 signal inherited from QObject

## Protected Functions

void | setStatus ( Status::ErrorCode c, const QString & t = QString() )
void | setStatus ( Status::ErrorCode c, const QString & t, const QMailAccountId & a, const QMailFolderId & f = QMailFolderId(), const QMailMessageId & m = QMailMessageId() )

- 7 protected functions inherited from QObject

### Additional Inherited Members

- 1 property inherited from QObject
- 1 public type inherited from QObject
- 4 static public members inherited from QObject
- 2 protected variables inherited from QObject

## Detailed Description

The QMailServiceAction class provides the interface for requesting actions from external message services.

QMailServiceAction provides the mechanisms for messaging clients to request actions from external services, and to receive information in response. The details of requests differ for each derived action, and the specific data returned is also variable. However, all actions present the same interface for communicating status, connectivity and progress information.

All actions communicate changes in their operational state by emitting the activityChanged() signal. If the execution of the action requires connectivity to an external service, then changes in connectivity state are emitted via the connectivityChanged() signal. Some actions are able to provide progress information as they execute; these changes are reported via the progressChanged() signal. If error conditions are encountered, the statusChanged() signal is emitted to report the new status.

A user may attempt to cancel an operation after it has been initiated. The cancelOperation() slot is provided for this purpose.

A QMailServiceAction instance supports only a single request at any time. An application may, however, use multiple QMailServiceAction instances to send independent requests concurrently. Each QMailServiceAction instance will report only the changes pertaining to the request that instance delivered. Whether or not concurrent requests are concurrently serviced by the message server depends on whether those requests must be serviced by the same QMailMessageService instance.

See also QMailMessageService.

## Member Type Documentation

### enum QMailServiceAction::Activity

This enum type is used to describe the activity state of the requested action.

Constant | Value | Description
--- | --- | ---
`QMailServiceAction::Pending` | `0` | The action has not yet begun execution.
`QMailServiceAction::InProgress` | `1` | The action is currently executing.
`QMailServiceAction::Successful` | `2` | The action has completed successfully.
`QMailServiceAction::Failed` | `3` | The action could not be completed successfully, and has finished execution.

### enum QMailServiceAction::Connectivity

This enum type is used to describe the connectivity state of the service implementing an action.

Constant | Value | Description
--- | --- | ---
`QMailServiceAction::Offline` | `0` | The service is offline.
`QMailServiceAction::Connecting` | `1` | The service is currently attempting to establish a connection.
`QMailServiceAction::Connected` | `2` | The service is connected.
`QMailServiceAction::Disconnected` | `3` | The service has been disconnected.

## Member Function Documentation

### Activity QMailServiceAction::activity () const

Returns the current activity state of the action.

See also activityChanged().

### void QMailServiceAction::activityChanged ( QMailServiceAction::Activity a ) `[signal]`

This signal is emitted when the activity status of the action changes, with the new state described by a.

See also activity().

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

Attempts to cancel the last requested operation.

### Connectivity QMailServiceAction::connectivity () const

Returns the current connectivity state of the service implementing this action.

See also connectivityChanged().

### void QMailServiceAction::connectivityChanged ( QMailServiceAction::Connectivity c ) `[signal]`

This signal is emitted when the connectivity status of the service performing the action changes, with the new state described by c.

See also connectivity().

### QPair<uint, uint> QMailServiceAction::progress () const

Returns the current progress of the service action.

See also progressChanged().

### void QMailServiceAction::progressChanged ( uint value, uint total ) `[signal]`

This signal is emitted when the progress of the action changes, with the new state described by value and total.

See also progress().

### void QMailServiceAction::setStatus ( Status::ErrorCode c, const QString & t = QString() ) `[protected]`

Set the current status so that QMailServiceAction::Status::errorCode errorCode is set to c and QMailServiceAction::Status::text text is set to t.

See also status().

### void QMailServiceAction::setStatus ( Status::ErrorCode c, const QString & t, const QMailAccountId & a, const QMailFolderId & f = QMailFolderId(), const QMailMessageId & m = QMailMessageId() ) `[protected]`

Set the current status so that QMailServiceAction::Status::errorCode errorCode is set to c, QMailServiceAction::Status::text text is set to t, QMailServiceAction::Status::accountId accountId is set to a, QMailServiceAction::Status::folderId folderId is set to f and QMailServiceAction::Status::messageId messageId is set to m.

### const Status QMailServiceAction::status () const

Returns the current status of the service action.

See also setStatus() and statusChanged().

### void QMailServiceAction::statusChanged ( const QMailServiceAction::Status & s ) `[signal]`

This signal is emitted when the error status of the action changes, with the new status described by s.

See also status().