OK, another update. This is just prior to redoing the MainWin completely.
[quassel.git] / core / core.h
index 4220056..f5532c3 100644 (file)
 #include <QString>
 #include <QVariant>
 
-typedef QMap<QString, QVariant> VarMap;
+#include "server.h"
 
-class Core {
+class Core : public QObject {
+  Q_OBJECT
 
   public:
-    static void init();
-    static VarMap loadNetworks();
-    static void storeNetworks(VarMap);
-    static VarMap loadIdentities();
-    static void storeIdentities(VarMap);
+
+    Core();
+    //~Core();
+
+  public slots:
+    void connectToIrc(QStringList);
+
+  signals:
+    void msgFromGUI(QString network, QString channel, QString message);
+    void displayMsg(QString network, QString channel, Message message);
+    void displayStatusMsg(QString, QString);
+
+    void connectToIrc(QString net);
+    void disconnectFromIrc(QString net);
+
+  private slots:
+    void globalDataUpdated(QString);
+    void recvStatusMsgFromServer(QString msg);
+    void recvMessageFromServer(QString buffer, Message msg);
+
+  private:
+    QHash<QString, Server *> servers;
+    QList<Message> backLog;
+    bool backLogEnabled;
+    QDir backLogDir;
+    QFile currentLogFile;
+    QDataStream logStream;
+    QDate currentLogFileDate;
+
+    void initBackLog();
+    void logMessage(Message);
 
 };
 
+extern Core *core;
+
 #endif