AusweisApp
Lade ...
Suche ...
Keine Treffer
UiPluginQml.h
gehe zur Dokumentation dieser Datei
1
9#pragma once
10
11#include "GlobalStatus.h"
12#include "ProxyCredentials.h"
13#include "TrayIcon.h"
14#include "UiPluginModel.h"
15
16#include <QQmlApplicationEngine>
17#include <QQuickWindow>
18#include <QScopedPointer>
19#if defined (Q_OS_MACOS)
20 #include <QMenuBar>
21#endif
22
23#ifdef Q_OS_IOS
24Q_FORWARD_DECLARE_OBJC_CLASS(FontChangeTracker);
25#endif
26
27
28class test_UiPluginQml;
29
30
31namespace governikus
32{
33
35 : public UiPluginModel
36{
38 Q_PLUGIN_METADATA(IID "governikus.UiPlugin" FILE "metadata.json")
39 Q_INTERFACES(governikus::UiPlugin)
41
42 private:
44#ifdef Q_OS_MACOS
46#endif
47 qsizetype mQmlEngineWarningCount;
48 bool mUpdateInformationPending;
49 TrayIcon mTrayIcon;
50 QString mDominator;
51 bool mHighContrastEnabled;
52 bool mDarkMode;
53 bool mShowFocusIndicator;
54 constexpr static qreal DEFAULT_SCALE_FACTOR = 0.6;
55 qreal mScaleFactor;
56 qreal mFontScaleFactor;
57
58 void init();
59 [[nodiscard]] static QString getOverridePlatform();
60 [[nodiscard]] QQuickWindow* getRootWindow() const;
61 [[nodiscard]] bool isHidden() const;
62 [[nodiscard]] bool showUpdateInformationIfPending();
63 [[nodiscard]] qreal getSystemFontScaleFactor() const;
64 void setFontScaleFactor(qreal pFactor);
65 void setOsDarkMode(bool pState);
66
67#ifdef Q_OS_IOS
68 struct Private
69 {
70 Private();
71 ~Private();
72 FontChangeTracker* const mFontChangeTracker;
73 };
75#endif
76
77 protected:
78 [[nodiscard]] bool eventFilter(QObject* pObj, QEvent* pEvent) override;
79
80 public:
82 ~UiPluginQml() override = default;
83
84 static void registerQmlTypes();
85#ifndef QT_NO_DEBUG
86 static QString adjustQmlImportPath(QQmlEngine* pEngine);
87#endif
88
89 [[nodiscard]] bool isDebugBuild() const override;
90 [[nodiscard]] bool isDeveloperVersion() const override;
91 [[nodiscard]] QString getDominator() const override;
92 [[nodiscard]] bool isDominated() const override;
93 [[nodiscard]] QVariantMap getSafeAreaMargins() const override;
94 [[nodiscard]] bool isHighContrastEnabled() const override;
95 [[nodiscard]] bool isOsDarkModeEnabled() const override;
96 [[nodiscard]] bool isOsDarkModeSupported() const override;
97 [[nodiscard]] QString getFixedFontFamily() const override;
98 [[nodiscard]] QSize getInitialWindowSize() const override;
99 [[nodiscard]] bool getShowFocusIndicator() const override;
100 [[nodiscard]] qreal getScaleFactor() const override;
101 void setScaleFactor(qreal pScaleFactor) override;
102 [[nodiscard]] qreal getFontScaleFactor() const override;
103 [[nodiscard]] bool isChromeOS() const override;
104
105 Q_INVOKABLE void hideFromTaskbar() const override;
106 Q_INVOKABLE void doRefresh() override;
107
108 Q_SIGNALS:
111
112 private Q_SLOTS:
113 void show();
114 void doShutdown() override;
115 void onWorkflowStarted(const QSharedPointer<WorkflowRequest>& pRequest) override;
116 void onWorkflowFinished(const QSharedPointer<WorkflowRequest>& pRequest) override;
117 void onApplicationInitialized() override;
118 void onApplicationStarted() override;
119 void onShowUi(UiModule pModule) override;
120 void onHideUi() override;
121 void onTranslationChanged() override;
122 void onProxyAuthenticationRequired(const QNetworkProxy& pProxy, QAuthenticator* pAuthenticator) override;
123 void onUiDomination(const UiPlugin* pUi, const QString& pInformation, bool pAccepted) override;
124 void onUiDominationReleased() override;
125 void onShowUserInformation(const QString& pMessage) override;
126 void onUpdateScheduled() const;
127 void onAppcastFinished(bool pUpdateAvailable);
128
129 void onQmlWarnings(const QList<QQmlError>& pWarnings);
130 void onQmlObjectCreated(QObject* pObject);
131 void onSceneGraphError(QQuickWindow::SceneGraphError pError, const QString& pMessage);
132
133 void onRawLog(const QString& pMessage, const QString& pCategoryName);
134
135 void onWindowPaletteChanged();
136 void onUseSystemFontChanged() const;
137 void onAutoStartChanged();
138 void onAppConfigChanged();
139};
140
141} // namespace governikus
Definition TrayIcon.h:21
Definition UiPluginModel.h:21
Definition UiPluginQml.h:36
Q_INVOKABLE void hideFromTaskbar() const override
Definition UiPluginQml.cpp:249
bool isChromeOS() const override
Definition UiPluginQml.cpp:895
bool isDeveloperVersion() const override
Definition UiPluginQml.cpp:726
bool getShowFocusIndicator() const override
Definition UiPluginQml.cpp:863
bool eventFilter(QObject *pObj, QEvent *pEvent) override
Definition UiPluginQml.cpp:578
static QString adjustQmlImportPath(QQmlEngine *pEngine)
Definition UiPluginQml.cpp:256
static void registerQmlTypes()
Definition UiPluginQml.cpp:166
bool isHighContrastEnabled() const override
Definition UiPluginQml.cpp:797
QString getDominator() const override
Definition UiPluginQml.cpp:732
QVariantMap getSafeAreaMargins() const override
Definition UiPluginQml.cpp:745
~UiPluginQml() override=default
bool isOsDarkModeSupported() const override
Definition UiPluginQml.cpp:834
bool isDominated() const override
Definition UiPluginQml.cpp:738
qreal getScaleFactor() const override
Definition UiPluginQml.cpp:869
void setScaleFactor(qreal pScaleFactor) override
Definition UiPluginQml.cpp:876
QString getFixedFontFamily() const override
Definition UiPluginQml.cpp:846
qreal getFontScaleFactor() const override
Definition UiPluginQml.cpp:889
QSize getInitialWindowSize() const override
Definition UiPluginQml.cpp:852
bool isOsDarkModeEnabled() const override
Definition UiPluginQml.cpp:813
bool isDebugBuild() const override
Definition UiPluginQml.cpp:714
Q_INVOKABLE void doRefresh() override
Definition UiPluginQml.cpp:702
friend class ::test_UiPluginQml
Definition UiPluginQml.h:40
Implementation of GeneralAuthenticate response APDUs.
Definition CommandApdu.h:17
QSharedPointer< T > decodeObject(const QByteArray &pData, bool pLogging=true)
Template function for decoding an OpenSSL type from DER encoded QByteArray.
Definition ASN1TemplateUtil.h:114