Qt Mobility Reference Documentation

QGalleryAbstractRequest Class Reference

The QGalleryAbstractRequest class provides a base class for gallery requests. More...

 #include <QGalleryAbstractRequest>

Inherited by QGalleryItemRequest, QGalleryQueryRequest, QGalleryRemoveRequest, and QGalleryTypeRequest.


Public Types

enum RequestError { NoError, NoGallery, NotSupported, GalleryError }
enum RequestType { QueryRequest, ItemRequest, TypeRequest, RemoveRequest }
enum Status { Inactive, Active, Cancelling, Idle }

Properties


Public Functions

QGalleryAbstractRequest ( RequestType type, QObject * parent = 0 )
QGalleryAbstractRequest ( QAbstractGallery * gallery, RequestType type, QObject * parent = 0 )
~QGalleryAbstractRequest ()
int currentProgress () const
int error () const
QString errorString () const
QAbstractGallery * gallery () const
bool isSupported () const
int maximumProgress () const
void setGallery ( QAbstractGallery * gallery )
Status status () const
RequestType type () const
bool waitForFinished ( int msecs )

Public Slots

void cancel ()
void clear ()
void execute ()

Signals

void cancelled ()
void error ( int error, const QString & errorString )
void errorChanged ()
void finished ()
void progressChanged ( int current, int maximum )
void statusChanged ( QGalleryAbstractRequest::Status status )
void supportedChanged ()

Protected Functions

virtual void setResponse ( QGalleryAbstractResponse * response ) = 0

Detailed Description

The QGalleryAbstractRequest class provides a base class for gallery requests.


Member Type Documentation

enum QGalleryAbstractRequest::RequestError

enum QGalleryAbstractRequest::RequestType

Identifies the type of a request.

ConstantValueDescription
QGalleryAbstractRequest::QueryRequest0The request is a QGalleryQueryRequest.
QGalleryAbstractRequest::ItemRequest1The request is a QGalleryItemRequest.
QGalleryAbstractRequest::TypeRequest2The request is a QGalleryTypeRequest
QGalleryAbstractRequest::RemoveRequest3The request is a QGalleryRemoveRequest.

enum QGalleryAbstractRequest::Status

Identifies the status of a gallery request.

ConstantValueDescription
QGalleryAbstractRequest::Inactive0The request has not been executed, or has finished.
QGalleryAbstractRequest::Active1The request is currently executing.
QGalleryAbstractRequest::Cancelling2The request was cancelled, but hasn't yet returned to the Inactive status.
QGalleryAbstractRequest::Idle4The request has finished, and is monitoring its return values for changes.

Property Documentation

currentProgress : const int

This property holds the current progress of a request.

Access functions:

int currentProgress () const

Notifier signal:

void progressChanged ( int current, int maximum )

error : const int

This property holds the error encountered by an unsuccessful request.

Common errors are defined in Error, more specific errors are defined by the gallery implementations such as in QDocumentGallery::Error.

Access functions:

int error () const
void error ( int error, const QString & errorString )

Notifier signal:

void errorChanged ()

errorString : const QString

This property holds a string describing the cause of an error in more detail.

This may be an empty string if more information is not known.

Access functions:

QString errorString () const

Notifier signal:

void errorChanged ()

gallery : QAbstractGallery *

This property holds the gallery service a request acts on.

Access functions:

QAbstractGallery * gallery () const
void setGallery ( QAbstractGallery * gallery )

maximumProgress : const int

This property holds the maximum value of currentProgress.

Access functions:

int maximumProgress () const

Notifier signal:

void progressChanged ( int current, int maximum )

status : const Status

This property holds the status of a request.

Access functions:

Status status () const

Notifier signal:

void statusChanged ( QGalleryAbstractRequest::Status status )

supported : const bool

This property holds whether a request is supported by its current gallery.

Access functions:

bool isSupported () const

Notifier signal:

void supportedChanged ()

Member Function Documentation

QGalleryAbstractRequest::QGalleryAbstractRequest ( RequestType type, QObject * parent = 0 )

Constructs a new gallery type request.

The parent is passed to QObject.

QGalleryAbstractRequest::QGalleryAbstractRequest ( QAbstractGallery * gallery, RequestType type, QObject * parent = 0 )

Constructs a new type request for the given gallery.

The parent is passed to QObject.

QGalleryAbstractRequest::~QGalleryAbstractRequest ()

Destroys a gallery request.

void QGalleryAbstractRequest::cancel () [slot]

Cancels the execution of a request. If the request is idle this will stop any future updates.

void QGalleryAbstractRequest::cancelled () [signal]

Signals that a request was cancelled before it could finish.

void QGalleryAbstractRequest::clear () [slot]

Clears the results of a request.

If the request is active or idle it will be cancelled.

void QGalleryAbstractRequest::errorChanged () [signal]

Signals that the error and errorString properties have changed.

void QGalleryAbstractRequest::execute () [slot]

Executes a request.

Note: A valid gallery must be set before a request can be executed.

void QGalleryAbstractRequest::finished () [signal]

Signals that a request has finished.

void QGalleryAbstractRequest::progressChanged ( int current, int maximum ) [signal]

Signals that the current or maximum progress value has changed.

void QGalleryAbstractRequest::setResponse ( QGalleryAbstractResponse * response ) [pure virtual protected]

Sets the response to an executed request.

void QGalleryAbstractRequest::statusChanged ( QGalleryAbstractRequest::Status status ) [signal]

void QGalleryAbstractRequest::supportedChanged () [signal]

Signals the supported property has changed.

RequestType QGalleryAbstractRequest::type () const

Returns the type of a request.

bool QGalleryAbstractRequest::waitForFinished ( int msecs )

Waits for msecs for the a request to finish.

Returns true if the request has finished on return, and returns false if the wait time expires or the request is inactive or idle.

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.