AusweisApp2
Lade ...
Suche ...
Keine Treffer
UIPlugInQml.h
gehe zur Dokumentation dieser Datei
1
9#pragma once
10
11#include "GlobalStatus.h"
12#include "HistoryModel.h"
13#include "NumberModel.h"
14#include "ProxyCredentials.h"
15#include "SettingsModel.h"
16#include "TrayIcon.h"
17#include "UIPlugIn.h"
18
19#include <QQmlApplicationEngine>
20#include <QQuickWindow>
21#include <QScopedPointer>
22#if defined (Q_OS_MACOS)
23 #include <QMenuBar>
24#endif
25
26namespace governikus
27{
28
30 : public UIPlugIn
31{
32 Q_OBJECT
33 Q_PLUGIN_METADATA(IID "governikus.UIPlugIn" FILE "metadata.json")
34 Q_INTERFACES(governikus::UIPlugIn)
35 Q_PROPERTY(QString platformStyle READ getPlatformStyle CONSTANT FINAL)
36 Q_PROPERTY(bool debugBuild READ isDebugBuild CONSTANT)
37 Q_PROPERTY(bool developerVersion READ isDeveloperVersion CONSTANT)
38 Q_PROPERTY(QString dominator READ getDominator NOTIFY fireDominatorChanged)
39 Q_PROPERTY(bool dominated READ isDominated NOTIFY fireDominatorChanged)
42 Q_PROPERTY(QString fixedFontFamily READ getFixedFontFamily CONSTANT)
43 Q_PROPERTY(bool tablet READ isTablet CONSTANT)
44 Q_PROPERTY(bool isTabletLayout READ isTabletLayout CONSTANT)
45 Q_PROPERTY(QSize initialWindowSize READ getInitialWindowSize CONSTANT)
47
48 private:
49 QScopedPointer<QQmlApplicationEngine> mEngine;
50 int mQmlEngineWarningCount;
51 QString mExplicitPlatformStyle;
52 bool mUpdateInformationPending;
53 TrayIcon mTrayIcon;
54 QString mDominator;
55 bool mHighContrastEnabled;
56#if defined(Q_OS_MACOS)
57 QMenuBar mMenuBar;
58#endif
59 bool mShowFocusIndicator;
60
61 [[nodiscard]] QString getPlatformSelectors() const;
62 [[nodiscard]] static QUrl getPath(const QString& pRelativePath, bool pQrc = true);
63 [[nodiscard]] QQuickWindow* getRootWindow() const;
64 [[nodiscard]] bool isHidden() const;
65 [[nodiscard]] bool isTablet() const;
66 [[nodiscard]] bool isTabletLayout() const;
67 [[nodiscard]] bool showUpdateInformationIfPending();
68
69 protected:
70 [[nodiscard]] bool eventFilter(QObject* pObj, QEvent* pEvent) override;
71
72 public:
74 ~UIPlugInQml() override = default;
75
76 static void registerQmlTypes();
77
78 [[nodiscard]] QString getPlatformStyle() const;
79 [[nodiscard]] bool isDebugBuild() const;
80 [[nodiscard]] bool isDeveloperVersion() const;
81 [[nodiscard]] QString getDominator() const;
82 [[nodiscard]] bool isDominated() const;
83 [[nodiscard]] QVariantMap getSafeAreaMargins() const;
84 [[nodiscard]] bool isHighContrastEnabled() const;
85 [[nodiscard]] QString getFixedFontFamily() const;
86 [[nodiscard]] QSize getInitialWindowSize() const;
87 [[nodiscard]] bool getShowFocusIndicator() const;
88
89 Q_INVOKABLE void applyPlatformStyle(const QString& pPlatformStyle);
90 Q_INVOKABLE void init();
91 Q_INVOKABLE void hideFromTaskbar();
92
93 Q_SIGNALS:
94 void fireShowRequest(UiModule pModule);
102
103 private Q_SLOTS:
104 void show();
105 void doShutdown() override;
106 void onWorkflowStarted(QSharedPointer<WorkflowContext> pContext) override;
107 void onWorkflowFinished(QSharedPointer<WorkflowContext> pContext) override;
108 void onApplicationInitialized() override;
109 void onApplicationStarted() override;
110 void onShowUi(UiModule pModule) override;
111 void onHideUi() override;
112 void onTranslationChanged() override;
113 void onProxyAuthenticationRequired(const QNetworkProxy& pProxy, QAuthenticator* pAuthenticator) override;
114 void onUiDomination(const UIPlugIn* pUi, const QString& pInformation, bool pAccepted) override;
115 void onUiDominationReleased() override;
116 void onShowUserInformation(const QString& pMessage) override;
117 void onUpdateScheduled();
118 void onUpdateAvailable(bool pUpdateAvailable, const GlobalStatus& pStatus);
119
120 void onQmlWarnings(const QList<QQmlError>& pWarnings);
121 void onQmlObjectCreated(QObject* pObject);
122 void onSceneGraphError(QQuickWindow::SceneGraphError pError, const QString& pMessage);
123
124 void onRawLog(const QString& pMessage, const QString& pCategoryName);
125
126 void onWindowPaletteChanged();
127 void onAutoStartChanged();
128
129 public Q_SLOTS:
130 void doRefresh();
131};
132
133} // namespace governikus
Definition GlobalStatus.h:22
Definition ProxyCredentials.h:17
Definition TrayIcon.h:21
Definition UIPlugInQml.h:31
~UIPlugInQml() override=default
void fireShowRequest(UiModule pModule)
QString getPlatformStyle() const
Definition UIPlugInQml.cpp:816
Q_INVOKABLE void hideFromTaskbar()
Definition UIPlugInQml.cpp:315
bool isDeveloperVersion() const
Definition UIPlugInQml.cpp:834
bool eventFilter(QObject *pObj, QEvent *pEvent) override
Definition UIPlugInQml.cpp:648
QString dominator
Definition UIPlugInQml.h:38
QVariantMap safeAreaMargins
Definition UIPlugInQml.h:40
bool isTabletLayout
Definition UIPlugInQml.h:44
bool highContrastEnabled
Definition UIPlugInQml.h:41
bool isHighContrastEnabled() const
Definition UIPlugInQml.cpp:905
QString getDominator() const
Definition UIPlugInQml.cpp:840
static void registerQmlTypes()
Definition UIPlugInQml.cpp:215
bool isDominated() const
Definition UIPlugInQml.cpp:846
bool debugBuild
Definition UIPlugInQml.h:36
bool showFocusIndicator
Definition UIPlugInQml.h:46
bool tablet
Definition UIPlugInQml.h:43
bool dominated
Definition UIPlugInQml.h:39
QVariantMap getSafeAreaMargins() const
Definition UIPlugInQml.cpp:853
QString getFixedFontFamily() const
Definition UIPlugInQml.cpp:922
void fireProxyAuthenticationRequired(ProxyCredentials *pProxyCredentials)
Q_INVOKABLE void init()
Definition UIPlugInQml.cpp:262
QSize initialWindowSize
Definition UIPlugInQml.h:45
QString fixedFontFamily
Definition UIPlugInQml.h:42
void fireHighContrastEnabledChanged()
bool developerVersion
Definition UIPlugInQml.h:37
UIPlugInQml()
Definition UIPlugInQml.cpp:153
bool getShowFocusIndicator() const
Definition UIPlugInQml.cpp:944
QString platformStyle
Definition UIPlugInQml.h:35
Q_INVOKABLE void applyPlatformStyle(const QString &pPlatformStyle)
Definition UIPlugInQml.cpp:969
void doRefresh()
Definition UIPlugInQml.cpp:809
QSize getInitialWindowSize() const
Definition UIPlugInQml.cpp:928
bool isDebugBuild() const
Definition UIPlugInQml.cpp:822
Implementation of GeneralAuthenticate response APDUs.
Definition CommandApdu.h:16