/
ctoolbase.h
51 lines (37 loc) · 1.19 KB
/
ctoolbase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef CTOOLBASE_H
#define CTOOLBASE_H
#include <QObject>
#include <QMouseEvent>
#include "ceditablemap.h"
class CMapWidget;
class CToolBase : public QObject {
Q_OBJECT
public:
explicit CToolBase(QObject *parent = 0);
virtual CMap::ObjectType typesToPreview() const { return CMap::NoObject; }
virtual int whatThingFor(CMap::ObjectType type, int x, int y, int normal) const {
(void)x; (void)y; (void)type;
return normal;
}
virtual void hoverStatusChanged(
bool fromValid, const CMapPoint &from,
bool toValid, const CMapPoint &to,
QMouseEvent *event) {
(void)fromValid; (void)toValid;
(void)from; (void)to;
(void)event;
}
virtual void activate() { }
virtual void deactivate() { }
virtual void tileMousePress(const CMapPoint &tile, QMouseEvent *event) { (void)tile; (void)event; }
virtual void tileMouseRelease(const CMapPoint &tile, QMouseEvent *event) { (void)tile; (void)event; }
virtual void tileMouseAltAction(const CMapPoint &tile, QMouseEvent *event) { (void)tile; (void)event; }
private:
CMapWidget *m_widget;
public:
void setMapWidget(CMapWidget *mw) { m_widget = mw; }
CMapWidget *widget() const { return m_widget; }
signals:
public slots:
};
#endif // CTOOLBASE_H