Kanzi Framework  3.9.0
Kanzi Engine API
kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView > Class Template Reference

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

Inheritance diagram for kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >:
[legend]

Classes

struct  KzuTrajectoryLayoutSnapInfo
 

Public Types

using BaseClass = ListBoxScrollPresenterConceptImpl< ListBoxTrajectoryPresenterType, TFinalClass, TScrollView >
 
using ItemSharedPtr = shared_ptr< TItemClass >
 
using LayoutSharedPtr = shared_ptr< TLayout >
 
using ListBoxTrajectoryPresenterType = ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >
 
using ScrollViewSharedPtr = shared_ptr< TScrollView >
 

Public Member Functions

void addToLayout (ItemSharedPtr listBoxItem)
 
void bringItemCenter (size_t selection, bool smooth)
 Brings given item to the selector position. More...
 
KzuVirtualItemIterator findMiddleIterator ()
 
LayoutSharedPtr getLayout () const
 
void initialize (TFinalClass *listBox, LayoutSharedPtr layout)
 
 ListBoxTrajectoryPresenter ()
 
void notifyItemAdded (size_t index)
 Implements notifyItemAdded for a trajectory list box. More...
 
void notifyItemContainerChanged ()
 Invalidates layout if the item container is changed. More...
 
void notifyItemRemoved (size_t index)
 Implements notifyItemRemoved for a trajectory list box. More...
 
void notifyItemReplaced (size_t)
 Implements kzuPresenterItemReplaced for trajectory list box. More...
 
void removeFromLayout (ItemSharedPtr listBoxItem)
 
void setScroll (Vector2 scroll)
 
void snap (Vector2 position, Vector2 direction, bool changeTarget, Vector2 *out_position, int *out_itemIndex)
 Snaps from a given position towards a given direction. More...
 
void update ()
 Updates presenter's state and visible items. More...
 
 ~ListBoxTrajectoryPresenter ()
 
- Public Member Functions inherited from kanzi::ListBoxScrollPresenterConceptImpl< ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >, TFinalClass, TScrollView >
ScrollViewSharedPtr getScrollView () const
 Returns the Scroll View that the presenter uses. More...
 
void initialize (TFinalClass *listBox)
 ListBoxScrollPresenterConceptImpl specific initialization. More...
 
 ListBoxScrollPresenterConceptImpl ()=default
 Constructor. More...
 

Protected Member Functions

bool calculateVisibleRange ()
 Sets indices and offsets of first and last visible items and the number of visible elements. Sets the values of viewInternal member. More...
 
void extendVisibleItemRangeToItem (unsigned int index)
 Extends visible range of presenter to it includes specified item. More...
 
ItemSharedPtr getItem (size_t presenterIndex) const
 
unsigned int getItemCount ()
 Gets number of items in presenters list box. More...
 
Vector3 getItemSize (unsigned int itemIndex)
 Returns size of an item specified by its index. More...
 
void iterateLeft (KzuVirtualItemIterator *it)
 Iterates left in virtual item list. More...
 
void iterateRight (KzuVirtualItemIterator *it)
 Iterates right in virtual item list. More...
 
void iterateToIndex (KzuVirtualItemIterator *iterator, size_t index)
 Iterates the iterator to the given index. More...
 
void snapImprove (KzuTrajectoryLayoutSnapInfo *snap, unsigned int objectIndex, float offset, float selectorOffset, kzBool snapLeft, kzBool snapRight)
 
void updateVisibleRange ()
 Asks the list box to update the items in the layout according to the currently set firstIndex and rangeSize, taking also the keep alive into account. More...
 
- Protected Member Functions inherited from kanzi::ListBoxScrollPresenterConceptImpl< ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >, TFinalClass, TScrollView >
void onClickBegin (ClickManipulator::ClickBeginMessageArguments &messageArguments)
 Handles ClickManipulator::onClickBeginMessage. More...
 
void onItemSelected (ListBoxConcept::ItemSelectedMessageArguments &messageArguments)
 Handles ListBoxConcept::ItemSelectedMessage. More...
 
void onScrolled (ScrollViewConcept::ScrolledMessageArguments &messageArguments)
 Handles ScrollViewClass::ScrolledMessage. More...
 
