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)
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 
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);
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
ReaderScanEnabler.h
governikus::ChangePinModel::fireStartWorkflow
void fireStartWorkflow(bool pRequestTransportPin)
governikus::UIPlugInQml::safeAreaMargins
QVariantMap safeAreaMargins
Definition: UIPlugInQml.h:38
AuthContext.h
SelfAuthModel.h
LogModel.h
governikus::UIPlugInQml::tablet
bool tablet
Definition: UIPlugInQml.h:41
CheckIDCardModel.h
governikus::UIPlugInQml::fireHighContrastEnabledChanged
void fireHighContrastEnabledChanged()
governikus::toString
char * toString(const MessageDispatcher::Msg &pMsg)
governikus::UIPlugInQml::dominated
bool dominated
Definition: UIPlugInQml.h:37
Initializer.h
NumberModel.h
governikus::AuthContext
Definition: AuthContext.h:49
ProxyCredentials.h
governikus::TrayIcon::fireQuit
void fireQuit()
governikus::TrayIcon
Definition: TrayIcon.h:21
governikus::UIPlugInQml::fireSafeAreaMarginsChanged
void fireSafeAreaMarginsChanged()
governikus::Service::fireUpdateScheduled
void fireUpdateScheduled()
VersionNumber.h
VersionInformationModel.h
governikus::UIPlugInQml::hideFromTaskbar
Q_INVOKABLE void hideFromTaskbar()
Definition: UIPlugInQml.cpp:296
AppSettings.h
governikus::UIPlugInQml::platformStyle
QString platformStyle
Definition: UIPlugInQml.h:33
LogHandler.h
governikus::UIPlugInQml::getDominator
QString getDominator() const
Definition: UIPlugInQml.cpp:726
AuthModel.h
governikus::UIPlugInQml::applyPlatformStyle
Q_INVOKABLE void applyPlatformStyle(const QString &pPlatformStyle)
Definition: UIPlugInQml.cpp:824
governikus::RemoteServiceContext
Definition: RemoteServiceContext.h:24
CardPositionModel.h
governikus::UIPlugInQml::~UIPlugInQml
~UIPlugInQml() override=default
governikus::ChangePinContext
Definition: ChangePinContext.h:16
UILoader.h
governikus::UIPlugInQml::fireShowRequest
void fireShowRequest(UiModule pModule)
governikus::UIPlugInQml::isDebugBuild
bool isDebugBuild() const
Definition: UIPlugInQml.cpp:708
governikus::UIPlugInQml::developerVersion
bool developerVersion
Definition: UIPlugInQml.h:35
SelfDiagnosisModel.h
ReaderDriverModel.h
VolatileSettings.h
governikus::UIPlugInQml::UIPlugInQml
UIPlugInQml()
Definition: UIPlugInQml.cpp:132
pScriptEngine
QJSEngine * pScriptEngine
Definition: UIPlugInQml.cpp:88
FormattedTextModel.h
CardPosition.h
SettingsModel.h
governikus::TrayIcon::fireShow
void fireShow()
PlatformTools.h
ChatModel.h
governikus::VersionNumber::isDeveloperVersion
bool isDeveloperVersion() const
Definition: VersionNumber.cpp:41
HistoryModel.h
Service.h
governikus::UIPlugInQml::getSafeAreaMargins
QVariantMap getSafeAreaMargins() const
Definition: UIPlugInQml.cpp:739
governikus::ProxyCredentials
Definition: ProxyCredentials.h:17
governikus::LogEventHandler::fireRawLog
void fireRawLog(const QString &pMsg, const QString &pCategoryName)
governikus::UIPlugInQml::highContrastEnabled
bool highContrastEnabled
Definition: UIPlugInQml.h:39
governikus::WorkflowContext::hasNextWorkflowPending
bool hasNextWorkflowPending() const
Definition: WorkflowContext.cpp:442
governikus::PlatformTools::hideFromTaskbar
static void hideFromTaskbar()
Definition: PlatformTools_generic.cpp:11
SurveyModel.h
ChangePinContext.h
governikus::UIPlugInQml::isDeveloperVersion
bool isDeveloperVersion() const
Definition: UIPlugInQml.cpp:720
ReleaseInformationModel.h
governikus::UIPlugInQml::init
Q_INVOKABLE void init()
Definition: UIPlugInQml.cpp:229
GlobalStatus.h
governikus
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15
DeviceInfo.h
governikus::SelfAuthContext
Definition: SelfAuthContext.h:18
governikus::TrayIcon::showMessage
void showMessage(const QString &pTitle, const QString &pMessage)
Definition: TrayIcon.cpp:152
governikus::Enum::fromString
static EnumTypeT fromString(const char *const pValue, EnumTypeT pDefault)
Definition: EnumHelper.h:145
governikus::UIPlugInQml::registerQmlTypes
static void registerQmlTypes()
Definition: UIPlugInQml.cpp:190
SelfAuthContext.h
INIT_FUNCTION
INIT_FUNCTION([] { qRegisterMetaType< QList< QQmlError > >("QList<QQmlError>");}) template< typename T > QObject *provideQmlType(QQmlEngine *pEngine
Env.h
CertificateDescriptionModel.h
NotificationModel.h
governikus::UIPlugInQml::debugBuild
bool debugBuild
Definition: UIPlugInQml.h:34
UIPlugIn.h
governikus::UIPlugInQml::doRefresh
void doRefresh()
Definition: UIPlugInQml.cpp:695
governikus::TrayIcon::getIcon
const QIcon & getIcon() const
Definition: TrayIcon.cpp:56
governikus::VersionNumber::getApplicationVersion
static const VersionNumber & getApplicationVersion()
Definition: VersionNumber.cpp:29
governikus::UIPlugInQml::isDominated
bool isDominated() const
Definition: UIPlugInQml.cpp:732
Random.h
ProviderCategoryFilterModel.h
governikus::GlobalStatus
Definition: GlobalStatus.h:20
FileDestination.h
governikus::UIPlugInQml::fixedFontFamily
QString fixedFontFamily
Definition: UIPlugInQml.h:40
ApplicationModel.h
ConnectivityManager.h
governikus::UIPlugInQml::dominator
QString dominator
Definition: UIPlugInQml.h:36
RemoteServiceModel.h
governikus::UIPlugInQml::fireProxyAuthenticationRequired
void fireProxyAuthenticationRequired(ProxyCredentials *pProxyCredentials)
T
#define T(v)
Definition: http_parser.cpp:237
governikus::UIPlugInQml::getPlatformStyle
QString getPlatformStyle() const
Definition: UIPlugInQml.cpp:702
governikus::SelfAuthModel::fireStartWorkflow
void fireStartWorkflow()
TrayIcon.h
UIPlugInQml.h
governikus::Service::fireAppcastFinished
void fireAppcastFinished(bool pUpdateAvailable, const GlobalStatus &pError)
governikus::UIPlugInQml::isHighContrastEnabled
bool isHighContrastEnabled() const
Definition: UIPlugInQml.cpp:790
governikus::UIPlugInQml::fireDominatorChanged
void fireDominatorChanged()
governikus::UIPlugInQml
Definition: UIPlugInQml.h:29
ChangePinModel.h
governikus::DeviceInfo::getFingerprint
static QString getFingerprint()
Definition: DeviceInfo.cpp:66
governikus::PlatformTools::restoreToTaskbar
static void restoreToTaskbar()
Definition: PlatformTools_generic.cpp:16
governikus::UIPlugInQml::fireHideRequest
void fireHideRequest()
governikus::TrayIcon::create
void create()
Definition: TrayIcon.cpp:62
governikus::RemoteServiceModel::fireStartWorkflow
void fireStartWorkflow()
governikus::TrayIcon::shutdown
void shutdown()
Definition: TrayIcon.cpp:122
governikus::UIPlugInQml::getFixedFontFamily
QString getFixedFontFamily() const
Definition: UIPlugInQml.cpp:807