#ifndef AMNEZIA_APPLICATION_H #define AMNEZIA_APPLICATION_H #include #include #include #include #include #include "settings.h" #include "vpnconnection.h" #include "configurators/vpn_configurator.h" #include "ui/controllers/connectionController.h" #include "ui/controllers/exportController.h" #include "ui/controllers/importController.h" #include "ui/controllers/installController.h" #include "ui/controllers/pageController.h" #include "ui/controllers/settingsController.h" #include "ui/models/containers_model.h" #include "ui/models/languageModel.h" #include "ui/models/servers_model.h" #define amnApp (static_cast(QCoreApplication::instance())) #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) #define AMNEZIA_BASE_CLASS QApplication #else #define AMNEZIA_BASE_CLASS SingleApplication #define QAPPLICATION_CLASS QApplication #include "singleapplication.h" #endif class AmneziaApplication : public AMNEZIA_BASE_CLASS { Q_OBJECT public: #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) AmneziaApplication(int &argc, char *argv[]); #else AmneziaApplication(int &argc, char *argv[], bool allowSecondary = false, SingleApplication::Options options = SingleApplication::User, int timeout = 1000, const QString &userData = {}); #endif virtual ~AmneziaApplication(); void init(); void registerTypes(); void loadFonts(); void loadTranslator(); void updateTranslator(const QLocale &locale); bool parseCommands(); QQmlApplicationEngine *qmlEngine() const; private: QQmlApplicationEngine *m_engine {}; std::shared_ptr m_settings; std::shared_ptr m_configurator; ContainerProps *m_containerProps {}; ProtocolProps *m_protocolProps {}; QTranslator *m_translator; QCommandLineParser m_parser; QSharedPointer m_containersModel; QSharedPointer m_serversModel; QScopedPointer m_languageModel; QSharedPointer m_vpnConnection; QScopedPointer m_connectionController; QScopedPointer m_pageController; QScopedPointer m_installController; QScopedPointer m_importController; QScopedPointer m_exportController; QScopedPointer m_settingsController; }; #endif // AMNEZIA_APPLICATION_H