X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Feventmanager.h;h=0a72a70ad8cc3021123a502c75bae1f06f753255;hp=16b83bc4e5ac0afbf85ccdd3ad4695e22f6801ab;hb=c194ed5fb3d15e14b9364f9796d3521910dc72fe;hpb=dd711790dddee81442e2138b3917764dac39c487 diff --git a/src/common/eventmanager.h b/src/common/eventmanager.h index 16b83bc4..0a72a70a 100644 --- a/src/common/eventmanager.h +++ b/src/common/eventmanager.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 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 * @@ -18,8 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef EVENTMANAGER_H -#define EVENTMANAGER_H +#pragma once + +#include "common-export.h" #include @@ -28,7 +29,7 @@ class Event; class Network; -class EventManager : public QObject +class COMMON_EXPORT EventManager : public QObject { Q_OBJECT Q_FLAGS(EventFlag EventFlags) @@ -91,6 +92,7 @@ public : IrcEventAccount, IrcEventAway, IrcEventCap, + IrcEventChghost, IrcEventInvite, IrcEventJoin, IrcEventKick, @@ -103,6 +105,7 @@ public : IrcEventPrivmsg, IrcEventQuit, IrcEventTopic, + IrcEventError, /// ERROR message from server IrcEventWallops, IrcEventRawPrivmsg, ///< Undecoded privmsg (still needs CTCP parsing) IrcEventRawNotice, ///< Undecoded notice (still needs CTCP parsing) @@ -119,7 +122,7 @@ public : KeyEvent = 0x00060000 }; - EventManager(QObject *parent = 0); + EventManager(QObject *parent = nullptr); static EventType eventTypeByName(const QString &name); static EventType eventGroupByName(const QString &name); @@ -149,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 { @@ -157,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; @@ -165,7 +168,7 @@ private: } }; - typedef QHash > HandlerHash; + using HandlerHash = QHash>; inline const HandlerHash ®isteredHandlers() const { return _registeredHandlers; } inline HandlerHash ®isteredHandlers() { return _registeredHandlers; } @@ -193,6 +196,4 @@ private: }; -Q_DECLARE_OPERATORS_FOR_FLAGS(EventManager::EventFlags); - -#endif +Q_DECLARE_OPERATORS_FOR_FLAGS(EventManager::EventFlags)