1 |
|
|
/* |
2 |
|
|
* The ManaPlus Client |
3 |
|
|
* Copyright (C) 2011-2019 The ManaPlus Developers |
4 |
|
|
* |
5 |
|
|
* This file is part of The ManaPlus Client. |
6 |
|
|
* |
7 |
|
|
* This program is free software; you can redistribute it and/or modify |
8 |
|
|
* it under the terms of the GNU General Public License as published by |
9 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
10 |
|
|
* any later version. |
11 |
|
|
* |
12 |
|
|
* This program is distributed in the hope that it will be useful, |
13 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
|
* GNU General Public License for more details. |
16 |
|
|
* |
17 |
|
|
* You should have received a copy of the GNU General Public License |
18 |
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 |
|
|
*/ |
20 |
|
|
|
21 |
|
|
/* _______ __ __ __ ______ __ __ _______ __ __ |
22 |
|
|
* / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ |
23 |
|
|
* / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / |
24 |
|
|
* / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / |
25 |
|
|
* / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / |
26 |
|
|
* /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / |
27 |
|
|
* \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ |
28 |
|
|
* |
29 |
|
|
* Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson |
30 |
|
|
* |
31 |
|
|
* |
32 |
|
|
* Per Larsson a.k.a finalman |
33 |
|
|
* Olof Naessén a.k.a jansem/yakslem |
34 |
|
|
* |
35 |
|
|
* Visit: http://guichan.sourceforge.net |
36 |
|
|
* |
37 |
|
|
* License: (BSD) |
38 |
|
|
* Redistribution and use in source and binary forms, with or without |
39 |
|
|
* modification, are permitted provided that the following conditions |
40 |
|
|
* are met: |
41 |
|
|
* 1. Redistributions of source code must retain the above copyright |
42 |
|
|
* notice, this list of conditions and the following disclaimer. |
43 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
44 |
|
|
* notice, this list of conditions and the following disclaimer in |
45 |
|
|
* the documentation and/or other materials provided with the |
46 |
|
|
* distribution. |
47 |
|
|
* 3. Neither the name of Guichan nor the names of its contributors may |
48 |
|
|
* be used to endorse or promote products derived from this software |
49 |
|
|
* without specific prior written permission. |
50 |
|
|
* |
51 |
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
52 |
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
53 |
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
54 |
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
55 |
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
56 |
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
57 |
|
|
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
58 |
|
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
59 |
|
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
60 |
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
61 |
|
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
62 |
|
|
*/ |
63 |
|
|
|
64 |
|
|
#ifndef LISTENERS_MOUSELISTENER_H |
65 |
|
|
#define LISTENERS_MOUSELISTENER_H |
66 |
|
|
|
67 |
|
|
#include "events/mouseevent.h" |
68 |
|
|
|
69 |
|
|
#include "localconsts.h" |
70 |
|
|
|
71 |
|
|
/** |
72 |
|
|
* Interface for listening for mouse events from widgets. |
73 |
|
|
* |
74 |
|
|
* @see Widget::addMouseListener, Widget::removeMouseListener |
75 |
|
|
*/ |
76 |
|
|
class MouseListener notfinal |
77 |
|
|
{ |
78 |
|
|
public: |
79 |
|
|
A_DELETE_COPY(MouseListener) |
80 |
|
|
|
81 |
|
|
/** |
82 |
|
|
* Destructor. |
83 |
|
|
*/ |
84 |
|
|
virtual ~MouseListener() |
85 |
|
1201 |
{ } |
86 |
|
|
|
87 |
|
|
/** |
88 |
|
|
* Called when the mouse has entered into the widget area. |
89 |
|
|
* |
90 |
|
|
* @param event Describes the event. |
91 |
|
|
*/ |
92 |
|
|
virtual void mouseEntered(MouseEvent &event A_UNUSED) |
93 |
|
|
{ |
94 |
|
|
} |
95 |
|
|
|
96 |
|
|
/** |
97 |
|
|
* Called when the mouse has exited the widget area. |
98 |
|
|
* |
99 |
|
|
* @param event Describes the event. |
100 |
|
|
*/ |
101 |
|
|
virtual void mouseExited(MouseEvent &event A_UNUSED) |
102 |
|
|
{ |
103 |
|
|
} |
104 |
|
|
|
105 |
|
|
/** |
106 |
|
|
* Called when a mouse button has been pressed on the widget area. |
107 |
|
|
* |
108 |
|
|
* NOTE: A mouse press is NOT equal to a mouse click. |
109 |
|
|
* Use mouseClickMessage to check for mouse clicks. |
110 |
|
|
* |
111 |
|
|
* @param event Describes the event. |
112 |
|
|
*/ |
113 |
|
|
virtual void mousePressed(MouseEvent &event A_UNUSED) |
114 |
|
|
{ |
115 |
|
|
} |
116 |
|
|
|
117 |
|
|
/** |
118 |
|
|
* Called when a mouse button has been released on the widget area. |
119 |
|
|
* |
120 |
|
|
* @param event Describes the event. |
121 |
|
|
*/ |
122 |
|
|
virtual void mouseReleased(MouseEvent &event A_UNUSED) |
123 |
|
|
{ |
124 |
|
|
} |
125 |
|
|
|
126 |
|
|
/** |
127 |
|
|
* Called when a mouse button is pressed and released (clicked) on |
128 |
|
|
* the widget area. |
129 |
|
|
* |
130 |
|
|
* @param event Describes the event. |
131 |
|
|
*/ |
132 |
|
|
virtual void mouseClicked(MouseEvent &event A_UNUSED) |
133 |
|
|
{ |
134 |
|
|
} |
135 |
|
|
|
136 |
|
|
/** |
137 |
|
|
* Called when the mouse wheel has moved up on the widget area. |
138 |
|
|
* |
139 |
|
|
* @param event Describes the event. |
140 |
|
|
*/ |
141 |
|
|
virtual void mouseWheelMovedUp(MouseEvent &event A_UNUSED) |
142 |
|
|
{ |
143 |
|
|
} |
144 |
|
|
|
145 |
|
|
/** |
146 |
|
|
* Called when the mouse wheel has moved down on the widget area. |
147 |
|
|
* |
148 |
|
|
* @param event Describes the event. |
149 |
|
|
*/ |
150 |
|
|
virtual void mouseWheelMovedDown(MouseEvent &event A_UNUSED) |
151 |
|
|
{ |
152 |
|
|
} |
153 |
|
|
|
154 |
|
|
/** |
155 |
|
|
* Called when the mouse has moved in the widget area and no mouse button |
156 |
|
|
* has been pressed (i.e no widget is being dragged). |
157 |
|
|
* |
158 |
|
|
* @param event Describes the event. |
159 |
|
|
*/ |
160 |
|
|
virtual void mouseMoved(MouseEvent &event A_UNUSED) |
161 |
|
|
{ |
162 |
|
|
} |
163 |
|
|
|
164 |
|
|
/** |
165 |
|
|
* Called when the mouse has moved and the mouse has previously been |
166 |
|
|
* pressed on the widget. |
167 |
|
|
* |
168 |
|
|
* @param event Describes the event. |
169 |
|
|
*/ |
170 |
|
|
virtual void mouseDragged(MouseEvent &event A_UNUSED) |
171 |
|
|
{ |
172 |
|
|
} |
173 |
|
|
|
174 |
|
|
protected: |
175 |
|
|
/** |
176 |
|
|
* Constructor. |
177 |
|
|
* |
178 |
|
|
* You should not be able to make an instance of MouseListener, |
179 |
|
|
* therefore its constructor is protected. |
180 |
|
|
*/ |
181 |
|
|
MouseListener() |
182 |
|
2249 |
{ } |
183 |
|
|
}; |
184 |
|
|
|
185 |
|
|
#endif // LISTENERS_MOUSELISTENER_H |