FIFE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FIFE::MouseEvent Class Reference

Class for mouse events. More...

#include <ec_mouseevent.h>

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

Public Types

enum  MouseEventType {
  UNKNOWN_EVENT = -1, MOVED = 0, PRESSED, RELEASED,
  WHEEL_MOVED_DOWN, WHEEL_MOVED_UP, CLICKED, ENTERED,
  EXITED, DRAGGED
}
 Mouse event types. More...
 
enum  MouseButtonType {
  EMPTY = 0, LEFT = 1, RIGHT = 2, MIDDLE = 4,
  UNKNOWN_BUTTON = 8
}
 Mouse button types. More...
 

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)
 
virtual bool isControlPressed () const
 Checks whether control is pressed. More...
 
virtual void setControlPressed (bool pressed)
 
virtual bool isMetaPressed () const
 Checks whether meta is pressed. More...
 
virtual void setMetaPressed (bool pressed)
 
virtual bool isShiftPressed () const
 Checks whether shift is pressed. More...
 
virtual void setShiftPressed (bool pressed)
 
virtual void consume ()
 Marks the event as consumed. More...
 
virtual bool isConsumed () const
 Checks if the event is consumed. More...
 
virtual void consumedByWidgets ()
 Marks events as consumed by widget library. More...
 
virtual bool isConsumedByWidgets () const
 
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 ec_mouseevent.h.

Member Enumeration Documentation

Mouse button types.

Enumerator
EMPTY 
LEFT 
RIGHT 
MIDDLE 
UNKNOWN_BUTTON 

Definition at line 64 of file ec_mouseevent.h.

Mouse event types.

Enumerator
UNKNOWN_EVENT 
MOVED 
PRESSED 
RELEASED 
WHEEL_MOVED_DOWN 
WHEEL_MOVED_UP 
CLICKED 
ENTERED 
EXITED 
DRAGGED 

Definition at line 47 of file ec_mouseevent.h.

Constructor & Destructor Documentation

FIFE::MouseEvent::MouseEvent ( )
inline

Constructor.

Definition at line 76 of file ec_mouseevent.h.

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

Destructor.

Definition at line 85 of file ec_mouseevent.h.

Member Function Documentation

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

Marks the event as consumed.

Reimplemented from FIFE::InputEvent.

Definition at line 126 of file ec_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 128 of file ec_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 140 of file ec_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 91 of file ec_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 139 of file ec_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 135 of file ec_mouseevent.h.

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

Gets the source of the event.

Reimplemented from FIFE::InputEvent.

Definition at line 130 of file ec_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 132 of file ec_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 98 of file ec_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 106 of file ec_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 114 of file ec_mouseevent.h.

References m_y.

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

Checks whether alt is pressed.

Reimplemented from FIFE::InputEvent.

Definition at line 117 of file ec_mouseevent.h.

References FIFE::InputEvent::isAltPressed().

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

Checks if the event is consumed.

Returns
true if the event is consumed, false otherwise.

Reimplemented from FIFE::InputEvent.

Definition at line 127 of file ec_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

Reimplemented from FIFE::InputEvent.

Definition at line 129 of file ec_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 119 of file ec_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 121 of file ec_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 123 of file ec_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 190 of file ec_mouseevent.h.

References EMPTY, LEFT, MIDDLE, and RIGHT.

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 152 of file ec_mouseevent.h.

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

Referenced by getAttrStr().

+ Here is the caller graph for this function:

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

Reimplemented from FIFE::InputEvent.

Definition at line 118 of file ec_mouseevent.h.

References FIFE::InputEvent::setAltPressed().

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

+ Here is the caller graph for this function:

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

Definition at line 92 of file ec_mouseevent.h.

References m_buttontype.

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

+ Here is the caller graph for this function:

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

Reimplemented from FIFE::InputEvent.

Definition at line 120 of file ec_mouseevent.h.

References FIFE::InputEvent::setControlPressed().

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

+ Here is the caller graph for this function:

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

Reimplemented from FIFE::InputEvent.

Definition at line 122 of file ec_mouseevent.h.

References FIFE::InputEvent::setMetaPressed().

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

+ Here is the caller graph for this function:

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

Reimplemented from FIFE::InputEvent.

Definition at line 124 of file ec_mouseevent.h.

References FIFE::InputEvent::setShiftPressed().

Referenced by FIFE::GUIChanManager::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 131 of file ec_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 133 of file ec_mouseevent.h.

References FIFE::InputEvent::setTimeStamp().

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

Definition at line 99 of file ec_mouseevent.h.

References m_eventtype.

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

+ Here is the caller graph for this function:

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

Definition at line 107 of file ec_mouseevent.h.

References m_x.

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

+ Here is the caller graph for this function:

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

Definition at line 115 of file ec_mouseevent.h.

References m_y.

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

+ Here is the caller graph for this function:

Member Data Documentation

MouseButtonType FIFE::MouseEvent::m_buttontype
private

Definition at line 215 of file ec_mouseevent.h.

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

MouseEventType FIFE::MouseEvent::m_eventtype
private

Definition at line 214 of file ec_mouseevent.h.

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

int32_t FIFE::MouseEvent::m_x
private

Definition at line 216 of file ec_mouseevent.h.

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

int32_t FIFE::MouseEvent::m_y
private

Definition at line 217 of file ec_mouseevent.h.

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


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