You.i Engine
CYIEvent Class Reference

Detailed Description

Base class for events.

Events are sent to targets via CYIEventDispatcher - targets are CYIEventTarget classes.

#include <event/YiEvent.h>

Inheritance diagram for CYIEvent:

Public Types

enum  Type : uint8_t {
  Type::None = 0,
  Type::ActionMove,
  Type::ActionDown,
  Type::ActionDelayedDown,
  Type::ActionUp,
  Type::ActionWheel,
  Type::ActionWheelHorizontal,
  Type::ActionWheelVertical,
  Type::ActionClick,
  Type::ActionOut,
  Type::ActionIn,
  Type::ActionEnter,
  Type::ActionLeave,
  Type::ActionPick,
  Type::ActionLongPress,
  Type::ActionSuppressedMove,
  Type::KeyDown,
  Type::KeyUp,
  Type::KeyInput,
  Type::SignalEmit,
  Type::StateMachineWrapped,
  Type::StateMachineSignal,
  Type::GPUGenerateHandle,
  Type::GPULoadBuffer,
  Type::GPUUnloadBuffer,
  Type::GPUFreeHandle,
  Type::GPUInvalidateHandle,
  Type::FocusIn,
  Type::FocusOut,
  Type::TrackpadDown,
  Type::TrackpadMove,
  Type::TrackpadUp,
  Type::DeferredDeletion,
  Type::Task,
  Type::AccessibilityAnnounce,
  Type::AccessibilityFocusIn,
  Type::AccessibilityFocusOut,
  Type::AccessibilityFocusNext,
  Type::AccessibilityFocusPrevious,
  Type::TypesCount
}
 The event type of the CYIEvent class instance. More...
 
enum  Phase : uint8_t {
  Phase::None = 0,
  Phase::Capture,
  Phase::AtTarget,
  Phase::Bubble,
  Phase::Broadcast
}
 The current processing phase of the event. More...
 
enum  Priority {
  Priority::Highest = 2,
  Priority::High = 1,
  Priority::Normal = 0,
  Priority::Low = -1,
  Priority::Lowest = -2,
  Priority::Default = Normal
}
 Priority of the event in the event queue. More...
 

Public Member Functions

 CYIEvent (CYIEvent::Type eventType)
 
 CYIEvent (const CYIEvent &other)
 
virtual ~CYIEvent ()
 
CYIEventoperator= (const CYIEvent &other)
 
const CYIStringGetName () const
 
CYIEvent::Type GetType () const
 
void SetType (CYIEvent::Type eventType)
 
bool IsActionEvent () const
 
std::unique_ptr< CYIActionEventCloneAsActionEvent () const
 
bool IsKeyEvent () const
 
std::unique_ptr< CYIKeyEventCloneAsKeyEvent () const
 
bool IsFocusEvent () const
 
std::unique_ptr< CYIFocusEventCloneAsFocusEvent () const
 
bool IsTrackpadEvent () const
 
std::unique_ptr< CYITrackpadEventCloneAsTrackpadEvent () const
 
bool IsAccessibilityEvent () const
 
std::unique_ptr< CYIAccessibilityEventCloneAsAccessibilityEvent () const
 
void SetTarget (CYIEventTarget *pTarget)
 
CYIEventTargetGetTarget () const
 
const std::shared_ptr< CYIEventTargetProxy > & GetTargetProxy () const
 
void SetCurrentTarget (CYIEventTarget *pTarget)
 
const CYIEventTargetGetCurrentTarget () const
 
CYIEventTargetGetCurrentTarget ()
 
const std::shared_ptr< CYIEventTargetProxy > & GetCurrentTargetProxy () const
 

Public Attributes

uint64_t m_eventTimeMs
 
Phase m_phase
 
bool m_canCancel
 
bool m_canBubble
 
bool m_canCapture
 
bool m_stopPropagation
 
bool m_handled
 

Member Enumeration Documentation

◆ Phase

enum CYIEvent::Phase : uint8_t
strong

The current processing phase of the event.

Enumerator
None 

No phase.

Capture 

The capture phase walks down the scene tree and allows each node from parent to target process the event with this phase set.

AtTarget 

The target phase allows the target node to process the event with this phase set.

Bubble 

The bubble phase walks up the scene tree and allows each node from target to parent to process the event with this phase set.

Broadcast 

This phase broadcasts the event to the scene tree.

◆ Priority

enum CYIEvent::Priority
strong

Priority of the event in the event queue.

Enumerator
Highest 
High 
Normal 
Low 
Lowest 
Default 

◆ Type

enum CYIEvent::Type : uint8_t
strong

The event type of the CYIEvent class instance.

Enumerator
None 
ActionMove 
ActionDown 
ActionDelayedDown 
ActionUp 
ActionWheel 
ActionWheelHorizontal 
ActionWheelVertical 
ActionClick 
ActionOut 
ActionIn 
ActionEnter 
ActionLeave 
ActionPick 
ActionLongPress 
ActionSuppressedMove 
KeyDown 
KeyUp 
KeyInput 
SignalEmit 
StateMachineWrapped 
StateMachineSignal 
GPUGenerateHandle 
GPULoadBuffer 
GPUUnloadBuffer 
GPUFreeHandle 
GPUInvalidateHandle 
FocusIn 
FocusOut 
TrackpadDown 
TrackpadMove 
TrackpadUp 
DeferredDeletion 
Task 
AccessibilityAnnounce 
AccessibilityFocusIn 
AccessibilityFocusOut 
AccessibilityFocusNext 
AccessibilityFocusPrevious 
TypesCount 

