Home · All Classes · All Functions ·

QContactAbstractRequest Class Reference

The QContactAbstractRequest class provides a mechanism for asynchronous requests to be made of a manager if it supports them. More...

    #include <QContactAbstractRequest>

Inherits QObject.

Inherited by QContactDetailDefinitionFetchRequest, QContactDetailDefinitionRemoveRequest, QContactDetailDefinitionSaveRequest, QContactFetchRequest, QContactLocalIdFetchRequest, QContactRelationshipFetchRequest, QContactRelationshipRemoveRequest, QContactRelationshipSaveRequest, QContactRemoveRequest, and QContactSaveRequest.


Public Types

enum RequestType { InvalidRequest, ContactFetchRequest, ContactLocalIdFetchRequest, ContactRemoveRequest, ..., RelationshipSaveRequest }
enum Status { Inactive, Active, Cancelling, Cancelled, Finished }

Public Functions

QContactAbstractRequest ()
virtual ~QContactAbstractRequest ()
QContactManager::Error error () const
QList<QContactManager::Error> errors () const
bool isActive () const
bool isFinished () const
QContactManager * manager () const
void setManager ( QContactManager * manager )
Status status () const
RequestType type () const

Public Slots

bool cancel ()
bool start ()
bool waitForFinished ( int msecs = 0 )
bool waitForProgress ( int msecs = 0 )

Protected Functions

QContactAbstractRequest ( QContactAbstractRequestPrivate * otherd )

Additional Inherited Members


Detailed Description

The QContactAbstractRequest class provides a mechanism for asynchronous requests to be made of a manager if it supports them.

It allows a client to asynchronously request some functionality of a particular QContactManager.


Member Type Documentation

enum QContactAbstractRequest::RequestType

Enumerates the various possible types of asynchronous requests

ConstantValueDescription
QContactAbstractRequest::InvalidRequest0An invalid request
QContactAbstractRequest::ContactFetchRequest1A request to fetch a list of contacts
QContactAbstractRequest::ContactLocalIdFetchRequest2A request to fetch a list of local contact ids
QContactAbstractRequest::ContactRemoveRequest3A request to remove a list of contacts
QContactAbstractRequest::ContactSaveRequest4A request to save a list of contacts
QContactAbstractRequest::DetailDefinitionFetchRequest5A request to fetch a collection of detail definitions
QContactAbstractRequest::DetailDefinitionRemoveRequest6A request to remove a list of detail definitions
QContactAbstractRequest::DetailDefinitionSaveRequest7A request to save a list of detail definitions
QContactAbstractRequest::RelationshipFetchRequest8A request to fetch relationships between contacts
QContactAbstractRequest::RelationshipRemoveRequest9A request to remove any relationships which match the request criteria
QContactAbstractRequest::RelationshipSaveRequest10A request to save a list of relationships

enum QContactAbstractRequest::Status

Enumerates the various states that a request may be in at any given time

ConstantValueDescription
QContactAbstractRequest::Inactive0Operation not yet started
QContactAbstractRequest::Active1Operation started, not yet finished
QContactAbstractRequest::Cancelling2Operation started then cancelled, not yet finished
QContactAbstractRequest::Cancelled3Operation is finished due to cancellation
QContactAbstractRequest::Finished4Operation successfully completed


Member Function Documentation

QContactAbstractRequest::QContactAbstractRequest ()

Constructs a new, invalid asynchronous request

QContactAbstractRequest::QContactAbstractRequest ( QContactAbstractRequestPrivate * otherd )   [protected]

Constructs a new request from the given request data otherd

QContactAbstractRequest::~QContactAbstractRequest ()   [virtual]

Cleans up the memory used by this request

bool QContactAbstractRequest::cancel ()   [slot]

Attempts to cancel the request. Returns false if the request is not in the QContactAbstractRequest::Active state, or if the request is unable to be cancelled by the manager engine; otherwise returns true.

QContactManager::Error QContactAbstractRequest::error () const

Returns the overall error of the most recent asynchronous operation

QList<QContactManager::Error> QContactAbstractRequest::errors () const

Returns the list of errors which occurred during the most recent asynchronous operation. Each individual error in the list corresponds to a result in the result list.

bool QContactAbstractRequest::isActive () const

Returns true if the request is pending, processing or cancelling; otherwise, returns false.

See also status().

bool QContactAbstractRequest::isFinished () const

Returns true if the request is finished or cancelled; otherwise, returns false.

See also status().

QContactManager * QContactAbstractRequest::manager () const

Returns a pointer to the manager of which this request instance requests operations

See also setManager().

void QContactAbstractRequest::setManager ( QContactManager * manager )

Sets the manager of which this request instance requests operations to manager

See also manager().

bool QContactAbstractRequest::start ()   [slot]

Attempts to start the request. Returns false if the request is not in the QContactAbstractRequest::Inactive, QContactAbstractRequest::Finished or QContactAbstractRequest::Cancelled states, or if the request was unable to be performed by the manager engine; otherwise returns true.

Status QContactAbstractRequest::status () const

Returns the current status of the request.

See also isFinished() and isActive().

RequestType QContactAbstractRequest::type () const

Returns the type of this asynchronous request

bool QContactAbstractRequest::waitForFinished ( int msecs = 0 )   [slot]

Blocks until the request has been completed by the manager engine, or until msecs milliseconds has elapsed. If msecs is zero, this function will block indefinitely. Returns true if the request was cancelled or completed successfully within the given period, otherwise false.

bool QContactAbstractRequest::waitForProgress ( int msecs = 0 )   [slot]

Blocks until the manager engine signals that more partial results are available for the request, or until msecs milliseconds has elapsed. If msecs is zero, this function will block indefinitely. Returns true if the request was cancelled or more partial results were made available within the given period, otherwise false.


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Mobility Project 1.0.0 (Technical Preview)