Introduce CtcpParser for CTCP-related event processing
[quassel.git] / src / common / eventmanager.h
index a5b7a27..025493b 100644 (file)
@@ -46,10 +46,14 @@ public:
   };
 
   enum EventFlag {
-    Backlog = 0x40,
-    Stopped = 0x80
+    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)
+  Q_DECLARE_FLAGS(EventFlags, EventFlag);
 
   /*
 
@@ -70,6 +74,8 @@ public:
     NetworkReconnecting,
     NetworkDisconnecting,
     NetworkDisconnected,
+    NetworkSplitJoin,
+    NetworkSplitQuit,
     NetworkIncoming,
 
     IrcServerEvent              = 0x00020000,
@@ -77,8 +83,8 @@ public:
     IrcServerParseError,
 
     IrcEvent                    = 0x00030000,
+    IrcEventAuthenticate,
     IrcEventCap,
-    IrcEventCapAuthenticate,
     IrcEventInvite,
     IrcEventJoin,
     IrcEventKick,
@@ -99,6 +105,9 @@ public:
     IrcEventNumericMask         = 0x00000fff, /* for checking if an event is numeric */
 
     MessageEvent                = 0x00040000, ///< Stringified event suitable for converting to Message
+
+    CtcpEvent                   = 0x00050000,
+    CtcpEventFlush,
   };
 
   EventManager(QObject *parent = 0);
@@ -106,6 +115,7 @@ public:
 
   EventType eventTypeByName(const QString &name) const;
   EventType eventGroupByName(const QString &name) const;
+
   QString enumName(EventType type) const;
 
 public slots:
@@ -153,7 +163,7 @@ private:
   inline HandlerHash &registeredFilters() { return _registeredFilters; }
 
   //! Add handlers to an existing sorted (by priority) handler list
-  void insertHandlers(const QList<Handler> &newHandlers, QList<Handler> &existing);
+  void insertHandlers(const QList<Handler> &newHandlers, QList<Handler> &existing, bool checkDupes = false);
   //! Add filters to an existing filter hash
   void insertFilters(const QList<Handler> &newFilters, QHash<QObject *, Handler> &existing);