Castor3D 0.16.0
Multiplatform 3D engine
Public Types | Public Member Functions | Protected Types | Protected Attributes | List of all members
castor3d::NonClientEventHandler< Derived > Class Template Reference

Description of an event handler, class that can receive event. More...

#include <EventHandler.hpp>

Inheritance diagram for castor3d::NonClientEventHandler< Derived >:
Inheritance graph
[legend]
Collaboration diagram for castor3d::NonClientEventHandler< Derived >:
Collaboration graph
[legend]

Public Types

using DerivedPtr = Derived *
 
using ClientMouseFunction = EventHandler::ClientMouseFunction
 
using ClientKeyboardFunction = EventHandler::ClientKeyboardFunction
 
using ClientHandlerFunction = EventHandler::ClientHandlerFunction
 
using NonClientMouseFunction = castor::Function< void( DerivedPtr, MouseEvent const & ) >
 
using NonClientKeyboardFunction = castor::Function< void( DerivedPtr, KeyboardEvent const & ) >
 
using NonClientHandlerFunction = castor::Function< void( DerivedPtr, HandlerEvent const & ) >
 
using OnNonClientMouseEvent = castor::SignalT< NonClientMouseFunction >
 
using OnNonClientKeyboardEvent = castor::SignalT< NonClientKeyboardFunction >
 
using OnNonClientHandlerEvent = castor::SignalT< NonClientHandlerFunction >
 
using OnNonClientMouseEventConnection = typename OnNonClientMouseEvent::connection
 
using OnNonClientKeyboardEventConnection = typename OnNonClientKeyboardEvent::connection
 
using OnNonClientHandlerEventConnection = typename OnNonClientHandlerEvent::connection
 
- Public Types inherited from castor3d::EventHandler
using ClientMouseFunction = castor::Function< void( MouseEvent const & ) >
 
using ClientKeyboardFunction = castor::Function< void( KeyboardEvent const & ) >
 
using ClientHandlerFunction = castor::Function< void( HandlerEvent const & ) >
 
using EnableFunction = castor::Function< void( bool ) >
 
using OnClientMouseEvent = castor::SignalT< ClientMouseFunction >
 
using OnClientKeyboardEvent = castor::SignalT< ClientKeyboardFunction >
 
using OnClientHandlerEvent = castor::SignalT< ClientHandlerFunction >
 
using OnEnable = castor::SignalT< EnableFunction >
 
using OnClientMouseEventConnection = OnClientMouseEvent::connection
 
using OnClientKeyboardEventConnection = OnClientKeyboardEvent::connection
 
using OnClientHandlerEventConnection = OnClientHandlerEvent::connection
 
using OnEnableConnection = OnEnable::connection
 

Public Member Functions

 NonClientEventHandler (castor::String const &name, bool catchMouseEvents)
 Constructor.
 
void connectNC (MouseEventType event, NonClientMouseFunction function)
 Connects a function to a non client mouse event.
 
void connectNC (KeyboardEventType event, NonClientKeyboardFunction function)
 Connects a function to a non client keyboard event.
 
void connectNC (HandlerEventType event, NonClientHandlerFunction function)
 Connects a function to a non client handler event.
 
- Public Member Functions inherited from castor3d::EventHandler
void pushEvent (MouseEvent const &event)
 Adds a mouse event to the events queue.
 
void connect (MouseEventType event, ClientMouseFunction function)
 Connects a function to a mouse event.
 
bool catchesMouseEvents () const
 Tells if the control catches mouse events.
 
void setCatchesMouseEvents (bool value)
 Sets if the control can catch mouse events.
 
void pushEvent (KeyboardEvent const &event)
 Adds a keyboard event to the events queue.
 
void connect (KeyboardEventType event, ClientKeyboardFunction function)
 Connects a function to a keyboard event.
 
bool catchesTabKey () const
 Tells if the control catches 'tab' key.
 
bool catchesReturnKey () const
 Tells if the control catches 'return' key.
 
 EventHandler (castor::String const &name, bool catchMouseEvents)
 Constructor.
 
virtual ~EventHandler () noexcept
 Destructor.
 
void processEvents ()
 Processes all queued events.
 
bool isEnabled () const
 
void enable ()
 Sets if the control is enabled.
 
void disable ()
 Sets if the control is disabled.
 
void pushEvent (HandlerEvent const &event)
 Adds a handler event to the events queue.
 
void connect (HandlerEventType event, ClientHandlerFunction function)
 Connects a function to a handler event.
 
- Public Member Functions inherited from castor::NamedBaseT< T >
 NamedBaseT (T name) noexcept
 Constructor.
 
T const & getName () const noexcept
 Retrieves the name.
 
