The QGalleryAbstractResponse class provides a base class for responses to gallery requests. More...
#include <QGalleryAbstractResponse>
Inherits: QObject.
Inherited by: QGalleryResultSet.
This class was introduced in Qt Mobility 1.1.
QGalleryAbstractResponse ( int error, const QString & errorString = QString(), QObject * parent = 0 ) | |
~QGalleryAbstractResponse () | |
virtual void | cancel () |
int | error () const |
QString | errorString () const |
bool | isActive () const |
bool | isIdle () const |
virtual bool | waitForFinished ( int msecs ) |
void | canceled () |
void | finished () |
void | progressChanged ( int current, int maximum ) |
void | resumed () |
QGalleryAbstractResponse ( QObject * parent = 0 ) | |
void | error ( int error, const QString & errorString = QString() ) |
void | finish ( bool idle = false ) |
void | resume () |
The QGalleryAbstractResponse class provides a base class for responses to gallery requests.
QGalleryAbstractResponse is the interface through which a QAbstractGallery returns a response to a QGalleryAbstractRequest. The interface provides functions to communicate the state of a response to a request, additional classes derived from QGalleryAbstractRequest such as QGalleryResultSet are used to communicate actual results.
New responses start in an active state indicating they have not yet finished. When a response has finished; implementers should call the finish function which will put the response into an inactive state and emit the finished signal. If the idle argument of finish is true then isIdle() will be true on return indicating that the response may return to an active state in order to refresh its results in the future. The resume function will return the response to an active state and emit the resumed signal.
If a response cannot finish successfully then implementers should call the error() function and supply an error code and description. This will finish the request and set values for error() and errorString().
If a request is cancelled it will call cancel() on its response. The base implementation wsets isActive() and isIdle() to false and emits the canceled signal, so implementers will need to override the default implementation to actually cancel any ongoing task or suspend updates before calling the base implementation. If the response can't be canceled synchronously then calling the base implementation should be deferred until the cancelation has completed. Canceling a response should not discard any intermediate results already made available by the response.
Unless a response finishes synchronously and calls finish() or error() from its constructor it must implement the waitForFinished() function to allow clients to block while waiting for the response to finish.
Constructs a new gallery response, for a request that has finished with an error. The optional errorString will describe the error in greater detail.
The parent is passed to QObject.
Constructs a new gallery response.
The parent is passed to QObject.
Destroys a gallery response.
Cancels an active or idle gallery response.
The default implementation finishes the an active response with the QGalleryAbstractRequest::Canceled result. If the reponse is idle the finished() signal will be re-emitted with idle
This function was introduced in Qt Mobility 1.1.
Signals that a response was canceled.
This function was introduced in Qt Mobility 1.1.
Returns an identifier describing an error condition encountered by a response.
In the case of no error this will return QGalleryAbstractRequest::NoError.
This function was introduced in Qt Mobility 1.1.
See also QGalleryAbstractRequest::Error and QDocumentGallery::Error.
Finalizes a response in response to an error condition.
The error, and errorString are communicated to issuing request.
This function was introduced in Qt Mobility 1.1.
Returns a string describing the cause of an error() in more detail.
This function was introduced in Qt Mobility 1.1.
Finalizes a gallery response.
If idle is true the items returned by a response will be monitored for changes and updated as appropriate.
This function was introduced in Qt Mobility 1.1.
Signals that a response has finished.
This function was introduced in Qt Mobility 1.1.
Identifies if a response is in an active state.
Returns true if a response is active, and false otherwise.
This function was introduced in Qt Mobility 1.1.
Identifies if the items returned by a response are being monitored for changes.
Returns true if a response is in an idle state, and false otherwise.
This function was introduced in Qt Mobility 1.1.
Signals that the current or maximum progress of a request has changed.
This function was introduced in Qt Mobility 1.1.
Returns a response to an active state.
An idle response can call this to indicate it has begun refreshing its contents.
This function was introduced in Qt Mobility 1.1.
Signals that an idle response has resumed communications.
This function was introduced in Qt Mobility 1.1.
Waits for msecs for the a response to finish.
Returns true if the response has finished on return, and returns false if the wait time expires or the request is inactive or idle.
This function was introduced in Qt Mobility 1.1.