GUI
Event.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 by Maciej Wiecierzewski
3  */
4 
5 #ifndef EVENT_H
6 #define EVENT_H
7 
8 #include "events.h"
9 #include "EventObject.h"
10 
11 namespace gui
12 {
13 
14 class EventObject;
15 
17 
18 class Event final
19 {
20  public:
21  Event(Event&& other);
22  Event& operator=(Event&& other);
23  ~Event();
24 
25  template<class T> T* getEventObject()
26  {
27  return static_cast<T*>(obj);
28  }
29  inline EventType getType() { return type; }
30 
31  protected:
32 
33  private:
34  Event();
35  Event(EventType eventType, EventObject *obj);
36 
40  Event(Event&) = delete;
41 
46 
51 
52  friend class GUISystem;
53 };
54 
55 }
56 
57 #endif // EVENT_H