Constructor & Destructor Documentation

◆ CYIEvent() [1/2]

CYIEvent::CYIEvent ( CYIEvent::Type  eventType)

◆ CYIEvent() [2/2]

CYIEvent::CYIEvent ( const CYIEvent other)

◆ ~CYIEvent()

virtual CYIEvent::~CYIEvent ( )
virtual

Member Function Documentation

◆ CloneAsAccessibilityEvent()

std::unique_ptr<CYIAccessibilityEvent> CYIEvent::CloneAsAccessibilityEvent ( ) const

Returns a clone of the CYIAccessibility event if this event is a CYIAccessibilityEvent, otherwise returns null.

See also
CYIAccessibilityEvent

◆ CloneAsActionEvent()

std::unique_ptr<CYIActionEvent> CYIEvent::CloneAsActionEvent ( ) const

Returns a clone of the CYIActionEvent if this event is a CYIActionEvent, otherwise returns null.

See also
CYIActionEvent

◆ CloneAsFocusEvent()

std::unique_ptr<CYIFocusEvent> CYIEvent::CloneAsFocusEvent ( ) const

Returns a clone of the CYIFocusEvent if this event is a CYIFocusEvent, otherwise returns null.

See also
CYIFocusEvent

◆ CloneAsKeyEvent()

std::unique_ptr<CYIKeyEvent> CYIEvent::CloneAsKeyEvent ( ) const

Returns a clone of the CYIKeyEvent if this event is a CYIKeyEvent, otherwise returns null.

See also
CYIKeyEvent

◆ CloneAsTrackpadEvent()

std::unique_ptr<CYITrackpadEvent> CYIEvent::CloneAsTrackpadEvent ( ) const

Returns a clone of the CYITrackpadEvent if this event is a CYITrackpadEvent, otherwise returns null.

See also
CYITrackpadEvent

◆ GetCurrentTarget() [1/2]

const CYIEventTarget* CYIEvent::GetCurrentTarget ( ) const

Returns the event current target.

See also
SetCurrentTarget
GetCurrentTargetProxy

◆ GetCurrentTarget() [2/2]

CYIEventTarget* CYIEvent::GetCurrentTarget ( )

◆ GetCurrentTargetProxy()

const std::shared_ptr<CYIEventTargetProxy>& CYIEvent::GetCurrentTargetProxy ( ) const

Returns the event current target proxy.

See also
SetCurrentTarget
CYIEventTargetProxy

◆ GetName()

const CYIString& CYIEvent::GetName ( ) const

Returns the name of the event if it exists and UNKNOWN otherwise.

◆ GetTarget()

CYIEventTarget* CYIEvent::GetTarget ( ) const

Returns the event target.

See also
SetTarget
GetTargetProxy

◆ GetTargetProxy()

const std::shared_ptr<CYIEventTargetProxy>& CYIEvent::GetTargetProxy ( ) const

Returns the event target proxy.

See also
SetTarget
CYIEventTargetProxy

◆ GetType()

CYIEvent::Type CYIEvent::GetType ( ) const
inline

Returns the type of the event.

◆ IsAccessibilityEvent()

bool CYIEvent::IsAccessibilityEvent ( ) const
inline

Returns true if this event is an accessibility event and false otherwise.

See also
CYIAccessibilityEvent

◆ IsActionEvent()

bool CYIEvent::IsActionEvent ( ) const
inline

Returns true if this event is an action event and false otherwise.

See also
CYIActionEvent

◆ IsFocusEvent()

bool CYIEvent::IsFocusEvent ( ) const
inline

Returns true if this event is a focus event and false otherwise.

See also
CYIFocusEvent

◆ IsKeyEvent()

bool CYIEvent::IsKeyEvent ( ) const
inline

Returns true if this event is a key event and false otherwise.

See also
CYIKeyEvent

◆ IsTrackpadEvent()

bool CYIEvent::IsTrackpadEvent ( ) const
inline

Returns true if this event is a trackpad event and false otherwise.

See also
CYITrackpadEvent

◆ operator=()

CYIEvent& CYIEvent::operator= ( const CYIEvent other)

◆ SetCurrentTarget()

void CYIEvent::SetCurrentTarget ( CYIEventTarget pTarget)

Assigns the event current target. The reference to the current target is automatically cleared when the target is destroyed.

See also
CYIEventTargetProxy

◆ SetTarget()

void CYIEvent::SetTarget ( CYIEventTarget pTarget)

Assigns the event target. The reference to the target is automatically cleared when the target is destroyed.

See also
CYIEventTargetProxy

◆ SetType()

void CYIEvent::SetType ( CYIEvent::Type  eventType)

Sets the type of the event.

Member Data Documentation

◆ m_canBubble

bool CYIEvent::m_canBubble

Whether this event can undergo the bubble phase.

◆ m_canCancel

bool CYIEvent::m_canCancel

Whether this event can be cancelled (propagation stopped).

◆ m_canCapture

bool CYIEvent::m_canCapture

Whether this event can undergo the capture phase.

◆ m_eventTimeMs

uint64_t CYIEvent::m_eventTimeMs

system time for the event, in milliseconds.

◆ m_handled

bool CYIEvent::m_handled

Whether or not than event has been handled by a previous handler.

◆ m_phase

Phase CYIEvent::m_phase

The current event processing phase.

◆ m_stopPropagation

bool CYIEvent::m_stopPropagation

When set to true the event will not undergo further processing.


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