OSDL::Events::MouseHandler Class Reference

#include <OSDLMouseHandler.h>

Inheritance diagram for OSDL::Events::MouseHandler:

[legend]
Collaboration diagram for OSDL::Events::MouseHandler:
[legend]
List of all members.

Detailed Description

Handler for mice connected to the system, if any.

Manages the mouse position, its up to three buttons, and a possible mouse wheel (up/down).

Note:
The UseMouse flag must be specified in the call to CommonModule::getCommonModule so that mouse support is enabled.

No multiple mice are managed for the moment.

Definition at line 52 of file OSDLMouseHandler.h.

Public Member Functions

 MouseHandler (bool useClassicalMice=true) throw ( InputDeviceHandlerException )
 Constructs a new mouse handler.
virtual ~MouseHandler () throw ()
 Virtual destructor.
virtual void linkToController (OSDL::MVC::Controller &controller) throw ( MouseException )
 Links the default mouse to specified controller, so that any further mouse-related event will be sent to this controller.
virtual void linkToController (MouseNumber index, OSDL::MVC::Controller &controller) throw ( MouseException )
 Links the specified mouse to specified controller, so that any further mouse-related event will be sent to this controller.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const throw ()
 Returns an user-friendly description of the state of this object.

Static Public Member Functions

static MouseNumber GetAvailableMiceCount () throw ()
 Returns the number of available mice, i.e.

Protected Member Functions

virtual void focusGained (const FocusEvent &mouseFocusEvent) const throw ()
 Called whenever a mouse focus is gained by the application.
virtual void focusLost (const FocusEvent &mouseFocusEvent) const throw ()
 Called whenever a mouse focus is lost by the application.
virtual void mouseMoved (const MouseMotionEvent &mouseMovedEvent) const throw ()
 Called whenever a mouse is moved, so that its controller, if any, is notified.
virtual void buttonPressed (const MouseButtonEvent &mouseButtonPressedEvent) const throw ()
 Called whenever a mouse button was pressed, so that its controller, if any, is notified.
virtual void buttonReleased (const MouseButtonEvent &mouseButtonReleasedEvent) const throw ()
 Called whenever a mouse button was released, so that its controller, if any, is notified.
virtual void blank () throw ()
 Blanks this mouse handler, i.e.
virtual void checkMouseAt (MouseNumber index) const throw ()
 Checks that the mouse at the specified index exists and is opened.

Protected Attributes

MouseNumber _miceCount
 Records how many mice are known by this handler.
Mouse ** _mice
 Records all known mice.
bool _useClassicalMice
 Tells whether complex mice (if false) or classical mice (if true) should be created.

Private Member Functions

 MouseHandler (const MouseHandler &source) throw ()
 Copy constructor made private to ensure that it will never be called.
MouseHandleroperator= (const MouseHandler &source) throw ()
 Assignment operator made private to ensure that it will never be called.

Friends

class OSDL::Events::EventsModule


Constructor & Destructor Documentation

MouseHandler::MouseHandler ( bool  useClassicalMice = true  )  throw ( InputDeviceHandlerException ) [explicit]

Constructs a new mouse handler.

Parameters:
useClassicalMice tells whether detected mice should be managed as complex mice (powerful interface, but it requires the controller to take in charge this complexity) or classical mice (for usual needs, comes with preset behaviours which ease controller work).
Exceptions:
InputDeviceHandlerException if the initialization of the mouse subsystem failed.

Definition at line 38 of file OSDLMouseHandler.cc.

MouseHandler::~MouseHandler (  )  throw () [virtual]

Virtual destructor.

Definition at line 64 of file OSDLMouseHandler.cc.

References blank().

OSDL::Events::MouseHandler::MouseHandler ( const MouseHandler source  )  throw () [explicit, private]

Copy constructor made private to ensure that it will never be called.

The compiler should complain whenever this undefined constructor is called, implicitly or not.


Member Function Documentation

void MouseHandler::linkToController ( OSDL::MVC::Controller controller  )  throw ( MouseException ) [virtual]

Links the default mouse to specified controller, so that any further mouse-related event will be sent to this controller.

Removes automatically any link previously defined between the mouse and any other controller.

Parameters:
controller the OSDL controller which will be notified of mouse changes.
Exceptions:
MouseException if the operation failed.

Definition at line 79 of file OSDLMouseHandler.cc.

References OSDL::Events::DefaultMouse.

