libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
event.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_CORE
13#include <cstdint>
14#include <promeki/namespace.h>
15#include <promeki/string.h>
16
17PROMEKI_NAMESPACE_BEGIN
18
40class Event {
41 public:
43 using Type = uint32_t;
44
46 static constexpr Type InvalidType = 0;
47
55 static Type registerType();
56
77 static Type registerType(const String &name);
78
92 static String typeName(Type type);
93
95 static const Type Timer;
96
98 static const Type DeferredCall;
99
101 static const Type SignalEvent;
102
104 static const Type Quit;
105
110 Event(Type type) : _type(type) {}
111
113 virtual ~Event() = default;
114
119 Type type() const { return _type; }
120
125 bool isAccepted() const { return _accepted; }
126
133 void accept() { _accepted = true; }
134
140 void ignore() { _accepted = false; }
141
142 private:
143 Type _type;
144 bool _accepted = false;
145};
146
147PROMEKI_NAMESPACE_END
148
149#endif // PROMEKI_ENABLE_CORE