modernize: Prefer default member init over ctor init
[quassel.git] / src / core / core.h
index efbefa6..45d0607 100644 (file)
@@ -20,6 +20,8 @@
 
 #pragma once
 
+#include "core-export.h"
+
 #include <memory>
 #include <vector>
 
@@ -59,7 +61,7 @@ struct NetworkInfo;
 class AbstractSqlMigrationReader;
 class AbstractSqlMigrationWriter;
 
-class Core : public QObject, public Singleton<Core>
+class CORE_EXPORT Core : public QObject, public Singleton<Core>
 {
     Q_OBJECT
 
@@ -69,6 +71,12 @@ public:
 
     void init();
 
+    /**
+     * Shuts down active core sessions, saves state and emits the shutdownComplete() signal afterwards.
+     */
+    void shutdown();
+
+
     /*** Storage access ***/
     // These methods are threadsafe.
 
@@ -704,6 +712,9 @@ signals:
     //! Emitted when a fatal error was encountered during async initialization
     void exitRequested(int exitCode, const QString &reason);
 
+    //! Emitted once core shutdown is complete
+    void shutdownComplete();
+
 public slots:
     void initAsync();
 
@@ -747,6 +758,8 @@ private slots:
 
     bool changeUserPass(const QString &username);
 
+    void onSessionShutdown(SessionThread *session);
+
 private:
     SessionThread *sessionForUser(UserId userId, bool restoreState = false);
     void addClientHelper(RemotePeer *peer, UserId uid);