GUI
EventListener.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 by Maciej Wiecierzewski
3  */
4 
5 #ifndef EVENTLISTENER_H
6 #define EVENTLISTENER_H
7 
8 #include <functional>
9 
10 #include "Event.h"
11 
12 namespace gui
13 {
14 
16 
18 {
19  public:
20  typedef std::function<void(Event&)> Function;
21  typedef unsigned int Id;
22 
24  EventListener(Function function);
25 
26  void bind(Function& function);
27  void operator() (Event& event);
28 
29  protected:
30 
31  private:
32  Function func;
34 
35  friend class EventEmitter;
36  friend class GUISystem;
37 };
38 
39 }
40 
41 #endif // EVENTLISTENER_H