#pragma once #include #include #include #include #include #include #include #include #ifndef LTSAPPMANAGER_EXPORT # ifdef BUILD_STATIC_LIBRARIES # define LTSAPPMANAGER_EXPORT # else # if defined(MAKE_LTSAPPMANAGER_LIB) # define LTSAPPMANAGER_EXPORT Q_DECL_EXPORT # else # define LTSAPPMANAGER_EXPORT Q_DECL_IMPORT # endif # endif #endif namespace LtsPluginManager { class LtsPluginManager; } namespace LtsLogin { class LtsLogin; } namespace LtsSession { class LtsSession; struct DdsConnectionParams; } namespace DeveloperTools { class DevDialog; } class QTcpSocket; namespace LtsAppManager { class LTSAPPMANAGER_EXPORT LtsAppManager : public QObject { Q_OBJECT public: static LtsAppManager* getInstance(); void showLogin(); LtsPluginManager::LtsPluginManager *createApp(LtsAppDescriptor::App appId, const LtsSession::DdsConnectionParams &connParams, const QString &workspaceId = QString(), bool hidden = false, bool force = false); bool startAppOrLetUserChoose(LtsAppDescriptor::App appId, const LtsSession::DdsConnectionParams &connParams, bool force = false); void setLoginPluginIid(const QString &loginPluginIid) { m_loginPluginIid = loginPluginIid; } void setMainApp(LtsAppDescriptor::App appId = LtsAppDescriptor::App::Login); QVector getAppList() const { return m_appList ;} LtsAppDescriptor::AppDescriptionVector getAvailableApps() const { return m_availableApps; } void setAvailableApps(const LtsAppDescriptor::AppDescriptionVector &availableApps); bool hasRightForApp(const LtsAppDescriptor::AppDescription &appDescription) const; LtsAppDescriptor::AppDescription getApp(LtsAppDescriptor::App appId) const; bool hasApp(LtsAppDescriptor::App appId) const; int getNumberOfSituationMapInstances() const; void debugSendMessage(const QString &msg); bool otherSessionsResponsibility(LtsSession::LtsSession *thisSession, const QVector &requiredAppTypes, const QVector &requiredPartitionTypes, const QString &menuGroup, const QString &identifier, LtsWidgets::LayoutArea area); private: friend struct LtsAppManagerHandler; friend class DeveloperTools::DevDialog; LtsAppManager(); ~LtsAppManager(); bool startAppOrLetUserChoose(const LtsAppDescriptor::AppDescription &appDescription, const LtsSession::DdsConnectionParams &connParams, bool force = false); LtsPluginManager::LtsPluginManager *createApp(const LtsAppDescriptor::AppDescription &appDescription, const LtsSession::DdsConnectionParams &connParams, const QString &workspaceId = QString(), bool hidden = false, bool force = false); void saveState(); LtsAppDescriptor::AppDescriptionVector m_availableApps; QVector m_appList; LtsLogin::LtsLogin *m_login; LtsAppDescriptor::AppDescription m_app; QString m_loginPluginIid; public slots: void slotLogout(); private slots: void slotQuit(); void slotSoftQuit(); void slotShowLogin(); void slotAppDestroyed(); void slotStartDebugServer(); void hideAllOtherBLWs(QObject *_caller); void taskSwitch(QObject *_caller); signals: void signalLoginDone(); void signalLogoffDone(); void signalShowLogin(); void signalInitializationFinished(); void signalCommand(QTcpSocket *client, const QStringList argList); }; }