X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=core%2Fcore.h;fp=core%2Fcore.h;h=0000000000000000000000000000000000000000;hp=126e3a5799d69de7185618ef9e0cc9bbc7919c14;hb=077d44f36d2f5c730283ef6be839aea7dd073d56;hpb=f0a6776fc5102ff6a7fe1469917fe231e4cd3a8a diff --git a/core/core.h b/core/core.h deleted file mode 100644 index 126e3a57..00000000 --- a/core/core.h +++ /dev/null @@ -1,168 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005/06 by The Quassel Team * - * 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) any later version. * - * * - * 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 _CORE_H_ -#define _CORE_H_ - -#include -#include -#include - -#include "server.h" -#include "storage.h" -#include "global.h" -#include "coreproxy.h" - -class CoreSession; - -class Core : public QObject { - Q_OBJECT - - public: - static Core * instance(); - static void destroy(); - - static CoreSession * session(UserId); - static CoreSession * localSession(); - static CoreSession * createSession(UserId); - - private slots: - void recvProxySignal(CoreSignal, QVariant, QVariant, QVariant); - bool startListening(uint port = 4242); - void stopListening(); - void incomingConnection(); - void clientHasData(); - void clientDisconnected(); - void updateGlobalData(UserId, QString); - - private: - Core(); - ~Core(); - void init(); - static Core *instanceptr; - - void processClientInit(QTcpSocket *socket, const QVariant &v); - void processClientUpdate(QTcpSocket *socket, QString key, const QVariant &data); - - UserId guiUser; - QHash sessions; - Storage *storage; - - QTcpServer server; // TODO: implement SSL - QHash validClients; - QHash blockSizes; -}; - -class CoreSession : public QObject { - Q_OBJECT - - public: - CoreSession(UserId, Storage *); - ~CoreSession(); - - QList buffers() const; - inline UserId userId(); - QVariant sessionState(); - CoreProxy *proxy(); - - public slots: - void connectToIrc(QStringList); - void processSignal(ClientSignal, QVariant, QVariant, QVariant); - void sendBacklog(BufferId, QVariant, QVariant); - void msgFromGui(BufferId, QString message); - void sendServerStates(); - - signals: - void proxySignal(CoreSignal, QVariant arg1 = QVariant(), QVariant arg2 = QVariant(), QVariant arg3 = QVariant()); - - void msgFromGui(QString net, QString buf, QString message); - void displayMsg(Message message); - void displayStatusMsg(QString, QString); - - void connectToIrc(QString net); - void disconnectFromIrc(QString net); - void serverStateRequested(); - - void backlogData(BufferId, QList, bool done); - - void bufferIdUpdated(BufferId); - - private slots: - //void recvProxySignal(CoreSignal, QVariant arg1 = QVariant(), QVariant arg2 = QVariant(), QVariant arg3 = QVariant()); - void globalDataUpdated(UserId, QString); - void recvStatusMsgFromServer(QString msg); - void recvMessageFromServer(Message::Type, QString target, QString text, QString sender = "", quint8 flags = Message::None); - void serverConnected(QString net); - void serverDisconnected(QString net); - - private: - CoreProxy *coreProxy; - Storage *storage; - QHash servers; - UserId user; - -}; - -/* -class Core : public QObject { - Q_OBJECT - - public: - - Core(); - ~Core(); - QList getBuffers(); - - public slots: - void connectToIrc(QStringList); - void sendBacklog(BufferId, QVariant, QVariant); - void msgFromGUI(BufferId, QString message); - - signals: - void msgFromGUI(QString net, QString buf, QString message); - void displayMsg(Message message); - void displayStatusMsg(QString, QString); - - void connectToIrc(QString net); - void disconnectFromIrc(QString net); - void serverStateRequested(); - - void backlogData(BufferId, QList, bool done); - - void bufferIdUpdated(BufferId); - - private slots: - void globalDataUpdated(QString); - void recvStatusMsgFromServer(QString msg); - void recvMessageFromServer(Message::Type, QString target, QString text, QString sender = "", quint8 flags = Message::None); - void serverDisconnected(QString net); - - private: - Storage *storage; - QHash servers; - UserId user; - -}; - -*/ -//extern Core *core; - - -#endif