AusweisApp
Lade ...
Suche ...
Keine Treffer
UiPluginQml.h
gehe zur Dokumentation dieser Datei
1
5#pragma once
6
7#include "TrayIcon.h"
8#include "UiPluginModel.h"
9
10#include <QQmlApplicationEngine>
11#include <QQuickWindow>
12#include <QScopedPointer>
13#if defined (Q_OS_MACOS)
14 #include <QMenuBar>
15#endif
16
17#ifdef Q_OS_IOS
18Q_FORWARD_DECLARE_OBJC_CLASS(FontChangeTracker);
19#endif
20
21
22class test_UiPluginQml;
23
24
25namespace governikus
26{
27
29 : public UiPluginModel
30{
31 Q_OBJECT
32 Q_PLUGIN_METADATA(IID "governikus.UiPlugin" FILE "metadata.json")
33 Q_INTERFACES(governikus::UiPlugin)
34 friend class ::test_UiPluginQml;
35
36 private:
37 QScopedPointer<QQmlApplicationEngine> mEngine;
38#ifdef Q_OS_MACOS
39 QScopedPointer<QMenuBar> mMenuBar;
40#endif
41 qsizetype mQmlEngineWarningCount;
42 TrayIcon mTrayIcon;
43 QString mDominator;
44 bool mHighContrastEnabled;
45 bool mDarkMode;
46 bool mShowFocusIndicator;
47 constexpr static qreal DEFAULT_SCALE_FACTOR = 0.6;
48 qreal mScaleFactor;
49 qreal mFontScaleFactor;
50
51 void init();
52 [[nodiscard]] static QString getOverridePlatform();
53 [[nodiscard]] QQuickWindow* getRootWindow() const;
54 [[nodiscard]] bool isHidden() const;
55 [[nodiscard]] bool showUpdateInformationIfPending();
56 [[nodiscard]] qreal getSystemFontScaleFactor() const;
57 void setFontScaleFactor(qreal pFactor);
58 void setOsDarkMode(bool pState);
59
60#ifdef Q_OS_IOS
61 struct Private
62 {
63 Private();
64 ~Private();
65 FontChangeTracker* const mFontChangeTracker;
66 };
67 const QScopedPointer<Private> mPrivate;
68#endif
69
70 protected:
71 [[nodiscard]] bool eventFilter(QObject* pObj, QEvent* pEvent) override;
72
73 public:
75 ~UiPluginQml() override = default;
76
77 static void registerQmlTypes();
78#ifndef QT_NO_DEBUG
79 static QString adjustQmlImportPath(QQmlEngine* pEngine);
80#endif
81
82 [[nodiscard]] QString getQtVersion() const override;
83 [[nodiscard]] bool isDebugBuild() const override;
84 [[nodiscard]] bool isDeveloperVersion() const override;
85 [[nodiscard]] QString getDominator() const override;
86 [[nodiscard]] bool isDominated() const override;
87 [[nodiscard]] QVariantMap getSafeAreaMargins() const override;
88 [[nodiscard]] bool isHighContrastEnabled() const override;
89 [[nodiscard]] bool isOsDarkModeEnabled() const;
90 [[nodiscard]] bool isOsDarkModeSupported() const override;
91 [[nodiscard]] bool isDarkModeEnabled() const override;
92 [[nodiscard]] QString getFixedFontFamily() const override;
93 [[nodiscard]] QSize getInitialWindowSize() const override;
94 [[nodiscard]] bool getShowFocusIndicator() const override;
95 [[nodiscard]] qreal getScaleFactor() const override;
96 void setScaleFactor(qreal pScaleFactor) override;
97 [[nodiscard]] qreal getFontScaleFactor() const override;
98 [[nodiscard]] bool isChromeOS() const override;
99
100 Q_INVOKABLE void hideFromTaskbar() const override;
101 Q_INVOKABLE void doRefresh() override;
102
103 Q_SIGNALS:
106
107 private Q_SLOTS:
108 void show();
109 void doShutdown() override;
110 void onWorkflowStarted(const QSharedPointer<WorkflowRequest>& pRequest) override;
111 void onWorkflowFinished(const QSharedPointer<WorkflowRequest>& pRequest) override;
112 void onApplicationInitialized() override;
113 void onApplicationStarted() override;
114 void onShowUi(UiModule pModule) override;
115 void onHideUi() override;
116 void onTranslationChanged() override;
117 void onProxyAuthenticationRequired(const QNetworkProxy& pProxy, QAuthenticator* pAuthenticator) override;
118 void onUiDomination(const UiPlugin* pUi, const QString& pInformation, bool pAccepted) override;
119 void onUiDominationReleased() override;
120 void onShowUserInformation(const QString& pMessage) override;
121 void onUpdateScheduled() const;
122
123 void onQmlWarnings(const QList<QQmlError>& pWarnings);
124 void onQmlObjectCreated(const QObject* pObject);
125 void onSceneGraphError(QQuickWindow::SceneGraphError pError, const QString& pMessage);
126
127 void onRawLog(const QString& pMessage, const QString& pCategoryName);
128
129 void onWindowPaletteChanged();
130 void onUserDarkModeChanged() const;
131 void onUseSystemFontChanged() const;
132 void onTrayIconEnabledChanged();
133 void onAppConfigChanged();
134};
135
136} // namespace governikus
Definition TrayIcon.h:21
Definition UiPluginModel.h:21
Definition UiPluginQml.h:30
Q_INVOKABLE void hideFromTaskbar() const override
Definition UiPluginQml.cpp:247
bool isChromeOS() const override
Definition UiPluginQml.cpp:914
bool isDarkModeEnabled() const override
Definition UiPluginQml.cpp:846
bool isDeveloperVersion() const override
Definition UiPluginQml.cpp:723
bool getShowFocusIndicator() const override
Definition UiPluginQml.cpp:882
bool eventFilter(QObject *pObj, QEvent *pEvent) override
Definition UiPluginQml.cpp:573
static QString adjustQmlImportPath(QQmlEngine *pEngine)
Definition UiPluginQml.cpp:254
static void registerQmlTypes()
Definition UiPluginQml.cpp:156
bool isHighContrastEnabled() const override
Definition UiPluginQml.cpp:794
QString getDominator() const override
Definition UiPluginQml.cpp:729
bool isOsDarkModeEnabled() const
Definition UiPluginQml.cpp:810
QVariantMap getSafeAreaMargins() const override
Definition UiPluginQml.cpp:742
~UiPluginQml() override=default
bool isOsDarkModeSupported() const override
Definition UiPluginQml.cpp:834
bool isDominated() const override
Definition UiPluginQml.cpp:735
qreal getScaleFactor() const override
Definition UiPluginQml.cpp:888
void setScaleFactor(qreal pScaleFactor) override
Definition UiPluginQml.cpp:895
QString getFixedFontFamily() const override
Definition UiPluginQml.cpp:865
QString getQtVersion() const override
Definition UiPluginQml.cpp:705
qreal getFontScaleFactor() const override
Definition UiPluginQml.cpp:908
QSize getInitialWindowSize() const override
Definition UiPluginQml.cpp:871
bool isDebugBuild() const override
Definition UiPluginQml.cpp:711
Q_INVOKABLE void doRefresh() override
Definition UiPluginQml.cpp:693
friend class ::test_UiPluginQml
Definition UiPluginQml.h:34
Defines the AccessRight and AccessRole enum.
Definition CommandApdu.h:17