HeaderDataQuery

Since: BlackBerry 10.2.0

#include <bb/cascades/datamanager/HeaderDataQuery>

To link against this class, add the following line to your .pro file: LIBS += -lbbcascadesdatamanager

Retrieve data and header data for a particular view of a data source.

To implement this class, you must decide how to handle error conditions. If there are SQL or other expected or unexpected runtime errors, you must determine which of these errors are catastrophic and which are recoverable. See the DataQuery class description for error handling guidelines.


Overview

Public Functions Index

HeaderDataQuery (QObject *parent=0)
virtual ~HeaderDataQuery ()
boolgetHeaderData (int offset, int limit, DataRevision *revision, int *totalCount, QList< DataItem > *results, QList< HeaderDataItem > *headerResults)=0
DataQuery (QObject *parent=0)Inherited
boolgetData (int offset, int limit, DataRevision *revision, int *totalCount, QList< DataItem > *results)=0Inherited
boolgetDataForRevision (int offset, int limit, const DataRevision &requestedRevision, QList< DataItem > *results)=0Inherited
QStringtoString () const =0Inherited

Signals Index

Only has inherited signals

voiddataChanged (DataRevision revision)Inherited
voiderror (int code, const QString &message)Inherited

Public Functions

HeaderDataQuery (

Constructs a HeaderDataQuery.

Parameters
parent

The parent owner or 0. Optional and defaults to 0 if not specified.

Since:

BlackBerry 10.2.0

virtual~HeaderDataQuery ()

Destructor.

Since:

BlackBerry 10.2.0

bool getHeaderData (

Fetch the overall revision, total count, all header items, and a range of data items from the data source.

This is a synchronous call, but it must be possible to safely call this method from any thread.

For more information about error handling, see the DataQuery class description. A return of false by this method should be preceded by the query emitting an error signal. This signal should be handled at the application level, leading to some appropriate action.

Parameters
offset

The index offset within the view.

limit

The number of items to retrieve.

revision

The current revision of the data source. This pointer must not be null.

totalCount

The total number of items in the view. This pointer must not be null.

results

The requested items. This pointer must not be null.

headerResults

The header items of the query. This pointer must not be null.

Return:

True if the data is successfully retrieved, false otherwise.

Since:

BlackBerry 10.2.0

DataQuery (Inherited

Constructs a DataQuery.

Parameters
parent

The parent owner or 0. Optional and defaults to 0 if not specified.

Since:

BlackBerry 10.2.0

bool getData (Inherited

Fetch the overall revision, total count, and a range of data items from the data source.

This is a synchronous call, but it must be possible to safely call this method from any thread.

See the discussion about error handling in the class description. A return of false by this method should be preceded by the query emitting an error signal. This signal should be handled at the application level, leading to some appropriate action.

Parameters
offset

The index offset within the view.

limit

The number of items to retrieve.

revision

The current revision of the data source. The revision value must match the state of the data items that are returned. This pointer must not be null.

totalCount

The total number of items in the view. This pointer must not be null.

results

The list of data items which is the return data. This pointer must not be null.

Return:

True if the data is successfully retrieved, false otherwise.

Since:

BlackBerry 10.2.0

bool getDataForRevision (Inherited

Fetch the data items from the data source if the data source is at the requested revision.

This is a synchronous call, but it must be safe to call this method from any thread.

See the discussion about error handling in the class description. A return of false by this method should be preceded by the query emitting an error signal. This signal should be handled at the application level, leading to some appropriate action.

Note:

The return of false by this method is always expected and not a catastrophic error since false is returned when the data source doesn't match the requested revision. The error() signal should be emitted on database and query related errors only.

Parameters
offset

The index offset within the view.

limit

The number of items to retrieve.

requestedRevision

The requested revision ID for the data source. If the data source does not match this revision, this method returns false.

results

The list of data items which is the return data. This pointer must not be null.

Return:

True if the data could be successfully retrieved at the requested revision, false otherwise.

Since:

BlackBerry 10.2.0

QString toString ()Inherited

Get a string representation of the query, for debugging purposes.

Return:

The string.

Since:

BlackBerry 10.2.0

Signals

(Only has inherited signals)

void dataChanged (Inherited

Emitted when the data changes.

Parameters
revision

The revision of the latest source data.

Since:

BlackBerry 10.2.0

void error (Inherited

Emitted when an error occurs when executing the query.

Parameters
code

The error code.

message

The error message.

Since:

BlackBerry 10.2.0

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus