AusweisApp
Lade ...
Suche ...
Keine Treffer
ApplicationModel.h
gehe zur Dokumentation dieser Datei
1
9#pragma once
10
11#include "Env.h"
13#include "WifiInfo.h"
15
16#include <QObject>
17#include <QQmlEngine>
18#include <QSharedPointer>
19#include <QStringList>
20#include <QTimer>
21
22#ifdef Q_OS_IOS
23Q_FORWARD_DECLARE_OBJC_CLASS(VoiceOverObserver);
24#endif
25
26class test_UIPlugInQml;
27
28
29namespace governikus
30{
31
33 : public QObject
34{
35 Q_OBJECT
36 friend class Env;
37 friend class ::test_UIPlugInQml;
38
39 Q_PROPERTY(QString storeUrl READ getStoreUrl NOTIFY fireStoreUrlChanged)
40 Q_PROPERTY(QUrl releaseNotesUrl READ getReleaseNotesUrl CONSTANT)
41
44
45 Q_PROPERTY(bool wifiEnabled READ isWifiEnabled NOTIFY fireWifiEnabledChanged)
46
48 Q_PROPERTY(qsizetype availableReader READ getAvailableReader NOTIFY fireAvailableReaderChanged)
49
50 Q_PROPERTY(QString feedback READ getFeedback NOTIFY fireFeedbackChanged)
51
52#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
53 Q_PROPERTY(QUrl customConfigPath READ getCustomConfigPath CONSTANT)
54#endif
55
56 private:
57 QSharedPointer<WorkflowContext> mContext;
58 WifiInfo mWifiInfo;
59 bool mWifiEnabled;
60 QStringList mFeedback;
61 QTimer mFeedbackTimer;
62 const int mFeedbackDisplayLength;
63 bool mIsAppInForeground;
64#ifdef Q_OS_IOS
65 struct Private
66 {
67 Private();
68 ~Private();
69 VoiceOverObserver* const mObserver;
70 };
71 const QScopedPointer<Private> mPrivate;
72#endif
73
75 ~ApplicationModel() override = default;
76 void onStatusChanged(const ReaderManagerPlugInInfo& pInfo);
77
78 private Q_SLOTS:
79 void onApplicationStateChanged(Qt::ApplicationState pState);
80 void onWifiEnabledChanged();
81
82 public Q_SLOTS:
84
85 public:
86 enum class Settings
87 {
92 };
93 Q_ENUM(Settings)
94
95 enum class Workflow
96 {
103 };
104 Q_ENUM(Workflow)
105
106 enum class QmlNfcState
107 {
112 };
113 Q_ENUM(QmlNfcState)
114
115 void resetContext(const QSharedPointer<WorkflowContext>& pContext = QSharedPointer<WorkflowContext>());
116
117 [[nodiscard]] Q_INVOKABLE int randomInt(int pLowerBound, int pUpperBound) const;
118
119 [[nodiscard]] QString getStoreUrl() const;
120 [[nodiscard]] QUrl getReleaseNotesUrl() const;
121
122 [[nodiscard]] QmlNfcState getNfcState() const;
123 [[nodiscard]] bool isExtendedLengthApdusUnsupported() const;
124
125 [[nodiscard]] bool isWifiEnabled() const;
126 [[nodiscard]] Workflow getCurrentWorkflow() const;
127 [[nodiscard]] qsizetype getAvailableReader() const;
128
129 [[nodiscard]] QString getFeedback() const;
130
131 [[nodiscard]] Q_INVOKABLE bool isScreenReaderRunning() const;
132
133 [[nodiscard]] Q_INVOKABLE bool isReaderTypeAvailable(ReaderManagerPlugInType pPlugInType) const;
134
135 Q_INVOKABLE void enableWifi()const;
136
137 Q_INVOKABLE void setClipboardText(const QString& pText) const;
138 Q_INVOKABLE void showSettings(const Settings& pAction) const;
139 Q_INVOKABLE void showFeedback(const QString& pMessage, bool pReplaceExisting = false);
140 Q_INVOKABLE void keepScreenOn(bool pActive) const;
141
142 [[nodiscard]] Q_INVOKABLE QStringList getLicenseText() const;
143#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
144 [[nodiscard]] Q_INVOKABLE QUrl getCustomConfigPath() const;
145 Q_INVOKABLE void saveEmbeddedConfig(const QUrl& pFilename) const;
146#endif
147 [[nodiscard]] Q_INVOKABLE QString stripHtmlTags(QString pString) const;
148#ifdef Q_OS_IOS
149 Q_INVOKABLE void showAppStoreRatingDialog();
150#endif
151
152 public Q_SLOTS:
153 Q_INVOKABLE void onShowNextFeedback();
154
155 Q_SIGNALS:
157
160
163
165
167
168 void fireApplicationStateChanged(bool pIsAppInForeground);
169};
170
171
172} // namespace governikus
Definition: ApplicationModel.h:34
Q_INVOKABLE QUrl getCustomConfigPath() const
Definition: ApplicationModel.cpp:391
Q_INVOKABLE void showFeedback(const QString &pMessage, bool pReplaceExisting=false)
Definition: ApplicationModel.cpp:287
QString storeUrl
Definition: ApplicationModel.h:39
Q_INVOKABLE QStringList getLicenseText() const
Definition: ApplicationModel.cpp:367
bool isWifiEnabled() const
Definition: ApplicationModel.cpp:184
Q_INVOKABLE QString stripHtmlTags(QString pString) const
Definition: ApplicationModel.cpp:451
QUrl customConfigPath
Definition: ApplicationModel.h:53
Q_INVOKABLE bool isReaderTypeAvailable(ReaderManagerPlugInType pPlugInType) const
Definition: ApplicationModel.cpp:229
qsizetype availableReader
Definition: ApplicationModel.h:48
Q_INVOKABLE int randomInt(int pLowerBound, int pUpperBound) const
Definition: ApplicationModel.cpp:101
Q_INVOKABLE void saveEmbeddedConfig(const QUrl &pFilename) const
Definition: ApplicationModel.cpp:400
Settings
Definition: ApplicationModel.h:87
QString feedback
Definition: ApplicationModel.h:50
Q_INVOKABLE void enableWifi() const
Definition: ApplicationModel.cpp:443
void fireApplicationStateChanged(bool pIsAppInForeground)
Q_INVOKABLE void keepScreenOn(bool pActive) const
Definition: ApplicationModel.cpp:344
QmlNfcState
Definition: ApplicationModel.h:107
QmlNfcState nfcState
Definition: ApplicationModel.h:42
Workflow
Definition: ApplicationModel.h:96
bool wifiEnabled
Definition: ApplicationModel.h:45
void resetContext(const QSharedPointer< WorkflowContext > &pContext=QSharedPointer< WorkflowContext >())
Definition: ApplicationModel.cpp:83
QUrl getReleaseNotesUrl() const
Definition: ApplicationModel.cpp:129
QUrl releaseNotesUrl
Definition: ApplicationModel.h:40
Workflow getCurrentWorkflow() const
Definition: ApplicationModel.cpp:190
void onTranslationChanged()
Definition: ApplicationModel.cpp:437
Q_INVOKABLE void showSettings(const Settings &pAction) const
Definition: ApplicationModel_android.cpp:40
Workflow currentWorkflow
Definition: ApplicationModel.h:47
Q_INVOKABLE void onShowNextFeedback()
Definition: ApplicationModel.cpp:269
bool isExtendedLengthApdusUnsupported() const
Definition: ApplicationModel.cpp:166
bool extendedLengthApdusUnsupported
Definition: ApplicationModel.h:43
Q_INVOKABLE void setClipboardText(const QString &pText) const
Definition: ApplicationModel.cpp:281
QmlNfcState getNfcState() const
Definition: ApplicationModel.cpp:137
QString getStoreUrl() const
Definition: ApplicationModel.cpp:108
qsizetype getAvailableReader() const
Definition: ApplicationModel.cpp:218
Q_INVOKABLE bool isScreenReaderRunning() const
Definition: ApplicationModel.cpp:246
QString getFeedback() const
Definition: ApplicationModel.cpp:263
Definition: Env.h:42
Definition: WifiInfo.h:21
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16