void rename (T name) noexcept
 

Protected Types

using EventHandlerFunction = EventHandler::EventHandlerFunction
 
using EventQueue = EventHandler::EventQueue
 
- Protected Types inherited from castor3d::EventHandler
using EventHandlerFunction = castor::Function< void() >
 
using EventQueue = castor::Deque< castor::Pair< UserInputEventSPtr, EventHandlerFunction > >
 

Protected Attributes

castor::Array< OnNonClientMouseEvent, size_t(MouseEventType::eCount) > m_ncMouseSlots
 
castor::Array< castor::Vector< OnNonClientMouseEventConnection >, size_t(MouseEventType::eCount) > m_ncMouseSlotsConnections
 
castor::Array< OnNonClientKeyboardEvent, size_t(KeyboardEventType::eCount) > m_ncKeyboardSlots
 
castor::Array< castor::Vector< OnNonClientKeyboardEventConnection >, size_t(KeyboardEventType::eCount) > m_ncKeyboardSlotsConnections
 
castor::Array< OnNonClientHandlerEvent, size_t(HandlerEventType::eCount) > m_ncHandlerSlots
 
castor::Array< castor::Vector< OnNonClientHandlerEventConnection >, size_t(HandlerEventType::eCount) > m_ncHandlerSlotsConnections
 
- Protected Attributes inherited from castor3d::EventHandler
castor::Array< OnClientMouseEvent, size_t(MouseEventType::eCount) > m_mouseSlots
 
castor::Array< castor::Vector< OnClientMouseEventConnection >, size_t(MouseEventType::eCount) > m_mouseSlotsConnections
 
castor::Array< OnClientKeyboardEvent, size_t(KeyboardEventType::eCount) > m_keyboardSlots
 
castor::Array< castor::Vector< OnClientKeyboardEventConnection >, size_t(KeyboardEventType::eCount) > m_keyboardSlotsConnections
 
castor::Array< OnClientHandlerEvent, size_t(HandlerEventType::eCount) > m_handlerSlots
 
castor::Array< castor::Vector< OnClientHandlerEventConnection >, size_t(HandlerEventType::eCount) > m_handlerSlotsConnections
 
- Protected Attributes inherited from castor::NamedBaseT< T >
m_name
 

Additional Inherited Members

- Public Attributes inherited from castor3d::EventHandler
OnEnable onEnable
 
- Protected Member Functions inherited from castor3d::EventHandler
void processMouseEvent (MouseEventSPtr event)
 Mouse event processing function.
 
void processKeyboardEvent (KeyboardEventSPtr event)
 Keyboard event processing function.
 
void processHandlerEvent (HandlerEventSPtr event)
 Handler event processing function.
 

Detailed Description

template<class Derived>
class castor3d::NonClientEventHandler< Derived >

Description of an event handler, class that can receive event.

Member Typedef Documentation

◆ ClientHandlerFunction

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::ClientHandlerFunction = EventHandler::ClientHandlerFunction

◆ ClientKeyboardFunction

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::ClientKeyboardFunction = EventHandler::ClientKeyboardFunction

◆ ClientMouseFunction

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::ClientMouseFunction = EventHandler::ClientMouseFunction

◆ DerivedPtr

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::DerivedPtr = Derived *

◆ EventHandlerFunction

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::EventHandlerFunction = EventHandler::EventHandlerFunction
protected

◆ EventQueue

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::EventQueue = EventHandler::EventQueue
protected

◆ NonClientHandlerFunction

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::NonClientHandlerFunction = castor::Function< void( DerivedPtr, HandlerEvent const & ) >

Catcher definition for non client handler events.

◆ NonClientKeyboardFunction

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::NonClientKeyboardFunction = castor::Function< void( DerivedPtr, KeyboardEvent const & ) >

Catcher definition for non client keyboard events.

◆ NonClientMouseFunction

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::NonClientMouseFunction = castor::Function< void( DerivedPtr, MouseEvent const & ) >

Catcher definition for non client mouse events.

◆ OnNonClientHandlerEvent

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::OnNonClientHandlerEvent = castor::SignalT< NonClientHandlerFunction >

Non client handler event signal definition.

◆ OnNonClientHandlerEventConnection

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::OnNonClientHandlerEventConnection = typename OnNonClientHandlerEvent::connection

Non client handler event signal connection definition.

◆ OnNonClientKeyboardEvent

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::OnNonClientKeyboardEvent = castor::SignalT< NonClientKeyboardFunction >

Non client keyboard event signal definition.

◆ OnNonClientKeyboardEventConnection

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::OnNonClientKeyboardEventConnection = typename OnNonClientKeyboardEvent::connection

Non client keyboard event signal connection definition.