void MouseHandler::linkToController ( MouseNumber  index,
OSDL::MVC::Controller controller 
) throw ( MouseException ) [virtual]

Links the specified mouse to specified controller, so that any further mouse-related event will be sent to this controller.

Removes automatically any link previously defined between the mouse and any other controller.

Parameters:
index the index of the mouse to link, in case there are other mice than the main default one.
controller the OSDL controller which will be notified of mouse changes.
Exceptions:
MouseException if the operation failed.

Definition at line 88 of file OSDLMouseHandler.cc.

References OSDL::Video::Pixels::toString().

const string MouseHandler::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const throw () [virtual]

Returns an user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
Ceylan::TextDisplayable

Definition at line 121 of file OSDLMouseHandler.cc.

References OSDL::Video::Pixels::toString().

MouseNumber MouseHandler::GetAvailableMiceCount (  )  throw () [static]

Returns the number of available mice, i.e.

the mice currently attached to the system.

Returns:
always one, for the moment.

Definition at line 163 of file OSDLMouseHandler.cc.

void MouseHandler::focusGained ( const FocusEvent mouseFocusEvent  )  const throw () [protected, virtual]

Called whenever a mouse focus is gained by the application.

Parameters:
mouseFocusEvent the mouse event about gained focus.
Note:
Expected to be triggered by the EventsModule.

Definition at line 181 of file OSDLMouseHandler.cc.

References OSDL::Events::DefaultMouse.

void MouseHandler::focusLost ( const FocusEvent mouseFocusEvent  )  const throw () [protected, virtual]

Called whenever a mouse focus is lost by the application.

Parameters:
mouseFocusEvent the mouse event about lost focus.
Note:
Expected to be triggered by the EventsModule.

Definition at line 194 of file OSDLMouseHandler.cc.

References OSDL::Events::DefaultMouse.

void MouseHandler::mouseMoved ( const MouseMotionEvent mouseMovedEvent  )  const throw () [protected, virtual]

Called whenever a mouse is moved, so that its controller, if any, is notified.

Note:
Expected to be triggered by the EventsModule.

Definition at line 206 of file OSDLMouseHandler.cc.

void MouseHandler::buttonPressed ( const MouseButtonEvent mouseButtonPressedEvent  )  const throw () [protected, virtual]

Called whenever a mouse button was pressed, so that its controller, if any, is notified.

Note:
Expected to be triggered by the EventsModule.

Definition at line 219 of file OSDLMouseHandler.cc.

void MouseHandler::buttonReleased ( const MouseButtonEvent mouseButtonReleasedEvent  )  const throw () [protected, virtual]

Called whenever a mouse button was released, so that its controller, if any, is notified.

Note:
Expected to be triggered by the EventsModule.

Definition at line 234 of file OSDLMouseHandler.cc.

void MouseHandler::blank (  )  throw () [protected, virtual]

Blanks this mouse handler, i.e.

makes it forget all previously known mice.

Definition at line 250 of file OSDLMouseHandler.cc.

References _mice, and _miceCount.

Referenced by ~MouseHandler().

void MouseHandler::checkMouseAt ( MouseNumber  index  )  const throw () [protected, virtual]

Checks that the mouse at the specified index exists and is opened.

Parameters:
index the index of the mouse to check.
Note:
Stop in emergency the application if the check failed.

Definition at line 270 of file OSDLMouseHandler.cc.

MouseHandler& OSDL::Events::MouseHandler::operator= ( const MouseHandler source  )  throw () [private]

Assignment operator made private to ensure that it will never be called.

The compiler should complain whenever this undefined operator is called, implicitly or not.


Friends And Related Function Documentation

friend class OSDL::Events::EventsModule [friend]

Definition at line 61 of file OSDLMouseHandler.h.


Member Data Documentation

MouseNumber OSDL::Events::MouseHandler::_miceCount [protected]

Records how many mice are known by this handler.

Definition at line 263 of file OSDLMouseHandler.h.

Referenced by blank().

Mouse** OSDL::Events::MouseHandler::_mice [protected]

Records all known mice.

A dynamic array is preferred to a list for performance reasons.

(read it as Mouse * _mice[])

Definition at line 275 of file OSDLMouseHandler.h.

Referenced by blank().

bool OSDL::Events::MouseHandler::_useClassicalMice [protected]

Tells whether complex mice (if false) or classical mice (if true) should be created.

Definition at line 283 of file OSDLMouseHandler.h.


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 14:47:29 2007 for OSDL by  doxygen 1.5.1