AusweisApp2
UIPlugInQml.h
gehe zur Dokumentation dieser Datei
1 
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 
24 namespace 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)
40  Q_PROPERTY(QString fixedFontFamily READ getFixedFontFamily CONSTANT)
41  Q_PROPERTY(bool tablet READ isTablet CONSTANT)
42 
43  private:
44  QScopedPointer<QQmlApplicationEngine> mEngine;
45  int mQmlEngineWarningCount;
46  QString mExplicitPlatformStyle;
47  bool mUpdateInformationPending;
48  TrayIcon mTrayIcon;
49  QString mDominator;
50  bool mHighContrastEnabled;
51 #if defined(Q_OS_MACOS)
52  QMenuBar mMenuBar;
53 #endif
54 
55  QString getPlatformSelectors() const;
56  static QUrl getPath(const QString& pRelativePath, bool pQrc = true);
57  QQuickWindow* getRootWindow() const;
58  bool isHidden() const;
59  bool isTablet() const;
60  bool isTabletLayout() const;
61  bool showUpdateInformationIfPending();
62 
63  public:
64  UIPlugInQml();
65  ~UIPlugInQml() override = default;
66 
67  static void registerQmlTypes();
68 
69  QString getPlatformStyle() const;
70  bool isDebugBuild() const;
71  bool isDeveloperVersion() const;
72  QString getDominator() const;
73  bool isDominated() const;
74  QVariantMap getSafeAreaMargins() const;
75  bool isHighContrastEnabled() const;
76  QString getFixedFontFamily() const;
77 
78  Q_INVOKABLE void applyPlatformStyle(const QString& pPlatformStyle);
79  Q_INVOKABLE void init();
80  Q_INVOKABLE void hideFromTaskbar();
81 
82  Q_SIGNALS:
83  void fireShowRequest(UiModule pModule);
84  void fireHideRequest();
85  void fireDominatorChanged();
88  void fireProxyAuthenticationRequired(ProxyCredentials* pProxyCredentials);
89 
90  private Q_SLOTS:
91  void show();
92  void doShutdown() override;
93  void onWorkflowStarted(QSharedPointer<WorkflowContext> pContext) override;
94  void onWorkflowFinished(QSharedPointer<WorkflowContext> pContext) override;
95  void onApplicationInitialized() override;
96  void onApplicationStarted() override;
97  void onShowUi(UiModule pModule) override;
98  void onHideUi() override;
99  void onTranslationChanged() override;
100  void onProxyAuthenticationRequired(const QNetworkProxy& pProxy, QAuthenticator* pAuthenticator) override;
101  void onUiDomination(const UIPlugIn* pUi, const QString& pInformation, bool pAccepted) override;
102  void onUiDominationReleased() override;
103  void onShowUserInformation(const QString& pMessage);
104  void onUpdateScheduled();
105  void onUpdateAvailable(bool pUpdateAvailable, const GlobalStatus& pStatus);
106 
107  void onQmlWarnings(const QList<QQmlError>& pWarnings);
108  void onQmlObjectCreated(QObject* pObject);
109  void onSceneGraphError(QQuickWindow::SceneGraphError pError, const QString& pMessage);
110 
111  void onRawLog(const QString& pMessage, const QString& pCategoryName);
112 
113  void onWindowPaletteChanged();
114 
115  public Q_SLOTS:
116  void doRefresh();
117 };
118 
119 } // namespace governikus
Definition: UIPlugInQml.h:27
bool isDeveloperVersion() const
Definition: UIPlugInQml.cpp:720
Definition: TrayIcon.h:19
bool isDominated() const
Definition: UIPlugInQml.cpp:732
QString fixedFontFamily
Definition: UIPlugInQml.h:40
bool developerVersion
Definition: UIPlugInQml.h:35
bool isHighContrastEnabled() const
Definition: UIPlugInQml.cpp:790
void doRefresh()
Definition: UIPlugInQml.cpp:695
bool highContrastEnabled
Definition: UIPlugInQml.h:39
Definition: GlobalStatus.h:19
QVariantMap safeAreaMargins
Definition: UIPlugInQml.h:38
QString platformStyle
Definition: UIPlugInQml.h:33
Definition: ProxyCredentials.h:15
bool debugBuild
Definition: UIPlugInQml.h:34
Q_INVOKABLE void init()
Definition: UIPlugInQml.cpp:229
Q_INVOKABLE void applyPlatformStyle(const QString &pPlatformStyle)
Definition: UIPlugInQml.cpp:824
bool tablet
Definition: UIPlugInQml.h:41
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:14
bool dominated
Definition: UIPlugInQml.h:37
void fireProxyAuthenticationRequired(ProxyCredentials *pProxyCredentials)
QString dominator
Definition: UIPlugInQml.h:36
~UIPlugInQml() override=default
void fireShowRequest(UiModule pModule)
void fireHighContrastEnabledChanged()
UIPlugInQml()
Definition: UIPlugInQml.cpp:132
QString getFixedFontFamily() const
Definition: UIPlugInQml.cpp:807
QString getPlatformStyle() const
Definition: UIPlugInQml.cpp:702
Q_INVOKABLE void hideFromTaskbar()
Definition: UIPlugInQml.cpp:296
QString getDominator() const
Definition: UIPlugInQml.cpp:726
QVariantMap getSafeAreaMargins() const
Definition: UIPlugInQml.cpp:739
static void registerQmlTypes()
Definition: UIPlugInQml.cpp:190
bool isDebugBuild() const
Definition: UIPlugInQml.cpp:708