FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::MouseEvent Class Reference

Class for mouse events. More...

#include <mouseevent.h>

+ Inheritance diagram for FIFE::MouseEvent:
+ Collaboration diagram for FIFE::MouseEvent:

Public Types

Public Member Functions

 MouseEvent ()
 Constructor. More...
 
virtual ~MouseEvent ()
 Destructor. More...
 
MouseButtonType getButton () const
 Gets the button of the mouse event. More...
 
void setButton (MouseButtonType type)
 
MouseEventType getType () const
 Gets the type of the event. More...
 
void setType (MouseEventType type)
 
int32_t getX () const
 Gets the x coordinate of the mouse event. More...
 
void setX (int32_t x)
 
int32_t getY () const
 Gets the y coordinate of the mouse event. More...
 
void setY (int32_t y)
 
virtual bool isAltPressed () const
 Checks whether alt is pressed. More...
 
virtual void setAltPressed (bool pressed)
 Sets alt to pressed. More...
 
virtual bool isControlPressed () const
 Checks whether control is pressed. More...
 
virtual void setControlPressed (bool pressed)
 Sets control to pressed. More...
 
virtual bool isMetaPressed () const
 Checks whether meta is pressed. More...
 
virtual void setMetaPressed (bool pressed)
 Sets meta to pressed. More...
 
virtual bool isShiftPressed () const
 Checks whether shift is pressed. More...
 
virtual void setShiftPressed (bool pressed)
 Sets shift to pressed. More...
 
virtual void consume ()
 Marks events as consumed. More...
 
virtual bool isConsumed () const
 Checks whether event is consumed. More...
 
virtual void consumedByWidgets ()
 Marks events as consumed by widget library. More...
 
virtual bool isConsumedByWidgets () const
 Checks whether event is consumed by widget library. More...
 
virtual IEventSourcegetSource () const
 Gets the source of the event. More...
 
virtual void setSource (IEventSource *source)
 Sets the source of the event. More...
 
virtual int32_t getTimeStamp () const
 Gets the timestamp of the event. More...
 
virtual void setTimeStamp (int32_t timestamp)
 Sets the timestamp of the event. More...
 
virtual const std::string & getName () const
 Gets the name of the event. More...
 
virtual std::string getDebugString () const
 Gets the debugstring of the event. More...
 
virtual std::string getAttrStr () const
 Gets attribute string of the event. More...
 
- Public Member Functions inherited from FIFE::InputEvent
 InputEvent ()
 Constructor. More...
 
 ~InputEvent ()
 Destructor. More...
 
- Public Member Functions inherited from FIFE::Event
 Event ()
 Constructor. More...
 
virtual ~Event ()
 Destructor. More...
 

Static Public Member Functions

static std::string mouseEventType2str (MouseEventType t)
 Returns string representation of given event type. More...
 
static std::string mouseButtonType2str (MouseButtonType t)
 Returns string representation of given button type. More...
 

Private Attributes

MouseEventType m_eventType
 
MouseButtonType m_buttonType
 
int32_t m_x
 
int32_t m_y
 

Detailed Description

Class for mouse events.

Definition at line 42 of file mouseevent.h.

Member Enumeration Documentation

Mouse button types.

Enumerator
EMPTY 
LEFT 
RIGHT 
MIDDLE 
X1 
X2 
UNKNOWN_BUTTON 

Definition at line 66 of file mouseevent.h.

Mouse event types.

Enumerator
UNKNOWN_EVENT 
MOVED 
PRESSED 
RELEASED 
WHEEL_MOVED_DOWN 
WHEEL_MOVED_UP 
WHEEL_MOVED_RIGHT 
WHEEL_MOVED_LEFT 
CLICKED 
ENTERED 
EXITED 
DRAGGED 

Definition at line 47 of file mouseevent.h.

Constructor & Destructor Documentation

FIFE::MouseEvent::MouseEvent ( )
inline

Constructor.

Definition at line 80 of file mouseevent.h.

virtual FIFE::MouseEvent::~MouseEvent ( )
inlinevirtual

Destructor.

Definition at line 89 of file mouseevent.h.

