FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
imouselistener.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2019 by the FIFE team *
3  * http://www.fifengine.net *
4  * This file is part of FIFE. *
5  * *
6  * FIFE is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU Lesser General Public *
8  * License as published by the Free Software Foundation; either *
9  * version 2.1 of the License, or (at your option) any later version. *
10  * *
11  * This library is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20  ***************************************************************************/
21 
22 #ifndef FIFE_EVENTCHANNEL_IMOUSELISTENER_H
23 #define FIFE_EVENTCHANNEL_IMOUSELISTENER_H
24 
25 // Standard C++ library includes
26 //
27 
28 // 3rd party library includes
29 //
30 
31 // FIFE includes
32 // These includes are split up in two parts, separated by one empty line
33 // First block: files included from the FIFE root src directory
34 // Second block: files included from the same folder
36 
37 namespace FIFE {
38 
39  class MouseEvent;
40 
45  class IMouseListener : public IListener {
46  public:
51  virtual void mouseEntered(MouseEvent& evt) = 0;
52 
57  virtual void mouseExited(MouseEvent& evt) = 0;
58 
64  virtual void mousePressed(MouseEvent& evt) = 0;
65 
70  virtual void mouseReleased(MouseEvent& evt) = 0;
71 
77  virtual void mouseClicked(MouseEvent& evt) = 0;
78 
83  virtual void mouseWheelMovedUp(MouseEvent& evt) = 0;
84 
89  virtual void mouseWheelMovedDown(MouseEvent& evt) = 0;
90 
95  virtual void mouseWheelMovedRight(MouseEvent& evt) = 0;
96 
101  virtual void mouseWheelMovedLeft(MouseEvent& evt) = 0;
102 
108  virtual void mouseMoved(MouseEvent& evt) = 0;
109 
115  virtual void mouseDragged(MouseEvent& evt) = 0;
116 
121  virtual bool isGlobalListener() const { return m_global; }
122 
127  virtual void setGlobalListener(bool global) { m_global = global; }
128 
129  virtual ~IMouseListener() {}
130 
131  protected:
132  IMouseListener() { m_global = false; }
133 
134  private:
135  bool m_global;
136  };
137 
138 } //FIFE
139 
140 #endif
virtual void mouseExited(MouseEvent &evt)=0
Called when the mouse has exited the event source area.
Class for mouse events.
Definition: mouseevent.h:42
virtual bool isGlobalListener() const
Indicates if this is a global listener Global listener can also receive events that are consumed by w...
virtual void mousePressed(MouseEvent &evt)=0
Called when a mouse button has been pressed on the event source area.
virtual void setGlobalListener(bool global)
Changes the behaviour of the listener to be global or not.
virtual void mouseWheelMovedDown(MouseEvent &evt)=0
Called when the mouse wheel has moved down on the event source area.
Listener of mouse events.
virtual void mouseMoved(MouseEvent &evt)=0
Called when the mouse has moved in the event source area and no mouse button has been pressed...
virtual void mouseWheelMovedLeft(MouseEvent &evt)=0
Called when the mouse wheel has moved left on the event source area.
virtual void mouseReleased(MouseEvent &evt)=0
Called when a mouse button has been released on the event source area.
virtual void mouseWheelMovedUp(MouseEvent &evt)=0
Called when the mouse wheel has moved up on the event source area.
virtual void mouseDragged(MouseEvent &evt)=0
Called when the mouse has moved and the mouse has previously been pressed on the event source...
virtual void mouseClicked(MouseEvent &evt)=0
Called when a mouse button is pressed and released (clicked) on the event source area.
Base Listener.
Definition: ilistener.h:40
virtual void mouseEntered(MouseEvent &evt)=0
Called when the mouse has entered into the event source area.
virtual void mouseWheelMovedRight(MouseEvent &evt)=0
Called when the mouse wheel has moved right on the event source area.