You.i Engine
CYIScrollingView Class Reference

Detailed Description

Allows users to scroll and pan through content inside.

A scrolling view can be thought of as a 'window' through which items are viewed. In the following documentation, the 'scrolling view' represents that window. The extent by which the window can be scrolled is referred to as the 'scrolling area'. When using a touch or cursor interface, users can scroll across the content by pressing and holding on the content and moving the cursor in the opposite direction they want to scroll. When using focus to navigate within the scrolling area, the scrolling view will scroll until the item is completely visible or, if the item is larger than the scrolling view, until its top or left edge is aligned with the top or left edge of the scrolling view.

View Template Specification

Type Labels Property Description
Comment overpull Optional A decimal amount representing the overpull in local units. Will set both horizontal and vertical overpull. Applied before horizontal-overpull and vertical-overpull, has least priority. Default is 0.0
Comment overpull-rule Optional Values can be always, and if-overflowing. Default is if-overflowing. if-overflowing will overpull when there is enough content to scroll in both directions Applied before horizontal-overpull-rule and vertical-overpull-rule, has least priority.
Comment horizontal-overpull Optional A decimal amount representing the overpull in local units. Default is 0.0. Will override overpull for the horizontal direction.
Comment horizontal-overpull-rule Optional Values can be always, or if-overflowing. Default is if-overflowing. 'if-overflowing will overpull when there is enough content to scroll in the horizontal direction. Will override overpull-rule for the horizontal direction
Comment vertical-overpull Optional A decimal amount representing the overpull in composition units. Default is 0.0. Will override overpull for the vertical direction.
Comment vertical-overpull-rule Optional Values can be always, or if-overflowing. Default is if-overflowing. if-overflowing will overpull when there is enough content to scroll in the vertical direction. Will override overpull-rule for the vertical direction
Comment scroll Optional Values can be true or false. Default is true. Scrolling will occur if there is content available outside of the view in the scroll direction. Applied before horizontal-scroll and vertical-scroll, has least priority.
Comment horizontal-scroll Optional Values can be true or false. Default is true. Scrolling will occur if there is content available outside of the view in the scroll direction. Will override scroll in the horizontal direction.
Comment vertical-scroll Optional Values can be true or false. Default is true. Scrolling will occur if there is content available outside of the view in the scroll direction. Will override scroll in the vertical direction.
Comment horizontal-carousel Optional Values can be never, always, or if-overflowing. Default is never. Represents the carousel mode in the horizontal direction.
Comment vertical-carousel Optional Values can be never, always, or if-overflowing. Default is never. Represents the carousel mode in the vertical direction.
Comment horizontal-layout-mode Optional A hint for the layout system indicating how the content should be laid out in the horizontal direction. Acceptable values are fit-content, fit-content-if-overflowing and fill-view. Defaults to fit-content-if-overflowing. See the Layout section for details.
Comment vertical-layout-mode Optional A hint for the layout system indicating how the content should be laid out in the vertical direction. Acceptable values are fit-content, fit-content-if-overflowing and fill-view. Defaults to fit-content-if-overflowing. See the Layout section for details.
Comment cascade-delay Optional A delay, in milliseconds, inserted between timelines within the cascade timeline groups. Defaults to 50 ms. See the 'Cascade Timelines' section for details.
Comment left-magnet-offset Optional The offset of the left magnet from the left edge of the view. Takes precedence over horizontal-center-magnet-offset, horizontal-begin-magnet-offset and horizontal-end-magnet-offset. See the Magnets section for details.
Comment right-magnet-offset Optional The offset of the right magnet from the right edge of the view. Takes precedence over horizontal-center-magnet-offset, horizontal-begin-magnet-offset and horizontal-end-magnet-offset. See the Magnets section for details.
Comment horizontal-center-magnet-offset Optional The offset of the horizontal center magnet from the center of the view. Takes precedence over horizontal-begin-magnet-offset and horizontal-end-magnet-offset. See the Magnets section for details.
Comment horizontal-begin-magnet-offset Optional The offset of the horizontal begin magnet from the left edge of the view. Takes precedence over horizontal-end-magnet-offset. See the Magnets section for details.
Comment horizontal-end-magnet-offset Optional The offset of the horizontal end magnet from the right edge of the view. See the Magnets section for details.
Comment up-magnet-offset Optional The offset of the up magnet from the top edge of the view. Takes precedence over vertical-center-magnet-offset, vertical-begin-magnet-offset and vertical-end-magnet-offset. See the Magnets section for details.
Comment down-magnet-offset Optional The offset of the down magnet from the bottom edge of the view. Takes precedence over vertical-center-magnet-offset, vertical-begin-magnet-offset and vertical-end-magnet-offset. See the Magnets section for details.
Comment vertical-center-magnet-offset Optional The offset of the vertical center magnet from the center of the view. Takes precedence over vertical-begin-magnet-offset and vertical-end-magnet-offset. See the Magnets section for details.
Comment vertical-begin-magnet-offset Optional The offset of the vertical begin magnet from the top edge of the view. Takes precedence over vertical-end-magnet-offset. See the Magnets section for details.
Comment vertical-end-magnet-offset Optional The offset of the vertical end magnet from the bottom edge of the view. See the Magnets section for details.

Child View Template Specification

The following markers or comments, if present within a child of the scrolling view, are used by the scrolling view itself.

Type Labels Property Description
Marker Move Optional A timeline that is seeked through as the child moves across the scrolling view's visible region. See the 'Move Timelines' section for details.
Marker MoveHorizontal Optional A timeline that is seeked through as the child moves horizontally across the scrolling view's visible region. See the 'Move Timelines' section for details.
Marker MoveVertical Optional A timeline that is seeked through as the child moves vertically across the scrolling view's visible region. See the 'Move Timelines' section for details.
Marker CascadeIn Optional A timeline that is used to generate an 'in' cascade timeline group. See the 'Cascade Timelines' section for details.
Marker CascadeOut Optional A timeline that is used to generate an 'out' cascade timeline group. See the 'Cascade Timelines' section for details.
Comment magnetic Optional Used on platforms with touch or cursor interfaces. Values can be true or false. By default backgrounds are not magnetic, but all other nodes are. When the scrolling view has at least one magnet configured it will align a magnet with the closest magnetic child. See the 'Magnets' section for more details.

Layout By default, the placement of the children within the scrolling view defines how large the scrolling area is. However, when a layout is applied to the scrolling view, this behaviour changes: the scrolling area is then defined by the measured size of the scrolling view's content.

The layout applied on the scrolling view is used to calculate the size of the scrolling area. This is equivalent to using the 'fit content' property on a non-scrolling view. Because the size of the scrolling area depends on the size of its content, children of the scrolling view typically cannot be set to 'fill parent'.

In some cases, it is desirable for the content of the scrolling view to be laid out such that it fills the width or the height of the scrolling view. For example, a user may want to use a row layout to align children horizontally while centering them vertically within the scrolling view. This is done by setting the 'layout mode' property. By default, no fill is performed and the scrolling view can scroll in both directions. If the 'layout mode' property is set to 'fill view vertically' or 'fill view horizontally', then the content is allowed to grow up to the dimension of the scrolling view itself. A side effect of doing this is that scrolling in the 'fill' direction is disabled, as the size of the scrolling view in that dimension equals that of the scrolling area. The 'layout mode' can also be set to 'fit content if overflowing'. When in this mode, the scrolling view behaves as if the 'fit content' mode is selected, but the scrolling area does not get smaller than the scrolling view itself.

When a layout is applied to a scrolling view, it affects the placement of the children within the scrollable area, but it does not affect the size of the scrolling view itself. If the scrolling view is itself placed within a view that has a layout, then the layout configuration of the scrolling view may affect the size of the scrolling view (but not of its content). For example, a scrolling view may be placed within a parent container and be set as 'fill parent'. This changes the size of the scrolling view to fill its parent container, thus expanding the size of the 'window'.

Note
If the 'scrolling area layout mode' is set to 'fill view' (either vertically or horizontally), then the scrolling view itself cannot be set to 'fit content' in that direction. Doing so would result in the size of the scrolling view in that direction to shrink to 0.

When a node is marked as 'background' of a scrolling view, that node's size is set to that of the scrolling area. This means that the node will be expanded to fill the full scrolling area (and likely would be clipped by the scrolling view). This also means that the 'background' would be scrolling within the scrolling view along with the rest of the scrolling view content. If this is undesirable and the background should not be scrolling, then the background should be held outside of the scrolling view within a parent container.

Note
If the background should also be visible in the 'overpull' region, a negative margin equal to the size of the overpull can be applied to the background node. Alternatively, the background can be held outside of the scrolling view within a parent container.

Move Timelines

As children of the scrolling view move across the scrolling view's visisble region, the OnChildMovedInVisibleRegion() function is called along with a normalized position for that child. The normalized position is calculated such that 0.0 represents the child coming into the visible range, and 1.0 represents the child completely exiting the visible range.

For example, consider the following example with children A, B, C and D within scrolling view E. Child A would be considered as having a normalized position of 0.0, child B would have a normalized position of 0.5, child C would have a normalized position of 1.0, and child D would have a larger-than-1.0 normalized position.

     +----------------+
     |                |
 +---+      +---+     +---+   +---+
 | A |      | B |     | C |   | D |
 +---+      +---+     +---+   +---+
     |  E             |
     +----------------+
 

The OnChildMovedInVisibleRegion() function is called only for children that are within the scrolling view's visible range. Thus, child D would not have its normalized position reported as part of a OnChildMovedInVisibleRegion() callback, and A and C would not have their normalized position reported unless they are at least partly in the visible region.

If the children of this scrolling view are scene views and have one of the recognised move timeline markers ('Move', 'MoveHorizontal' or 'MoveVertical'), then those timelines are automatically seeked to the percentage equal to the child's normalized position.

'MoveHorizontal' timelines are seeked to the child's horizontal normalized position. 'MoveVertical' timelines are seeked to the child's vertical normalized position. 'Move' timelines are a convenience timeline whose behaviour depends on the configuration of the scrolling view. If the scrolling view is configured to scroll vertically or horizontall only, then the normalized position in that direction is used to seek the 'Move' timeline. Otherwise, the vertical and horizontal normalized positions are combined to determine the seek position. The effect of the combination is that only the first 'half' of the 'Move' timeline is used, with the first half being played in reverse to handle normalized positions between 0.5 and 1.0.

If the scrolling view is configured to be a carousel and the content is sufficiently small, the same child may be visible in multiple positions within the scrolling view's visible region. Since the child cannot have two visual states, the normalized position that is closest to the center of the scrolling view is chosen. This may result in undesirable visuals.

Magnets

Magnets can be added to the scrolling view so that items snap to a position as the view is scrolled. A scrolling view scrolled left will have content entering on the left side. If the view is configured with two horizontal magnets the scrolled view will move to align the left magnet and the closest left edge of a magnetic child. Similarly when content enters from the right, top, or bottom while scrolling, the view will align the right, up, and down magnets to the right, top and bottom edge of the closest magnetic child. When the view has a single horizontal center/begin/end magnet the view will snap to the closest center/left/right of a magnetic child. The same is true for a single vertical magnet.

Both horizontal and vertical center magnets will be positioned at the center of the view when the magnet is positoned at 0. For horizontal center magnets, a positive value will move the magnet towards the right edge of the view and a negative value will move the magnet towards the left edge of the view. For vertical center magnets, a positive value will move the magnet towards the bottom edge of the view and a negative value will move the magnet towards the top edge of the view.

