AusweisApp2
AppController.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include "ActivationController.h"
10 #include "EnumHelper.h"
11 
12 #include <QAbstractNativeEventFilter>
13 #include <QSharedPointer>
14 
15 class test_AppController;
16 
17 namespace governikus
18 {
19 
21  NONE,
22  AUTH,
23  SELF,
24  PIN,
25  READER_SETTINGS,
26  REMOTE_SERVICE)
27 
28 
29 class WorkflowController;
30 class WorkflowRequest;
31 class CommandLineParser;
32 
33 class AppController final
34  : public QObject
35  , public QAbstractNativeEventFilter
36 {
37  Q_OBJECT
38 
39  private:
40  friend class ::test_AppController;
41  Q_DISABLE_COPY(AppController)
42 
43  friend class SignalHandler;
44  friend class CommandLineParser;
45 
46  static bool cShowUi;
47  Action mCurrentAction;
48  QScopedPointer<WorkflowRequest> mWaitingRequest;
49  QScopedPointer<WorkflowController> mActiveController;
50  ActivationController mActivationController;
51  bool mShutdownRunning;
52  const UIPlugIn* mUiDomination;
53  bool mRestartApplication;
54  int mExitCode;
55 
56  [[nodiscard]] bool canStartNewAction() const;
57  void completeShutdown();
58 
59  public:
60  AppController();
61  ~AppController() override;
62 
63  bool eventFilter(QObject* pObj, QEvent* pEvent) override;
64 
65 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
66  bool nativeEventFilter(const QByteArray& pEventType, void* pMessage, qintptr* pResult) override;
67 #else
68  bool nativeEventFilter(const QByteArray& pEventType, void* pMessage, long* pResult) override;
69 #endif
70 
71  bool start();
72 
73  [[nodiscard]] bool shouldApplicationRestart() const;
74 
75  Q_SIGNALS:
77  void fireStarted();
78  void fireShutdown();
79  void fireWorkflowStarted(QSharedPointer<WorkflowContext> pContext);
80  void fireWorkflowFinished(QSharedPointer<WorkflowContext> pContext);
81  void fireShowUi(UiModule pModule);
82  void fireHideUi();
83  void fireShowUserInformation(const QString& pInformationMessage);
86  void fireProxyAuthenticationRequired(const QNetworkProxy& pProxy, QAuthenticator* pAuthenticator);
88  void fireUiDomination(const UIPlugIn* pUi, const QString& pInformation, bool pAccepted);
90 
91  private Q_SLOTS:
92  void doShutdown();
93  void doShutdown(int pExitCode);
94  void onUiPlugin(UIPlugIn* pPlugin);
95  void onWorkflowFinished();
96  void onCloseReminderFinished(bool pDontRemindAgain);
97  void onChangePinRequested(bool pRequestTransportPin);
98  void onSelfAuthenticationRequested();
99  void onAuthenticationRequest(const QUrl& pUrl);
100  void onAuthenticationContextRequest(const QSharedPointer<ActivationContext>& pActivationContext);
101  void onRemoteServiceRequested();
102  void onLanguageChanged();
103  void onUILoaderShutdownComplete();
104  void onUiDominationRequested(const UIPlugIn* pUi, const QString& pInformation);
105  void onUiDominationRelease();
106  void onRestartApplicationRequested();
107 
108  private:
109  template<typename Controller, typename Context> bool startNewWorkflow(Action pAction, const QSharedPointer<Context>& pContext);
110  static void clearCacheFolders();
111 
112 };
113 
114 } // namespace governikus
Definition: ActivationController.h:16
Definition: AppController.h:36
bool nativeEventFilter(const QByteArray &pEventType, void *pMessage, qintptr *pResult) override
Definition: AppController.cpp:598
bool shouldApplicationRestart() const
Definition: AppController.cpp:225
void fireWorkflowStarted(QSharedPointer< WorkflowContext > pContext)
void fireWorkflowFinished(QSharedPointer< WorkflowContext > pContext)
void fireProxyAuthenticationRequired(const QNetworkProxy &pProxy, QAuthenticator *pAuthenticator)
void fireShowUserInformation(const QString &pInformationMessage)
bool eventFilter(QObject *pObj, QEvent *pEvent) override
Definition: AppController.cpp:130
bool start()
Definition: AppController.cpp:159
void fireShowUi(UiModule pModule)
void fireUiDomination(const UIPlugIn *pUi, const QString &pInformation, bool pAccepted)
Definition: CommandLineParser.h:16
Definition: SignalHandler.h:25
Definition: WorkflowController.h:20
Definition: AppController.cpp:47
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15
AUTH
Definition: MsgTypes.h:25
defineEnumType(ActivationType, UNKNOWN, SHOWUI, STATUS, TCTOKENURL) defineEnumType(StatusFormat
Format types for status responses.