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

QDSAction Class Reference
[QtBaseModule]

The QDSAction class provides an interface for requesting Qt Extended Data Sharing (QDS) services. More...

    #include <QDSAction>

Inherits QObject.

Public Types

Public Functions

Signals

Additional Inherited Members


Detailed Description

The QDSAction class provides an interface for requesting Qt Extended Data Sharing (QDS) services.

Applications can use the QDSAction class to make a request for a QDS service. The request can be made either synchronously (using QDSAction::exec()) or asynchronously (using QDSAction::invoke()).

See also QDSServiceInfo and Qt Extended Data Sharing (QDS).


Member Type Documentation

enum QDSAction::ResponseCode

This enum describes response codes for synchronous requests.

ConstantValueDescription
QDSAction::Invalid0Response code has not been set.
QDSAction::Complete1The request was processed correctly.
QDSAction::CompleteData2The request was processed correctly, and response data was received.
QDSAction::Error3An error occured, use QDSAction::errorMessage() to view the error message.


Member Function Documentation

QDSAction::QDSAction ( QObject * parent = 0 )

Constructs an empty QDSAction object and attaches it to parent.

QDSAction::QDSAction ( const QDSAction & other )

Constructs a deep copy of other.

QDSAction::QDSAction ( const QString & name, const QString & service, QObject * parent = 0 )

Constructs a QDSAction object for the QDS service name and the Qt Extended service service. The action is attached to parent.

QDSAction::QDSAction ( const QDSServiceInfo & serviceInfo, QObject * parent = 0 )

Constructs a QDSAction object for the service described in serviceInfo and attaches to parent.

QDSAction::~QDSAction ()

Destroys the action.

void QDSAction::error ( const QUniqueId & actionId, const QString & message )   [signal]

This signal is emitted when an error message message is received for the action identified by actionId.

QString QDSAction::errorMessage () const

Returns any error message generated during the request. Errors are reported from either QDSAction or the provider application, and are reported through QDSData::error() or the return value of QDSData::exec(). If no error has been reported a null string will be returned.

int QDSAction::exec ()

Synchronously performs the QDS service request. The return value provides the result of the request, see QDSAction::ResponseCode.

This method should only be used for QDS services which don't have request data, as discussed in QDSServiceInfo, otherwise an error will be generated.

Warning: This call will block until a response has been received from the QDS service or the request times out.

int QDSAction::exec ( const QDSData & requestData, const QByteArray & auxiliary = QByteArray() )

This is an overloaded member function, provided for convenience.

Synchronously performs the QDS service request with requestData. The return value provides the result of the request, see QDSAction::ResponseCode.

The request may also contain auxiliary data for supplementary information which may be required for the request but does not conceptually belong to requestData.

This method should only be used for QDS services which have request data, as discussed in QDSServiceInfo, otherwise an error will be generated.

Warning: This call will block until the response has been received from the QDS service or the request times out.

QUniqueId QDSAction::id () const

Returns the unique identifier for the QDSAction

bool QDSAction::invoke ()

Asynchronously initiates the QDS service request. Depending on the outcome of the request, the response from the QDS service provider is given by one of QDSData::response() or QDSData::error() signals.

This method should only be used for QDS services which don't have request data, as discussed in QDSServiceInfo, otherwise an error will be generated.

Returns true on successful completion of the request; otherwise returns false.

bool QDSAction::invoke ( const QDSData & requestData, const QByteArray & auxiliary = QByteArray() )

This is an overloaded member function, provided for convenience.

Asynchronously initiates the QDS service request with requestData. Depending on the outcome of the request, the response from the QDS service provider is given by one of QDSData::response() or QDSData::error() signals.

The request may also contain auxiliary data for supplementary information, which may be required for the request but does not conceptually belong to requestData.

This method should only be used for QDS services which have request data, as discussed in QDSServiceInfo, otherwise an error will be generated.

Returns true on successful completion of the request; otherwise returns false.

bool QDSAction::isActive () const

Returns true if the request is still being processed by the QDS service provider; otherwise returns false.

bool QDSAction::isAvailable () const

Returns true if the QDSAction object represents an available QDS service; otherwise returns false. The requirements of an available QDS service are discussed in QDSServiceInfo.

bool QDSAction::isValid () const

Returns true if the QDSAction object represents a valid QDS service; otherwise returns false. The requirements of a valid QDS service are discussed in QDSServiceInfo.

void QDSAction::response ( const QUniqueId & actionId )   [signal]

This signal is emitted when a response is received from the service provider for the action identified by actionId.

void QDSAction::response ( const QUniqueId & actionId, const QDSData & responseData )   [signal]

This is an overloaded member function, provided for convenience.

This signal is emitted when a response is received from the service provider which contains the response data responseData for the action identified by actionId.

QDSData QDSAction::responseData () const

Returns the QDSData generated by the request.

const QDSServiceInfo & QDSAction::serviceInfo () const

Returns the QDSServiceInfo object which describes the QDS service being utilised.

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

Makes a deep copy of other and assigns it to this QDSAction object. Returns a reference to this QDSAction object.


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3