The QGalleryAbstractRequest class provides a base class for gallery requests. More...
#include <QGalleryAbstractRequest>
Inherited by QGalleryItemRequest, QGalleryQueryRequest, QGalleryRemoveRequest, and QGalleryTypeRequest.
enum | RequestError { NoError, NoGallery, NotSupported, GalleryError } |
enum | RequestType { QueryRequest, ItemRequest, TypeRequest, RemoveRequest } |
enum | Status { Inactive, Active, Cancelling, Idle } |
|
|
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 ) |
void | cancel () |
void | clear () |
void | execute () |
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 () |
virtual void | setResponse ( QGalleryAbstractResponse * response ) = 0 |
The QGalleryAbstractRequest class provides a base class for gallery requests.
Identifies the type of a request.
Constant | Value | Description |
---|---|---|
QGalleryAbstractRequest::QueryRequest | 0 | The request is a QGalleryQueryRequest. |
QGalleryAbstractRequest::ItemRequest | 1 | The request is a QGalleryItemRequest. |
QGalleryAbstractRequest::TypeRequest | 2 | The request is a QGalleryTypeRequest |
QGalleryAbstractRequest::RemoveRequest | 3 | The request is a QGalleryRemoveRequest. |
Identifies the status of a gallery request.
Constant | Value | Description |
---|---|---|
QGalleryAbstractRequest::Inactive | 0 | The request has not been executed, or has finished. |
QGalleryAbstractRequest::Active | 1 | The request is currently executing. |
QGalleryAbstractRequest::Cancelling | 2 | The request was cancelled, but hasn't yet returned to the Inactive status. |
QGalleryAbstractRequest::Idle | 4 | The request has finished, and is monitoring its return values for changes. |
This property holds the current progress of a request.
Access functions:
int | currentProgress () const |
Notifier signal:
void | progressChanged ( int current, int maximum ) |
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 () |
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 () |
This property holds the gallery service a request acts on.
Access functions:
QAbstractGallery * | gallery () const |
void | setGallery ( QAbstractGallery * gallery ) |
This property holds the maximum value of currentProgress.
Access functions:
int | maximumProgress () const |
Notifier signal:
void | progressChanged ( int current, int maximum ) |
This property holds the status of a request.
Access functions:
Status | status () const |
Notifier signal:
void | statusChanged ( QGalleryAbstractRequest::Status status ) |
This property holds whether a request is supported by its current gallery.
Access functions:
bool | isSupported () const |
Notifier signal:
void | supportedChanged () |
Constructs a new gallery type request.
The parent is passed to QObject.
Constructs a new type request for the given gallery.
The parent is passed to QObject.
Destroys a gallery request.
Cancels the execution of a request. If the request is idle this will stop any future updates.
Signals that a request was cancelled before it could finish.
Clears the results of a request.
If the request is active or idle it will be cancelled.
Signals that the error and errorString properties have changed.
Executes a request.
Note: A valid gallery must be set before a request can be executed.
Signals that a request has finished.
Signals that the current or maximum progress value has changed.
Sets the response to an executed request.
Signals the supported property has changed.
Returns the type of a request.
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.