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 State { InactiveState, ActiveState, CanceledState, FinishedState }

Public Functions

QContactAbstractRequest ()
virtual ~QContactAbstractRequest ()
QContactManager::Error error () const
bool isActive () const
bool isCanceled () const
bool isFinished () const
bool isInactive () const
QContactManager * manager () const
void setManager ( QContactManager * manager )
State state () const
RequestType type () const

Public Slots

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

Signals

void resultsAvailable ()
void stateChanged ( QContactAbstractRequest::State newState )

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::State

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

ConstantValueDescription
QContactAbstractRequest::InactiveState0Operation not yet started
QContactAbstractRequest::ActiveState1Operation started, not yet finished
QContactAbstractRequest::CanceledState2Operation is finished due to cancellation
QContactAbstractRequest::FinishedState3Operation 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

bool QContactAbstractRequest::isActive () const

Returns true if the request is in the QContactAbstractRequest::ActiveState state; otherwise, returns false

See also state().

bool QContactAbstractRequest::isCanceled () const

Returns true if the request is in the QContactAbstractRequest::CanceledState; otherwise, returns false

See also state().

bool QContactAbstractRequest::isFinished () const

Returns true if the request is in the QContactAbstractRequest::FinishedState; otherwise, returns false

See also state().

bool QContactAbstractRequest::isInactive () const

Returns true if the request is in the QContactAbstractRequest::InactiveState state; otherwise, returns false

See also state().

QContactManager * QContactAbstractRequest::manager () const

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

See also setManager().

void QContactAbstractRequest::resultsAvailable ()   [signal]

This signal is emitted when new results are available. Results can include the operation error which may be accessed via error(), or derived-class-specific results which are accessible through the derived class API.

See also error().

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.

State QContactAbstractRequest::state () const

Returns the current state of the request.

void QContactAbstractRequest::stateChanged ( QContactAbstractRequest::State newState )   [signal]

This signal is emitted when the state of the request is changed. The new state of the request will be contained in newState.

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. Some backends are unable to support this operation safely, and will return false immediately.


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