Qt Mobility Reference Documentation

QOrganizerItemAbstractRequest Class Reference

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

 #include <QOrganizerItemAbstractRequest>

Inherited by QOrganizerCollectionFetchRequest, QOrganizerCollectionLocalIdFetchRequest, QOrganizerCollectionRemoveRequest, QOrganizerCollectionSaveRequest, QOrganizerItemDetailDefinitionFetchRequest, QOrganizerItemDetailDefinitionRemoveRequest, QOrganizerItemDetailDefinitionSaveRequest, QOrganizerItemFetchRequest, QOrganizerItemInstanceFetchRequest, QOrganizerItemLocalIdFetchRequest, QOrganizerItemRemoveRequest, and QOrganizerItemSaveRequest.


Public Types

enum RequestType { InvalidRequest, ItemInstanceFetchRequest, ItemFetchRequest, ItemLocalIdFetchRequest, ..., DetailDefinitionSaveRequest }
enum State { InactiveState, ActiveState, CanceledState, FinishedState }

Public Functions

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

Public Slots

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

Signals

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

Detailed Description

The QOrganizerItemAbstractRequest 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 QOrganizerItemManager. Instances of the class will emit signals when the state of the request changes, or when more results become available.

Clients should not attempt to create instances of this class directly, but should instead use the use-case-specific classes derived from this class.

After creating any sort of request, the client retains ownership and must delete the request to avoid leaking memory. The client may either do this directly (if not within a slot connected to a signal emitted by the request) or by using the deleteLater() slot to schedule the request for deletion when control returns to the event loop.


Member Type Documentation

enum QOrganizerItemAbstractRequest::RequestType

Enumerates the various possible types of asynchronous requests

ConstantValueDescription
QOrganizerItemAbstractRequest::InvalidRequest0An invalid request
QOrganizerItemAbstractRequest::ItemInstanceFetchRequest1A request to fetch a list of instances of organizer items
QOrganizerItemAbstractRequest::ItemFetchRequest2A request to fetch a list of organizer items
QOrganizerItemAbstractRequest::ItemLocalIdFetchRequest3A request to fetch a list of local organizer item ids
QOrganizerItemAbstractRequest::ItemRemoveRequest4A request to remove a list of organizer items
QOrganizerItemAbstractRequest::ItemSaveRequest5A request to save a list of organizer items
QOrganizerItemAbstractRequest::DetailDefinitionFetchRequest6A request to fetch a collection of detail definitions
QOrganizerItemAbstractRequest::DetailDefinitionRemoveRequest7A request to remove a list of detail definitions
QOrganizerItemAbstractRequest::DetailDefinitionSaveRequest8A request to save a list of detail definitions

enum QOrganizerItemAbstractRequest::State

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

ConstantValueDescription
QOrganizerItemAbstractRequest::InactiveState0Operation not yet started
QOrganizerItemAbstractRequest::ActiveState1Operation started, not yet finished
QOrganizerItemAbstractRequest::CanceledState2Operation is finished due to cancellation
QOrganizerItemAbstractRequest::FinishedState3Operation successfully completed

Member Function Documentation

QOrganizerItemAbstractRequest::~QOrganizerItemAbstractRequest ()

Cleans up the memory used by this request

bool QOrganizerItemAbstractRequest::cancel () [slot]

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

QOrganizerItemManager::Error QOrganizerItemAbstractRequest::error () const

Returns the overall error of the most recent asynchronous operation

bool QOrganizerItemAbstractRequest::isActive () const

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

See also state().

bool QOrganizerItemAbstractRequest::isCanceled () const

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

See also state().

bool QOrganizerItemAbstractRequest::isFinished () const

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

See also state().

bool QOrganizerItemAbstractRequest::isInactive () const

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

See also state().

QOrganizerItemManager * QOrganizerItemAbstractRequest::manager () const

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

See also setManager().

void QOrganizerItemAbstractRequest::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 QOrganizerItemAbstractRequest::setManager ( QOrganizerItemManager * manager )

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

See also manager().

bool QOrganizerItemAbstractRequest::start () [slot]

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

State QOrganizerItemAbstractRequest::state () const

Returns the current state of the request.

void QOrganizerItemAbstractRequest::stateChanged ( QOrganizerItemAbstractRequest::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 QOrganizerItemAbstractRequest::type () const

Returns the type of this asynchronous request

bool QOrganizerItemAbstractRequest::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 or negative, this function will block until the request is complete, regardless of how long it takes. 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.

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.