The Quassel Core now remembers on exit which networks where connected and which channels
[quassel.git] / src / core / core.h
index 15a2e90..fc20772 100644 (file)
@@ -1,11 +1,11 @@
 /***************************************************************************
- *   Copyright (C) 2005/06 by The Quassel Team                             *
+ *   Copyright (C) 2005-07 by the Quassel IRC 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.                                   *
+ *   (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 <QTcpServer>
 #include <QTcpSocket>
 
-#include "coreproxy.h"
+#include "global.h"
+#include "types.h"
 
 class CoreSession;
 class Storage;
@@ -45,21 +46,24 @@ class Core : public QObject {
     static QVariant connectLocalClient(QString user, QString passwd);
     static void disconnectLocalClient();
 
+    static void saveState();
+    static void restoreState();
+
   private slots:
-    void recvProxySignal(CoreSignal, QVariant, QVariant, QVariant);
     bool startListening(uint port = DEFAULT_PORT);
     void stopListening();
     void incomingConnection();
     void clientHasData();
     void clientDisconnected();
-    void updateGlobalData(UserId, QString);
+
+    bool initStorageSqlite(QVariantMap dbSettings, bool setup);
 
   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 +71,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<UserId, CoreSession *> sessions;
     Storage *storage;
 
     QTcpServer server; // TODO: implement SSL
-    QHash<QTcpSocket *, UserId> validClients;
     QHash<QTcpSocket *, quint32> blockSizes;
+    
+    bool configured;
 };
 
 #endif