Horizontal/vertical begin magnets will be positioned at the left/top of the view when the magnet is positoned at 0. Begin magnets with a positive value will move the magnet towards the center of the view and a negative value will move the magnet away from the center of the view.

Horizontal/vertical end magnets will be positioned at the right/top of the view when the magnet is positoned at 0. Begin magnets with a positive value will move the magnet towards the center of the view and a negative value will move the magnet away from the center of the view.

The 'magnetic' property of each node can be queried using IsMagnetic() and overwritten using EnableMagnetism() and DisableMagnetism().

Note
When using focus to navigate the 'magnetic' property is ignored and all focusable items are considered to be magnetic.

Cascade Timelines

The scrolling view builds and maintains a pair of timelines known as the cascade timeline groups. The first timeline group is called the 'In' cascade timeline group, and is typically used to animate items into view. The second timeline group is called the 'Out' cascade timeline group, and is typically used to animate items out of view.

These timelines are built using the views that are currently in the visible region of the scrolling view at a given time. Only the visible views with the appropriate timeline markers are considered. For 'in' cascade timeline groups, the 'CascadeIn' timelines are used. For 'out' cascade timeline groups, the 'CascadeOut' timelines are used. These timeline markers are expected to be within the views contained in this scrolling view.

After the cascade timelines for the visible items are obtained, they are combined in the cascade timeline groups. Each timeline is offset from the previous timeline such that the first timeline is played, then the second timeline is played x ms later, then the third timeline is played x ms later and so on. The delay between the starting of the various timelines is configurable using the SetCascadeTimelineGroupDelay() function. Alternatively, subclasses of this class can override the GetTotalCascadeDelayFor() function to provide custom delays.

Because the set of visible items may change over time, the cascade timeline groups are 'refreshed' each time the GetCascadeTimelineGroup() function is called. Thus, it is not advisable to cache the cascade timeline groups. Instead, they should be fetched using the GetCascadeTimelineGroup() function immediately before being played.

If this view has an assigned 'In' timeline, calling CYIAbstractTimeline::StartForward() on it automatically 'plays' the 'In' cascade timeline group. If this view has an assigned 'Out' timeline, calling CYIAbstractTimeline::StartForward() on it automatically 'plays' the 'Out' cascade timeline group.

Limitations in 3D Undesirable visual effects can occur when CYIScrollingView is populated with 3-dimensional content, or is placed into a 3-dimensional scene, under the following conditions:

Clipping should not be disabled when the scrolling view is configured to carousel. In carousel mode, the content of the view is rendered as if it is endlessly repeating in the direction of carousel, however this effect is only guaranteed to work within the confines of the view. If the clipping box does not entirely align with the edges of the view as it appears on screen, the view will overdraw and appear to "pop" its contents in.

The size and position of CYIScrollingView's content (its immediate children) are assumed to be relative to position Z = 0. If the content is moved forward (-Z) or backward (+Z) the calculation of the content size, and the scrolling view's overflow state, may be affected. Only content which logically, through size or scale, overflows the view will be detected as overflowing. For instance moving an image which does not fill the view at Z = 0 forward, until it visually encompasses the view, will not cause the scrolling view to detect that it is now visually overflowing.

Items may be placed visually forward (-Z) or backward (+Z) inside of the CYIScrollingView's content so long as the immediate children of the scrolling view are not offset. When using carousel content which is pushed backward (+Z) may appear to "pop" in at the seams of the repeating content.

#include <view/YiScrollingView.h>

Inheritance diagram for CYIScrollingView:

Classes

struct  Magnets
 
class  PagingStrategy
 
struct  ViewAndDistance
 

Public Types

enum  OverpullRule {
  OverpullRule::Always,
  OverpullRule::IfOverflowing
}
 
enum  LayoutMode {
  LayoutMode::FitContent,
  LayoutMode::FitContentIfOverflowing,
  LayoutMode::FillView
}
 
enum  CarouselRule {
  CarouselRule::Never,
  CarouselRule::Always,
  CarouselRule::IfOverflowing
}
 
enum  TimelineType {
  TimelineType::In = 0,
  TimelineType::Out
}
 
enum  MagnetsType {
  MagnetsType::None,
  MagnetsType::Edges,
  MagnetsType::Center,
  MagnetsType::Begin,
  MagnetsType::End
}
 
- Public Types inherited from CYISceneView
enum  TimelineGetMode {
  TimelineGetMode::GetDefault,
  TimelineGetMode::GetTimeline,
  TimelineGetMode::GetTimelineGroup,
  TimelineGetMode::GetComponentOfTimelineGroup
}
 
- Public Types inherited from CYISceneNode
enum  LayoutDirtyFlag : uint8_t {
  LayoutDirtyFlag::Clean,
  LayoutDirtyFlag::ChildDirty,
  LayoutDirtyFlag::Dirty
}
 
enum  LayoutConfigFetchMode {
  LayoutConfigFetchMode::DoNotLazyInstantiate = 0,
  LayoutConfigFetchMode::LazyInstantiate
}
 
enum  MeasureMode {
  MeasureMode::Unspecified,
  MeasureMode::UpTo,
  MeasureMode::Exactly
}
 
enum  FetchType {
  FetchType::Optional = 0,
  FetchType::Mandatory
}
 
typedef std::reverse_iterator< IteratorReverseIterator
 
typedef uint16_t DirtyFlag
 
- Public Types inherited from CYIEventTarget
enum  SpecialEventTargetType : uint8_t {
  SpecialEventTargetType::None = 0x00,
  SpecialEventTargetType::LastMove = 0x01,
  SpecialEventTargetType::LastDown = 0x02,
  SpecialEventTargetType::PointerCapture = 0x04,
  SpecialEventTargetType::KeyboardCapture = 0x08,
  SpecialEventTargetType::Root = 0x10,
  SpecialEventTargetType::NoPick = 0x20,
  SpecialEventTargetType::TrackpadCapture = 0x40
}
 
enum  Phase : uint8_t {
  Phase::Bubble,
  Phase::Capture
}
 

Public Member Functions

 CYIScrollingView ()
 
virtual ~CYIScrollingView ()
 
virtual bool Init () override
 
void ScrollToHorizontalPosition (float normalizedPosition, uint32_t durationMs, CYITimeInterpolator *pInterpolator=nullptr)
 
void ScrollToHorizontalPosition (float normalizedPosition)
 
void ScrollToVerticalPosition (float normalizedPosition, uint32_t durationMs, CYITimeInterpolator *pInterpolator=nullptr)
 
void ScrollToVerticalPosition (float normalizedPosition)
 
void ScrollToPosition (const glm::vec2 &normalizedPositions, uint32_t durationMs=0, CYITimeInterpolator *pInterpolator=nullptr)
 
float GetHorizontalPosition () const
 
float GetVerticalPosition () const
 
void Reveal (CYISceneNode *pNode, uint32_t durationMs, CYITimeInterpolator *pInterpolator=nullptr)
 
void DisableHorizontalScrolling ()
 
void EnableHorizontalScrolling ()
 
void SetHorizontalScrollingEnabled (bool enabled)
 
bool IsHorizontalScrollingEnabled () const
 
void DisableVerticalScrolling ()
 
void EnableVerticalScrolling ()
 
void SetVerticalScrollingEnabled (bool enabled)
 
bool IsVerticalScrollingEnabled () const
 
void SetHorizontalOverpullDistance (float distance)
 
float GetHorizontalOverpullDistance () const
 
void SetVerticalOverpullDistance (float distance)
 
float GetVerticalOverpullDistance () const
 
void SetHorizontalOverpullRule (OverpullRule rule)
 
void SetVerticalOverpullRule (OverpullRule rule)
 
OverpullRule GetHorizontalOverpullRule () const
 
OverpullRule GetVerticalOverpullRule () const
 
void SetHorizontalScrollingAreaLayoutMode (LayoutMode mode)
 
void SetVerticalScrollingAreaLayoutMode (LayoutMode mode)
 
LayoutMode GetHorizontalScrollingAreaLayoutMode () const
 
LayoutMode GetVerticalScrollingAreaLayoutMode () const
 
bool HasHorizontalOverflow () const
 
bool HasVerticalOverflow () const
 
const CYIAABBGetScrollableRegion () const
 
void StopScrolling ()
 
void StopHorizontalScrolling ()
 
void StopVerticalScrolling ()
 
void SetHorizontalCarouselRule (CarouselRule carouselRule)
 
void SetVerticalCarouselRule (CarouselRule carouselRule)
 
CarouselRule GetHorizontalCarouselRule () const
 
CarouselRule GetVerticalCarouselRule () const
 
void SetCascadeTimelineGroupDelay (uint32_t delayMs)
 
uint32_t GetCascadeTimelineGroupDelay () const
 
CYITimelineGroupGetCascadeTimelineGroup (TimelineType type=TimelineType::In)
 
bool IsInVisibleRegion (const CYISceneNode *pCandidate) const
 
void SetHorizontalMagnets (const Magnets &magnets)
 
void RemoveHorizontalMagnets ()
 
Magnets GetHorizontalMagnets () const
 
void SetHorizontalSwipeOneItemEnabled (bool swipeOneItem)
 
bool IsHorizontalSwipeOneItemEnabled () const
 
void SetVerticalMagnets (const Magnets &magnets)
 
void RemoveVerticalMagnets ()
 
Magnets GetVerticalMagnets () const
 
void SetVerticalSwipeOneItemEnabled (bool swipeOneItem)
 
bool IsVerticalSwipeOneItemEnabled () const
 
void EnableMagnetism (CYISceneNode *pNode)
 
void DisableMagnetism (CYISceneNode *pChild)
 
bool IsMagnetic (const CYISceneNode *pNode) const
 
bool IsScrollingHorizontally () const
 
bool IsScrollingVertically () const
 
float GetHorizontalTrackpadLeaveFriction () const
 
void SetHorizontalTrackpadLeaveFriction (float friction)
 
float GetVerticalTrackpadLeaveFriction () const
 
void SetVerticalTrackpadLeaveFriction (float friction)
 
size_t GetHorizontalPageCount () const
 
size_t GetCurrentHorizontalPage () const
 
size_t GetVerticalPageCount () const
 
size_t GetCurrentVerticalPage () const
 
void SetHorizontalPagingStrategy (std::unique_ptr< PagingStrategy > PagingStrategy)
 
void SetVerticalPagingStrategy (std::unique_ptr< PagingStrategy > PagingStrategy)
 
const std::set< CYISceneNode * > & GetVisibleChildren () const
 
virtual void BuildDrawList (std::vector< IYIRenderer::Command > &children, CYIAbstractCameraSceneNode *pCameraToDrawWith=nullptr) override
 
virtual bool HandlesFocusInDescendants () const override
 
