/***************************************************************************
- * Copyright (C) 2005-2010 by the Quassel Project *
+ * Copyright (C) 2005-2012 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
};
enum EventFlag {
+ 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);
/*
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:
//! 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);
int findEventType(const QString &methodSignature, const QString &methodPrefix) const;
- void processEvents();
+ void processEvent(Event *event);
void dispatchEvent(Event *event);
//! @return the EventType enum
HandlerHash _registeredHandlers;
HandlerHash _registeredFilters;
mutable QMetaEnum _enum;
-
QList<Event *> _eventQueue;
};