You.i Engine
CYIFocusSearchOptions Class Reference

Detailed Description

A class containing focus search options.

Instances of this class are used in various focus-related functions to further restrict the set of available focus candidates. For example, an instance of CYIFocusSearchOptions can be used to move focus only to push buttons, or only to text edit views.

Note
The focus search options are used in addition to the usual focus search rules: visibility, reachability, and focusability. The focus search options cannot be used to accept focus candidates that would otherwise be rejected by the usual focus search rules.
See also
CYIFocus

#include <focus/YiFocusSearchOptions.h>

Public Types

enum  WrapMode {
  WrapMode::Wrap = 0,
  WrapMode::DoNotWrap
}
 
typedef bool(* SearchPredicate) (const CYISceneView *)
 

Public Member Functions

 CYIFocusSearchOptions ()
 
 CYIFocusSearchOptions (SearchPredicate pPredicate, WrapMode mode=WrapMode::Wrap)
 
SearchPredicate GetSearchPredicate () const
 
WrapMode GetWrapMode () const
 
bool IsValidCandidate (const CYISceneView *pView) const
 

Member Typedef Documentation

◆ SearchPredicate

typedef bool(* CYIFocusSearchOptions::SearchPredicate) (const CYISceneView *)

The type of predicate used to determine the validity of focus candidates. Must return true if the provided scene view is a valid candidate.

Member Enumeration Documentation

◆ WrapMode

An enum representing the wrap mode to be used for relative focus searches (e.g. focus searches that use CYIFocus::Direction::Forward or CYIFocus::Direction::Reverse)

Enumerator
Wrap 

Indicates that the focus search should wrap around when the 'end' of the candidates list is reached.

DoNotWrap 

Indicates that the focus search abort when the 'end' of the candidates list is reached.

Constructor & Destructor Documentation

◆ CYIFocusSearchOptions() [1/2]

CYIFocusSearchOptions::CYIFocusSearchOptions ( )

Creates an instance where every focus candidate is accepted and searches wrap around.

◆ CYIFocusSearchOptions() [2/2]

CYIFocusSearchOptions::CYIFocusSearchOptions ( SearchPredicate  pPredicate,
WrapMode  mode = WrapMode::Wrap 
)

Creates an instance using predicate pPredicate and wrap mode mode.

Member Function Documentation

◆ GetSearchPredicate()

SearchPredicate CYIFocusSearchOptions::GetSearchPredicate ( ) const

Returns the search predicate associated to this search options object. Returns nullptr if no predicate is assigned (and thus all candidates should be accepted).

◆ GetWrapMode()

WrapMode CYIFocusSearchOptions::GetWrapMode ( ) const

Returns the wrap mode to be used for relative focus searches.

See also
WrapMode

◆ IsValidCandidate()

bool CYIFocusSearchOptions::IsValidCandidate ( const CYISceneView pView) const

Returns true if pView is an acceptable focus candidate. The assigned search predicate is used to do this determination. If no search predicate is assigned, pView is assumed to be a valid candidate.


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