+class Network;
+
+class EventManager : public QObject
+{
+ Q_OBJECT
+ Q_FLAGS(EventFlag EventFlags)
+ Q_ENUMS(EventType)
+
+public :
+
+ enum RegistrationMode {
+ Prepend,
+ Append
+ };
+
+ enum Priority {
+ VeryLowPriority,
+ LowPriority,
+ NormalPriority,
+ HighPriority,
+ HighestPriority
+ };
+
+ enum EventFlag {
+ Self = 0x01, ///< Self-generated (user input) event
+ Fake = 0x08, ///< Ignore this in CoreSessionEventProcessor
+ Netsplit = 0x10, ///< Netsplit join/part, ignore on display
+ Backlog = 0x20,
+ Silent = 0x40, ///< Don't generate a MessageEvent
+ Stopped = 0x80
+ };
+ Q_DECLARE_FLAGS(EventFlags, EventFlag)
+
+ /*
+
+ */
+ /* These values make sense! Don't change without knowing what you do! */
+ enum EventType {
+ Invalid = 0xffffffff,
+ GenericEvent = 0x00000000,
+
+ // for event group handlers (handleIrcEvent() will handle all IrcEvent* enums)
+ // event groups are specified by bits 20-24
+ EventGroupMask = 0x00ff0000,
+
+ NetworkEvent = 0x00010000,
+ NetworkConnecting,
+ NetworkInitializing,
+ NetworkInitialized,
+ NetworkReconnecting,
+ NetworkDisconnecting,
+ NetworkDisconnected,
+ NetworkSplitJoin,
+ NetworkSplitQuit,
+ NetworkIncoming,
+
+ IrcServerEvent = 0x00020000,
+ IrcServerIncoming,
+ IrcServerParseError,
+
+ IrcEvent = 0x00030000,
+ IrcEventAuthenticate,
+ IrcEventCap,
+ IrcEventInvite,
+ IrcEventJoin,
+ IrcEventKick,
+ IrcEventMode,
+ IrcEventNick,
+ IrcEventNotice,
+ IrcEventPart,
+ IrcEventPing,
+ IrcEventPong,
+ IrcEventPrivmsg,
+ IrcEventQuit,
+ IrcEventTopic,
+ IrcEventWallops,
+ IrcEventRawPrivmsg, ///< Undecoded privmsg (still needs CTCP parsing)
+ IrcEventRawNotice, ///< Undecoded notice (still needs CTCP parsing)
+ IrcEventUnknown, ///< Unknown non-numeric cmd
+
+ IrcEventNumeric = 0x00031000, /* needs 1000 (0x03e8) consecutive free values! */
+ IrcEventNumericMask = 0x00000fff, /* for checking if an event is numeric */
+
+ MessageEvent = 0x00040000, ///< Stringified event suitable for converting to Message
+
+ CtcpEvent = 0x00050000,
+ CtcpEventFlush
+
+#ifdef HAVE_QCA2
+ ,KeyEvent = 0x00060000
+#endif
+ };
+
+ EventManager(QObject *parent = 0);
+
+ static EventType eventTypeByName(const QString &name);
+ static EventType eventGroupByName(const QString &name);
+ static QString enumName(EventType type);
+ static QString enumName(int type); // for sanity tests