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.

In implementing this class, the developer must make decisions about how to handle error conditions. If there are SQL or other expected or unexpected runtime errors, the developer must determine which of these errors are catastrophic and which are recoverable. See 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 (

Constructor.

Parameters
parent

The parent owner or 0. Optional and will default 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.

See the discussion about error handling in the class description. A return of false by this method should be both:
  • preceeded by the query emitting an error signal

  • application-level handling of the error signal 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. Pointer must not be null.

totalCount

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

results

The requested items. Pointer must not be null.

headerResults

The header items of the query. Pointer must not be null.

Return:

Returns true if the data could be successfully retrieved, else returns false.

Since:

BlackBerry 10.2.0

DataQuery (Inherited

Constructor.

Parameters
parent

The parent owner or 0. Optional and will default 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 both:
  • preceeded by the query emitting an error signal

  • application-level handling of the error signal 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. Pointer must not be null.

totalCount

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

results

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

Return:

Returns true if the data could be successfully retrieved, else returns false.

Since:

BlackBerry 10.2.0

bool getDataForRevision (Inherited

Fetch the data items from the data source if the data source is at the request 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 both:
  • preceeded by the query emitting an error signal

  • application-level handling of the error signal leading to some appropriate action

IMPORTANT NOTE: The return of false by this method is always expected and never a catastrophic error since false is returned when the data source does not 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 will return false.

results

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

Return:

Returns true if the data could be successfully retrieved at the requested revision, else returns false.

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

Signal for data changes.

Parameters
revision

the revision of the latest source data.

Since:

BlackBerry 10.2.0

void error (Inherited

Signal for error when executing the query.

Parameters
code

the error code

message

the error message

Since:

BlackBerry 10.2.0

Last modified: 2014-03-13

comments powered by Disqus