AusweisApp2
UIPlugInQml.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
10 #include "ChatModel.h"
11 #include "ConnectivityManager.h"
12 #include "GlobalStatus.h"
13 #include "HistoryModel.h"
14 #include "NumberModel.h"
15 #include "ProxyCredentials.h"
16 #include "SettingsModel.h"
17 #include "TrayIcon.h"
18 #include "UIPlugIn.h"
20 
21 #include <QQmlApplicationEngine>
22 #include <QQuickWindow>
23 #include <QScopedPointer>
24 #if defined (Q_OS_MACOS)
25 #include <QMenuBar>
26 #endif
27 
28 namespace governikus
29 {
30 
32  : public UIPlugIn
33 {
34  Q_OBJECT
35  Q_PLUGIN_METADATA(IID "governikus.UIPlugIn" FILE "metadata.json")
36  Q_INTERFACES(governikus::UIPlugIn)
37  Q_PROPERTY(QString platformStyle READ getPlatformStyle CONSTANT)
38  Q_PROPERTY(bool debugBuild READ isDebugBuild CONSTANT)
39  Q_PROPERTY(bool developerVersion READ isDeveloperVersion CONSTANT)
40  Q_PROPERTY(QString dominator READ getDominator NOTIFY fireDominatorChanged)
41  Q_PROPERTY(bool dominated READ isDominated NOTIFY fireDominatorChanged)
44  Q_PROPERTY(QString fixedFontFamily READ getFixedFontFamily CONSTANT)
45  Q_PROPERTY(bool tablet READ isTablet CONSTANT)
46 
47  private:
48  QScopedPointer<QQmlApplicationEngine> mEngine;
49  int mQmlEngineWarningCount;
50  VersionInformationModel mVersionInformationModel;
51  CertificateDescriptionModel mCertificateDescriptionModel;
52  ChatModel mChatModel;
53  QString mExplicitPlatformStyle;
54  ConnectivityManager mConnectivityManager;
55  bool mUpdateInformationPending;
56  TrayIcon mTrayIcon;
57  QString mDominator;
58  bool mHighContrastEnabled;
59 #if defined(Q_OS_MACOS)
60  QMenuBar mMenuBar;
61 #endif
62 
63  QString getPlatformSelectors() const;
64  static QUrl getPath(const QString& pRelativePath, bool pQrc = true);
65  QQuickWindow* getRootWindow() const;
66  bool isHidden() const;
67  bool isTablet() const;
68  bool isTabletLayout() const;
69  bool showUpdateInformationIfPending();
70 
71  public:
72  UIPlugInQml();
73  virtual ~UIPlugInQml() override = default;
74 
75  static void registerQmlTypes();
76 
77  QString getPlatformStyle() const;
78  bool isDebugBuild() const;
79  bool isDeveloperVersion() const;
80  QString getDominator() const;
81  bool isDominated() const;
82  QVariantMap getSafeAreaMargins() const;
83  bool isHighContrastEnabled() const;
84  QString getFixedFontFamily() const;
85 
86  Q_INVOKABLE void applyPlatformStyle(const QString& pPlatformStyle);
87  Q_INVOKABLE void init();
88  Q_INVOKABLE void hideFromTaskbar();
89  Q_INVOKABLE void switchUi();
90 
91  Q_SIGNALS:
92  void fireShowRequest(UiModule pModule);
93  void fireHideRequest();
94  void fireDominatorChanged();
97  void fireProxyAuthenticationRequired(ProxyCredentials* pProxyCredentials);
98 
99  private Q_SLOTS:
100  void show();
101  virtual void doShutdown() override;
102  virtual void onWorkflowStarted(QSharedPointer<WorkflowContext> pContext) override;
103  virtual void onWorkflowFinished(QSharedPointer<WorkflowContext> pContext) override;
104  virtual void onApplicationStarted() override;
105  virtual void onShowUi(UiModule pModule) override;
106  virtual void onHideUi() override;
107  virtual void onProxyAuthenticationRequired(const QNetworkProxy& pProxy, QAuthenticator* pAuthenticator) override;
108  virtual void onUiDomination(const UIPlugIn* pUi, const QString& pInformation, bool pAccepted) override;
109  virtual void onUiDominationReleased() override;
110  void onShowUserInformation(const QString& pMessage);
111  void onUpdateScheduled();
112  void onUpdateAvailable(bool pUpdateAvailable, const GlobalStatus& pStatus);
113 
114  void onQmlWarnings(const QList<QQmlError>& pWarnings);
115  void onQmlObjectCreated(QObject* pObject);
116  void onSceneGraphError(QQuickWindow::SceneGraphError pError, const QString& pMessage);
117 
118  void onRawLog(const QString& pMessage, const QString& pCategoryName);
119 
120  void onWindowPaletteChanged();
121 
122  public Q_SLOTS:
123  void doRefresh();
124 };
125 
126 } // namespace governikus
Definition: UIPlugInQml.h:31
bool isDeveloperVersion() const
Definition: UIPlugInQml.cpp:656
virtual ~UIPlugInQml() override=default
Definition: TrayIcon.h:19
bool isDominated() const
Definition: UIPlugInQml.cpp:668
QString fixedFontFamily
Definition: UIPlugInQml.h:44
Q_INVOKABLE void switchUi()
Definition: UIPlugInQml.cpp:277
bool developerVersion
Definition: UIPlugInQml.h:39
bool isHighContrastEnabled() const
Definition: UIPlugInQml.cpp:702
void doRefresh()
Definition: UIPlugInQml.cpp:631
bool highContrastEnabled
Definition: UIPlugInQml.h:43
Definition: GlobalStatus.h:19
Definition: ConnectivityManager.h:17
QVariantMap safeAreaMargins
Definition: UIPlugInQml.h:42
QString platformStyle
Definition: UIPlugInQml.h:37
Definition: ProxyCredentials.h:15
bool debugBuild
Definition: UIPlugInQml.h:38
Q_INVOKABLE void init()
Definition: UIPlugInQml.cpp:218
Q_INVOKABLE void applyPlatformStyle(const QString &pPlatformStyle)
Definition: UIPlugInQml.cpp:735
bool tablet
Definition: UIPlugInQml.h:45
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:14
bool dominated
Definition: UIPlugInQml.h:41
void fireProxyAuthenticationRequired(ProxyCredentials *pProxyCredentials)
QString dominator
Definition: UIPlugInQml.h:40
void fireShowRequest(UiModule pModule)
void fireHighContrastEnabledChanged()
UIPlugInQml()
Definition: UIPlugInQml.cpp:120
QString getFixedFontFamily() const
Definition: UIPlugInQml.cpp:718
QString getPlatformStyle() const
Definition: UIPlugInQml.cpp:638
Q_INVOKABLE void hideFromTaskbar()
Definition: UIPlugInQml.cpp:271
QString getDominator() const
Definition: UIPlugInQml.cpp:662
Definition: VersionInformationModel.h:15
Definition: ChatModel.h:24
QVariantMap getSafeAreaMargins() const
Definition: UIPlugInQml.cpp:675
static void registerQmlTypes()
Definition: UIPlugInQml.cpp:189
Definition: CertificateDescriptionModel.h:21
bool isDebugBuild() const
Definition: UIPlugInQml.cpp:644