AusweisApp2
UILoader.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include "EnumHelper.h"
10 #include "UIPlugIn.h"
11 
12 #include <QJsonObject>
13 #include <QMap>
14 #include <QVector>
15 
16 namespace governikus
17 {
18 
19 defineEnumType(UIPlugInName, UIPlugInQml, UIPlugInJson, UIPlugInWebSocket, UIPlugInAidl, UIPlugInFunctional)
20 
21 class UILoader
22  : public QObject
23 {
24  Q_OBJECT
25  friend class Env;
26 
27  private:
28  static QVector<UIPlugInName> cDefault;
29  QMap<UIPlugInName, UIPlugIn*> mLoadedPlugIns;
30 
31  static QVector<UIPlugInName> getInitialDefault();
32  static QString getName(UIPlugInName pPlugin);
33 
34  UILoader();
35  ~UILoader() override;
36  [[nodiscard]] inline bool isPlugIn(const QJsonObject& pJson) const;
37  [[nodiscard]] inline bool hasName(const QJsonObject& pJson, const QString& pName) const;
38 
39  public:
40  // do not make this non-static as the CommandLineParser spawns
41  // this object on startup. Since this is a QObject this shoud be avoided.
42  static QStringList getDefault();
43  static void setDefault(const QStringList& pDefault);
44 
45  [[nodiscard]] bool isLoaded() const;
46  bool load();
47  bool load(UIPlugInName pName);
48 
49  [[nodiscard]] UIPlugIn* getLoaded(UIPlugInName pName) const;
50 
51  Q_INVOKABLE void shutdown();
52 
53  Q_SIGNALS:
54  void fireLoadedPlugin(UIPlugIn* pPlugin);
55  void fireShutdownComplete();
56 };
57 
58 } // namespace governikus
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15
defineEnumType(ActivationType, UNKNOWN, SHOWUI, STATUS, TCTOKENURL) defineEnumType(StatusFormat
Format types for status responses.