00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CEVENT_H
00016 #define CEVENT_H
00017
00018 #include "BasicTypes.h"
00019 #include "stdmap.h"
00020
00022
00025 class CEvent {
00026 public:
00027 typedef UInt32 Type;
00028 enum {
00029 kUnknown,
00030 kQuit,
00031 kSystem,
00032 kTimer,
00033 kLast
00034 };
00035
00036 typedef UInt32 Flags;
00037 enum {
00038 kNone = 0x00,
00039 kDeliverImmediately = 0x01,
00040 kDontFreeData = 0x02
00041 };
00042
00043 CEvent();
00044
00046
00053 CEvent(Type type, void* target = NULL, void* data = NULL,
00054 UInt32 flags = kNone);
00055
00057
00058
00060
00063 static Type registerType(const char* name);
00064
00066
00071 static Type registerTypeOnce(Type& type, const char* name);
00072
00074
00078 static const char* getTypeName(Type type);
00079
00081
00084 static void deleteData(const CEvent&);
00085
00087
00088
00089
00091
00094 Type getType() const;
00095
00097
00100 void* getTarget() const;
00101
00103
00106 void* getData() const;
00107
00109
00112 Flags getFlags() const;
00113
00115
00116 private:
00117 Type m_type;
00118 void* m_target;
00119 void* m_data;
00120 Flags m_flags;
00121 };
00122
00123 #endif