/** * @RDE_HEADER@ * App Descriptor - Class to modify App Descriptor JSON Documents * $Id$ * $HeadURL$ * $Author$ * * Created by Mike Wille, SLSE, 2016-10-24 */ #pragma once #include #include #ifndef LTSAPPDESCRIPTOR_EXPORT # ifdef BUILD_STATIC_LIBRARIES # define LTSAPPDESCRIPTOR_EXPORT # else # if defined(MAKE_LTSAPPDESCRIPTOR_LIB) # define LTSAPPDESCRIPTOR_EXPORT Q_DECL_EXPORT # else # define LTSAPPDESCRIPTOR_EXPORT Q_DECL_IMPORT # endif # endif #endif namespace LtsAppDescriptor { enum class App { Login = -1, Situation = 0, ResourceManager = 1, PlanEditor = 2, BuildingViewer = 3, OC = 4, OrgChart = 5, Scripts = 6, // merged into Scripts (aka. ScriptEditor) ScriptPlayer = 7, Snapshot = 8, SystemMonitor = 9, Timeline = 10, SymbolEditor = 11, ScriptEditorEssentialsView = 12, BaseDownloader = 13, OnlineHelp = 14, ThpSituationReplay = 15, SituationTablet = 17, SilhouetteEditor = 18, // for L400P2 Shootback = 19, // for L400P2 SAAs = 20, //Schnittstelle Adapter Adler }; struct PluginInfo { enum class PluginType { UNKNOWN, DATA, GUI, GUI_ELEMENT, }; enum class Flag { UNKNOWN = 1 << 0, ACTIONS = 1 << 1, MAIN = 1 << 2, PAYLOAD = 1 << 3, OPTION = 1 << 4, }; PluginType type = PluginType::UNKNOWN; QString iid; QFlags flags; QStringList options; }; struct AppDescription { App id = App::Login; bool active = false; bool visible = true; QString appName; QVector requiredAcls; QVector pluginInfos; bool isValid() const { return !appName.isEmpty(); } }; typedef QVector AppDescriptionVector; namespace LtsAppDescriptor // TODO: make qobject class singleton - for tr { LTSAPPDESCRIPTOR_EXPORT App appFromInteger(int i); LTSAPPDESCRIPTOR_EXPORT AppDescriptionVector getAppDescriptionVector(const QByteArray &jsonDocument, QStringList &lastErrors, const QStringList &ignoredPlugins, QString &loginPluginIid); } } // namespace LtsAppDescriptor