Can dispatch events. More...
Inherited by Polycode::Core, Polycode::CoreInput, Polycode::CoreServices, Polycode::Entity, Polycode::Peer, Polycode::Scene, Polycode::Screen, Polycode::ScreenManager, Polycode::ServerClient, Polycode::Socket, Polycode::Threaded, Polycode::Timer, and Polycode::Tween.
|Default constructor. |
|Removes all current event handlers from this dispatcher. |
|void||removeAllHandlersForListener (EventHandler *handler)|
|Removes all current event handlers from this dispatcher for a specific event listener. |
|void||addEventListener (EventHandler *handler, int eventCode)|
|Adds an event listener for a specific event code. |
|void||removeEventListener (EventHandler *handler, int eventCode)|
|Removes a listener for a specific handler and event code. |
|virtual void||dispatchEvent (Event *event, int eventCode)|
|Dispatches an event to all handlers listening for the event code specified. |
Can dispatch events.
The event dispatcher is base class which allows its subclass to dispatch custom events which EventHandler subclasses can then listen to. EventDispatcher and EventHandler are the two main classes in the Polycode event system. If you are familiar with ActionScript3's event system, you will find this to be very similar, except that it uses integers for event codes for speed, rather than strings.
|void Polycode::EventDispatcher::addEventListener||(||EventHandler *||handler,|
Adds an event listener for a specific event code.
Once a listener is registered for a specific event code, that listener will start getting event callbacks into the handleEvent() method.
|handler||The event handler to add as a listener|
|eventCode||The requested event code to listen to.|
|void Polycode::EventDispatcher::dispatchEvent||(||Event *||event,|
Dispatches an event to all handlers listening for the event code specified.
|event||Event class to dispatch to listeners. You can subclass the Event class to send data in your events.|
|eventCode||The event code to dispatch the event for.|
Reimplemented in Polycode::Threaded.
|void Polycode::EventDispatcher::removeAllHandlersForListener||(||EventHandler *||handler||)|
Removes all current event handlers from this dispatcher for a specific event listener.
|Event||listener to remove handlers for.|