AusweisApp2
AppController.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include "ActivationController.h"
10 #include "EnumHelper.h"
11 #include "WorkflowRequest.h"
12 
13 #include <QAbstractNativeEventFilter>
14 #include <QSharedPointer>
15 
16 class test_AppController;
17 
18 namespace governikus
19 {
20 class WorkflowController;
21 class CommandLineParser;
22 
23 class AppController final
24  : public QObject
25  , public QAbstractNativeEventFilter
26 {
27  Q_OBJECT
28  Q_DISABLE_COPY(AppController)
29  friend class ::test_AppController;
30  friend int initApp(int&, char**);
31  friend class CommandLineParser;
32 
33  private:
34  static bool cShowUi;
35  QSharedPointer<WorkflowRequest> mActiveWorkflow;
36  QSharedPointer<WorkflowRequest> mWaitingRequest;
37  ActivationController mActivationController;
38  bool mShutdownRunning;
39  const UIPlugIn* mUiDomination;
40  bool mRestartApplication;
41  int mExitCode;
42 
43  [[nodiscard]] bool canStartNewWorkflow() const;
44  void completeShutdown();
45 
46  public:
47  AppController();
48 
49  bool eventFilter(QObject* pObj, QEvent* pEvent) override;
50 
51 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
52  bool nativeEventFilter(const QByteArray& pEventType, void* pMessage, qintptr* pResult) override;
53 #else
54  bool nativeEventFilter(const QByteArray& pEventType, void* pMessage, long* pResult) override;
55 #endif
56 
57  bool start();
58 
59  [[nodiscard]] bool shouldApplicationRestart() const;
60 
61  Q_SIGNALS:
63  void fireStarted();
64  void fireShutdown();
65  void fireWorkflowStarted(QSharedPointer<WorkflowContext> pContext);
66  void fireWorkflowFinished(QSharedPointer<WorkflowContext> pContext);
67  void fireShowUi(UiModule pModule);
68  void fireHideUi();
69  void fireShowUserInformation(const QString& pInformationMessage);
71  void fireProxyAuthenticationRequired(const QNetworkProxy& pProxy, QAuthenticator* pAuthenticator);
73  void fireUiDomination(const UIPlugIn* pUi, const QString& pInformation, bool pAccepted);
75 
76  private Q_SLOTS:
77  void doShutdown(int pExitCode = EXIT_SUCCESS);
78  void onUiPlugin(const UIPlugIn* pPlugin);
79  void onWorkflowFinished();
80  void onWorkflowRequested(const QSharedPointer<WorkflowRequest>& pRequest);
81  void onCloseReminderFinished(bool pDontRemindAgain);
82  void onAuthenticationContextRequest(const QSharedPointer<ActivationContext>& pActivationContext);
83  void onLanguageChanged();
84  void onUILoaderShutdownComplete();
85  void onUiDominationRequested(const UIPlugIn* pUi, const QString& pInformation);
86  void onUiDominationRelease();
87  void onRestartApplicationRequested();
88 
89  private:
90  bool startNewWorkflow(const QSharedPointer<WorkflowRequest>& pRequest);
91  static void clearCacheFolders();
92 
93 };
94 
95 } // namespace governikus
Definition: ActivationController.h:16
Definition: AppController.h:26
bool nativeEventFilter(const QByteArray &pEventType, void *pMessage, qintptr *pResult) override
Definition: AppController.cpp:476
bool shouldApplicationRestart() const
Definition: AppController.cpp:171
void fireWorkflowStarted(QSharedPointer< WorkflowContext > pContext)
void fireWorkflowFinished(QSharedPointer< WorkflowContext > pContext)
void fireProxyAuthenticationRequired(const QNetworkProxy &pProxy, QAuthenticator *pAuthenticator)
void fireShowUserInformation(const QString &pInformationMessage)
friend int initApp(int &, char **)
bool eventFilter(QObject *pObj, QEvent *pEvent) override
Definition: AppController.cpp:81
bool start()
Definition: AppController.cpp:110
void fireShowUi(UiModule pModule)
void fireUiDomination(const UIPlugIn *pUi, const QString &pInformation, bool pAccepted)
Definition: CommandLineParser.h:16
Definition: WorkflowRequest.h:25
A simple template renderer.
Definition: ActivationContext.h:15