Kanzi 3.9.10
kzu_virtual_item_list.h File Reference

Classes

struct  KzuVirtualItemIterator
 Iterator for KzuVirtualItemList. More...
 

Typedefs

typedef unsigned int(* KzuVirtualItemCountFunction) (void *userData)
 Function that returns item count of a list box.
 
typedef kzsError(* KzuVirtualItemSizeFunction) (unsigned int index, void *userData, kanzi::Vector3 &size)
 Function that returns size of an item in the list box.
 
typedef float(* KzuVirtualItemWidthFunction) (const kanzi::Vector3 size)
 Function that returns a one-dimensional width of a virtual item, based on it's dimensions.
 

Enumerations

enum  KzuVirtualItemListDirectionPreference { KZU_VIRTUAL_ITEM_LIST_PREFER_PREVIOUS , KZU_VIRTUAL_ITEM_LIST_PREFER_NEXT }
 Preferred element when exact match cannot be found. More...
 

Functions

float kzuVirtualItemIteratorGetCenter (const struct KzuVirtualItemIterator *iterator)
 Gets offset of the center of the item pointed by the iterator.
 
unsigned int kzuVirtualItemIteratorGetIndex (const struct KzuVirtualItemIterator *iterator)
 Gets index of the item pointed by the iterator.
 
float kzuVirtualItemIteratorGetLeftEdge (const struct KzuVirtualItemIterator *iterator)
 Gets offset of the left edge of the item pointed by the iterator.
 
unsigned int kzuVirtualItemIteratorGetNextIndex (const struct KzuVirtualItemIterator *iterator)
 Gets index of the item after the item pointed by the iterator.
 
unsigned int kzuVirtualItemIteratorGetPreviousIndex (const struct KzuVirtualItemIterator *iterator)
 Gets index of the item before the item pointed by the iterator.
 
float kzuVirtualItemIteratorGetRightEdge (const struct KzuVirtualItemIterator *iterator)
 Gets offset of the right edge of the item pointed by the the iterator.
 
kzBool kzuVirtualItemIteratorHasNext (const struct KzuVirtualItemIterator *iterator)
 Returns whether the iterator has a next item.
 
kzBool kzuVirtualItemIteratorHasPrevious (const struct KzuVirtualItemIterator *iterator)
 Returns whether the iterator has a previous item.
 
void kzuVirtualItemIteratorInvalidate (struct KzuVirtualItemIterator *iterator)
 Sets the iterator invalid.
 
kzBool kzuVirtualItemIteratorIsValid (const struct KzuVirtualItemIterator *iterator)
 Returns whether the virtual item iterator is valid.
 
kzsError kzuVirtualItemIteratorNext (struct KzuVirtualItemIterator *iterator)
 Iterates to the next item.
 
kzsError kzuVirtualItemIteratorPrevious (struct KzuVirtualItemIterator *iterator)
 Iterates to the previous item.
 
kzsError kzuVirtualItemIteratorUpdateWidth (struct KzuVirtualItemIterator *iterator)
 Asks the iterator to update its width.
 
kzsError kzuVirtualItemListCreate (KzuVirtualItemWidthFunction widthFunction, KzuVirtualItemSizeFunction sizeFunction, void *sizeFunctionUserData, KzuVirtualItemCountFunction countFunction, void *countFunctionUserData, struct KzuVirtualItemList **out_itemList)
 Creates a virtual item list that uses the given list box to provide item data.
 
kzsError kzuVirtualItemListDelete (struct KzuVirtualItemList *itemList)
 Deletes a virtual item list.
 
unsigned int kzuVirtualItemListGetIntervalElementCount (const struct KzuVirtualItemIterator *leftIterator, const struct KzuVirtualItemIterator *rightIterator)
 Gets the number of elements that are in between the left and right iterators, including the iterators.
 
kzBool kzuVirtualItemListIsLooping (const struct KzuVirtualItemList *itemList)
 Gets whether the virtual item list is looping.
 
void kzuVirtualItemListSetLooping (struct KzuVirtualItemList *itemList, kzBool looping)
 Sets whether the virtual item list is looping.
 
void kzuVirtualItemListSetSpacing (struct KzuVirtualItemList *itemList, float spacing)
 Sets spacing between items in the virtual item list.
 

Typedef Documentation

◆ KzuVirtualItemWidthFunction

typedef float(* KzuVirtualItemWidthFunction) (const kanzi::Vector3 size)

Function that returns a one-dimensional width of a virtual item, based on it's dimensions.

As an example, if used in a horizontal layout the function should return object's width. This value is used for determining how much space an item will need in the virtual item list.

◆ KzuVirtualItemSizeFunction

typedef kzsError(* KzuVirtualItemSizeFunction) (unsigned int index, void *userData, kanzi::Vector3 &size)

Function that returns size of an item in the list box.

◆ KzuVirtualItemCountFunction

typedef unsigned int(* KzuVirtualItemCountFunction) (void *userData)

Function that returns item count of a list box.

Enumeration Type Documentation

◆ KzuVirtualItemListDirectionPreference

Preferred element when exact match cannot be found.

