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