#ifndef FLUAPP_H #define FLUAPP_H #include #include #include #include #include #include #include #include "FluRegister.h" #include "FluHttpInterceptor.h" #include "stdafx.h" /** * @brief The FluApp class */ class FluApp : public QObject { Q_OBJECT Q_PROPERTY_AUTO(QString,initialRoute); Q_PROPERTY_AUTO(QJsonObject,routes); Q_PROPERTY_AUTO(FluHttpInterceptor*,httpInterceptor); QML_NAMED_ELEMENT(FluApp) QML_SINGLETON private: explicit FluApp(QObject *parent = nullptr); public: ~FluApp(); static FluApp *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine) { return getInstance(); } static FluApp *getInstance(); Q_INVOKABLE void run(); Q_INVOKABLE void navigate(const QString& route,const QJsonObject& argument = {},FluRegister* fluRegister = nullptr); Q_INVOKABLE void init(QQuickWindow *window); Q_INVOKABLE QJsonArray awesomelist(const QString& keyword = ""); Q_INVOKABLE void closeApp(); Q_INVOKABLE void deleteWindow(QQuickWindow* window); public: QMap wnds; private: static FluApp* m_instance; QWindow *appWindow; }; #endif // FLUAPP_H