modernize: Use '= default' instead of empty ctor/dtor bodies
[quassel.git] / src / common / eventmanager.h
index b899be5..0a72a70 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2012 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef EVENTMANAGER_H
-#define EVENTMANAGER_H
+#pragma once
+
+#include "common-export.h"
 
 #include <QMetaEnum>
 
@@ -28,7 +29,7 @@
 class Event;
 class Network;
 
-class EventManager : public QObject
+class COMMON_EXPORT EventManager : public QObject
 {
     Q_OBJECT
     Q_FLAGS(EventFlag EventFlags)
@@ -88,7 +89,10 @@ public :
 
         IrcEvent                    = 0x00030000,
         IrcEventAuthenticate,
+        IrcEventAccount,
+        IrcEventAway,
         IrcEventCap,
+        IrcEventChghost,
         IrcEventInvite,
         IrcEventJoin,
         IrcEventKick,
@@ -101,6 +105,8 @@ public :
         IrcEventPrivmsg,
         IrcEventQuit,
         IrcEventTopic,
+        IrcEventError,        /// ERROR message from server
+        IrcEventWallops,
         IrcEventRawPrivmsg, ///< Undecoded privmsg (still needs CTCP parsing)
         IrcEventRawNotice, ///< Undecoded notice (still needs CTCP parsing)
         IrcEventUnknown, ///< Unknown non-numeric cmd
@@ -111,10 +117,12 @@ public :
         MessageEvent                = 0x00040000, ///< Stringified event suitable for converting to Message
 
         CtcpEvent                   = 0x00050000,
-        CtcpEventFlush
+        CtcpEventFlush,
+
+        KeyEvent                    = 0x00060000
     };
 
-    EventManager(QObject *parent = 0);
+    EventManager(QObject *parent = nullptr);
 
     static EventType eventTypeByName(const QString &name);
     static EventType eventGroupByName(const QString &name);
@@ -144,7 +152,7 @@ public slots:
 
 protected:
     virtual Network *networkById(NetworkId id) const = 0;
-    virtual void customEvent(QEvent *event);
+    void customEvent(QEvent *event) override;
 
 private:
     struct Handler {
@@ -152,7 +160,7 @@ private:
         int methodIndex;
         Priority priority;
 
-        explicit Handler(QObject *obj = 0, int method = 0, Priority prio = NormalPriority)
+        explicit Handler(QObject *obj = nullptr, int method = 0, Priority prio = NormalPriority)
         {
             object = obj;
             methodIndex = method;
@@ -160,7 +168,7 @@ private:
         }
     };
 
-    typedef QHash<uint, QList<Handler> > HandlerHash;
+    using HandlerHash = QHash<uint, QList<Handler>>;
 
     inline const HandlerHash &registeredHandlers() const { return _registeredHandlers; }
     inline HandlerHash &registeredHandlers() { return _registeredHandlers; }
@@ -188,6 +196,4 @@ private:
 };
 
 
-Q_DECLARE_OPERATORS_FOR_FLAGS(EventManager::EventFlags);
-
-#endif
+Q_DECLARE_OPERATORS_FOR_FLAGS(EventManager::EventFlags)