modernize: Reformat ALL the source... again!
[quassel.git] / src / core / coreapplication.h
index b350d52..f2f076f 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2016 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef COREAPPLICATION_H_
-#define COREAPPLICATION_H_
+#pragma once
 
-#include <QCoreApplication>
-
-#include "quassel.h"
-
-/// Encapsulates CoreApplication's logic.
-/** This allows it to be reused within MonolithicApplication as well.
- */
-class CoreApplicationInternal
-{
-    Q_DECLARE_TR_FUNCTIONS(CoreApplicationInternal)
-
-public:
-    CoreApplicationInternal();
-    ~CoreApplicationInternal();
+#include "core-export.h"
 
-    bool init();
+#include <memory>
 
-    /**
-     * Requests a reload of relevant runtime configuration.
-     *
-     * In particular, signals to the Core to reload SSL certificates.
-     *
-     * @return True if configuration reload successful, otherwise false
-     */
-    bool reloadConfig();
+#include <QCoreApplication>
 
-private:
-    bool _coreCreated;
-};
+#include "core.h"
+#include "quassel.h"
 
+class Core;
 
-class CoreApplication : public QCoreApplication, public Quassel
+class CORE_EXPORT CoreApplication : public QCoreApplication
 {
     Q_OBJECT
+
 public:
-    CoreApplication(int &argc, char **argv);
-    ~CoreApplication();
+    CoreApplication(int& argc, char** argv);
 
-    bool init();
+    void init();
 
-    /**
-     * Requests a reload of relevant runtime configuration.
-     *
-     * @see Quassel::reloadConfig()
-     *
-     * @return True if configuration reload successful, otherwise false
-     */
-    bool reloadConfig();
+private slots:
+    void onShutdownComplete();
 
 private:
-    CoreApplicationInternal *_internal;
+    std::unique_ptr<Core> _core;
 };
-
-
-#endif