virtual bool ContainsFocusableDescendant (const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const override
 
virtual bool RequestFocus (CYIFocus::Direction direction=CYIFocus::Direction::Forward, CYIFocus::FocusRootRule focusRootRule=CYIFocus::FocusRootRule::DescendantsUpdateContext, const CYIAABB &previousFocusRect=CYIAABB(), const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) override
 
virtual CYISceneViewFindNextFocusInDescendants (const CYISceneView *pCurrentFocusView, CYIFocus::Direction direction, CYIAABB &screenSpaceFocusRegion, const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const override
 
virtual void FocusChangedInDescendants () override
 
virtual void FocusGainedInDescendants () override
 
- Public Member Functions inherited from CYISceneView
 CYISceneView ()
 
virtual ~CYISceneView ()
 
bool BuildFromTemplate (CYISceneManager *pSceneManager, const std::shared_ptr< CYIAssetViewTemplate > &pAssetViewTemplate, CYISceneManager::MissingClassHandlingMode missingHandlingMode=CYISceneManager::MissingClassHandlingMode::Abort)
 
bool IsInitialized () const
 
void SetClippingAreaNode (CYISceneNode *pClippingNode)
 
virtual bool GetProperty (const CYIString &propertyName, CYIString *pValue) const override
 
virtual bool HasProperties () const override
 
void EnableDefaultHitZone ()
 
bool IsResponsiveLayoutEnabled () const
 
void EnableResponsiveLayout ()
 
void DisableResponsiveLayout ()
 
void AddAnchor (EYIAnchorType anchorType)
 
YI_ANCHOR_DATA GetAnchor (EYIAnchorType anchorType) const
 
virtual const CYISceneView::AssetRequirementGetAssetRequirements (uint32_t *pRequirementCount)
 
CYIAbstractTimelineGetInTimeline () const
 
CYIAbstractTimelineGetOutTimeline () const
 
CYIAbstractTimelineGetFocusInTimeline () const
 
CYIAbstractTimelineGetFocusOutTimeline () const
 
bool HasFocus () const
 
void SetFocusable (bool focusable)
 
bool IsFocusable () const
 
bool CanBeFocused () const
 
void SetNextFocus (CYISceneView *pView, CYIFocus::Direction direction)
 
CYISceneViewGetNextFocus (CYIFocus::Direction direction) const
 
void SetInitiallyFocusedView (CYISceneView *pView)
 
CYISceneViewGetInitiallyFocusedView () const
 
CYISceneViewFindNextFocus (CYIFocus::Direction direction, const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const
 
CYISceneViewFindNextFocus (CYIFocus::Direction direction, CYIAABB &screenSpaceFocusRegion, const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const
 
const CYISceneNodeGetFocusRoot () const
 
CYISceneViewGetFocusHandler () const
 
virtual void OnFocusGained ()
 
virtual void FocusGained ()
 
virtual void OnFocusLost ()
 
virtual void FocusLost ()
 
const std::shared_ptr< CYIAssetViewTemplate > & GetViewTemplate () const
 
const std::vector< CYIString > & GetChildTemplateNames ()
 
virtual CYIAbstractTimelineGetTimeline (const CYIString &rMarkerName, TimelineGetMode mode=TimelineGetMode::GetDefault)
 
CYIAbstractTimelineGetTimeline (CYIMarkerData::ID id, TimelineGetMode mode=TimelineGetMode::GetDefault)
 
std::map< CYIString, CYITimeline * > GetTimelines () const
 
bool FindTimeline (CYIAbstractTimeline *&pTimeline, const CYIString &markerName, FetchType type, const CYIString &tag="", TimelineGetMode mode=TimelineGetMode::GetDefault)
 
CYITimelineGroupGetTimelineGroup (const CYIString &markerName)
 
std::unique_ptr< CYITimelineGroupBuildTimelineGroup (const CYIString &markerName)
 
void BuildAnchorList ()
 
virtual void Reset ()
 
void SetLayout (std::unique_ptr< CYILayout > pLayout)
 
const CYILayoutGetLayout () const
 
CYILayoutGetLayout ()
 
- Public Member Functions inherited from CYISceneNode
 CYISceneNode ()
 
virtual ~CYISceneNode ()
 
void ForceDirty ()
 
void SetDirtyFlag (DirtyFlag dirtyFlag)
 
DirtyFlag GetDirtyFlag () const
 
DirtyFlag GetPreviousDirtyFlag () const
 
const CYIStringGetName () const
 
CYIString GetUniqueName () const
 
void SetSceneManager (CYISceneManager *pSceneManager)
 
void SetName (const CYIString &name)
 
int32_t GetID () const
 
void SetID (int32_t id)
 
uint64_t GetUniqueID () const
 
bool AddChild (std::unique_ptr< CYISceneNode > pSceneNode)
 
bool AddChild (std::unique_ptr< CYISceneNode >, size_t index)
 
bool InsertChildAfter (CYISceneNode *pRefNode, std::unique_ptr< CYISceneNode > pSceneNode)
 
std::unique_ptr< CYISceneNodeRemoveChild (CYISceneNode *pSceneNode)
 
bool ReorderChild (size_t fromIndex, size_t toIndex)
 
CYITransformGetTransform ()
 
CYISceneNodeGetParent () const
 
bool ChangeParent (CYISceneNode *pParent)
 
CYISceneNodeGetDrawParent () const
 
bool IsAncestorOf (const CYISceneNode *pNode) const
 
CYISceneManagerGetSceneManager () const
 
size_t GetChildCount () const
 
uint32_t GetChildCountRecursive () const
 
CYISceneNodeGetChild (size_t index) const
 
Iterator begin (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
 
Iterator end (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
 
ReverseIterator rbegin (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
 
ReverseIterator rend (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
 
CYISceneNodeGetChild (const CYIString &name) const
 
size_t GetDrawChildCount () const
 
CYISceneNodeGetDrawChild (size_t index) const
 
CYISceneNodeGetDrawChildByID (int32_t id) const
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetChild (uint32_t targetMatchedNodeCount=1) const
 
template<class YI_SCENE_NODE_SUBCLASS >
std::list< YI_SCENE_NODE_SUBCLASS * > GetChildren () const
 
template<class YI_SCENE_NODE_SUBCLASS >
std::list< YI_SCENE_NODE_SUBCLASS * > GetDrawChildren () const
 
size_t GetIndexOfChild (const CYISceneNode *pSceneNode) const
 
void Show ()
 
void Hide ()
 
void SetVisibility (bool visible)
 
void SetOpacity (float opacity)
 
float GetCompositeOpacity () const
 
float GetLocalOpacity () const
 
bool IsVisible () const
 
bool IsTrulyVisible () const
 
CYISceneNodeGetNode (const CYIString &name)
 
CYISceneNodeGetNode (const CYIString &name, const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNode (const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, CYISceneNode *pStartAfterTarget)
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetNode (const CYIString &name)
 
CYISceneNodeGetNode (const int32_t id)
 
CYISceneNodeGetNode (const int32_t id, const CYIRuntimeTypeInfo &enforceClassType)
 
template<class YI_SCENE_NODE_SUBCLASS >
bool FindNode (YI_SCENE_NODE_SUBCLASS *&pNode, const CYIString &nodeName, FetchType type, const CYIString &tag)
 
std::list< CYISceneNode * > GetNodes (const CYIString &name)
 
std::list< CYISceneNode * > GetNodes (int32_t id)
 
std::list< CYISceneNode * > GetNodes (const CYIRuntimeTypeInfo &enforceClassType)
 
template<class YI_SCENE_NODE_SUBCLASS >
const YI_SCENE_NODE_SUBCLASS * GetNode (uint32_t targetMatchedNodeCount=1) const
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetNode (uint32_t targetMatchedNodeCount=1)
 
void SetMesh (const std::shared_ptr< CYIMesh > &pMesh)
 
bool SetNPatchBitmap (const std::shared_ptr< CYIBitmap > &pNPatchBitmap)
 
void ClearNPatch ()
 
void SetMaterial (const std::shared_ptr< CYIMaterial > &pMaterial, size_t index=0)
 
void AddEffect (const std::shared_ptr< CYIEffect > &pEffect)
 
void RemoveEffect (const std::shared_ptr< CYIEffect > &pEffect)
 
size_t GetEffectCount () const
 
std::shared_ptr< CYIEffectGetEffect (size_t index) const
 
void ConnectEffectsToTimelines (const CYITimelineTrack *pTrack)
 
void AddMask (std::unique_ptr< CYIMask > pMask)
 
std::unique_ptr< CYIMaskRemoveMask (const CYIMask *pMask)
 
size_t GetMaskCount () const
 
const CYIMaskGetMask (size_t index) const
 
CYIMaskGetMask (size_t index)
 
const std::shared_ptr< CYIMesh > & GetMesh () const
 
const std::shared_ptr< CYIBitmap > & GetNPatchBitmap () const
 
size_t GetMaterialCount () const
 
const std::shared_ptr< CYIMaterialGetMaterial (size_t index=0) const
 
const std::shared_ptr< IYIUniformBufferObject > & GetShaderUniforms () const
 
void SetMeshTransform (const glm::mat4 &rTransform)
 
void DestroyChildren ()
 
const glm::mat4 & GetLocalTransform () const
 
const glm::mat4 & GetEffectTransform () const
 
const glm::mat4 & GetWorldTransform () const
 
bool Intersects (const CYISceneNode *pNode) const
 
void SetRenderTarget (const std::shared_ptr< CYIRenderTarget > &pRenderTarget)
 
const std::shared_ptr< CYIRenderTargetGetRenderTarget () const
 
const CYIAABBGetWorldAABB () const
 
const CYIAABBGetLocalAABB () const
 
void SetAnchorPoint (const glm::vec3 &anchorPoint)
 
void SetAnchorPoint (float x, float y, float z)
 
void SetAnchorPointX (float x)
 
void SetAnchorPointY (float y)
 
void SetAnchorPointZ (float z)
 
void SetPosition (const glm::vec3 &position)
 
void SetPosition (float x, float y, float z)
 
void SetPositionX (float x)
 
void SetPositionY (float y)
 
void SetPositionZ (float z)
 
void SetRotation (const glm::vec3 &rotation)
 
void SetRotation (float pitchDegrees, float yawDegrees, float rollDegrees)
 
void SetRotationX (float pitchDegrees)
 
void SetRotationY (float yawDegrees)
 
void SetRotationZ (float rollDegrees)
 
void SetOrientation (float pitchDegrees, float yawDegrees, float rollDegrees)
 
void SetOrientation (const glm::quat &orientation)
 
void SetScale (const glm::vec3 &scale)
 
void SetScale (float factorX, float factorY, float factorZ)
 
void SetScaleX (float factor)
 
void SetScaleY (float factor)
 
void SetScaleZ (float factor)
 
const glm::vec3 & GetPosition () const
 
const glm::vec3 & GetScale () const
 
const glm::vec3 & GetWorldScale () const
 
const glm::vec3 & GetWorldSurfaceScale () const
 
const glm::vec3 & GetRotation () const
 
const glm::quat & GetOrientation () const
 
const glm::vec3 & GetAnchorPoint () const
 
virtual void SetSize (const glm::vec3 &size, bool dirtyLayout=true)
 
const glm::vec3 & GetSize () const
 
const glm::vec3 & GetInitialSize () const
 
void SetMeasuredSize (const glm::vec3 &measuredSize)
 
const glm::vec3 & GetMeasuredSize () const
 
void SetInternalCustomTimelineValue (uint32_t trackID, const CYIVariant &value)
 
virtual void SetCustomTimelineValue (uint32_t trackID, const CYIVariant &value)
 
void SetClippingOn ()
 
void SetClippingOff ()
 
bool GetClipping () const
 
void SetClippingBox (const CYIAABB &rWorldBox)
 
const CYIAABBGetClippingBox () const
 
void StartPropertyAnimation (PropertyAnimation::Type propType, float from, float to, uint32_t durMs, CYITimeInterpolator *pTimeInterpolator=nullptr, bool dirtyLayout=true)
 
void StopPropertyAnimation (PropertyAnimation::Type propType)
 
void UpdateLocalSpaceCollision (CYIActionEvent *pActionEvent)
 
void UpdateEventForLocalSpace (CYIActionEvent *pActionEvent, glm::vec3 &rayOrigin, glm::vec3 &rayNonOriginPoint) const
 
bool IsBoundingBoxHit (const CYIRay &rWorldSpaceRay) const
 
bool IsMeshHit (const CYIRay &rWorldSpaceRay) const
 
void DumpTree () const
 
void StartCaptureKeyboardEvents ()
 
void StopCaptureKeyboardEvents ()
 
void StartCaptureTrackpadEvents ()
 
void StopCaptureTrackpadEvents ()
 
void StartCapturePointerEvents (uint8_t pointerID)
 
void StopCapturePointerEvents (uint8_t pointerID)
 
bool DrawBehindChildren (CYISceneNode *pSceneNode, bool *pChanged=nullptr)
 
bool DrawInFrontOfChildren (CYISceneNode *pSceneNode, bool *pChanged=nullptr)
 
bool DrawBehind (CYISceneNode *pSceneNode, bool *pChanged=nullptr)
 
bool DrawInFront (CYISceneNode *pSceneNode, bool *pChanged=nullptr)
 
bool IsFocusRoot () const
 
void SetIsFocusRoot (bool isFocusRoot)
 
virtual void OnFocusGainedInDescendants ()
 
virtual void OnFocusLostInDescendants ()
 
virtual void FocusLostInDescendants ()
 
virtual void OnFocusChangedInDescendants ()
 
void SetUseLocalTransformAndAlpha (bool use)
 
virtual const std::map< CYIString, CYIString > & GetProperties () const override
 
void SetProperty (const CYIString &rPropertyName, const CYIString &rPropertyValue)
 
const std::shared_ptr< CYISceneNodeProxy > & GetSceneNodeProxy () const
 
void SetLayoutConfig (std::unique_ptr< CYILayoutConfig > pLayoutConfig)
 
const CYILayoutConfigGetLayoutConfig (LayoutConfigFetchMode fetchMode=LayoutConfigFetchMode::LazyInstantiate) const
 
CYILayoutConfigGetLayoutConfig (LayoutConfigFetchMode fetchMode=LayoutConfigFetchMode::LazyInstantiate)
 
void SetLayoutState (std::unique_ptr< CYILayoutState > pLayoutState)
 
const CYILayoutStateGetLayoutState () const
 
CYILayoutStateGetLayoutState ()
 
void RequestLayout ()
 
LayoutDirtyFlag GetLayoutDirtyFlag () const
 
virtual void SetLayoutDirtyFlag (LayoutDirtyFlag flag)
 
template<typename T >
bool CanCastTo () const
 
- Public Member Functions inherited from CYIEventTarget
 CYIEventTarget ()
 
virtual ~CYIEventTarget ()
 
bool AddEventListener (CYIEvent::Type eventType, CYIEventHandler *pListener, CYIEventTarget::Phase phase=CYIEventTarget::Phase::Bubble)
 
bool RemoveEventListener (CYIEvent::Type eventType, CYIEventHandler *pListener, CYIEventTarget::Phase phase=CYIEventTarget::Phase::Bubble)
 
void SetSpecialTypeFlag (SpecialEventTargetType type)
 
void ClearSpecialTypeFlag (SpecialEventTargetType type)
 
SpecialEventTargetType GetSpecialTypes () const
 
- Public Member Functions inherited from CYIScriptableRTTIObject
 CYIScriptableRTTIObject ()
 
virtual ~CYIScriptableRTTIObject ()
 
virtual const CYIRuntimeTypeInfoGetRuntimeTypeInfoForScriptObject () const override
 
- Public Member Functions inherited from CYIScriptableObject
 CYIScriptableObject ()
 
 CYIScriptableObject (const CYIScriptableObject &other)
 
CYIScriptableObjectoperator= (const CYIScriptableObject &other)
 
virtual ~CYIScriptableObject ()
 
CYIBindingImplementationGetBindingImplementation () const
 
void SetBindingImplementation (CYIBindingImplementation *pBindingImplementation)
 
- Public Member Functions inherited from CYISignalHandler
 CYISignalHandler ()
 
 CYISignalHandler (const CYISignalHandler &rSignalHandler)
 
virtual ~CYISignalHandler ()
 
CYISignalHandleroperator= (const CYISignalHandler &rSignalHandler)
 
void MoveToThread (CYIThread *pThread)
 This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More...
 
CYIThreadHandle GetThreadAffinity () const
 
void SetThreadAffinity (const CYIThreadHandle &rThreadAffinity)
 
virtual bool IsConnected () const
 
virtual bool IsConnected (const CYISignalBase &rSignal) const
 
void Disconnect (CYISignalBase &rSignal)
 
void DisconnectFromAllSignals ()
 
- Public Member Functions inherited from CYIThread::Listener
 Listener ()
 
virtual ~Listener ()
 
virtual void OnThreadStarted (CYIThread *)
 
virtual void OnThreadTerminated (CYIThread *)
 
virtual void OnThreadFinished (CYIThread *)
 
- Public Member Functions inherited from IYIPropertiesSource
virtual ~IYIPropertiesSource ()
 
- Public Member Functions inherited from CYIEventHandler
 CYIEventHandler ()
 
 CYIEventHandler (const CYIEventHandler &)
 
virtual ~CYIEventHandler ()
 
CYIEventHandleroperator= (const CYIEventHandler &)
 
bool RegisterEventFilter (CYIEventFilter *pFilter)
 
bool UnregisterEventFilter (CYIEventFilter *pFilter)
 
bool PreFilter (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent)
 
bool PostFilter (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent)
 
bool AreEventsEnabled () const
 
void EnableEvents (bool enable)
 
- Public Member Functions inherited from CYIScrollController::ScrollListener
virtual ~ScrollListener ()
 
- Public Member Functions inherited from CYITime::UpdateListener
 UpdateListener ()
 
virtual ~UpdateListener ()
 
virtual bool GetDisablesInput ()
 

Public Attributes

CYISignal InteractionBegan
 
CYISignal HorizontalScrollingBegan
 
CYISignal VerticalScrollingBegan
 
CYISignal< float > HorizontalPositionChanged
 
CYISignal< float > VerticalPositionChanged
 
CYISignal InteractionEnded
 
CYISignal HorizontalScrollingEnded
 
CYISignal VerticalScrollingEnded
 
CYISignal< bool > HorizontalOverflowChanged
 
CYISignal< bool > VerticalOverflowChanged
 
CYISignal< CYISceneNode * > ChildEnteredVisibleRegion
 
CYISignal< CYISceneNode * > ChildLeftVisibleRegion
 
CYISignal< size_t, size_tHorizontalPageChanged
 
CYISignal< size_t, size_tHorizontalPageCountChanged
 
CYISignal< size_t, size_tVerticalPageChanged
 
CYISignal< size_t, size_tVerticalPageCountChanged
 
- Public Attributes inherited from CYISceneView
CYISignal< CYISceneView * > GainedFocus
 Emitted when focus has entered this view. More...
 
CYISignal< CYISceneView * > LostFocus
 Emitted when focus has left this view. More...
 
- Public Attributes inherited from CYISceneNode
CYISignal< CYISceneNode *, PropertyAnimation::TypePropertyAnimationComplete
 
CYISignal DescendantGainedFocus
 Emitted when focus has entered this tree. More...
 
CYISignal DescendantLostFocus
 Emitted when focus has left this tree. More...
 
CYISignal DescendantsChangedFocus
 Emitted when focus has changed within this tree. More...
 

Protected Types

enum  Direction {
  Direction::Horizontal,
  Direction::Vertical,
  Direction::DirectionsCount
}
 
enum  ScrollDirection {
  ScrollDirection::Closest,
  ScrollDirection::Forward,
  ScrollDirection::Reverse
}
 

Protected Member Functions

CYIScrollControllerGetScrollController (Direction direction) const
 
void ConfigureScrollControllers ()
 
virtual bool BroadcastEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) override
 
void ConfigureScrollingRange (Direction direction, float contentSize)
 
void ConfigureOverpull (Direction direction, float viewSize)
 
void ConfigureMagnets (Direction direction, float viewSize, float oldViewSize)
 
virtual void ParseProperties ()
 
virtual bool HandleEvent (const std::shared_ptr< CYIEventDispatcher > &pEventDispatcher, CYIEvent *pEvent) override
 
virtual void Measure (const MeasureSpec &widthSpec, const MeasureSpec &heightSpec, const MeasureSpec &depthSpec) override
 
virtual void ApplyMeasurements () override
 
virtual void SizeChanged () override
 
virtual void WorldBoundingBoxUpdated () override
 
virtual void ChildAdded (CYISceneNode *pChild) override
 
virtual void ChildRemoved (CYISceneNode *pChild) override
 
virtual void Reveal (CYISceneNode *pNode, uint32_t durationMs, ScrollDirection horizontalDirection, ScrollDirection verticalDirection, CYITimeInterpolator *pInterpolator=nullptr)
 
virtual CYIAABB CalculateScrollableRegion () const
 
CYIAABB CalculateContentSize () const
 
bool IsInExpandedVisibleRegion (const CYISceneNode *pCandidate, float visibleRegionMultiplier) const
 
void CheckAndNotifyVisibilityInVisibilityRegion (CYISceneNode *pChild)
 
virtual void ChildVisibilityInVisibleRegionChanged (CYISceneNode *pChild, bool isInVisibleRegion)
 
virtual void OnChildVisibilityInVisibleRegionChanged (CYISceneNode *pChild, bool isInVisibleRegion)
 
virtual void ChildMovedInVisibleRegion (CYISceneNode *pChild, const glm::vec2 &normalizedPosition)
 
virtual void OnChildMovedInVisibleRegion (CYISceneNode *pChild, const glm::vec2 &normalizedPosition)
 
virtual void OnScrollAuto (CYIScrollController *pController) override
 
virtual void OnScrollStarted (CYIScrollController *pController) override
 
virtual void OnScrolled (CYIScrollController *pController, YI_SCROLLED_INFO scrolledInfo) override
 
virtual void OnScrollEnded (CYIScrollController *pController) override
 
virtual void UpdateEnd () override
 
bool IsCarouseling (Direction direction) const
 
CYITimelineGroupGetCascadeTimelineGroup (TimelineType type, bool updateTimeline)
 
virtual CYIAbstractTimelineGetCascadeTimelineFor (TimelineType type, CYISceneView *pView)
 
virtual std::map< CYISceneView *, uint64_t > GetTotalCascadeDelayFor (TimelineType type, const std::vector< ViewAndDistance > &visibleViews)
 
virtual bool OnFrameTimeUpdated (std::chrono::microseconds frameTime) override
 
virtual CYIAbstractCameraSceneNodeFindActiveCamera (const CYISceneNode *pTargetSceneNode=nullptr) const override
 
float GetScrollDeltaToNodeInFocusPosition (Direction direction, CYISceneNode *pNode) const
 
void UpdateHorizontalPagingStrategy ()
 
void UpdateVerticalPagingStrategy ()
 
virtual void UpdateHorizontalPagingStrategyImpl ()
 
virtual void UpdateVerticalPagingStrategyImpl ()
 
- Protected Member Functions inherited from CYISceneView
void UpdateClipping ()
 
virtual void WorldScaleUpdated () override
 
virtual void OnViewReflowed (const glm::vec3 &worldScale)
 
virtual void ViewReflowed (const glm::vec3 &worldScale)
 
virtual bool ProcessEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) override
 
void UpdateResponsiveLayoutAnchors ()
 
virtual void ChildNeedsLayout () override
 
virtual void LayoutDirtied () override
 
virtual void ChildVisibilityChanged (CYISceneNode *pChild) override
 
void OnViewIsInAnimatedPosition ()
 
void OnViewIsGoingOutOfAnimatedPosition ()
 
void SetInTimeline (CYIAbstractTimeline *pTimeline)
 
void SetOutTimeline (CYIAbstractTimeline *pTimeline)
 
virtual void OnInit ()
 
bool TryRequestFocusOnInitiallyFocusedView ()
 
- Protected Member Functions inherited from CYISceneNode
void Update ()
 
virtual void OnUpdateBegin ()
 
virtual void UpdateBegin ()
 
virtual void OnUpdateEnd ()
 
virtual void OnDirtyFlagChanged ()
 
virtual void DirtyFlagChanged ()
 
virtual void OnTransformUpdated ()
 
virtual void TransformUpdated ()
 
virtual void OnWorldScaleUpdated ()
 
virtual void OnWorldSurfaceScaleUpdated ()
 
virtual void WorldSurfaceScaleUpdated ()
 
virtual void OnVisibilityUpdated ()
 
virtual void VisibilityUpdated ()
 
virtual void OnCompositeOpacityUpdated ()
 
virtual void CompositeOpacityUpdated ()
 
virtual void OnWorldBoundingBoxUpdated ()
 
virtual void OnLocalBoundingBoxUpdated ()
 
virtual void LocalBoundingBoxUpdated ()
 
virtual void OnChildAdded (CYISceneNode *pChild)
 
virtual void OnChildRemoved (CYISceneNode *pChild)
 
virtual void OnSizeChanged ()
 
virtual void OnChildVisibilityChanged (CYISceneNode *pChild)
 
LayoutDirtyFlag GetCurrentLayoutDirtyFlag () const
 
virtual CYIString GetDumpTreeString () const
 
void DumpTree (int32_t indentLevel) const
 
virtual void SetCustomUniforms ()
 
template<class T >
void SetNodeType ()
 
virtual CYISceneNodeGetNodeFromChildren (const CYIString &name)
 
virtual CYISceneNodeGetNodeFromChildren (const int32_t id)
 
virtual CYISceneNodeGetNodeFromChildren (const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeFromChildrenAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, bool *pTargetReached, CYISceneNode *pStartAfterTarget)
 
- Protected Member Functions inherited from CYIScriptableRTTIObject
virtual std::pair< const CYIRuntimeTypeInfo *, const void * > GetRuntimeTypeInfoWithObject () const =0
 

Static Protected Member Functions

static const CYIStringDirectionToString (Direction direction)
 

Protected Attributes

uint32_t m_focusScrollDuration
 
std::unique_ptr< PagingStrategym_horizontalPagingStrategy
 
std::unique_ptr< PagingStrategym_verticalPagingStrategy
 
- Protected Attributes inherited from CYISceneView
bool m_stopEventPropagation
 
bool m_responsiveLayoutEnabled
 
bool m_sceneTreeBuilt
 
bool m_inAnimatedPosition
 
CYISceneNodem_pClippingNode
 
CYIAbstractTimelinem_pFocusInTimeline
 
CYIAbstractTimelinem_pFocusOutTimeline
 
std::unique_ptr< CYILayoutm_pLayout
 
std::shared_ptr< CYIAssetViewTemplatem_pAssetViewTemplate
 
std::shared_ptr< CYISceneNodeProxym_pInitiallyFocusedView
 
std::multimap< EYIAnchorType, YI_ANCHOR_DATAm_anchors
 
std::map< CYIString, std::unique_ptr< CYITimeline > > m_timelines
 
std::map< CYIString, std::unique_ptr< CYIParallelTimelineGroup > > m_timelineGroups
 
- Protected Attributes inherited from CYISceneNode
CYIString m_name
 
CYISceneNodem_pParent
 
CYISceneNodem_pDrawParent
 
std::vector< std::unique_ptr< CYISceneNode > > m_children
 
std::vector< CYISceneNode * > m_drawChildren
 
std::map< CYIString, CYIStringm_Properties
 
std::vector< std::shared_ptr< CYIMaterial > > m_pMaterials
 
std::vector< std::unique_ptr< CYIMask > > m_Masks
 
std::vector< std::shared_ptr< CYIEffect > > m_Effects
 
std::vector< PropertyAnimation * > m_propertyAnimations
 
float m_localOpacity
 
CYIAABB m_WSClipBox
 
glm::mat4 m_EffectTransform
 
std::unique_ptr< CYITransformm_pTransform
 
glm::vec3 m_size
 
glm::vec3 m_initialSize
 
glm::vec3 m_measuredSize
 
glm::vec3 m_vlsLastCollision
 
bool m_clip
 
bool m_localVisibility
 
int32_t m_id
 
uint64_t m_guid
 
std::shared_ptr< CYIRenderTargetm_pRenderTarget
 
std::shared_ptr< CYIMeshm_pMesh
 
std::unique_ptr< CYINPatch > m_pNPatch
 
std::shared_ptr< CYIBitmapm_pNPatchBitmap
 
std::shared_ptr< IYIUniformBufferObjectm_pShaderUniforms
 
- Protected Attributes inherited from CYIEventTarget
std::vector< EventListenerEntry > m_listeners
 
SpecialEventTargetType m_specialTypes
 
- Protected Attributes inherited from CYIEventHandler
bool m_enableEvents
 

Friends

class CYIScrollingViewPriv
 

Additional Inherited Members

- Static Public Member Functions inherited from CYISceneView
static void RegisterAllViews ()
 
- Static Public Member Functions inherited from CYISceneNode
static void RegisterAllSceneNodes ()
 
- Static Public Attributes inherited from CYISceneNode
static const float OPACITY_NOT_VISIBLE_EPSILON
 
static constexpr DirtyFlag DirtyClean = 0x0000
 
static constexpr DirtyFlag DirtySceneGraph = 0x0001
 
static constexpr DirtyFlag DirtyVisibility = 0x0002
 
static constexpr DirtyFlag DirtyOpacity = 0x0004
 
static constexpr DirtyFlag DirtyLocalTransform = 0x0008
 
static constexpr DirtyFlag DirtyWorldTransform = 0x0010
 
static constexpr DirtyFlag DirtyUniform = 0x0020
 
static constexpr DirtyFlag DirtyWorldBoundingBox = 0x0040
 
static constexpr DirtyFlag DirtyMesh = 0x0080
 
static constexpr DirtyFlag DirtyWorldSurfaceScale = 0x0100
 
static constexpr DirtyFlag DirtyWorldScale = 0x0200
 
static constexpr DirtyFlag DirtyLocalBoundingBox = 0x0400
 
static constexpr DirtyFlag DirtyEverything = (DirtySceneGraph | DirtyVisibility | DirtyOpacity | DirtyLocalTransform | DirtyWorldTransform | DirtyUniform | DirtyWorldBoundingBox | DirtyWorldSurfaceScale | DirtyWorldScale | DirtyLocalBoundingBox)
 
- Static Public Attributes inherited from CYITime::UpdateListener
static const uint32_t DEFAULT_UPDATE_PRIORITY = 0
 

Member Enumeration Documentation

Enumerator
Never 

The view is bounded to the content, it will not carousel.

Always 

The view will carousel regardless of whether the content is greater than the view. If there is not enough content to fill the view, there will be gaps between iterations.

IfOverflowing 

The view will carousel only when the amount of content surpasses the size of the view.

enum CYIScrollingView::Direction
strongprotected
Enumerator
Horizontal 
Vertical 
DirectionsCount 
Enumerator
FitContent 

The content is laid out as within a container with 'fit-content' set on it.

FitContentIfOverflowing 

The content is laid out as within a container with 'fit-content' set on it, with a minimum size equal to that of the scrolling view itself.

FillView 

The content is laid out as within a container of fixed size whose size equals that of the scrolling view. As a consequence, scrolling appears disabled when this mode is selected.

Enumerator
None 

No magnet is used.

Edges 

Two magnets are used (i.e. left and right, or up and down).

Center 

A single center magnet is used.

Begin 

A single begin magnet is used (i.e left or up).

End 

A single end magnet is used (i.e right or down).

Enumerator
Always 

Overpull occurs whether or not there is enough content in the view to make it scrollable.

IfOverflowing 

Overpull occurs only if the amount of content surpasses the size of the view.

enum CYIScrollingView::ScrollDirection
strongprotected
Enumerator
Closest 

When revealing an item using CYIScrollingView::Reveal or scrolling to an item using CYIScrollingView::ScrollToHorizontalPosition or CYIScrollingView::ScrollToVerticalPosition, indicates that the view should take the shortest path to the item.

Forward 

When revealing an item using CYIScrollingView::Reveal or scrolling to an item using CYIScrollingView::ScrollToHorizontalPosition or CYIScrollingView::ScrollToVerticalPosition, indicates that the view should take the forward direction (right, down) even if that means wrapping through the content in a carousel.

Reverse 

When revealing an item using CYIScrollingView::Reveal or scrolling to an item using CYIScrollingView::ScrollToHorizontalPosition or CYIScrollingView::ScrollToVerticalPosition, indicates that the view should take the reverse direction (left, up) even if that means wrapping through the content in a carousel.

Enumerator
In 

An 'in' timeline. Users typically play these timelines when a scene is staged.

Out 

An 'out' timeline. Users typically play these timelines when a scene is unstaged.

Constructor & Destructor Documentation

CYIScrollingView::CYIScrollingView ( )
virtual CYIScrollingView::~CYIScrollingView ( )
virtual

Member Function Documentation

virtual void CYIScrollingView::ApplyMeasurements ( )
overrideprotectedvirtual

Applies the measured sizes of this node's children.

Note
Typically, if ApplyMeasurements is overridden then Measure must also be overridden.
Measurements should be applied before calculating position for layout.
Warning
Subclasses that override this function must ensure that the ApplyMeasurements function of ALL children of this scene node is called.
Note
Subclasses that override this function should make use of the GetCurrentLayoutDirtyFlag() function (rather than GetLayoutDirtyFlag() ).

Reimplemented from CYISceneView.

Reimplemented in CYIListView.

virtual bool CYIScrollingView::BroadcastEvent ( const std::shared_ptr< CYIEventDispatcher > &  pDispatcher,
CYIEvent pEvent 
)
overrideprotectedvirtual

Recursively broadcasts an event to the node's children, then offers it to the node itself.

Reimplemented from CYISceneNode.

virtual void CYIScrollingView::BuildDrawList ( std::vector< IYIRenderer::Command > &  drawList,
CYIAbstractCameraSceneNode pCameraToDrawWith = nullptr 
)
overridevirtual

Interal use only, this function will construct the list of render actions required to render the data contained in the subtree rooted at this node. Specify the camera used to draw with pCameraToDrawWith. The camera must be a draw-child of the node and be visible.

Warning
Override at your own risk; no guarantee of consistent behaviour.

Reimplemented from CYISceneView.

CYIAABB CYIScrollingView::CalculateContentSize ( ) const
protected

Calculates the region (in terms of size) encompassed by the children of this scrolling view.

Hidden nodes are excluded. This view's camera is also excluded. If all children are hidden, or no viable children exist, a 0-sized AABB at (0,0) will be returned. If there are visible children, the bounding box may not necessarily contain the point (0,0).

Note
When a layout is assigned to this view, the layout's measured size is used as content size and this function is not used.
virtual CYIAABB CYIScrollingView::CalculateScrollableRegion ( ) const
protectedvirtual

The default implementation returns the bounding box encompassing the entirety of the "size" our immediate content (children) and ourselves. This differs from the world bounding box in that children of children are not included.

Subclasses may override this function to provide a custom scrollable region calculation.

Note
When a layout is assigned to this view, the layout's measured size is used as scrollable region and the return value of this function is ignored.
void CYIScrollingView::CheckAndNotifyVisibilityInVisibilityRegion ( CYISceneNode pChild)
protected

Checks if pChild is within the visible region and emits the ChildEnteredVisibleRegion and ChildLeftVisibleRegion signals if required. This function has no effect if pChild is not a direct child of this scrolling view.

virtual void CYIScrollingView::ChildAdded ( CYISceneNode pChild)
overrideprotectedvirtual

Called when a child is added. If pChild is in the visible area the CYIScrollingView::ChildEnteredVisibleRegion signal will be emmited on the next update.

Reimplemented from CYISceneView.

virtual void CYIScrollingView::ChildMovedInVisibleRegion ( CYISceneNode pChild,
const glm::vec2 &  normalizedPosition 
)
protectedvirtual

Reimplemented in CYIListView.

virtual void CYIScrollingView::ChildRemoved ( CYISceneNode pChild)
overrideprotectedvirtual

Called when a child is removed. If pChild is in the visible area the CYIScrollingView::ChildLeftVisibleRegion signal will be emmited.

Reimplemented from CYISceneView.

virtual void CYIScrollingView::ChildVisibilityInVisibleRegionChanged ( CYISceneNode pChild,
bool  isInVisibleRegion 
)
protectedvirtual

A function called when the visibility of a child within the visible region changes.

Warning
Overrides must call the base class implementation.
See also
OnChildVisibilityInVisibleRegionChanged()

Reimplemented in CYIListView.

void CYIScrollingView::ConfigureMagnets ( Direction  direction,
float  viewSize,
float  oldViewSize 
)
protected
void CYIScrollingView::ConfigureOverpull ( Direction  direction,
float  viewSize 
)
protected
void CYIScrollingView::ConfigureScrollControllers ( )
protected

Calls ConfigureScrollingRange and ConfigureOverpull for each CYIScrollingView::Direction.

See also
ConfigureScrollingRange(CYIScrollingView::Direction, float)
ConfigureOverpull(CYIScrollingView::Direction, float)
ConfigureMagnets(CYIScrollingView::Direction, float)
void CYIScrollingView::ConfigureScrollingRange ( Direction  direction,
float  contentSize 
)
protected
virtual bool CYIScrollingView::ContainsFocusableDescendant ( const CYIFocusSearchOptions options = CYIFocusSearchOptions()) const
overridevirtual

Returns true if this view contains any descendants which can receive focus.

This override only considers descendants which are within the screen space for the view.

See also
CYIFocus::GetScreenSpaceFocusRegion

Reimplemented from CYISceneNode.

static const CYIString& CYIScrollingView::DirectionToString ( Direction  direction)
staticprotected

Returns the string representation of the provided enum value direction.

void CYIScrollingView::DisableHorizontalScrolling ( )

Disables scrolling on the horizontal axis. Scrolling is enabled by default.

See also
ScrollToHorizontalPosition(float, uint32_t, CYITimeInterpolator*)
void CYIScrollingView::DisableMagnetism ( CYISceneNode pChild)
void CYIScrollingView::DisableVerticalScrolling ( )

Disables scrolling on the vertical axis. Scrolling is enabled by default.

See also
ScrollToVerticalPosition(float, uint32_t, CYITimeInterpolator*)
void CYIScrollingView::EnableHorizontalScrolling ( )

Enables scrolling on the horizontal axis. Scrolling is enabled by default.

See also
ScrollToHorizontalPosition(float, uint32_t, CYITimeInterpolator*)
void CYIScrollingView::EnableMagnetism ( CYISceneNode pNode)

Enable pNode to be snapped to when the scrolling view is configured with at least one magnet. Every CYISceneNode is magnetic by default.

Note
When using 10ft focus nagivation, the 'magnetism' property is ignored. All focusable items are assumed to be magnetic, and all non-focusable items are assumed to be non-magnetic.
See also
SetHorizontalMagnet()
SetVerticalMagnet()
void CYIScrollingView::EnableVerticalScrolling ( )

Enables scrolling on the vertical axis. Scrolling is enabled by default.

See also
ScrollToVerticalPosition(float, uint32_t, CYITimeInterpolator*)
virtual CYIAbstractCameraSceneNode* CYIScrollingView::FindActiveCamera ( const CYISceneNode pTargetSceneNode = nullptr) const
overrideprotectedvirtual

The active camera is the last encountered visible child of this node which is also a camera node. The order the children are encountered in is defined by the draw order.

Note
This method can be overridden to find the active camera based on the child node pTargetSceneNode. Otherwise this argument is not used.

Reimplemented from CYISceneNode.

virtual CYISceneView* CYIScrollingView::FindNextFocusInDescendants ( const CYISceneView pCurrentFocusView,
CYIFocus::Direction  direction,
CYIAABB screenSpaceFocusRegion,
const CYIFocusSearchOptions options = CYIFocusSearchOptions() 
) const
overridevirtual

Handle focus changes within this view. This will initiate a focus search within this view, considering all descendants. Scrolling will override screenSpaceFocusRegion, this box should be used for future focus searches.

Reimplemented from CYISceneView.

virtual void CYIScrollingView::FocusChangedInDescendants ( )
overridevirtual

Scrolls to reveal the newly focused item if necessary.

Reimplemented from CYISceneNode.

virtual void CYIScrollingView::FocusGainedInDescendants ( )
overridevirtual

Scrolls to reveal the newly focused item if necessary.

Reimplemented from CYISceneNode.

virtual CYIAbstractTimeline* CYIScrollingView::GetCascadeTimelineFor ( TimelineType  type,
CYISceneView pView 
)
protectedvirtual

Returns the cascade timeline of type type for view pView. When type is CYIScrollingView::TimelineType::In, the timeline with marker name 'CascadeIn' is returned. When type is CYIScrollingView::TimelineType::Out, the timeline with marker name 'CascadeOut' is returned. This function returns nullptr if the relevant timeline could not be located in pView.

Reimplemented in CYIListView.

CYITimelineGroup* CYIScrollingView::GetCascadeTimelineGroup ( TimelineType  type = TimelineType::In)

Returns the cascade timeline group of type type. This timeline is built from the timelines of the visible children of this view, and is updated each time this function is called.

Note
Because cascade timeline groups are updated only when this function is called, it is not advisable to cache the returned pointer.
Warning
The returned timeline is owned by this scrolling view and must not be deleted.
CYITimelineGroup* CYIScrollingView::GetCascadeTimelineGroup ( TimelineType  type,
bool  updateTimeline 
)
protected

Returns the cascade timeline group of type type. If updateTimeline is false, the existing cascade timeline group is returned without being updated. This may be useful when manually removing timelines from cascade timeline groups. This function may return nullptr.

See also
GetCascadeTimelineGroup(TimelineType)
uint32_t CYIScrollingView::GetCascadeTimelineGroupDelay ( ) const
See also
SetCarouselTimelineDelay
size_t CYIScrollingView::GetCurrentHorizontalPage ( ) const

Returns the current horizontal page that the view is scrolled to, if a horizontal paging strategy is set. Otherwise returns max size_t value.

See also
SetHorizontalPagingStrategy
size_t CYIScrollingView::GetCurrentVerticalPage ( ) const

Returns the current vertical page that the view is scrolled to, if a vertical paging strategy is set. Otherwise returns max size_t value.

See also
SetVerticalPagingStrategy
CarouselRule CYIScrollingView::GetHorizontalCarouselRule ( ) const
Magnets CYIScrollingView::GetHorizontalMagnets ( ) const

Returns an object containing the current configuration of the horizontal magnets. The CYIScrollingView::Magnets::type field must be read to see which other fields are valid.

float CYIScrollingView::GetHorizontalOverpullDistance ( ) const
OverpullRule CYIScrollingView::GetHorizontalOverpullRule ( ) const
size_t CYIScrollingView::GetHorizontalPageCount ( ) const

Returns the number of horizontal pages in the view, if a horizontal paging strategy is set. Otherwise returns 0.

See also
SetHorizontalPagingStrategy
float CYIScrollingView::GetHorizontalPosition ( ) const
LayoutMode CYIScrollingView::GetHorizontalScrollingAreaLayoutMode ( ) const
float CYIScrollingView::GetHorizontalTrackpadLeaveFriction ( ) const

Returns the friction necessary to have focus leave the scrolling view when using a trackpad and swiping horizontally.

See also
SetHorizontalTrackpadLeaveFriction
const CYIAABB& CYIScrollingView::GetScrollableRegion ( ) const

Returns the current scrollable region bounds. The default bounds returns the bounding box encompassing the entirety of our immediate children and ourselves. This differs from the world bounding box in that children of children are not included. Subclasses may provide a custom scrollable region calculation by overriding CalculateScrollableRegion() to provide their own required implementation for calculating the scrollable region.

Note
When a layout is assigned to this view, the layout's measured size is used as the scrollable region.
CYIScrollController* CYIScrollingView::GetScrollController ( Direction  direction) const
protected
float CYIScrollingView::GetScrollDeltaToNodeInFocusPosition ( Direction  direction,
CYISceneNode pNode 
) const
protected

Returns the distance that the scrolling view would need to scroll for pNode to be in a focus position. If magnets are enabled, this includes positions where pNode is snapped to magnets corresponding to direction. If not, then this includes pNode being centered in the scrolling view.

virtual std::map<CYISceneView *, uint64_t> CYIScrollingView::GetTotalCascadeDelayFor ( TimelineType  type,
const std::vector< ViewAndDistance > &  visibleViews 
)
protectedvirtual

Returns the total cascade timeline delays for a cascade timeline group of type type. These delays represent how long the cascade timeline group will wait before starting the cascade timeline of a particular view.

The visibleViews vector contains the list of visible views (that have the appropriate cascade timeline) for which a delay must be calculated. The vector also contains the distance from the top-left corner of the visible region to the center of each view. For each view in visibleViews, an entry must be added to the returned std::map.

Note
If any of the views present in visibleViews are not present in the returned map, a value of 0 will be assumed.

The default implementation of this function uses the return value of GetCascadeTimelineGroupDelay() and applies that value between each child cascade timeline. The timeline of the view closest to the top-left corner of the visible area is played first, followed by the second closest, and so on.

CarouselRule CYIScrollingView::GetVerticalCarouselRule ( ) const
Magnets CYIScrollingView::GetVerticalMagnets ( ) const

Returns an object containing the current configuration of the vertical magnets. The CYIScrollingView::Magnets::type field must be read to see which other fields are valid.

float CYIScrollingView::GetVerticalOverpullDistance ( ) const
OverpullRule CYIScrollingView::GetVerticalOverpullRule ( ) const
size_t CYIScrollingView::GetVerticalPageCount ( ) const

Returns the number of vertical pages in the view, if a vertical paging strategy is set. Otherwise returns 0.

See also
SetVerticalPagingStrategy
float CYIScrollingView::GetVerticalPosition ( ) const
LayoutMode CYIScrollingView::GetVerticalScrollingAreaLayoutMode ( ) const
float CYIScrollingView::GetVerticalTrackpadLeaveFriction ( ) const

Returns the friction necessary to have focus leave the scrolling view when using a trackpad and swiping vertically.

See also
SetVerticalTrackpadLeaveFriction
const std::set<CYISceneNode *>& CYIScrollingView::GetVisibleChildren ( ) const

Returns the children that are within the visible range of the scrolling view.

virtual bool CYIScrollingView::HandleEvent ( const std::shared_ptr< CYIEventDispatcher > &  pDispatcher,
CYIEvent pEvent 
)
overrideprotectedvirtual

Pure virtual for the child to implement according to how they wish the events to be handled.

The method is to return true if the event was processed and false otherwise.

Reimplemented from CYISceneView.

Reimplemented in CYIScrollingTextView.

virtual bool CYIScrollingView::HandlesFocusInDescendants ( ) const
overridevirtual

Returns true to indicate that this view handles focus in its descendants.

Reimplemented from CYISceneView.

Reimplemented in CYIScrollingTextView.

bool CYIScrollingView::HasHorizontalOverflow ( ) const

Returns true if the content of the view overflows its horizontal bounds.

bool CYIScrollingView::HasVerticalOverflow ( ) const

Returns true if the content of the view overflows its vertical bounds.

virtual bool CYIScrollingView::Init ( )
overridevirtual

Initializes the view and all of its content. Subclasses must call CYISceneView::Init().

Note
This must be called after CYISceneView::BuildFromTemplate()

Reimplemented from CYISceneView.

Reimplemented in CYIListView, CYIPageIndicatorView, and CYIScrollingTextView.

bool CYIScrollingView::IsCarouseling ( Direction  direction) const
protected

Returns true if this view is currently carouseling.

Note
This differs from the current carousel rule, since it takes into account content size when CYIScrollingView::CarouselRule::IfOverflowing is specified.
See also
CYIScrollingView::CarouselRule
bool CYIScrollingView::IsHorizontalScrollingEnabled ( ) const

Returns true if scrolling is enabled on the horizontal axis.

bool CYIScrollingView::IsHorizontalSwipeOneItemEnabled ( ) const

Gets whether horizontal magnets should be constrained to only scroll as far as the next magnetic point per swipe.

bool CYIScrollingView::IsInExpandedVisibleRegion ( const CYISceneNode pCandidate,
float  visibleRegionMultiplier 
) const
protected

Returns true if pCandidate is within the bounds of this view, defined by its size (scaled by visibleRegionMultiplier). The visibleRegionMultiplier parameter can be used to expand or contract the visible region by a factor, while keeping the test region centered. For example, a value of 2.0f indicates that the test region should be 50% larger than the visible region on each side.

Note
pCandidate must be a direct child of this scrolling view. A runtime assertion will occur otherwise.
See also
IsInVisibleRegion(CYISceneNode *)
bool CYIScrollingView::IsInVisibleRegion ( const CYISceneNode pCandidate) const

Returns true if pCandidate is within the bounds of this view, defined by its size.

Note
pCandidate must be a direct child of this scrolling view. A runtime assertion will occur otherwise.
See also
CYIScrollingView::ChildEnteredVisibleRegion
CYIScrollingView::ChildLeftVisibleRegion
bool CYIScrollingView::IsMagnetic ( const CYISceneNode pNode) const
bool CYIScrollingView::IsScrollingHorizontally ( ) const

Returns true if the view is currently scrolling in the horizontal direction.

See also
HorizontalScrollingEnded()
HorizontalScrollingBegan()
bool CYIScrollingView::IsScrollingVertically ( ) const

Returns true if the view is currently scrolling in the vertical direction.

See also
VerticalScrollingEnded()
VerticalScrollingBegan()
bool CYIScrollingView::IsVerticalScrollingEnabled ( ) const

Returns true if scrolling is enabled on the vertical axis.

bool CYIScrollingView::IsVerticalSwipeOneItemEnabled ( ) const

Gets whether vertical magnets should be constrained to only scroll as far as the next magnetic point per swipe.

virtual void CYIScrollingView::Measure ( const MeasureSpec widthSpec,
const MeasureSpec heightSpec,
const MeasureSpec depthSpec 
)
overrideprotectedvirtual

Measures this scene node, considering the layout configuration constraints (if available) and the provided measure specifications. The Measure function is used by the layout system to determine the 'desired' size of elements in a container. The result of calls to this function can be accessed through the GetMeasuredSize() function.

Note
The Measure function may be called multiple times on a single scene node during a layout pass.
The measure specs passed in must take in consideration the node's scale. For example, if a node is calling the Measure function on one of its children and that child has a scale of glm::vec3(1, 3, 1), then the size of heightSpec must be divided by 3.
The measured values may exceed the provided measure specifications if the specifications cannot be met given the constraints placed on this scene node. In other words, the constraints placed on this node have a higher priority than the provided measure specifications.
Warning
Subclasses that override this function must ensure that the Measure function of ALL children of this scene node is called at least once, even if those children are hidden.
Note
Typically, if Measure is overridden then ApplyMeasurements must also be overridden.
Subclasses that override this function should make use of the GetCurrentLayoutDirtyFlag() function (rather than GetLayoutDirtyFlag() ).

Reimplemented from CYISceneView.

virtual void CYIScrollingView::OnChildMovedInVisibleRegion ( CYISceneNode pChild,
const glm::vec2 &  normalizedPosition 
)
protectedvirtual
virtual void CYIScrollingView::OnChildVisibilityInVisibleRegionChanged ( CYISceneNode pChild,
bool  isInVisibleRegion 
)
protectedvirtual

A function called when the visibility of a child within the visible region changes.

See also
ChildEnteredVisibleRegion
ChildLeftVisibleRegion
virtual bool CYIScrollingView::OnFrameTimeUpdated ( std::chrono::microseconds  frameTime)
overrideprotectedvirtual

Implement this function to receive frame time update notifications. Return true if you want to keep receiving notifications. Return false if you want the listener to unregister.

Implements CYITime::UpdateListener.

virtual void CYIScrollingView::OnScrollAuto ( CYIScrollController )
overrideprotectedvirtual

Called when a scroll is generated by animation.

See also
CYIScrollController::MoveByAnimate

Reimplemented from CYIScrollController::ScrollListener.

virtual void CYIScrollingView::OnScrolled ( CYIScrollController ,
YI_SCROLLED_INFO   
)
overrideprotectedvirtual

Called when a scroll gesture updates. This is called after CYIScrollController::GestureUpdate and every frame when the scroll controller is animating to a new position.

Reimplemented from CYIScrollController::ScrollListener.

virtual void CYIScrollingView::OnScrollEnded ( CYIScrollController )
overrideprotectedvirtual

Called when a scroll gesture ends.

Reimplemented from CYIScrollController::ScrollListener.

virtual void CYIScrollingView::OnScrollStarted ( CYIScrollController )
overrideprotectedvirtual

Called when a scroll gesture starts.

Reimplemented from CYIScrollController::ScrollListener.

virtual void CYIScrollingView::ParseProperties ( )
protectedvirtual

The properties outlined in the table at the top are parsed and applied here.

Reimplemented in CYIListView.

void CYIScrollingView::RemoveHorizontalMagnets ( )

Removes all horizontal magnets. The scrolling view will no longer snap to horizontal magnetic points. This is equivalent to calling SetHorizontalMagnets(CYIScrollingView::Magnets()).

See also
SetHorizontalMagnets()
void CYIScrollingView::RemoveVerticalMagnets ( )

Removes all vertical magnets. The scrolling view will no longer snap to vertical magnetic points. This is equivalent to calling SetVerticalMagnets(CYIScrollingView::Magnets()).

See also
SetVerticalMagnets()
virtual bool CYIScrollingView::RequestFocus ( CYIFocus::Direction  direction = CYIFocus::Direction::Forward,
CYIFocus::FocusRootRule  focusRootRule = CYIFocus::FocusRootRule::DescendantsUpdateContext,
const CYIAABB previousFocusRect = CYIAABB(),
const CYIFocusSearchOptions options = CYIFocusSearchOptions() 
)
overridevirtual

Assign initial focus within the view. This will initiate a focus search within this view, using the focus region of this view to filter results.

Reimplemented from CYISceneView.

Reimplemented in CYIScrollingTextView.

void CYIScrollingView::Reveal ( CYISceneNode pNode,
uint32_t  durationMs,
CYITimeInterpolator pInterpolator = nullptr 
)

Reveals pNode with an animation duration of durationMs.

This function is called in response to focus changes within this view.

When durationMs is non-0, pInterpolator can be used to specify an interpolator to use for the animation. If an interpolator is not provided, CYIInterpolateSigmoid is used.

Takes the nearest path to the node.

See also
CYIScrollingView::ScrollDirection
virtual void CYIScrollingView::Reveal ( CYISceneNode pNode,
uint32_t  durationMs,
ScrollDirection  horizontalDirection,
ScrollDirection  verticalDirection,
CYITimeInterpolator pInterpolator = nullptr 
)
protectedvirtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

The default implementation will bring the draw child containing pNode into the bounds of this view, defined by its size, if it is currently outside this region. It will move the minimum amount to bring the item into view. If the node is larger than the view, it will reveal the top/left side of the node preferentially.

The default implementation respects the "scroll enabled" settings provided by the user.

Subclasses may provide custom behaviour.

By default, if the provided horizontalDirection or verticalDirection do not make sense given the position of the node and the carousel state of this view, the algorithm will fall back to the closest direction.

See also
CYIScrollingView::ScrollDirection
void CYIScrollingView::ScrollToHorizontalPosition ( float  normalizedPosition,
uint32_t  durationMs,
CYITimeInterpolator pInterpolator = nullptr 
)

Scrolls the view to normalizedPosition on the horizontal axis.

A value of 0.0 aligns the beginning of the content with the left edge of the view.

If the scrolling view is not set to carousel on the horizontal axis a value of 1.0 aligns the end of the content with the right edge of the view.

If the scrolling view is set to carousel on the horizontal axis a value of 1.0 represents a full loop through the content and is equivalent to 0.0.

A non-zero durationMs will trigger an animated position change. Animated position changes with carousel enabled will take the shortest distance even if this means wrapping around the content.

If the view can not scroll in the horizontal direction due to lack of content, the call will have no effect.

The range of acceptable values for normalizedPosition is [0..1]. Values outside of this range will be clamped.

When durationMs is non-zero, pInterpolator can be used to specify an interpolator to use for the animation. If an interpolator is not provided, CYIInterpolateSigmoid is used.

Note
This will have effect even if horizontal scrolling has been disabled.
See also
IsHorizontalCarouselEnabled
CYIScrollingView::ScrollToHorizontalPosition ( float  normalizedPosition)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Immediately scrolls to to normalizedPosition.

void CYIScrollingView::ScrollToPosition ( const glm::vec2 &  normalizedPositions,
uint32_t  durationMs = 0,
CYITimeInterpolator pInterpolator = nullptr 
)
void CYIScrollingView::ScrollToVerticalPosition ( float  normalizedPosition,
uint32_t  durationMs,
CYITimeInterpolator pInterpolator = nullptr 
)

Scrolls the view to normalizedPosition on the vertical axis.

A value of 0.0 aligns the beginning of the content with the top edge of the view.

If the scrolling view is not set to carousel on the vertical axis a value of 1.0 aligns the end of the content with the bottom edge of the view.

If the scrolling view is set to carousel on the vertical axis a value of 1.0 represents a full loop through the content and is equivalent to 0.0.

A non-zero durationMs will trigger an animated position change.

If the view can not scroll in the vertical direction either due to lack of content, the call will have no effect.

The range of acceptable values for normalizedPosition is [0..1]. Values outside of this range will be clamped.

When durationMs is non-zero, pInterpolator can be used to specify an interpolator to use for the animation. If an interpolator is not provided, CYIInterpolateSigmoid is used.

Note
This will have effect even if vertical scrolling has been disabled.
See also
IsVerticalCarouselEnabled
CYIScrollingView::ScrollToVerticalPosition ( float  normalizedPosition)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Immediately scrolls to normalizedPosition.

void CYIScrollingView::SetCascadeTimelineGroupDelay ( uint32_t  delayMs)

Sets the cascade timeline group delay to delayMs milliseconds. This delay is used when building cascade timeline groups and represents an offset in time between each component of the cascade timeline groups.

For example, given a cascade group containing 3 timelines and a delay value of 50ms, the first timeline in the group would be played when the timeline group is started. The second timeline in the group would be played 50 ms later, and the third timeline in the group would be played 50 ms after that (i.e. 100 ms after the first timeline has started).

See also
GetCascadeTimelineGroup
void CYIScrollingView::SetHorizontalCarouselRule ( CarouselRule  carouselRule)

Sets carousel rule on the horizontal axis. Default value is CYIScrollingView::CarouselRule::Never.

Note
With carousel enabled the meaning of the scrolling view's horizontal position changes from 0..1 representing the start and end of the content, to 0..1 representing a full loop through the content. Calling this API will emit HorizontalPositionChanged
Warning
Turning clipping off or enlarging the clipping box beyond the view size with carousel enabled will result in undesirable visuals.
See also
CYIScrollingView::CarouselRule
ScrollToHorizontalPosition(float, uint32_t, CYITimeInterpolator*)
void CYIScrollingView::SetHorizontalMagnets ( const Magnets magnets)

Sets the magnets to use for the horizontal direction to the data contained in magnets.

This will remove any other horizontal magnets.

See also
GetHorizontalMagnets()
Magnets
void CYIScrollingView::SetHorizontalOverpullDistance ( float  distance)

Set the overpull distance (i.e. distance past the extents) that users may scroll horizontally in local units.

Negative values will be clamped to zero.

void CYIScrollingView::SetHorizontalOverpullRule ( OverpullRule  rule)
void CYIScrollingView::SetHorizontalPagingStrategy ( std::unique_ptr< PagingStrategy PagingStrategy)
void CYIScrollingView::SetHorizontalScrollingAreaLayoutMode ( LayoutMode  mode)
void CYIScrollingView::SetHorizontalScrollingEnabled ( bool  enabled)
void CYIScrollingView::SetHorizontalSwipeOneItemEnabled ( bool  swipeOneItem)

Sets whether horizontal magnets should be constrained to only scroll as far as the next magnetic point per swipe. The default value is false.

Note
If swipeOneItem is true and magnets are disabled horizontally, one item is considered to be the width of the scrolling view.
void CYIScrollingView::SetHorizontalTrackpadLeaveFriction ( float  friction)

Sets the friction necessary to have focus leave the scrolling view when using a trackpad and swiping horizontally. friction should be a value between 0 and 1, where 0 is no friction and 1 is focus never leaving the scrolling view.

Note
The default is 0.3.
void CYIScrollingView::SetVerticalCarouselRule ( CarouselRule  carouselRule)

Sets carousel rule on the vertical axis. Default value is CYIScrollingView::CarouselRule::Never.

Note
With carousel enabled the meaning of the scrolling view's vertical position changes from 0..1 representing the start and end of the content, to 0..1 representing a full loop through the content. Calling this API will emit VerticalPositionChanged
Warning
Turning clipping off or enlarging the clipping box beyond the view size with carousel enabled will result in undesirable visuals.
See also
CYIScrollingView::CarouselRule
ScrollToVerticalPosition(float, uint32_t, CYITimeInterpolator*)
void CYIScrollingView::SetVerticalMagnets ( const Magnets magnets)

Sets the magnets to use for the vertical direction to the data contained in magnets.

This will remove any other vertical magnets.

See also
GetVerticalMagnets()
Magnets
void CYIScrollingView::SetVerticalOverpullDistance ( float  distance)

Set the overpull distance (i.e. distance past the extents) that users may scroll vertically in local units.

Negative values will be clamped to zero.

void CYIScrollingView::SetVerticalOverpullRule ( OverpullRule  rule)
void CYIScrollingView::SetVerticalPagingStrategy ( std::unique_ptr< PagingStrategy PagingStrategy)
void CYIScrollingView::SetVerticalScrollingAreaLayoutMode ( LayoutMode  mode)
void CYIScrollingView::SetVerticalScrollingEnabled ( bool  enabled)
void CYIScrollingView::SetVerticalSwipeOneItemEnabled ( bool  swipeOneItem)

Sets whether vertical magnets should be constrained to only scroll as far as the next magnetic point per swipe. The default value is false.

Note
If swipeOneItem is true and magnets are disabled vertically, one item is considered to be the height of the scrolling view.
void CYIScrollingView::SetVerticalTrackpadLeaveFriction ( float  friction)

Sets the friction necessary to have focus leave the scrolling view when using a trackpad and swiping vertically. friction should be a value between 0 and 1, where 0 is no friction and 1 is focus never leaving the scrolling view.

Note
The default is 0.3.
virtual void CYIScrollingView::SizeChanged ( )
overrideprotectedvirtual

Called when the size of this scene node has been changed.

Warning
Overrides must call the base class implementation.
See also
OnSizeChanged()

Reimplemented from CYISceneView.

void CYIScrollingView::StopHorizontalScrolling ( )

Stops the current scroll in the horizontally direction.

void CYIScrollingView::StopScrolling ( )

Stops the current scroll in all directions.

void CYIScrollingView::StopVerticalScrolling ( )

Stops the current scroll in the vertically direction.

virtual void CYIScrollingView::UpdateEnd ( )
overrideprotectedvirtual

This hook provides subclasses a means to do operations subsequent to update. This hook is called after all children of the current node have been updated, and after all other update hooks have been called.

Warning
The dirty flag will be cleared prior to calling this function to allow new dirty state to be recorded from this function. If querying information about the dirty state of the node, use GetPreviousDirtyFlag().
Overrides must call the base class implementation.
See also
Update()
OnUpdateEnd()

Reimplemented from CYISceneNode.

void CYIScrollingView::UpdateHorizontalPagingStrategy ( )
protected

Updates the information required by the horizontal paging strategy, such as scroll region width, and scroll position, and checks for changes in the current page and page count. Subclasses should call if they handle cases where the horizontal paging strategy should be updated.

virtual void CYIScrollingView::UpdateHorizontalPagingStrategyImpl ( )
protectedvirtual

Updates the information required by the horizontal paging strategy, such as scroll region width, and scroll position. Subclasses should override if they have visibility into the new information included in a subclass of CYIScrollingView::PagingStrategy.

Reimplemented in CYIListView.

void CYIScrollingView::UpdateVerticalPagingStrategy ( )
protected

Updates the information required by the vertical paging strategy, such as scroll region width, and scroll position, and checks for changes in the current page and page count. Subclasses should call if they handle cases where the vertical paging strategy should be updated.

virtual void CYIScrollingView::UpdateVerticalPagingStrategyImpl ( )
protectedvirtual

Updates the information required by the vertical paging strategy, such as scroll region width, and scroll position. Subclasses should override if they have visibility into the new information included in a subclass of CYIScrollingView::PagingStrategy.

Reimplemented in CYIListView.

virtual void CYIScrollingView::WorldBoundingBoxUpdated ( )
overrideprotectedvirtual

Called by Update() when the world bounding box update process is complete. Subclasses may overload this function to do post-processing.

Warning
The dirty flag will be cleared prior to calling this function to allow new dirty state to be recorded from this function. If querying information about the dirty state of the node, use GetPreviousDirtyFlag().
Overrides must call the base class implementation.
See also
Update()
OnWorldBoundingBoxUpdated()

Reimplemented from CYISceneView.

Reimplemented in CYIListView.

Friends And Related Function Documentation

friend class CYIScrollingViewPriv
friend

Member Data Documentation

CYISignal<CYISceneNode *> CYIScrollingView::ChildEnteredVisibleRegion

Emitted when a child of the CYIScrollingView has entered the visible region.

See also
IsInVisibleRegion()
CYISignal<CYISceneNode *> CYIScrollingView::ChildLeftVisibleRegion

Emitted when a child of the CYIScrollingView has left the visible region.

See also
IsInVisibleRegion()
CYISignal<bool> CYIScrollingView::HorizontalOverflowChanged

Emitted with true when the horizontal overflow has changed such that the content size exceeds the view size. false means the content has shrunk below the view size.

CYISignal<size_t, size_t> CYIScrollingView::HorizontalPageChanged

Emitted with the page index when the horizontal page changes. Arguments are the new item index, and the previous item index.

CYISignal<size_t, size_t> CYIScrollingView::HorizontalPageCountChanged

Emitted with the page count when the horizontal page count changes. Arguments are the new item count, and the previous item count.

CYISignal<float> CYIScrollingView::HorizontalPositionChanged

Emitted a normalized value [0..1] representing the percentage scrolled in the horizontal direction. May be emitted without an 'InteractionBegan' if the view contents change size.

CYISignal CYIScrollingView::HorizontalScrollingBegan

Emitted when scrolling begins in the horizontal direction.

See also
InteractionBegan
CYISignal CYIScrollingView::HorizontalScrollingEnded

Emitted when scrolling has ended in the horizontal direction. View contents will be at rest in the horizontal direction when this signal is emitted.

See also
InteractionEnded
CYISignal CYIScrollingView::InteractionBegan

Emitted when user begins interacting with the scrolling view.

See also
HorizontalScrollingBegan
VerticalScrollingBegan
CYISignal CYIScrollingView::InteractionEnded

Emitted when user interaction with the scrolling view has ended. A gesture may cause the list to continue scrolling after this signal is emitted.

See also
HorizontalScrollingEnded
VerticalScrollingEnded
uint32_t CYIScrollingView::m_focusScrollDuration
protected
std::unique_ptr<PagingStrategy> CYIScrollingView::m_horizontalPagingStrategy
protected
std::unique_ptr<PagingStrategy> CYIScrollingView::m_verticalPagingStrategy
protected
CYISignal<bool> CYIScrollingView::VerticalOverflowChanged

Emitted with true when the vertical overflow has changed such that the content size exceeds the view size. false means the content has shrunk below the view size.

CYISignal<size_t, size_t> CYIScrollingView::VerticalPageChanged

Emitted with the page index when the vertical page changes. Arguments are the new item index, and the previous item index.

CYISignal<size_t, size_t> CYIScrollingView::VerticalPageCountChanged

Emitted with the page count when the vertical page count changes. Arguments are the new item count, and the previous item count.

CYISignal<float> CYIScrollingView::VerticalPositionChanged

Emitted a normalized value [0..1] representing the percentage scrolled in the vertical direction. May be emitted without an 'InteractionBegan' if the view contents change size.

CYISignal CYIScrollingView::VerticalScrollingBegan

Emitted when scrolling begins in the vertical direction.

See also
InteractionBegan
CYISignal CYIScrollingView::VerticalScrollingEnded

Emitted when scrolling has ended in the vertical direction. View contents will be at rest in the vertical direction when this signal is emitted.

See also
InteractionEnded

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