projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
++API, ++EventFlags
[quassel.git]
/
src
/
common
/
eventmanager.h
diff --git
a/src/common/eventmanager.h
b/src/common/eventmanager.h
index
54d2721
..
d7480d1
100644
(file)
--- a/
src/common/eventmanager.h
+++ b/
src/common/eventmanager.h
@@
-21,13
+21,13
@@
#ifndef EVENTMANAGER_H
#define EVENTMANAGER_H
#ifndef EVENTMANAGER_H
#define EVENTMANAGER_H
-#include <QHash>
-#include <QObject>
+#include <QMetaEnum>
class Event;
class EventManager : public QObject {
Q_OBJECT
class Event;
class EventManager : public QObject {
Q_OBJECT
+ Q_FLAGS(EventFlag EventFlags)
Q_ENUMS(EventType)
public:
Q_ENUMS(EventType)
public:
@@
-45,6
+45,12
@@
public:
HighestPriority
};
HighestPriority
};
+ enum EventFlag {
+ Backlog = 0x40,
+ Stopped = 0x80
+ };
+ Q_DECLARE_FLAGS(EventFlags, EventFlag)
+
/*
*/
/*
*/
@@
-85,14
+91,20
@@
public:
IrcEventPrivmsg,
IrcEventQuit,
IrcEventTopic,
IrcEventPrivmsg,
IrcEventQuit,
IrcEventTopic,
+ IrcEventRawPrivmsg, ///< Undecoded privmsg (still needs CTCP parsing)
+ IrcEventRawNotice, ///< Undecoded notice (still needs CTCP parsing)
+ IrcEventUnknown, ///< Unknown non-numeric cmd
IrcEventNumeric = 0x00031000, /* needs 1000 (0x03e8) consecutive free values! */
IrcEventNumeric = 0x00031000, /* needs 1000 (0x03e8) consecutive free values! */
+
+ MessageEvent = 0x00040000, ///< Stringified event suitable for converting to Message
};
EventManager(QObject *parent = 0);
//virtual ~EventManager();
};
EventManager(QObject *parent = 0);
//virtual ~EventManager();
- QStringList providesEnums();
+ EventType eventTypeByName(const QString &name) const;
+ EventType eventGroupByName(const QString &name) const;
public slots:
void registerObject(QObject *object, Priority priority = NormalPriority, const QString &methodPrefix = "handle");
public slots:
void registerObject(QObject *object, Priority priority = NormalPriority, const QString &methodPrefix = "handle");
@@
-130,8
+142,13
@@
private:
void dispatchEvent(Event *event);
void dispatchEvent(Event *event);
- HandlerHash _registeredHandlers;
+ //! @return the EventType enum
+ QMetaEnum eventEnum() const;
+ HandlerHash _registeredHandlers;
+ mutable QMetaEnum _enum;
};
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(EventManager::EventFlags);
+
#endif
#endif