aboutsummaryrefslogtreecommitdiff
path: root/mwe/events/include/iMouseListener.h
blob: 5b1181c7cbe96bb2863f92ef984daeef2a9d9f2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once
#include "event.h"
#include "eventHandler.h"
#include "eventManager.h"

class IMouseListener {
public:
	virtual ~IMouseListener();

	virtual void onMouseClicked(const MouseClickEvent & event) = 0;
	virtual void onMousePressed(const MousePressedEvent & event) = 0;
	virtual void onMouseReleased(const MouseReleasedEvent & event) = 0;
	virtual void onMouseMoved(const MouseMovedEvent & event) = 0;

protected:
	void subscribeEvents(int listenerId = 0);
	void unsubscribeEvents(int listenerId = 0);

private:
	EventHandler<MouseClickEvent> mouseClickHandler;
	EventHandler<MousePressedEvent> mousePressHandler;
	EventHandler<MouseReleasedEvent> mouseReleaseHandler;
	EventHandler<MouseMovedEvent> mouseMoveHandler;
};