Member Function Documentation

virtual void FIFE::MouseEvent::consume ( )
inlinevirtual

Marks events as consumed.

Reimplemented from FIFE::InputEvent.

Definition at line 130 of file mouseevent.h.

References FIFE::InputEvent::consume().

virtual void FIFE::MouseEvent::consumedByWidgets ( )
inlinevirtual

Marks events as consumed by widget library.

Reimplemented from FIFE::InputEvent.

Definition at line 132 of file mouseevent.h.

References FIFE::InputEvent::consumedByWidgets().

virtual std::string FIFE::MouseEvent::getAttrStr ( ) const
inlinevirtual

Gets attribute string of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 144 of file mouseevent.h.

References FIFE::InputEvent::getAttrStr(), m_buttonType, m_eventType, m_x, m_y, mouseButtonType2str(), and mouseEventType2str().

MouseButtonType FIFE::MouseEvent::getButton ( ) const
inline

Gets the button of the mouse event.

Returns
the button of the mouse event.

Definition at line 95 of file mouseevent.h.

References m_buttonType.

Referenced by FIFE::EventManager::processMouseEvent().

+ Here is the caller graph for this function:

virtual std::string FIFE::MouseEvent::getDebugString ( ) const
inlinevirtual

Gets the debugstring of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 143 of file mouseevent.h.

References FIFE::InputEvent::getDebugString().

virtual const std::string& FIFE::MouseEvent::getName ( ) const
inlinevirtual

Gets the name of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 139 of file mouseevent.h.

virtual IEventSource* FIFE::MouseEvent::getSource ( ) const
inlinevirtual

Gets the source of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 134 of file mouseevent.h.

References FIFE::InputEvent::getSource().

virtual int32_t FIFE::MouseEvent::getTimeStamp ( ) const
inlinevirtual

Gets the timestamp of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 136 of file mouseevent.h.

References FIFE::InputEvent::getTimeStamp().

MouseEventType FIFE::MouseEvent::getType ( ) const
inline

Gets the type of the event.

Returns
the type of the event.

Definition at line 102 of file mouseevent.h.

References m_eventType.

Referenced by FIFE::EventManager::dispatchMouseEvent(), and FIFE::EventManager::fillMouseEvent().

+ Here is the caller graph for this function:

int32_t FIFE::MouseEvent::getX ( ) const
inline

Gets the x coordinate of the mouse event.

The coordinate is relative to the source event source.

Returns
the x coordinate of the mouse event.

Definition at line 110 of file mouseevent.h.

References m_x.

int32_t FIFE::MouseEvent::getY ( ) const
inline

Gets the y coordinate of the mouse event.

The coordinate is relative to the source event source.

Returns
the y coordinate of the mouse event.

Definition at line 118 of file mouseevent.h.

References m_y.

virtual bool FIFE::MouseEvent::isAltPressed ( ) const
inlinevirtual

Checks whether alt is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 121 of file mouseevent.h.

References FIFE::InputEvent::isAltPressed().

virtual bool FIFE::MouseEvent::isConsumed ( ) const
inlinevirtual

Checks whether event is consumed.

Reimplemented from FIFE::InputEvent.

Definition at line 131 of file mouseevent.h.

References FIFE::InputEvent::isConsumed().

Referenced by FIFE::EventManager::dispatchMouseEvent().

+ Here is the caller graph for this function:

virtual bool FIFE::MouseEvent::isConsumedByWidgets ( ) const
inlinevirtual

Checks whether event is consumed by widget library.

Reimplemented from FIFE::InputEvent.

Definition at line 133 of file mouseevent.h.

References FIFE::InputEvent::isConsumedByWidgets().

virtual bool FIFE::MouseEvent::isControlPressed ( ) const
inlinevirtual

Checks whether control is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 123 of file mouseevent.h.

References FIFE::InputEvent::isControlPressed().

virtual bool FIFE::MouseEvent::isMetaPressed ( ) const
inlinevirtual

Checks whether meta is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 125 of file mouseevent.h.

References FIFE::InputEvent::isMetaPressed().

virtual bool FIFE::MouseEvent::isShiftPressed ( ) const
inlinevirtual