◆ OnNonClientMouseEvent

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::OnNonClientMouseEvent = castor::SignalT< NonClientMouseFunction >

Non client mouse event signal definition.

◆ OnNonClientMouseEventConnection

template<class Derived >
using castor3d::NonClientEventHandler< Derived >::OnNonClientMouseEventConnection = typename OnNonClientMouseEvent::connection

Non client mouse event signal connection definition.

Constructor & Destructor Documentation

◆ NonClientEventHandler()

template<class Derived >
castor3d::NonClientEventHandler< Derived >::NonClientEventHandler ( castor::String const & name,
bool catchMouseEvents )
inlineexplicit

Constructor.

Parameters
[in]nameThe handler name.
[in]catchMouseEventsDefines if the event handler catches mouse event.

Member Function Documentation

◆ connectNC() [1/3]

template<class Derived >
void castor3d::NonClientEventHandler< Derived >::connectNC ( HandlerEventType event,
NonClientHandlerFunction function )
inline

Connects a function to a non client handler event.

Parameters
[in]eventThe event type.
[in]functionThe function.

References castor3d::EventHandler::connect(), castor3d::NonClientEventHandler< Derived >::m_ncHandlerSlots, and castor3d::NonClientEventHandler< Derived >::m_ncHandlerSlotsConnections.

Here is the call graph for this function:

◆ connectNC() [2/3]

template<class Derived >
void castor3d::NonClientEventHandler< Derived >::connectNC ( KeyboardEventType event,
NonClientKeyboardFunction function )
inline

Connects a function to a non client keyboard event.

Parameters
[in]eventThe event type.
[in]functionThe function.

References castor3d::EventHandler::connect(), castor3d::NonClientEventHandler< Derived >::m_ncKeyboardSlots, and castor3d::NonClientEventHandler< Derived >::m_ncKeyboardSlotsConnections.

Here is the call graph for this function:

◆ connectNC() [3/3]

template<class Derived >
void castor3d::NonClientEventHandler< Derived >::connectNC ( MouseEventType event,
NonClientMouseFunction function )
inline

Connects a function to a non client mouse event.

Parameters
[in]eventThe event type.
[in]functionThe function.

References castor3d::EventHandler::connect(), castor3d::NonClientEventHandler< Derived >::m_ncMouseSlots, and castor3d::NonClientEventHandler< Derived >::m_ncMouseSlotsConnections.

Here is the call graph for this function:

Member Data Documentation

◆ m_ncHandlerSlots

template<class Derived >
castor::Array< OnNonClientHandlerEvent, size_t( HandlerEventType::eCount ) > castor3d::NonClientEventHandler< Derived >::m_ncHandlerSlots
protected

The non client handler events slots.

Referenced by castor3d::NonClientEventHandler< Derived >::connectNC().

◆ m_ncHandlerSlotsConnections

template<class Derived >
castor::Array< castor::Vector< OnNonClientHandlerEventConnection >, size_t( HandlerEventType::eCount ) > castor3d::NonClientEventHandler< Derived >::m_ncHandlerSlotsConnections
protected

The non client handler events slots.

Referenced by castor3d::NonClientEventHandler< Derived >::connectNC().

◆ m_ncKeyboardSlots

template<class Derived >
castor::Array< OnNonClientKeyboardEvent, size_t( KeyboardEventType::eCount ) > castor3d::NonClientEventHandler< Derived >::m_ncKeyboardSlots
protected

The non client keyboard events slots.

Referenced by castor3d::NonClientEventHandler< Derived >::connectNC().

◆ m_ncKeyboardSlotsConnections

template<class Derived >
castor::Array< castor::Vector< OnNonClientKeyboardEventConnection >, size_t( KeyboardEventType::eCount ) > castor3d::NonClientEventHandler< Derived >::m_ncKeyboardSlotsConnections
protected

The non client keyboard events slots.

Referenced by castor3d::NonClientEventHandler< Derived >::connectNC().

◆ m_ncMouseSlots

template<class Derived >
castor::Array< OnNonClientMouseEvent, size_t( MouseEventType::eCount ) > castor3d::NonClientEventHandler< Derived >::m_ncMouseSlots
protected

The non client mouse events slots.

Referenced by castor3d::NonClientEventHandler< Derived >::connectNC().

◆ m_ncMouseSlotsConnections

template<class Derived >
castor::Array< castor::Vector< OnNonClientMouseEventConnection >, size_t( MouseEventType::eCount ) > castor3d::NonClientEventHandler< Derived >::m_ncMouseSlotsConnections
protected

The non client mouse events slots.

Referenced by castor3d::NonClientEventHandler< Derived >::connectNC().


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