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

47 lines
1.4 KiB
C
Raw Normal View History

#ifndef NEXUS_H
#define NEXUS_H
#include <QObject>
class Widget;
class AndroidGUI;
class Profile;
class LoginScreen;
class Core;
/// 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(); ///< Sets up invariants and calls showLogin
void showLogin(); ///< Shows the login screen
/// Hides the login screen and shows the GUI for the given profile.
/// Will delete the current GUI, if it exists.
void showMainGUI();
static Nexus& getInstance();
2015-02-07 02:38:08 +08:00
static void destroyInstance();
static Core* getCore(); ///< Will return 0 if not started
static Profile* getProfile(); ///< Will return 0 if not started
static void setProfile(Profile* profile); ///< Delete the current profile, if any, and replaces it
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();
static bool tryRemoveFile(const QString& filepath); ///< Dangerous way to find out if a path is writable
private:
explicit Nexus(QObject *parent = 0);
~Nexus();
private:
Profile* profile;
Widget* widget;
AndroidGUI* androidgui;
LoginScreen* loginScreen;
};
#endif // NEXUS_H