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::GestureTap,
  Type::GestureDoubleTap,
  Type::GestureSwipe,
  Type::GestureDrag,
  Type::GestureScrub,
  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 &rOther)
 
virtual ~CYIEvent ()
 
virtual std::unique_ptr< CYIEventClone () const
 
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
 
bool IsGestureEvent () const
 
std::unique_ptr< CYIGestureEventCloneAsGestureEvent () const
 
bool IsSwipeGestureEvent () const
 
bool IsScrubGestureEvent () const
 
std::unique_ptr< CYISwipeGestureEventCloneAsSwipeGestureEvent () const
 
void SetTarget (const CYIEventTarget *pTarget)
 
const std::shared_ptr< CYIEventTargetProxy > & GetTargetProxy () const
 

Public Attributes

CYIEventTargetm_pTarget
 
CYIEventTargetm_pCurrentTarget
 
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 
GestureTap 
GestureDoubleTap 
GestureSwipe 
GestureDrag 
GestureScrub 
TypesCount 

Constructor & Destructor Documentation

◆ CYIEvent() [1/2]

CYIEvent::CYIEvent ( CYIEvent::Type  eventType)

◆ CYIEvent() [2/2]

CYIEvent::CYIEvent ( const CYIEvent rOther)

◆ ~CYIEvent()

virtual CYIEvent::~CYIEvent ( )
virtual

Member Function Documentation

◆ Clone()

virtual std::unique_ptr<CYIEvent> CYIEvent::Clone ( ) const
virtual

◆ 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

◆ CloneAsGestureEvent()

std::unique_ptr<CYIGestureEvent> CYIEvent::CloneAsGestureEvent ( ) const

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

See also
CYIGestureEvent

◆ 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

◆ CloneAsSwipeGestureEvent()

std::unique_ptr<CYISwipeGestureEvent> CYIEvent::CloneAsSwipeGestureEvent ( ) const

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

See also
CYISwipeGestureEvent

◆ 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

◆ GetName()

const CYIString& CYIEvent::GetName ( ) const

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

◆ 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

◆ IsGestureEvent()

bool CYIEvent::IsGestureEvent ( ) const
inline

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

See also
CYIGestureEvent

◆ IsKeyEvent()

bool CYIEvent::IsKeyEvent ( ) const
inline

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

See also
CYIKeyEvent

◆ IsScrubGestureEvent()

bool CYIEvent::IsScrubGestureEvent ( ) const
inline

Returns true if this event is a scrub gesture event and false otherwise.

See also
CYIGestureEvent

◆ IsSwipeGestureEvent()

bool CYIEvent::IsSwipeGestureEvent ( ) const
inline

Returns true if this event is a swipe gesture event and false otherwise.

See also
CYISwipeGestureEvent

◆ IsTrackpadEvent()

bool CYIEvent::IsTrackpadEvent ( ) const
inline

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

See also
CYITrackpadEvent

◆ SetTarget()

void CYIEvent::SetTarget ( const 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_pCurrentTarget

CYIEventTarget* CYIEvent::m_pCurrentTarget
Deprecated:
m_pCurrentTarget is deprecated and may be removed in future releases.

◆ m_phase

Phase CYIEvent::m_phase

The current event processing phase.

◆ m_pTarget

CYIEventTarget* CYIEvent::m_pTarget
Deprecated:
m_pTarget is deprecated and may be removed in future releases. Use SetTarget and GetTargetProxy instead.

◆ 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: