IndexMapper

Since: BlackBerry 10.0.0

#include <bb/cascades/DataModel/IndexMapper>

Indicates whether a ListView can translate cached items to new indexes.

An instance of this class can be sent along with the new indexes class that can be sent along with the DataModel::itemsChanged signal so that the listening ListView can translate all of the items in its cache to the new indexes (and won't have to do a full refresh of the items). Items in the ListView cache that have no such translation are removed from the ListView.


Overview

Public Functions Index

virtual ~IndexMapper ()
boolnewIndexPath (QVariantList *pOutIndexPath, int *pOutReplacementIndex, const QVariantList &oldIndexPath) const =0

Public Functions

virtual~IndexMapper ()

Destructor.

bool newIndexPath (

Called by ListView for every item in its cache in response to the DataModel::itemsChanged signal.

Parameters
pOutIndexPath

An output parameter. If the return value of this function is false, the content of *pOutIndexPath is undefined. Otherwise, it's a new index path specifying the placement of the item in question in the model after the update.

pOutReplacementIndex

An output parameter. If the return value of this function is true, the value of *pOutReplacementIndex is undefined. Otherwise, it's the index amongst its siblings (that is, the last index in the index path) that the item in question would have had in the updated model, had the item not been removed. This parameter affects placement of the item-visuals that are animated out of the list. This parameter can be a negative value if the ItemRemoved-animated visuals can be placed after its parent's remaining children.

oldIndexPath

The index path for listItem before the change in the model.

Return:

true if the item in question remains in the model after the update, false if the item has been removed.

Since:

BlackBerry 10.0.0

Last modified: 2014-09-30



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

comments powered by Disqus