/***************************************************************************
- * Copyright (C) 2005-2013 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 *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef EVENTMANAGER_H
-#define EVENTMANAGER_H
+#pragma once
+
+#include "common-export.h"
#include <QMetaEnum>
class Event;
class Network;
-class EventManager : public QObject
+class COMMON_EXPORT EventManager : public QObject
{
Q_OBJECT
Q_FLAGS(EventFlag EventFlags)
IrcEvent = 0x00030000,
IrcEventAuthenticate,
+ IrcEventAccount,
+ IrcEventAway,
IrcEventCap,
+ IrcEventChghost,
IrcEventInvite,
IrcEventJoin,
IrcEventKick,
IrcEventPrivmsg,
IrcEventQuit,
IrcEventTopic,
+ IrcEventError, /// ERROR message from server
IrcEventWallops,
IrcEventRawPrivmsg, ///< Undecoded privmsg (still needs CTCP parsing)
IrcEventRawNotice, ///< Undecoded notice (still needs CTCP parsing)
MessageEvent = 0x00040000, ///< Stringified event suitable for converting to Message
CtcpEvent = 0x00050000,
- CtcpEventFlush
+ CtcpEventFlush,
-#ifdef HAVE_QCA2
- ,KeyEvent = 0x00060000
-#endif
+ KeyEvent = 0x00060000
};
- EventManager(QObject *parent = 0);
+ EventManager(QObject *parent = nullptr);
static EventType eventTypeByName(const QString &name);
static EventType eventGroupByName(const QString &name);
protected:
virtual Network *networkById(NetworkId id) const = 0;
- virtual void customEvent(QEvent *event);
+ void customEvent(QEvent *event) override;
private:
struct Handler {
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;
}
};
- typedef QHash<uint, QList<Handler> > HandlerHash;
+ using HandlerHash = QHash<uint, QList<Handler>>;
inline const HandlerHash ®isteredHandlers() const { return _registeredHandlers; }
inline HandlerHash ®isteredHandlers() { return _registeredHandlers; }
};
-Q_DECLARE_OPERATORS_FOR_FLAGS(EventManager::EventFlags);
-
-#endif
+Q_DECLARE_OPERATORS_FOR_FLAGS(EventManager::EventFlags)