void onScrollFinished (ScrollViewConcept::ScrollFinishedMessageArguments &messageArguments)
 Handles ScrollViewClass::ScrollFinishedMessage. More...
 
void onScrollStarted (ScrollViewConcept::ScrollStartedMessageArguments &messageArguments)
 Handles ScrollViewClass::ScrollStartedMessage. More...
 
void onSnapRequested (ScrollViewConcept::SnapRequestMessageArguments &messageArguments)
 Handles ScrollViewClass::SnapRequestMessage. More...
 
void onUserScrollFinished (ScrollViewConcept::UserScrollFinishedMessageArguments &messageArguments)
 Handles ScrollViewClass::UserScrollFinishedMessage. More...
 
void onUserScrollStarted (ScrollViewConcept::UserScrollStartedMessageArguments &messageArguments)
 Handles ScrollViewClass::UserScrollStartedMessage. More...
 
void scrollToTargetItem (size_t itemIndex, Vector2 scrollPosition, bool smooth) const
 Requests Scroll View to scroll to target item position. More...
 
void sendListBoxTargetChangedMessage (size_t targetItem) const
 Sends ListBoxScrollPresenterConcept::TargetChangedMessage message to List Box. More...
 
void sendScrollViewSetScrollMessage (const Vector2 &scrollPosition) const
 Sends ScrollViewConcept::SetScrollMessage message to Scroll View. More...
 
void sendScrollViewSetScrollTargetMessage (const Vector2 &scrollTarget) const
 Sends ScrollViewConcept::SetScrollTargetMessage message to Scroll View. More...
 

Static Protected Member Functions

static unsigned int kzuTrajectoryLayoutPresenterItemCountFunction_internal (void *userData)
 Gets list box's total item count. More...
 
static kzsError kzuTrajectoryLayoutPresenterItemListSizeFunction_internal (unsigned int index, void *userData, Vector3 &size)
 Gets object's size by index. More...
 
static float kzuTrajectoryLayoutPresenterItemWidthFunction_internal (const Vector3 size)
 Gets object's width from its size for virtual item list. More...
 

Additional Inherited Members

- Protected Attributes inherited from kanzi::ListBoxScrollPresenterConceptImpl< ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >, TFinalClass, TScrollView >
TFinalClass * m_listBox
 List Box that owns this presenter. More...
 

Member Typedef Documentation

◆ ListBoxTrajectoryPresenterType

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::ListBoxTrajectoryPresenterType = ListBoxTrajectoryPresenter<TFinalClass, TLayout, TItemClass, TScrollView>

◆ BaseClass

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::BaseClass = ListBoxScrollPresenterConceptImpl<ListBoxTrajectoryPresenterType, TFinalClass, TScrollView>

◆ LayoutSharedPtr

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::LayoutSharedPtr = shared_ptr<TLayout>

◆ ItemSharedPtr

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::ItemSharedPtr = shared_ptr<TItemClass>

◆ ScrollViewSharedPtr

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::ScrollViewSharedPtr = shared_ptr<TScrollView>

Constructor & Destructor Documentation

◆ ListBoxTrajectoryPresenter()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::ListBoxTrajectoryPresenter ( )
inlineexplicit

◆ ~ListBoxTrajectoryPresenter()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::~ListBoxTrajectoryPresenter ( )
inline

Member Function Documentation

◆ getLayout()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
LayoutSharedPtr kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::getLayout ( ) const
inline

◆ notifyItemAdded()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::notifyItemAdded ( size_t  index)
inline

Implements notifyItemAdded for a trajectory list box.

Called by the ListBoxConceptImpl after the item has been added.

Parameters
indexIndex of the item that was added.

◆ notifyItemRemoved()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::notifyItemRemoved ( size_t  index)
inline

Implements notifyItemRemoved for a trajectory list box.

Called by the ListBoxConceptImpl after the item is removed.

Parameters
indexIndex of the item that will be removed.

◆ notifyItemReplaced()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::notifyItemReplaced ( size_t  )
inline

Implements kzuPresenterItemReplaced for trajectory list box.

◆ notifyItemContainerChanged()

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

Invalidates layout if the item container is changed.

◆ initialize()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::initialize ( TFinalClass *  listBox,
LayoutSharedPtr  layout 
)
inline

