AusweisApp2
Lade ...
Suche ...
Keine Treffer
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 [[nodiscard]] QString getPlatformSelectors() const;
60 [[nodiscard]] static QUrl getPath(const QString& pRelativePath, bool pQrc = true);
61 [[nodiscard]] QQuickWindow* getRootWindow() const;
62 [[nodiscard]] bool isHidden() const;
63 [[nodiscard]] bool isTablet() const;
64 [[nodiscard]] bool isTabletLayout() const;
65 [[nodiscard]] bool showUpdateInformationIfPending();
66
67 protected:
68 [[nodiscard]] bool eventFilter(QObject* pObj, QEvent* pEvent) override;
69
70 public:
72 ~UIPlugInQml() override = default;
73
74 static void registerQmlTypes();
75
76 [[nodiscard]] QString getPlatformStyle() const;
77 [[nodiscard]] bool isDebugBuild() const;
78 [[nodiscard]] bool isDeveloperVersion() const;
79 [[nodiscard]] QString getDominator() const;
80 [[nodiscard]] bool isDominated() const;
81 [[nodiscard]] QVariantMap getSafeAreaMargins() const;
82 [[nodiscard]] bool isHighContrastEnabled() const;
83 [[nodiscard]] QString getFixedFontFamily() const;
84 [[nodiscard]] QSize getInitialWindowSize() const;
85 [[nodiscard]] 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) override;
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:812
Q_INVOKABLE void hideFromTaskbar()
Definition: UIPlugInQml.cpp:315
bool isDeveloperVersion() const
Definition: UIPlugInQml.cpp:830
bool eventFilter(QObject *pObj, QEvent *pEvent) override
Definition: UIPlugInQml.cpp:644
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:901
QString getDominator() const
Definition: UIPlugInQml.cpp:836
static void registerQmlTypes()
Definition: UIPlugInQml.cpp:215
bool isDominated() const
Definition: UIPlugInQml.cpp:842
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:849
QString getFixedFontFamily() const
Definition: UIPlugInQml.cpp:918
void fireProxyAuthenticationRequired(ProxyCredentials *pProxyCredentials)
Q_INVOKABLE void init()
Definition: UIPlugInQml.cpp:262
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:940
QString platformStyle
Definition: UIPlugInQml.h:33
Q_INVOKABLE void applyPlatformStyle(const QString &pPlatformStyle)
Definition: UIPlugInQml.cpp:965
void doRefresh()
Definition: UIPlugInQml.cpp:805
QSize getInitialWindowSize() const
Definition: UIPlugInQml.cpp:924
bool isDebugBuild() const
Definition: UIPlugInQml.cpp:818
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16