#include <kanzi/ui/node/concept/list_box/list_box_trajectory_presenter.hpp>
Classes | |
struct | KzuTrajectoryLayoutSnapInfo |
Public Types | |
using | BaseClass |
using | ItemSharedPtr |
using | LayoutSharedPtr |
using | ListBoxTrajectoryPresenterType |
using | ScrollViewSharedPtr |
Public Member Functions | |
void | addToLayout (ItemSharedPtr listBoxItem) |
void | bringItemCenter (size_t selection, bool smooth) |
Brings given item to the selector position. | |
void | enableKeyNavigation (bool enabled) |
Enables directional key navigation on the Trajectory Presenter. | |
KzuVirtualItemIterator | findMiddleIterator () |
LayoutSharedPtr | getLayout () const |
void | initialize (TFinalClass *listBox, LayoutSharedPtr layout) |
ListBoxTrajectoryPresenter () | |
void | notifyItemAdded (size_t index) |
Implements notifyItemAdded for a trajectory list box. | |
void | notifyItemContainerChanged () |
Invalidates layout if the item container is changed. | |
void | notifyItemRemoved (size_t index) |
Implements notifyItemRemoved for a trajectory list box. | |
void | notifyItemReplaced (size_t) |
Implements kzuPresenterItemReplaced for trajectory list box. | |
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. | |
void | update () |
Updates presenter's state and visible items. | |
~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. | |
void | initialize (TFinalClass *listBox) |
ListBoxScrollPresenterConceptImpl specific initialization. | |
ListBoxScrollPresenterConceptImpl ()=default | |
Constructor. | |
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. | |
void | extendVisibleItemRangeToItem (unsigned int index) |
Extends visible range of presenter to it includes specified item. | |
ItemSharedPtr | getItem (size_t presenterIndex) const |
unsigned int | getItemCount () const |
Gets number of items in presenters list box. | |
Vector3 | getItemSize (unsigned int itemIndex) |
Returns size of an item specified by its index. | |
bool | isHorizontalScroll () const |
Returns whether the Trajectory List Box is scrolling horizontally. | |
void | iterateLeft (KzuVirtualItemIterator *it) |
Iterates left in virtual item list. | |
void | iterateRight (KzuVirtualItemIterator *it) |
Iterates right in virtual item list. | |
void | iterateToIndex (KzuVirtualItemIterator *iterator, size_t index) |
Iterates the iterator to the given index. | |
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. | |
Protected Member Functions inherited from kanzi::ListBoxScrollPresenterConceptImpl< ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >, TFinalClass, TScrollView > | |
void | onClickBegin (ClickManipulator::ClickBeginMessageArguments &messageArguments) |
Handles ClickManipulator::onClickBeginMessage. | |
void | onItemSelected (ListBoxConcept::ItemSelectedMessageArguments &messageArguments) |
Handles ListBoxConcept::ItemSelectedMessage. | |
void | onScrolled (ScrollViewConcept::ScrolledMessageArguments &messageArguments) |
Handles ScrollViewClass::ScrolledMessage. | |
void | onScrollFinished (ScrollViewConcept::ScrollFinishedMessageArguments &messageArguments) |
Handles ScrollViewClass::ScrollFinishedMessage. | |
void | onScrollStarted (ScrollViewConcept::ScrollStartedMessageArguments &messageArguments) |
Handles ScrollViewClass::ScrollStartedMessage. | |
void | onSnapRequested (ScrollViewConcept::SnapRequestMessageArguments &messageArguments) |
Handles ScrollViewClass::SnapRequestMessage. | |
void | onUserScrollFinished (ScrollViewConcept::UserScrollFinishedMessageArguments &messageArguments) |
Handles ScrollViewClass::UserScrollFinishedMessage. | |
void | onUserScrollStarted (ScrollViewConcept::UserScrollStartedMessageArguments &messageArguments) |
Handles ScrollViewClass::UserScrollStartedMessage. | |
void | scrollToTargetItem (size_t itemIndex, Vector2 scrollPosition, bool smooth) const |
Requests Scroll View to scroll to target item position. | |
void | sendListBoxTargetChangedMessage (size_t targetItem) const |
Sends ListBoxScrollPresenterConcept::TargetChangedMessage message to List Box. | |
void | sendScrollViewSetScrollMessage (const Vector2 &scrollPosition) const |
Sends ScrollViewConcept::SetScrollMessage message to Scroll View. | |
void | sendScrollViewSetScrollTargetMessage (const Vector2 &scrollTarget) const |
Sends ScrollViewConcept::SetScrollTargetMessage message to Scroll View. | |
Static Protected Member Functions | |
static unsigned int | kzuTrajectoryLayoutPresenterItemCountFunction_internal (void *userData) |
Gets list box's total item count. | |
static kzsError | kzuTrajectoryLayoutPresenterItemListSizeFunction_internal (unsigned int index, void *userData, Vector3 &size) |
Gets object's size by index. | |
static float | kzuTrajectoryLayoutPresenterItemWidthFunction_internal (const Vector3 size) |
Gets object's width from its size for virtual item list. | |
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. | |
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::ListBoxTrajectoryPresenterType |
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::BaseClass |
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::LayoutSharedPtr |
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::ItemSharedPtr |
using kanzi::ListBoxTrajectoryPresenter< TFinalClass, TLayout, TItemClass, TScrollView >::ScrollViewSharedPtr |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
Implements notifyItemAdded for a trajectory list box.
Called by the ListBoxConceptImpl after the item has been added.
index | Index of the item that was added. |
|
inline |
Implements notifyItemRemoved for a trajectory list box.
Called by the ListBoxConceptImpl after the item is removed.
index | Index of the item that will be removed. |
|
inline |
Implements kzuPresenterItemReplaced for trajectory list box.
|
inline |
Invalidates layout if the item container is changed.
|
inline |
|
inline |
Enables directional key navigation on the Trajectory Presenter.
enabled | To enable key navigation, pass true. To disable key navigation, pass false. |
|
inline |
Updates presenter's state and visible items.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Brings given item to the selector position.
|
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.
|
inlineprotected |
Sets indices and offsets of first and last visible items and the number of visible elements. Sets the values of viewInternal member.
|
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.
|
inlineprotected |
|
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.
it | Iterator to iterate. |
|
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.
it | Iterator to iterate. |
|
inlineprotected |
|
inlinestaticprotected |
Gets object's width from its size for virtual item list.
|
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.
index | Index of the item which should be included into the range. |
|
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.
itemIndex | Index of an item whose size should be returned. |
|
inlineprotected |
Gets number of items in presenters list box.
|
inlinestaticprotected |
Gets object's size by index.
|
inlinestaticprotected |
Gets list box's total item count.
|
inlineprotected |
Iterates the iterator to the given index.
|
inlineprotected |
Returns whether the Trajectory List Box is scrolling horizontally.