X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcore.h;h=ae39dc18c45b9818207c0bec8e9d23ce536774f7;hp=374d821021f18ca5226e786222122021633e80d9;hb=f9fc50a5e043668a2525a6c0903ea339d4ba05b7;hpb=0ac9ce4d7cf768d13993d6aa1d6b791c4149a843 diff --git a/src/core/core.h b/src/core/core.h index 374d8210..ae39dc18 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005/06 by The Quassel Team * + * Copyright (C) 2005-08 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) any later version. * + * (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 * @@ -26,7 +26,8 @@ #include #include -#include "coreproxy.h" +#include "global.h" +#include "types.h" class CoreSession; class Storage; @@ -43,23 +44,27 @@ class Core : public QObject { static CoreSession * createSession(UserId); static QVariant connectLocalClient(QString user, QString passwd); - static QVariant disconnectLocalClient(); + static void disconnectLocalClient(); + + static void saveState(); + static void restoreState(); private slots: - void recvProxySignal(CoreSignal, QVariant, QVariant, QVariant); - bool startListening(uint port = 4242); + bool startListening(uint port = Global::defaultPort); void stopListening(); void incomingConnection(); void clientHasData(); void clientDisconnected(); - void updateGlobalData(UserId, QString); + + bool initStorage(QVariantMap dbSettings, bool setup); + bool initStorage(QVariantMap dbSettings); private: Core(); ~Core(); void init(); static Core *instanceptr; - + //! Initiate a session for the user with the given credentials if one does not already exist. /** This function is called during the init process for a new client. If there is no session for the * given user, one is created. @@ -67,16 +72,19 @@ class Core : public QObject { * \return A QVariant containing the session data, e.g. global data and buffers */ QVariant initSession(UserId userId); - void processClientInit(QTcpSocket *socket, const QVariant &v); - void processClientUpdate(QTcpSocket *socket, QString key, const QVariant &data); + void processClientInit(QTcpSocket *socket, const QVariantMap &msg); + void processCoreSetup(QTcpSocket *socket, QVariantMap &msg); + + QStringList availableStorageProviders(); UserId guiUser; QHash sessions; Storage *storage; QTcpServer server; // TODO: implement SSL - QHash validClients; QHash blockSizes; + + bool configured; }; #endif