Enumerator
KZU_VIRTUAL_ITEM_LIST_PREFER_PREVIOUS 

Prefer previous element.

KZU_VIRTUAL_ITEM_LIST_PREFER_NEXT 

Prefer next element.

Function Documentation

◆ kzuVirtualItemIteratorIsValid()

kzBool kzuVirtualItemIteratorIsValid ( const struct KzuVirtualItemIterator * iterator)

Returns whether the virtual item iterator is valid.

◆ kzuVirtualItemIteratorInvalidate()

void kzuVirtualItemIteratorInvalidate ( struct KzuVirtualItemIterator * iterator)

Sets the iterator invalid.

◆ kzuVirtualItemIteratorUpdateWidth()

kzsError kzuVirtualItemIteratorUpdateWidth ( struct KzuVirtualItemIterator * iterator)

Asks the iterator to update its width.

◆ kzuVirtualItemIteratorGetRightEdge()

float kzuVirtualItemIteratorGetRightEdge ( const struct KzuVirtualItemIterator * iterator)

Gets offset of the right edge of the item pointed by the the iterator.

◆ kzuVirtualItemIteratorGetCenter()

float kzuVirtualItemIteratorGetCenter ( const struct KzuVirtualItemIterator * iterator)

Gets offset of the center of the item pointed by the iterator.

◆ kzuVirtualItemIteratorGetLeftEdge()

float kzuVirtualItemIteratorGetLeftEdge ( const struct KzuVirtualItemIterator * iterator)

Gets offset of the left edge of the item pointed by the iterator.

◆ kzuVirtualItemIteratorGetIndex()

unsigned int kzuVirtualItemIteratorGetIndex ( const struct KzuVirtualItemIterator * iterator)

Gets index of the item pointed by the iterator.

◆ kzuVirtualItemIteratorHasNext()

kzBool kzuVirtualItemIteratorHasNext ( const struct KzuVirtualItemIterator * iterator)

Returns whether the iterator has a next item.

◆ kzuVirtualItemIteratorHasPrevious()

kzBool kzuVirtualItemIteratorHasPrevious ( const struct KzuVirtualItemIterator * iterator)

Returns whether the iterator has a previous item.

◆ kzuVirtualItemIteratorGetNextIndex()

unsigned int kzuVirtualItemIteratorGetNextIndex ( const struct KzuVirtualItemIterator * iterator)

Gets index of the item after the item pointed by the iterator.

◆ kzuVirtualItemIteratorGetPreviousIndex()

unsigned int kzuVirtualItemIteratorGetPreviousIndex ( const struct KzuVirtualItemIterator * iterator)

Gets index of the item before the item pointed by the iterator.

◆ kzuVirtualItemIteratorNext()

kzsError kzuVirtualItemIteratorNext ( struct KzuVirtualItemIterator * iterator)

Iterates to the next item.

◆ kzuVirtualItemIteratorPrevious()

kzsError kzuVirtualItemIteratorPrevious ( struct KzuVirtualItemIterator * iterator)

Iterates to the previous item.

◆ kzuVirtualItemListCreate()

kzsError kzuVirtualItemListCreate ( KzuVirtualItemWidthFunction widthFunction,
KzuVirtualItemSizeFunction sizeFunction,
void * sizeFunctionUserData,
KzuVirtualItemCountFunction countFunction,
void * countFunctionUserData,
struct KzuVirtualItemList ** out_itemList )

Creates a virtual item list that uses the given list box to provide item data.

Parameters
widthFunctionFunction that returns the width from an object size.
sizeFunctionFunction that returns the size of an object by index.
sizeFunctionUserDataUser data for the size function.
countFunctionFunction that returns total item count of virtual item list.
countFunctionUserDataUser data for the count function.
out_itemListThe created virtual item list.
Returns
Error code.

◆ kzuVirtualItemListDelete()

kzsError kzuVirtualItemListDelete ( struct KzuVirtualItemList * itemList)

Deletes a virtual item list.

◆ kzuVirtualItemListSetLooping()

void kzuVirtualItemListSetLooping ( struct KzuVirtualItemList * itemList,
kzBool looping )

Sets whether the virtual item list is looping.

◆ kzuVirtualItemListIsLooping()

kzBool kzuVirtualItemListIsLooping ( const struct KzuVirtualItemList * itemList)

Gets whether the virtual item list is looping.

◆ kzuVirtualItemListSetSpacing()

void kzuVirtualItemListSetSpacing ( struct KzuVirtualItemList * itemList,
float spacing )

Sets spacing between items in the virtual item list.

◆ kzuVirtualItemListGetIntervalElementCount()

unsigned int kzuVirtualItemListGetIntervalElementCount ( const struct KzuVirtualItemIterator * leftIterator,
const struct KzuVirtualItemIterator * rightIterator )

Gets the number of elements that are in between the left and right iterators, including the iterators.

For example:

  • kzuVirtualItemListGetIntervalElementCount(iterator, iterator) returns 1.
  • kzuVirtualItemListGetIntervalElementCount(current, next) returns 2.

Calling this function with invalid iterators results in undefined behavior.