All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass > Class Template Reference

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

Classes

struct  KzuTrajectoryLayoutSnapInfo
 

Public Types

typedef
ListBoxTrajectoryPresenter
< TFinalClass, TLayout,
TItemClass > 
ListBoxTrajectoryPresenterType
 
typedef shared_ptr< TLayout > LayoutSharedPtr
 
typedef shared_ptr< TItemClass > ItemSharedPtr
 

Public Member Functions

LayoutSharedPtr getLayout () const
 
void notifyItemAdded (unsigned int index)
 Implements kzuPresenterItemAdded for trajectory list box. More...
 
void notifyItemRemoved (unsigned int index)
 Implements kzuPresenterItemRemoved for trajectory list box. More...
 
void notifyItemReplaced (unsigned int index)
 Implements kzuPresenterItemReplaced for trajectory list box. More...
 
void initialize (TFinalClass *listBox, LayoutSharedPtr layout)
 
void update ()
 Updates presenter's state and visible items. More...
 
void setScroll (Vector2 scroll)
 
void getScrollBounds (float *out_scrollMinimumX, float *out_scrollMaximumX, float *out_scrollMinimumY, float *out_scrollMaximumY)
 
void addToLayout (ItemSharedPtr listBoxItem)
 
void removeFromLayout (ItemSharedPtr listBoxItem)
 
 ListBoxTrajectoryPresenter ()
 
 ~ListBoxTrajectoryPresenter ()
 
KzuVirtualItemIterator findMiddleIterator ()
 
Vector2 bringItemCenter (unsigned int selection)
 Brings given item to the selector position. More...
 
void snap (Vector2 position, Vector2 direction, bool changeTarget, Vector2 *out_position, int *out_itemIndex)
 Snaps towards given direction from given position. More...
 

Protected Member Functions

bool calculateVisibleRange ()
 Sets indices and offsets of first and last visible items and the number of visible elements. More...
 
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...
 
ItemSharedPtr getItem (size_t presenterIndex)
 
void iterateLeft (KzuVirtualItemIterator *it)
 Iterates left in virtual item list. More...
 
void iterateRight (KzuVirtualItemIterator *it)
 Iterates right in virtual item list. More...
 
void snapImprove (KzuTrajectoryLayoutSnapInfo *snap, unsigned int objectIndex, float offset, float selectorOffset, kzBool snapLeft, kzBool snapRight)
 
void extendVisibleItemRangeToItem (unsigned int index)
 Extends visible range of presenter to it includes specified item. More...
 
Vector3 getItemSize (unsigned int itemIndex)
 Returns size of an item specified by its index. More...
 
unsigned int getItemCount ()
 Gets number of items in presenters list box. More...
 
void iterateToIndex (KzuVirtualItemIterator *iterator, unsigned int index)
 Iterates the iterator to the given index. More...
 

Static Protected Member Functions

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

Member Typedef Documentation

template<typename TFinalClass , typename TLayout , typename TItemClass >
typedef ListBoxTrajectoryPresenter<TFinalClass, TLayout, TItemClass> kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::ListBoxTrajectoryPresenterType
template<typename TFinalClass , typename TLayout , typename TItemClass >
typedef shared_ptr<TLayout> kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::LayoutSharedPtr
template<typename TFinalClass , typename TLayout , typename TItemClass >
typedef shared_ptr<TItemClass> kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::ItemSharedPtr

Constructor & Destructor Documentation

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

Member Function Documentation

template<typename TFinalClass , typename TLayout , typename TItemClass >
LayoutSharedPtr kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::getLayout ( ) const
inline
template<typename TFinalClass , typename TLayout , typename TItemClass >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::notifyItemAdded ( unsigned int  index)
inline

Implements kzuPresenterItemAdded for trajectory list box.

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

Implements kzuPresenterItemRemoved for trajectory list box.

template<typename TFinalClass , typename TLayout , typename TItemClass >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::notifyItemReplaced ( unsigned int  index)
inline

Implements kzuPresenterItemReplaced for trajectory list box.

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

Updates presenter's state and visible items.

template<typename TFinalClass , typename TLayout , typename TItemClass >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::setScroll ( Vector2  scroll)
inline
template<typename TFinalClass , typename TLayout , typename TItemClass >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::getScrollBounds ( float *  out_scrollMinimumX,
float *  out_scrollMaximumX,
float *  out_scrollMinimumY,
float *  out_scrollMaximumY 
)
inline
template<typename TFinalClass , typename TLayout , typename TItemClass >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::addToLayout ( ItemSharedPtr  listBoxItem)
inline
template<typename TFinalClass , typename TLayout , typename TItemClass >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::removeFromLayout ( ItemSharedPtr  listBoxItem)
inline
template<typename TFinalClass , typename TLayout , typename TItemClass >
KzuVirtualItemIterator kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::findMiddleIterator ( )
inline
template<typename TFinalClass , typename TLayout , typename TItemClass >
Vector2 kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::bringItemCenter ( unsigned int  selection)
inline

Brings given item to the selector position.

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

Snaps towards given direction from given position.

Returns snapping target and index of the object that scrolling snapped to, unless they're given as KZ_NULL. The changeTarget should be KZ_TRUE if the list box target is changed to the snapped item.

If snapping happened towards no object, index will be -1.

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

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

Sets the values of viewInternal member.

template<typename TFinalClass , typename TLayout , typename TItemClass >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::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.

template<typename TFinalClass , typename TLayout , typename TItemClass >
ItemSharedPtr kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::getItem ( size_t  presenterIndex)
inlineprotected
template<typename TFinalClass , typename TLayout , typename TItemClass >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::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.
template<typename TFinalClass , typename TLayout , typename TItemClass >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::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.
template<typename TFinalClass , typename TLayout , typename TItemClass >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::snapImprove ( KzuTrajectoryLayoutSnapInfo snap,
unsigned int  objectIndex,
float  offset,
float  selectorOffset,
kzBool  snapLeft,
kzBool  snapRight 
)
inlineprotected
template<typename TFinalClass , typename TLayout , typename TItemClass >
static float kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::kzuTrajectoryLayoutPresenterItemWidthFunction_internal ( const KzcVector3 size)
inlinestaticprotected

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

template<typename TFinalClass , typename TLayout , typename TItemClass >
void kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::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.
template<typename TFinalClass , typename TLayout , typename TItemClass >
Vector3 kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::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.
template<typename TFinalClass , typename TLayout , typename TItemClass >
unsigned int kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::getItemCount ( )
inlineprotected

Gets number of items in presenters list box.

Returns
item count.
template<typename TFinalClass , typename TLayout , typename TItemClass >
static kzsError kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass >::kzuTrajectoryLayoutPresenterItemListSizeFunction_internal ( unsigned int  index,
void *  userData,
KzcVector3 out_size 
)
inlinestaticprotected

Gets object's size by index.

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

Gets list box's total item count.

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

Iterates the iterator to the given index.


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