2015-02-06 19:28:49 +08:00
|
|
|
#ifndef NEXUS_H
|
|
|
|
#define NEXUS_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
class QThread;
|
|
|
|
class Core;
|
|
|
|
class Widget;
|
|
|
|
class AndroidGUI;
|
|
|
|
|
|
|
|
/// This class is in charge of connecting various systems together
|
|
|
|
/// and forwarding signals appropriately to the right objects
|
|
|
|
/// It is in charge of starting the GUI and the Core
|
|
|
|
class Nexus : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
void start(); ///< Will initialise the systems (GUI, Core, ...)
|
|
|
|
|
|
|
|
static Nexus& getInstance();
|
2015-02-07 02:38:08 +08:00
|
|
|
static void destroyInstance();
|
2015-02-06 19:28:49 +08:00
|
|
|
static Core* getCore(); ///< Will return 0 if not started
|
2015-02-07 02:01:31 +08:00
|
|
|
static AndroidGUI* getAndroidGUI(); ///< Will return 0 if not started
|
|
|
|
static Widget* getDesktopGUI(); ///< Will return 0 if not started
|
2015-02-06 19:28:49 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
explicit Nexus(QObject *parent = 0);
|
|
|
|
~Nexus();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Core* core;
|
|
|
|
QThread* coreThread;
|
|
|
|
Widget* widget;
|
|
|
|
AndroidGUI* androidgui;
|
|
|
|
bool started;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // NEXUS_H
|