◆ update()

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

Updates presenter's state and visible items.

◆ setScroll()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::setScroll ( Vector2  scroll)
inline

◆ addToLayout()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::addToLayout ( ItemSharedPtr  listBoxItem)
inline

◆ removeFromLayout()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::removeFromLayout ( ItemSharedPtr  listBoxItem)
inline

◆ findMiddleIterator()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
KzuVirtualItemIterator kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::findMiddleIterator ( )
inline

◆ bringItemCenter()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::bringItemCenter ( size_t  selection,
bool  smooth 
)
inline

Brings given item to the selector position.

◆ snap()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::snap ( Vector2  position,
Vector2  direction,
bool  changeTarget,
Vector2 out_position,
int *  out_itemIndex 
)
inline

Snaps from a given position towards a given direction.

Returns the snapping target and the index of the item to which the scrolling snapped, unless they are given as nullptr. If the list box target changes to the snapped item, changeTarget is KZ_TRUE. If the snapping did not target any item, the index is -1.

◆ calculateVisibleRange()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
bool kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::calculateVisibleRange ( )
inlineprotected

Sets indices and offsets of first and last visible items and the number of visible elements. Sets the values of viewInternal member.

◆ updateVisibleRange()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::updateVisibleRange ( )
inlineprotected

Asks the list box to update the items in the layout according to the currently set firstIndex and rangeSize, taking also the keep alive into account.

◆ getItem()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
ItemSharedPtr kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::getItem ( size_t  presenterIndex) const
inlineprotected

◆ iterateLeft()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::iterateLeft ( KzuVirtualItemIterator it)
inlineprotected

Iterates left in virtual item list.

This operation might extend presenters range of visible items if the size of an item where iterator will be pointing to could not be determined otherwise.

Parameters
itIterator to iterate.

◆ iterateRight()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::iterateRight ( KzuVirtualItemIterator it)
inlineprotected

Iterates right in virtual item list.

This operation might extend presenters range of visible items if the size of an item where iterator will be pointing to could not be determined otherwise.

Parameters
itIterator to iterate.

◆ snapImprove()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::snapImprove ( KzuTrajectoryLayoutSnapInfo snap,
unsigned int  objectIndex,
float  offset,
float  selectorOffset,
kzBool  snapLeft,
kzBool  snapRight 
)
inlineprotected

◆ kzuTrajectoryLayoutPresenterItemWidthFunction_internal()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
static float kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::kzuTrajectoryLayoutPresenterItemWidthFunction_internal ( const Vector3  size)
inlinestaticprotected

Gets object's width from its size for virtual item list.

◆ extendVisibleItemRangeToItem()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::extendVisibleItemRangeToItem ( unsigned int  index)
inlineprotected

Extends visible range of presenter to it includes specified item.

If item is already inside the visible range, then the range will remain unchanged.

Parameters
indexIndex of the item which should be included into the range.

◆ getItemSize()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
Vector3 kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::getItemSize ( unsigned int  itemIndex)
inlineprotected

Returns size of an item specified by its index.

If the item is outside of presenters range of visible items and its size could not be determined by list box, the visible range will be extended so list box can acquire the item and determine its size.

Parameters
itemIndexIndex of an item whose size should be returned.
Returns
size of an item.

◆ getItemCount()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
unsigned int kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::getItemCount ( )
inlineprotected

Gets number of items in presenters list box.

Returns
item count.

◆ kzuTrajectoryLayoutPresenterItemListSizeFunction_internal()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
static kzsError kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::kzuTrajectoryLayoutPresenterItemListSizeFunction_internal ( unsigned int  index,
void *  userData,
Vector3 size 
)
inlinestaticprotected

Gets object's size by index.

◆ kzuTrajectoryLayoutPresenterItemCountFunction_internal()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
static unsigned int kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::kzuTrajectoryLayoutPresenterItemCountFunction_internal ( void *  userData)
inlinestaticprotected

Gets list box's total item count.

◆ iterateToIndex()

template<typename TFinalClass , typename TLayout , typename TItemClass , typename TScrollView >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::iterateToIndex ( KzuVirtualItemIterator iterator,
size_t  index 
)
inlineprotected

Iterates the iterator to the given index.


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