Kanzi Graphics Engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
kzu_presenter.h File Reference

Defines base class for items that handle scrolling of layouts. More...

Data Structures

struct  KzuPresenterConfiguration
 Presenter configuration. More...
 
struct  KzuPresenterClass
 Presenter class. More...
 
struct  KzuPresenterData
 Presenter data. More...
 
struct  KzuPresenter
 Controls presentation of scrolling for layout ui components. More...
 

Typedefs

typedef kzsError(* KzuPresenterDeleteFunction )(struct KzuPresenter *presenter)
 Function type to delete presenter. More...
 
typedef kzsError(* KzuPresenterSnapFunction )(const struct KzuPresenter *presenter, const struct KzcVector2 *position, const struct KzcVector2 *direction, kzBool changeTarget, struct KzcVector2 *out_position, kzInt *out_itemIndex)
 Function type to snap presenter to an item in the given direction from given position. More...
 
typedef kzsError(* KzuPresenterSetScrollFunction )(const struct KzuPresenter *presenter, const struct KzcVector2 *scroll)
 Function type to set new scroll value for the presenter. More...
 
typedef kzsError(* KzuPresenterGetScrollBoundsFunction )(const struct KzuPresenter *presenter, kzFloat *out_scrollMinimumX, kzFloat *out_scrollMaximumX, kzFloat *out_scrollMinimumY, kzFloat *out_scrollMaximumY)
 Function type to return allowed scrolling area of presenter. More...
 
typedef kzsError(* KzuPresenterBringItemCenterFunction )(const struct KzuPresenter *presenter, kzUint itemIndex, struct KzcVector2 *out_scrollValue)
 Function type to output a scroll value such that the given item is in the center. More...
 
typedef kzsError(* KzuPresenterAddToLayoutFunction )(const struct KzuPresenter *presenter, struct KzuObjectNode *listBoxItem)
 Function type to add the specified list box item to the layout. More...
 
typedef kzsError(* KzuPresenterRemoveFromLayoutFunction )(const struct KzuPresenter *presenter, struct KzuObjectNode *listBoxItem)
 Function type to remove the specified list box item from the layout. More...
 
typedef kzsError(* KzuPresenterClearLayoutFunction )(const struct KzuPresenter *presenter)
 Function type to remove all list box items from the layout. More...
 
typedef kzsError(* KzuPresenterUpdateFunction )(const struct KzuPresenter *presenter)
 Function type to update layout's object nodes. More...
 
typedef kzsError(* KzuPresenterItemAddedFunction )(const struct KzuPresenter *presenter, kzUint index)
 Function type to inform the presenter that an item was added to the virtual item list at the given index. More...
 
typedef kzsError(* KzuPresenterItemRemovedFunction )(const struct KzuPresenter *presenter, kzUint index)
 Function type to inform the presenter that an item was removed from the virtual item list from the given index. More...
 
typedef kzsError(* KzuPresenterItemReplacedFunction )(const struct KzuPresenter *presenter, kzUint index)
 Function type to inform the presenter that an item in the virtual item list at the given index was replaced. More...
 

Functions

kzsError kzuPresenterDelete (struct KzuPresenter *presenter)
 Deletes a presenter. More...
 
kzBool kzuPresenterSupportsFocus (const struct KzuPresenter *presenter)
 Returns whether the presenter supports focus. More...
 
kzsError kzuPresenterSetScroll (const struct KzuPresenter *presenter, const struct KzcVector2 *scroll)
 Sets scroll value. More...
 
kzsError kzuPresenterSnap (const struct KzuPresenter *presenter, const struct KzcVector2 *position, const struct KzcVector2 *direction, kzBool changeTarget, struct KzcVector2 *out_position, kzInt *out_itemIndex)
 Snaps towards given direction from given position. More...
 
kzsError kzuPresenterGetScrollBounds (const struct KzuPresenter *presenter, kzFloat *out_scrollMinimumX, kzFloat *out_scrollMaximumX, kzFloat *out_scrollMinimumY, kzFloat *out_scrollMaximumY)
 Gets scroll bounds for the layout. More...
 
kzsError kzuPresenterBringItemCenter (const struct KzuPresenter *presenter, kzUint itemIndex, struct KzcVector2 *out_scrollValue)
 Outputs a scroll value such that the given item moves to the center. More...
 
kzsError kzuPresenterAddToLayout (const struct KzuPresenter *presenter, struct KzuObjectNode *listBoxItem)
 Adds the specified list box item to the layout. More...
 
kzsError kzuPresenterRemoveFromLayout (const struct KzuPresenter *presenter, struct KzuObjectNode *listBoxItem)
 Removes the specified list box item from the layout. More...
 
kzsError kzuPresenterClearLayout (const struct KzuPresenter *presenter)
 Removes all list box items from the layout. More...
 
kzsError kzuPresenterUpdate (const struct KzuPresenter *presenter)
 Updates presenter's state and visible items. More...
 
kzsError kzuPresenterItemAdded (const struct KzuPresenter *presenter, kzUint index)
 Informs the presenter that an item was added to the virtual item list at the given index. More...
 
