properly rewind oidentd config file
[quassel.git] / src / common / eventmanager.h
index a5b7a27..e01b594 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,13 +105,16 @@ 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);
-  virtual ~EventManager();
 
   EventType eventTypeByName(const QString &name) const;
   EventType eventGroupByName(const QString &name) const;
+
   QString enumName(EventType type) const;
 
 public slots:
@@ -123,10 +132,9 @@ public slots:
   //! Send an event to the registered handlers
   /**
     The EventManager takes ownership of the event and will delete it once it's processed.
-    NOTE: This method is not threadsafe!
     @param event The event to be dispatched
    */
-  void sendEvent(Event *event);
+  void postEvent(Event *event);
 
 protected:
   virtual void customEvent(QEvent *event);
@@ -153,13 +161,13 @@ 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);
 
   int findEventType(const QString &methodSignature, const QString &methodPrefix) const;
 
-  void processEvents();
+  void processEvent(Event *event);
   void dispatchEvent(Event *event);
 
   //! @return the EventType enum
@@ -168,7 +176,6 @@ private:
   HandlerHash _registeredHandlers;
   HandlerHash _registeredFilters;
   mutable QMetaEnum _enum;
-
   QList<Event *> _eventQueue;
 };