igor::iEvent Class Referenceabstract

#include <iEvent.h>

Inherited by igor::iEventKeyASCII, igor::iEventKeyDown, igor::iEventKeyUp, igor::iEventMouseKeyDoubleClick, igor::iEventMouseKeyDown, igor::iEventMouseKeyUp, igor::iEventMouseMove, igor::iEventMouseWheel, igor::iEventNodeAddedToScene, igor::iEventNodeRemovedFromScene, igor::iEventSceneSelectionChanged, igor::iEventWindowClose, igor::iEventWindowOpen, and igor::iEventWindowResize.

Public Member Functions

 iEvent (iWindowPtr window=nullptr)
 
virtual ~iEvent ()=default
 
bool isOfKind (const iEventKind kind)
 
virtual iEventType getEventType () const =0
 
virtual iEventKindMask getEventKindMask () const =0
 
virtual const iaString getName () const =0
 
virtual const iaString getInfo () const
 
iWindowPtr getWindow () const
 
bool isConsumed () const
 
void consume ()
 
template<typename T , typename F >
bool dispatch (const F &func)
 

Detailed Description

event base class

Constructor & Destructor Documentation

◆ iEvent()

igor::iEvent::iEvent ( iWindowPtr  window = nullptr)

init members

Parameters
windowthe window that event came from (only in case it was an event created by a window)

◆ ~iEvent()

virtual igor::iEvent::~iEvent ( )
virtualdefault

does nothing

Member Function Documentation

◆ consume()

void igor::iEvent::consume ( )

consumes this event

◆ dispatch()

template<typename T , typename F >
bool igor::iEvent::dispatch ( const F &  func)
inline

dispatch event

only executes if event is of type T

Parameters
functhe given function to call with the event
Returns
true if event was consumed by the given function

◆ getEventKindMask()

◆ getEventType()

virtual iEventType igor::iEvent::getEventType ( ) const
pure virtual
Returns
event type

◆ getInfo()

◆ getName()

virtual const iaString igor::iEvent::getName ( ) const
pure virtual
Returns
name of event

◆ getWindow()

iWindowPtr igor::iEvent::getWindow ( ) const
Returns
the window

◆ isConsumed()

bool igor::iEvent::isConsumed ( ) const
Returns
true if already consumed

◆ isOfKind()

bool igor::iEvent::isOfKind ( const iEventKind  kind)
Returns
true if event is of given kind
Parameters
kindthe given kind

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