corenetwork.cpp
corenetworkconfig.cpp
coresession.cpp
+ coresessioneventprocessor.cpp
coresettings.cpp
coreuserinputhandler.cpp
coreusersettings.cpp
corenetwork.h
corenetworkconfig.h
coresession.h
+ coresessioneventprocessor.h
coreuserinputhandler.h
ctcphandler.h
ircserverhandler.h
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
+#include "coresession.h"
+
#include <QtScript>
#include "core.h"
-#include "coresession.h"
#include "coreuserinputhandler.h"
-#include "signalproxy.h"
#include "corebuffersyncer.h"
#include "corebacklogmanager.h"
#include "corebufferviewmanager.h"
-#include "coreirclisthelper.h"
-#include "corenetworkconfig.h"
-#include "storage.h"
-
#include "coreidentity.h"
+#include "coreignorelistmanager.h"
+#include "coreirclisthelper.h"
#include "corenetwork.h"
-#include "ircuser.h"
-#include "ircchannel.h"
-
-#include "util.h"
+#include "corenetworkconfig.h"
+#include "coresessioneventprocessor.h"
#include "coreusersettings.h"
+#include "eventmanager.h"
+#include "ircchannel.h"
+#include "ircuser.h"
#include "logger.h"
-#include "coreignorelistmanager.h"
+#include "signalproxy.h"
+#include "storage.h"
+#include "util.h"
class ProcessMessagesEvent : public QEvent {
public:
_ircListHelper(new CoreIrcListHelper(this)),
_networkConfig(new CoreNetworkConfig("GlobalNetworkConfig", this)),
_coreInfo(this),
+ _eventManager(new EventManager(this)),
+ _eventProcessor(new CoreSessionEventProcessor(this)),
scriptEngine(new QScriptEngine(this)),
_processMessages(false),
_ignoreListManager(this)
loadSettings();
initScriptEngine();
+ eventManager()->registerObject(eventProcessor(), EventManager::Prepend, "process");
+
// periodically save our session state
connect(&(Core::instance()->syncTimer()), SIGNAL(timeout()), this, SLOT(saveSessionState()));
class CoreBacklogManager;
class CoreBufferSyncer;
class CoreBufferViewManager;
+class CoreIdentity;
class CoreIrcListHelper;
+class CoreNetwork;
class CoreNetworkConfig;
-class Identity;
-class CoreIdentity;
+class CoreSessionEventProcessor;
+class EventManager;
class NetworkConnection;
-class CoreNetwork;
-struct NetworkInfo;
class SignalProxy;
+struct NetworkInfo;
+
class QScriptEngine;
class CoreSession : public QObject {
const AliasManager &aliasManager() const { return _aliasManager; }
AliasManager &aliasManager() { return _aliasManager; }
+ inline EventManager *eventManager() const { return _eventManager; }
+ inline CoreSessionEventProcessor *eventProcessor() const { return _eventProcessor; }
+
inline CoreIrcListHelper *ircListHelper() const { return _ircListHelper; }
inline CoreIgnoreListManager *ignoreListManager() { return &_ignoreListManager; }
CoreNetworkConfig *_networkConfig;
CoreCoreInfo _coreInfo;
+ EventManager *_eventManager;
+ CoreSessionEventProcessor *_eventProcessor;
+
QScriptEngine *scriptEngine;
QList<RawMessage> _messageQueue;
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-2010 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#include "coresessioneventprocessor.h"
+
+#include "coresession.h"
+
+CoreSessionEventProcessor::CoreSessionEventProcessor(CoreSession *session)
+ : QObject(session),
+ _coreSession(session)
+{
+
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-2010 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * 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. *
+ ***************************************************************************/
+
+#ifndef CORESESSIONEVENTPROCESSOR_H
+#define CORESESSIONEVENTPROCESSOR_H
+
+#include <QObject>
+
+class CoreSession;
+
+class CoreSessionEventProcessor : public QObject {
+ Q_OBJECT
+
+public:
+ CoreSessionEventProcessor(CoreSession *session);
+
+ inline CoreSession *coreSession() const { return _coreSession; }
+
+protected:
+
+private:
+ CoreSession *_coreSession;
+};
+
+#endif