Checks whether shift is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 127 of file mouseevent.h.

References FIFE::InputEvent::isShiftPressed().

static std::string FIFE::MouseEvent::mouseButtonType2str ( MouseButtonType  t)
inlinestatic

Returns string representation of given button type.

Definition at line 200 of file mouseevent.h.

References EMPTY, LEFT, MIDDLE, RIGHT, UNKNOWN_BUTTON, X1, and X2.

Referenced by getAttrStr().

+ Here is the caller graph for this function:

static std::string FIFE::MouseEvent::mouseEventType2str ( MouseEventType  t)
inlinestatic

Returns string representation of given event type.

Definition at line 156 of file mouseevent.h.

References CLICKED, DRAGGED, ENTERED, EXITED, MOVED, PRESSED, RELEASED, WHEEL_MOVED_DOWN, WHEEL_MOVED_LEFT, WHEEL_MOVED_RIGHT, and WHEEL_MOVED_UP.

Referenced by getAttrStr().

+ Here is the caller graph for this function:

virtual void FIFE::MouseEvent::setAltPressed ( bool  pressed)
inlinevirtual

Sets alt to pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 122 of file mouseevent.h.

References FIFE::InputEvent::setAltPressed().

Referenced by FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

void FIFE::MouseEvent::setButton ( MouseButtonType  type)
inline

Definition at line 96 of file mouseevent.h.

References m_buttonType.

Referenced by FIFE::EventManager::fillMouseEvent(), and FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

virtual void FIFE::MouseEvent::setControlPressed ( bool  pressed)
inlinevirtual

Sets control to pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 124 of file mouseevent.h.

References FIFE::InputEvent::setControlPressed().

Referenced by FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

virtual void FIFE::MouseEvent::setMetaPressed ( bool  pressed)
inlinevirtual

Sets meta to pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 126 of file mouseevent.h.

References FIFE::InputEvent::setMetaPressed().

Referenced by FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

virtual void FIFE::MouseEvent::setShiftPressed ( bool  pressed)
inlinevirtual

Sets shift to pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 128 of file mouseevent.h.

References FIFE::InputEvent::setShiftPressed().

Referenced by FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

virtual void FIFE::MouseEvent::setSource ( IEventSource source)
inlinevirtual

Sets the source of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 135 of file mouseevent.h.

References FIFE::InputEvent::setSource().

Referenced by FIFE::EventManager::processMouseEvent().

+ Here is the caller graph for this function:

virtual void FIFE::MouseEvent::setTimeStamp ( int32_t  timestamp)
inlinevirtual

Sets the timestamp of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 137 of file mouseevent.h.

References FIFE::InputEvent::setTimeStamp().

void FIFE::MouseEvent::setType ( MouseEventType  type)
inline

Definition at line 103 of file mouseevent.h.

References m_eventType.

Referenced by FIFE::EventManager::fillMouseEvent(), and FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

void FIFE::MouseEvent::setX ( int32_t  x)
inline

Definition at line 111 of file mouseevent.h.

References m_x.

Referenced by FIFE::EventManager::fillMouseEvent(), and FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

void FIFE::MouseEvent::setY ( int32_t  y)
inline

Definition at line 119 of file mouseevent.h.

References m_y.

Referenced by FIFE::EventManager::fillMouseEvent(), and FIFE::FifechanManager::translateMouseEvent().

+ Here is the caller graph for this function:

Member Data Documentation

MouseButtonType FIFE::MouseEvent::m_buttonType
private

Definition at line 234 of file mouseevent.h.

Referenced by getAttrStr(), getButton(), and setButton().

MouseEventType FIFE::MouseEvent::m_eventType
private

Definition at line 233 of file mouseevent.h.

Referenced by getAttrStr(), getType(), and setType().

int32_t FIFE::MouseEvent::m_x
private

Definition at line 235 of file mouseevent.h.

Referenced by getAttrStr(), getX(), and setX().

int32_t FIFE::MouseEvent::m_y
private

Definition at line 236 of file mouseevent.h.

Referenced by getAttrStr(), getY(), and setY().


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