#ifndef CORECONTROLLER_H #define CORECONTROLLER_H #include #include #include #include "ui/controllers/api/apiConfigsController.h" #include "ui/controllers/api/apiSettingsController.h" #include "ui/controllers/appSplitTunnelingController.h" #include "ui/controllers/connectionController.h" #include "ui/controllers/exportController.h" #include "ui/controllers/focusController.h" #include "ui/controllers/importController.h" #include "ui/controllers/installController.h" #include "ui/controllers/pageController.h" #include "ui/controllers/settingsController.h" #include "ui/controllers/sitesController.h" #include "ui/controllers/systemController.h" #include "ui/models/containers_model.h" #include "ui/models/languageModel.h" #include "ui/models/protocols/cloakConfigModel.h" #ifdef Q_OS_WINDOWS #include "ui/models/protocols/ikev2ConfigModel.h" #endif #include "ui/models/api/apiAccountInfoModel.h" #include "ui/models/api/apiServicesModel.h" #include "ui/models/api/apiCountryModel.h" #include "ui/models/appSplitTunnelingModel.h" #include "ui/models/clientManagementModel.h" #include "ui/models/protocols/awgConfigModel.h" #include "ui/models/protocols/openvpnConfigModel.h" #include "ui/models/protocols/shadowsocksConfigModel.h" #include "ui/models/protocols/wireguardConfigModel.h" #include "ui/models/protocols/xrayConfigModel.h" #include "ui/models/protocols_model.h" #include "ui/models/servers_model.h" #include "ui/models/services/sftpConfigModel.h" #include "ui/models/services/socks5ProxyConfigModel.h" #include "ui/models/sites_model.h" #ifndef Q_OS_ANDROID #include "ui/notificationhandler.h" #endif class CoreController : public QObject { Q_OBJECT public: explicit CoreController(const QSharedPointer &vpnConnection, const std::shared_ptr &settings, QQmlApplicationEngine *engine, QObject *parent = nullptr); QSharedPointer pageController() const; void setQmlRoot(); signals: void translationsUpdated(); private: void initModels(); void initControllers(); void initAndroidController(); void initAppleController(); void initSignalHandlers(); void initNotificationHandler(); void updateTranslator(const QLocale &locale); void initErrorMessagesHandler(); void initApiCountryModelUpdateHandler(); void initContainerModelUpdateHandler(); void initAdminConfigRevokedHandler(); void initPassphraseRequestHandler(); void initTranslationsUpdatedHandler(); void initAutoConnectHandler(); void initAmneziaDnsToggledHandler(); void initPrepareConfigHandler(); QQmlApplicationEngine *m_engine {}; // TODO use parent child system here? std::shared_ptr m_settings; QSharedPointer m_vpnConnection; QSharedPointer m_translator; #ifndef Q_OS_ANDROID QScopedPointer m_notificationHandler; #endif QMetaObject::Connection m_reloadConfigErrorOccurredConnection; QScopedPointer m_connectionController; QScopedPointer m_focusController; QSharedPointer m_pageController; // TODO QScopedPointer m_installController; QScopedPointer m_importController; QScopedPointer m_exportController; QScopedPointer m_settingsController; QScopedPointer m_sitesController; QScopedPointer m_systemController; QScopedPointer m_appSplitTunnelingController; QScopedPointer m_apiSettingsController; QScopedPointer m_apiConfigsController; QSharedPointer m_containersModel; QSharedPointer m_defaultServerContainersModel; QSharedPointer m_serversModel; QSharedPointer m_languageModel; QSharedPointer m_protocolsModel; QSharedPointer m_sitesModel; QSharedPointer m_appSplitTunnelingModel; QSharedPointer m_clientManagementModel; QSharedPointer m_apiServicesModel; QSharedPointer m_apiCountryModel; QSharedPointer m_apiAccountInfoModel; QScopedPointer m_openVpnConfigModel; QScopedPointer m_shadowSocksConfigModel; QScopedPointer m_cloakConfigModel; QScopedPointer m_xrayConfigModel; QScopedPointer m_wireGuardConfigModel; QScopedPointer m_awgConfigModel; #ifdef Q_OS_WINDOWS QScopedPointer m_ikev2ConfigModel; #endif QScopedPointer m_sftpConfigModel; QScopedPointer m_socks5ConfigModel; }; #endif // CORECONTROLLER_H