kzsError kzuPresenterItemRemoved (const struct KzuPresenter *presenter, kzUint index)
 Informs the presenter that an item was removed from the virtual item list from the given index. More...
 
kzsError kzuPresenterItemReplaced (const struct KzuPresenter *presenter, kzUint index)
 Informs the presenter that an item in the virtual item list at the given index was replaced. More...
 

Detailed Description

Defines base class for items that handle scrolling of layouts.

Copyright 2008-2019 by Rightware. All rights reserved.

Typedef Documentation

typedef kzsError(* KzuPresenterDeleteFunction)(struct KzuPresenter *presenter)

Function type to delete presenter.

typedef kzsError(* KzuPresenterSnapFunction)(const struct KzuPresenter *presenter, const struct KzcVector2 *position, const struct KzcVector2 *direction, kzBool changeTarget, struct KzcVector2 *out_position, kzInt *out_itemIndex)

Function type to snap presenter to an item in the given direction from given position.

typedef kzsError(* KzuPresenterSetScrollFunction)(const struct KzuPresenter *presenter, const struct KzcVector2 *scroll)

Function type to set new scroll value for the presenter.

typedef kzsError(* KzuPresenterGetScrollBoundsFunction)(const struct KzuPresenter *presenter, kzFloat *out_scrollMinimumX, kzFloat *out_scrollMaximumX, kzFloat *out_scrollMinimumY, kzFloat *out_scrollMaximumY)

Function type to return allowed scrolling area of presenter.

typedef kzsError(* KzuPresenterBringItemCenterFunction)(const struct KzuPresenter *presenter, kzUint itemIndex, struct KzcVector2 *out_scrollValue)

Function type to output a scroll value such that the given item is in the center.

typedef kzsError(* KzuPresenterAddToLayoutFunction)(const struct KzuPresenter *presenter, struct KzuObjectNode *listBoxItem)

Function type to add the specified list box item to the layout.

typedef kzsError(* KzuPresenterRemoveFromLayoutFunction)(const struct KzuPresenter *presenter, struct KzuObjectNode *listBoxItem)

Function type to remove the specified list box item from the layout.

typedef kzsError(* KzuPresenterClearLayoutFunction)(const struct KzuPresenter *presenter)

Function type to remove all list box items from the layout.

typedef kzsError(* KzuPresenterUpdateFunction)(const struct KzuPresenter *presenter)

Function type to update layout's object nodes.

typedef kzsError(* KzuPresenterItemAddedFunction)(const struct KzuPresenter *presenter, kzUint index)

Function type to inform the presenter that an item was added to the virtual item list at the given index.

typedef kzsError(* KzuPresenterItemRemovedFunction)(const struct KzuPresenter *presenter, kzUint index)

Function type to inform the presenter that an item was removed from the virtual item list from the given index.

typedef kzsError(* KzuPresenterItemReplacedFunction)(const struct KzuPresenter *presenter, kzUint index)

Function type to inform the presenter that an item in the virtual item list at the given index was replaced.

Function Documentation

kzsError kzuPresenterDelete ( struct KzuPresenter presenter)

Deletes a presenter.

kzBool kzuPresenterSupportsFocus ( const struct KzuPresenter presenter)

Returns whether the presenter supports focus.

kzsError kzuPresenterSetScroll ( const struct KzuPresenter presenter,
const struct KzcVector2 scroll 
)

Sets scroll value.

kzsError kzuPresenterSnap ( const struct KzuPresenter presenter,
const struct KzcVector2 position,
const struct KzcVector2 direction,
kzBool  changeTarget,
struct KzcVector2 out_position,
kzInt out_itemIndex 
)

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.

kzsError kzuPresenterGetScrollBounds ( const struct KzuPresenter presenter,
kzFloat out_scrollMinimumX,
kzFloat out_scrollMaximumX,
kzFloat out_scrollMinimumY,
kzFloat out_scrollMaximumY 
)

Gets scroll bounds for the layout.

kzsError kzuPresenterBringItemCenter ( const struct KzuPresenter presenter,
kzUint  itemIndex,
struct KzcVector2 out_scrollValue 
)

Outputs a scroll value such that the given item moves to the center.

kzsError kzuPresenterAddToLayout ( const struct KzuPresenter presenter,
struct KzuObjectNode listBoxItem 
)

Adds the specified list box item to the layout.

kzsError kzuPresenterRemoveFromLayout ( const struct KzuPresenter presenter,
struct KzuObjectNode listBoxItem 
)

Removes the specified list box item from the layout.

kzsError kzuPresenterClearLayout ( const struct KzuPresenter presenter)

Removes all list box items from the layout.

kzsError kzuPresenterUpdate ( const struct KzuPresenter presenter)

Updates presenter's state and visible items.

kzsError kzuPresenterItemAdded ( const struct KzuPresenter presenter,
kzUint  index 
)

Informs the presenter that an item was added to the virtual item list at the given index.

kzsError kzuPresenterItemRemoved ( const struct KzuPresenter presenter,
kzUint  index 
)

Informs the presenter that an item was removed from the virtual item list from the given index.

kzsError kzuPresenterItemReplaced ( const struct KzuPresenter presenter,
kzUint  index 
)

Informs the presenter that an item in the virtual item list at the given index was replaced.