FifeGUI 0.3.0
A C++ GUI library designed for games.
mouselistener.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2004 - 2008 Olof Naessén and Per Larsson
3// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
4
5#ifndef INCLUDE_FIFECHAN_MOUSELISTENER_HPP_
6#define INCLUDE_FIFECHAN_MOUSELISTENER_HPP_
7
8// Platform config include
9#include "fifechan/platform.hpp"
10
11// Project headers (subdirs before local)
12#include "fifechan/events/mouseevent.hpp"
13
14namespace fcn
15{
23 class FIFEGUI_API MouseListener
24 {
25 public:
26 virtual ~MouseListener() = default;
27
31 MouseListener(MouseListener const &) = default;
32
37
42
47
53 virtual void mouseEntered(MouseEvent& mouseEvent)
54 {
55 }
56
62 virtual void mouseExited(MouseEvent& mouseEvent)
63 {
64 }
65
76 virtual void mousePressed(MouseEvent& mouseEvent)
77 {
78 }
79
85 virtual void mouseReleased(MouseEvent& mouseEvent)
86 {
87 }
88
95 virtual void mouseClicked(MouseEvent& mouseEvent)
96 {
97 }
98
104 virtual void mouseWheelMovedUp(MouseEvent& mouseEvent)
105 {
106 }
107
113 virtual void mouseWheelMovedDown(MouseEvent& mouseEvent)
114 {
115 }
116
122 virtual void mouseWheelMovedRight(MouseEvent& mouseEvent)
123 {
124 }
125
131 virtual void mouseWheelMovedLeft(MouseEvent& mouseEvent)
132 {
133 }
134
141 virtual void mouseMoved(MouseEvent& mouseEvent)
142 {
143 }
144
151 virtual void mouseDragged(MouseEvent& mouseEvent)
152 {
153 }
154
155 protected:
162 MouseListener() = default;
163 };
164} // namespace fcn
165
166#endif // INCLUDE_FIFECHAN_MOUSELISTENER_HPP_
Represents a mouse event.
MouseListener(MouseListener &&)=default
Move constructor.
virtual void mouseClicked(MouseEvent &mouseEvent)
Called when a mouse button is pressed and released (clicked) on the widget area.
MouseListener & operator=(MouseListener &&)=default
Move assignment operator.
MouseListener(MouseListener const &)=default
Copy constructor.
virtual void mouseWheelMovedDown(MouseEvent &mouseEvent)
Called when the mouse wheel has moved down on the widget area.
virtual void mouseDragged(MouseEvent &mouseEvent)
Called when the mouse has moved and the mouse has previously been pressed on the widget.
virtual void mouseEntered(MouseEvent &mouseEvent)
Called when the mouse has entered into the widget area.
virtual void mouseWheelMovedRight(MouseEvent &mouseEvent)
Called when the mouse wheel has moved right on the widget area.
virtual void mouseMoved(MouseEvent &mouseEvent)
Called when the mouse has moved in the widget area and no mouse button has been pressed (i....
virtual void mousePressed(MouseEvent &mouseEvent)
Called when a mouse button has been pressed down on the widget area.
MouseListener & operator=(MouseListener const &)=default
Copy assignment operator.
virtual void mouseWheelMovedLeft(MouseEvent &mouseEvent)
Called when the mouse wheel has moved left on the widget area.
MouseListener()=default
Protected default constructor.
virtual void mouseExited(MouseEvent &mouseEvent)
Called when the mouse has exited the widget area.
virtual void mouseReleased(MouseEvent &mouseEvent)
Called when a mouse button has been released on the widget area.
virtual void mouseWheelMovedUp(MouseEvent &mouseEvent)
Called when the mouse wheel has moved up on the widget area.
Used replacement tokens by configure_file():