You.i Engine
CYINullFocusEngine Class Reference

Detailed Description

A 'null' focus engine. This focus engine does not perform any focus navigation. This class is used mostly for debugging purposes.

#include <focus/YiNullFocusEngine.h>

Inheritance diagram for CYINullFocusEngine:

Public Member Functions

virtual ~CYINullFocusEngine ()
 
virtual bool Init (CYISceneNode *pLogicalRoot) override
 
virtual void Update () override
 
virtual void ClearFocus () override
 
virtual void HandleKeyInputs (const CYIKeyEvent *pKeyEvent) override
 
virtual void HandleTrackpadInputs (const CYITrackpadEvent *pKeyEvent) override
 
virtual void CancelTrackpadSwipes () override
 
virtual const CYISceneViewGetViewWithFocus () const override
 
virtual const CYISceneViewFindNextFocus (const CYISceneView *pSearchFrom, CYIFocus::Direction direction, const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) override
 
virtual bool RequestFocus (const CYISceneView *pViewToFocus, CYIFocus::FocusRootRule focusRootRule=CYIFocus::FocusRootRule::DescendantsUpdateContext) override
 
virtual bool MoveFocus (CYIFocus::Direction direction, const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) override
 
virtual FocusabilityStatus GetViewFocusability (const CYISceneView *pViewToFocus) const override
 
- Public Member Functions inherited from CYIFocusEngine
 CYIFocusEngine ()
 
virtual ~CYIFocusEngine ()=default
 
CYISceneViewGetViewWithFocus ()
 
const CYISceneViewGetViewWithFocus (const CYISceneNode *pRootNode) const
 
CYISceneViewGetViewWithFocus (const CYISceneNode *pRootNode)
 
bool CanBeFocused (const CYISceneView *pView) const
 

Additional Inherited Members

- Public Types inherited from CYIFocusEngine
enum  FocusabilityStatus {
  FocusabilityStatus::CanBeFocused = 0x00,
  FocusabilityStatus::ViewNull = 0x01,
  FocusabilityStatus::ViewNotFocusable = 0x02,
  FocusabilityStatus::ViewInvisible = 0x04,
  FocusabilityStatus::ViewNotStaged = 0x08,
  FocusabilityStatus::FocusEngineSpecific = 0x10
}
 
- Public Attributes inherited from CYIFocusEngine
CYISignal< CYISceneView * > ViewWithFocusChanged
 

Constructor & Destructor Documentation

◆ ~CYINullFocusEngine()

virtual CYINullFocusEngine::~CYINullFocusEngine ( )
virtual

Member Function Documentation

◆ CancelTrackpadSwipes()

virtual void CYINullFocusEngine::CancelTrackpadSwipes ( )
overridevirtual

Cancels any in-progress trackpad swipes.

Implements CYIFocusEngine.

◆ ClearFocus()

virtual void CYINullFocusEngine::ClearFocus ( )
overridevirtual

Clears the currently focused view, if any.

Implements CYIFocusEngine.

◆ FindNextFocus()

virtual const CYISceneView* CYINullFocusEngine::FindNextFocus ( const CYISceneView pSearchFrom,
CYIFocus::Direction  direction,
const CYIFocusSearchOptions options = CYIFocusSearchOptions() 
)
overridevirtual

Finds the next view that can take focus in direction direction, searching from pSearchFrom. If pSearchFrom is nullptr, a search from 'nothing' is performed. Returns nullptr if no new focus target could be found.

Implements CYIFocusEngine.

◆ GetViewFocusability()

virtual FocusabilityStatus CYINullFocusEngine::GetViewFocusability ( const CYISceneView pViewToFocus) const
overridevirtual

Returns details about whether a view can be focused.

Implements CYIFocusEngine.

◆ GetViewWithFocus()

virtual const CYISceneView* CYINullFocusEngine::GetViewWithFocus ( ) const
overridevirtual

Returns the view that currently has focus, or null if no view has focus.

Implements CYIFocusEngine.

◆ HandleKeyInputs()

virtual void CYINullFocusEngine::HandleKeyInputs ( const CYIKeyEvent pKeyEvent)
overridevirtual

Handles focus changes given a CYIEvent::Type::KeyDown event.

Implements CYIFocusEngine.

◆ HandleTrackpadInputs()

virtual void CYINullFocusEngine::HandleTrackpadInputs ( const CYITrackpadEvent pKeyEvent)
overridevirtual

Handles focus changes given a trackpad event. This generates focus moves requests (as necessary) as the trackpad events are received.

Implements CYIFocusEngine.

◆ Init()

virtual bool CYINullFocusEngine::Init ( CYISceneNode pLogicalRoot)
overridevirtual

Initializes this focus engine. Returns false if initialization failed.

Implements CYIFocusEngine.

◆ MoveFocus()

virtual bool CYINullFocusEngine::MoveFocus ( CYIFocus::Direction  direction,
const CYIFocusSearchOptions options = CYIFocusSearchOptions() 
)
overridevirtual

'Moves' the focus in direction direction, relative to the view that currently has focus. If no view currently has focus, a focus search is started from the current focus root.

options can be used to further restrict the set of valid focus candidates.

Returns true if focus was successfully moved.

Implements CYIFocusEngine.

◆ RequestFocus()

virtual bool CYINullFocusEngine::RequestFocus ( const CYISceneView pViewToFocus,
CYIFocus::FocusRootRule  focusRootRule = CYIFocus::FocusRootRule::DescendantsUpdateContext 
)
overridevirtual

Requests that pViewToFocus receive focus. The view will receive focus if it is focusable. Returns true if pViewToFocus obtained focus or had focus before the request.

For a view to take focus, it must meet the following requirements: it is visible, attached to the tree, and focusable.

focusRootRule dictates whether the focus system will allow the focus request to move to a view outside of the current focus root. When CYIFocus::FocusRootRule::DescendantsUpdateContext is provided this method will return true if pViewToFocus's focus root is updated with pViewToFocus as the current focus in that context.

pViewToFocus must be non-null. If focus needs to be cleared, ClearFocus can be used.

See also
CYISceneView::RequestFocus

Implements CYIFocusEngine.

◆ Update()

virtual void CYINullFocusEngine::Update ( )
overridevirtual

Called by CYISceneManager after the scene tree is updated. This allows the focus engine to update focus after modifications have been made to the scene tree.

Implements CYIFocusEngine.


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