AusweisApp2
 Alle Klassen Namensbereiche Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Propertys Freundbeziehungen Makrodefinitionen
ActivationHandler.h
gehe zur Dokumentation dieser Datei
1 
5 #pragma once
6 
7 #include "EnumHelper.h"
8 
9 #include <QMap>
10 #include <QUrl>
11 
12 namespace governikus
13 {
14 
15 class ActivationContext;
16 
20 defineEnumType(UiModule,
21  CURRENT,
22  DEFAULT,
23  IDENTIFY,
24  SETTINGS,
25  PINMANAGEMENT
26  )
27 
28 
29 
32 defineEnumType(StatusFormat,
34  JSON
35  )
36 
37 
46  : public QObject
47 {
48  Q_OBJECT
49 
50  private:
51  static bool isPlugIn(const QJsonObject& pJson);
52 
53  protected:
55  virtual ~ActivationHandler();
56 
60  static QMap<QString, QString> getQueryParameter(const QUrl& pUrl);
61 
62  public:
63  static const QVector<ActivationHandler*>& getInstances();
64 
65  template<typename T> static T* getInstance()
66  {
67  for (auto handler : ActivationHandler::getInstances())
68  {
69  if (auto obj = qobject_cast<T*>(handler))
70  {
71  return obj;
72  }
73  }
74 
75  qCritical() << "Cannot find requested ActivationHandler";
76  return nullptr;
77  }
78 
79 
80  virtual bool start() = 0;
81  virtual void stop() = 0;
82 
83  Q_SIGNALS:
84  void fireShowUserInformation(const QString& pErrorMessage = QString());
85  void fireShowUiRequest(UiModule pModule);
86  void fireAuthenticationRequest(const QSharedPointer<ActivationContext>& pActivationContext);
87 };
88 
89 } /* namespace governikus */
90 
91 Q_DECLARE_INTERFACE(governikus::ActivationHandler, "governikus.ActivationHandler")
static const QVector< ActivationHandler * > & getInstances()
Definition: ActivationHandler.cpp:49
The ActivationHandler is beside the UI another API of the application.
Definition: ActivationHandler.h:45
PLAIN
Definition: ActivationHandler.h:33
#define T(v)
Definition: http_parser.cpp:234
static T * getInstance()
Definition: ActivationHandler.h:65
defineEnumType(UiModule, CURRENT, DEFAULT, IDENTIFY, SETTINGS, PINMANAGEMENT) defineEnumType(StatusFormat
UI modules that can be requested to show.