1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/src/nexus.h

41 lines
1.0 KiB
C
Raw Normal View History

#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();
static Core* getCore(); ///< Will return 0 if not started
static AndroidGUI* getAndroidGUI(); ///< Will return 0 if not started
static Widget* getDesktopGUI(); ///< Will return 0 if not started
2015-02-16 07:35:27 +08:00
static QString getSupportedImageFilter();
2015-03-17 05:41:59 +08:00
static bool isFilePathWritable(const QString& filepath); // WARNING: Tests by brute force, i.e. removes the file in question
private:
explicit Nexus(QObject *parent = 0);
~Nexus();
private:
Core* core;
QThread* coreThread;
Widget* widget;
AndroidGUI* androidgui;
bool started;
};
#endif // NEXUS_H