CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csBaseEventHandler Class Reference
[Event handling]

Base implementation of a generic event handler. More...

#include <csbaseeventh.h>

Inheritance diagram for csBaseEventHandler:

iEventHandler iBase List of all members.

Public Methods

virtual ~csBaseEventHandler ()
 Destructor.

bool RegisterQueue (iObjectRegistry *registry, unsigned int trigger=UINT_MAX)
 Register the event handler with the event queue registered with the object registry.

bool RegisterQueue (iEventQueue *queue, unsigned int trigger=UINT_MAX)
 Register the event handler with an event queue.


Protected Methods

 csBaseEventHandler ()
 Constructor.

virtual bool OnBroadcast (iEvent &event)
 Invoked by the event handler when a broadcast event is received.

virtual bool OnCommand (iEvent &event)
 Invoked by the event handler when a command event is received.

virtual bool OnJoystickMove (iEvent &event)
 Invoked by the event handler when a joystick movement event is received.

virtual bool OnJoystickDown (iEvent &event)
 Invoked by the event handler when a joystick button down event is received.

virtual bool OnJoystickUp (iEvent &event)
 Invoked by the event handler when a joystick button up event is received.

virtual bool OnKeyboard (iEvent &event)
 Invoked by the event handler when a keyboard event is received.

virtual bool OnMouseMove (iEvent &event)
 Invoked by the event handler when a mouse move event is received.

virtual bool OnMouseDown (iEvent &event)
 Invoked by the event handler when a mouse down event is received.

virtual bool OnMouseUp (iEvent &event)
 Invoked by the event handler when a mouse up event is received.

virtual bool OnMouseClick (iEvent &event)
 Invoked by the event handler when a mouse button click event is received.

virtual bool OnMouseDoubleClick (iEvent &event)
 Invoked by the event handler when a mouse button double-click event is received.

virtual bool OnNetwork (iEvent &event)
 Invoked by the event handler when a network event is received.

virtual bool OnUnhandledEvent (iEvent &event)
 Invoked by the event handler when an unknown event is received.

virtual void PreProcessFrame ()
 Invoked by the handler during a pre-process frame broadcast event.

virtual void ProcessFrame ()
 Invoked by the handler during a process frame broadcast event.

virtual void PostProcessFrame ()
 Invoked by the handler during a post-process frame broadcast event.

virtual void FinishFrame ()
 Invoked by the handler during a finish frame broadcast event.


Detailed Description

Base implementation of a generic event handler.

This class provides a base object which does absolutely nothing with the events that are sent to it. In order to properly use, you must derive a class from this one and override the specific OnFoo() trigger methods you are interested in processing.

Remarks:
Although this class is derived from iEventHandler, you should not attempt to overload the HandleEvent() method. Always override the specific On... trigger function.

Definition at line 50 of file csbaseeventh.h.


Constructor & Destructor Documentation

csBaseEventHandler::csBaseEventHandler   [protected]
 

Constructor.

Remarks:
When deriving a class from csBaseEventHandler, you must call this constructor in order to initialize reference counting for the interface.

The constructor is declared as protected to prevent a developer from using this class directly.

virtual csBaseEventHandler::~csBaseEventHandler   [virtual]
 

Destructor.


Member Function Documentation

virtual void csBaseEventHandler::FinishFrame   [protected, virtual]
 

Invoked by the handler during a finish frame broadcast event.

virtual bool csBaseEventHandler::OnBroadcast iEvent   event [protected, virtual]
 

Invoked by the event handler when a broadcast event is received.

Remarks:
Ordinarily a developer should not override this funtion, as the default implementation will call PreProcessFrame(), ProcessFrame(), PostProcessFrame(), or FinishFrame() as appropriate. If you do override this function, either call the base implementation to invoke the aforementioned trigger functions or provide your own implementation.

If you are expecting to handle a broadcast event which is not one of the standard four used for frame rendering, override OnUnhandledEvent(), which is called by the implementaion of OnBroadcast() for any broadcast event which is not processed by one of the 4 frame rendering trigger functions. If you don't plan on responding to the standard 4 broadcast functions, then overriding OnBroadcast() is appropriate.

virtual bool csBaseEventHandler::OnCommand iEvent   event [protected, virtual]
 

Invoked by the event handler when a command event is received.

virtual bool csBaseEventHandler::OnJoystickDown iEvent   event [protected, virtual]
 

Invoked by the event handler when a joystick button down event is received.

virtual bool csBaseEventHandler::OnJoystickMove iEvent   event [protected, virtual]
 

Invoked by the event handler when a joystick movement event is received.

virtual bool csBaseEventHandler::OnJoystickUp iEvent   event [protected, virtual]
 

Invoked by the event handler when a joystick button up event is received.

virtual bool csBaseEventHandler::OnKeyboard iEvent   event [protected, virtual]
 

Invoked by the event handler when a keyboard event is received.

virtual bool csBaseEventHandler::OnMouseClick iEvent   event [protected, virtual]
 

Invoked by the event handler when a mouse button click event is received.

virtual bool csBaseEventHandler::OnMouseDoubleClick iEvent   event [protected, virtual]
 

Invoked by the event handler when a mouse button double-click event is received.

virtual bool csBaseEventHandler::OnMouseDown iEvent   event [protected, virtual]
 

Invoked by the event handler when a mouse down event is received.

virtual bool csBaseEventHandler::OnMouseMove iEvent   event [protected, virtual]
 

Invoked by the event handler when a mouse move event is received.

virtual bool csBaseEventHandler::OnMouseUp iEvent   event [protected, virtual]
 

Invoked by the event handler when a mouse up event is received.

virtual bool csBaseEventHandler::OnNetwork iEvent   event [protected, virtual]
 

Invoked by the event handler when a network event is received.

virtual bool csBaseEventHandler::OnUnhandledEvent iEvent   event [protected, virtual]
 

Invoked by the event handler when an unknown event is received.

Remarks:
Also, this function will be called when a broadcast event was not processed by OnBroadcast().

virtual void csBaseEventHandler::PostProcessFrame   [protected, virtual]
 

Invoked by the handler during a post-process frame broadcast event.

virtual void csBaseEventHandler::PreProcessFrame   [protected, virtual]
 

Invoked by the handler during a pre-process frame broadcast event.

virtual void csBaseEventHandler::ProcessFrame   [protected, virtual]
 

Invoked by the handler during a process frame broadcast event.

bool csBaseEventHandler::RegisterQueue iEventQueue   queue,
unsigned int    trigger = UINT_MAX
 

Register the event handler with an event queue.

Parameters:
queue  The event queue to register with
trigger  Combination of the CSMASK_XXX event triggers defined in iutil/evdefs.h. Multiple triggers may be specified by combining them with the bitwise "or" operator (`|').
See also:
iEventQueue::RegisterListener()

bool csBaseEventHandler::RegisterQueue iObjectRegistry   registry,
unsigned int    trigger = UINT_MAX
 

Register the event handler with the event queue registered with the object registry.

Parameters:
registry  The application's object registry
trigger  Combination of the CSMASK_XXX event triggers defined in iutil/evdefs.h. Multiple triggers may be specified by combining them with the bitwise "or" operator (`|').
See also:
iEventQueue::RegisterListener()


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.18