Kanzi 4.1.0
kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem Class Reference

Represents a virtual item within a ListBox. More...

#include <kanzi/ui/node/concept/list_box/list_box_trajectory_presenter.hpp>

Public Member Functions

float getCenter () const
 Returns the offset of the center point of an item.
 
int getIndex () const
 Returns the virtual index of the item.
 
float getLeftEdge () const
 Returns the offset of the left edge of an item.
 
unsigned int getNormalizedIndex () const
 Returns the normalized index of the item, representing its actual position in the ListBox even when looping is enabled and the virtual index exceeds the item range.
 
float getOffset () const
 Returns the offset of the virtual item.
 
float getRightEdge () const
 Returns the offset of the right edge of an item.
 
bool hasNext () const
 Whether this virtual item has a next neighbor in the ListBox, taking possible item looping into account.
 
bool hasPrevious () const
 Whether this virtual item has a previous neighbor in the ListBox, taking possible item looping into account.
 
void invalidate ()
 Invalidates this virtual item.
 
bool isValid () const
 Whether this virtual item is valid.
 
void next ()
 Iterates to the next neighbor item in the ListBox.
 
void previous ()
 Iterates to the previous neighbor item in the ListBox.
 
void update (int index, float offset)
 Updates the virtual item with the given index.
 
 VirtualListBoxItem (ListBoxTrajectoryPresenterType *presenter)
 Constructor.
 

Detailed Description

template<typename TDerivedClass, typename TFinalClass, typename TLayout, typename TItemClass, typename TScrollView>
class kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem

Represents a virtual item within a ListBox.

Does not store or manage any real underlying data; instead, it provides the dimensional and positional information required by the presenter. Supports looping in the ListBox, allowing it to represent an effectively infinite sequence of items. Supports bidirectional iteration over virtual items in the ListBox.

Since
Kanzi 4.1.0

Constructor & Destructor Documentation

◆ VirtualListBoxItem()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::VirtualListBoxItem ( ListBoxTrajectoryPresenterType * presenter)
inlineexplicit

Constructor.

By default creates an invalid virtual item.

Parameters
presenterPresenter for a List Box, which items this VirtualListBoxItem represent.

Member Function Documentation

◆ update()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::update ( int index,
float offset )
inline

Updates the virtual item with the given index.

Sets the offset for this item and retrieves the actual item width.

Parameters
indexVirtual index of an item. If looping is enabled index can be beyond an actual List Box items range.
offsetOffset of the virtual item.

◆ getIndex()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
int kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::getIndex ( ) const
inline

Returns the virtual index of the item.

If looping is enabled index can be beyond an actual List Box items range.

Returns
Virtual index of the item.

◆ getOffset()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
float kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::getOffset ( ) const
inline

Returns the offset of the virtual item.

Returns
The offset of the virtual item.

◆ isValid()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
bool kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::isValid ( ) const
inline

Whether this virtual item is valid.

Returns
If this virtual item data is valid and reflect some actual data from the List Box, true, otherwise false.

◆ invalidate()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::invalidate ( )
inline

Invalidates this virtual item.

◆ hasNext()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
bool kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::hasNext ( ) const
inline

Whether this virtual item has a next neighbor in the ListBox, taking possible item looping into account.

Returns
If this virtual item has a next neighbor in the ListBox, true, otherwise false.

◆ hasPrevious()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
bool kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::hasPrevious ( ) const
inline

Whether this virtual item has a previous neighbor in the ListBox, taking possible item looping into account.

Returns
If this virtual item has a previous neighbor in the ListBox, true, otherwise false.

◆ next()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::next ( )
inline

Iterates to the next neighbor item in the ListBox.

Updates the item index, width and offset to represent the next neighbor item.

◆ previous()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::previous ( )
inline

Iterates to the previous neighbor item in the ListBox.

Updates the item index, width and offset to represent the previous neighbor item.

◆ getLeftEdge()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
float kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::getLeftEdge ( ) const
inline

Returns the offset of the left edge of an item.

Returns
The offset of the left edge of an item.

◆ getRightEdge()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
float kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::getRightEdge ( ) const
inline

Returns the offset of the right edge of an item.

Returns
The offset of the right edge of an item.

◆ getCenter()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
float kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::getCenter ( ) const
inline

Returns the offset of the center point of an item.

Returns
The offset of the center point of an item.

◆ getNormalizedIndex()

template<typename TDerivedClass , typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
unsigned int kanzi::ListBoxTrajectoryPresenter< TDerivedClass, TFinalClass, TLayout, TItemClass, TScrollView >::VirtualListBoxItem::getNormalizedIndex ( ) const
inline

Returns the normalized index of the item, representing its actual position in the ListBox even when looping is enabled and the virtual index exceeds the item range.

Returns
Normalized index of the item.

The documentation for this class was generated from the following file: