AusweisApp2
Lade ...
Suche ...
Keine Treffer
AppUpdater.h
gehe zur Dokumentation dieser Datei
1
5#pragma once
6
7#include "AppUpdateData.h"
8#include "Env.h"
9#include "GlobalStatus.h"
10
11#include <QDateTime>
12#include <QUrl>
13
14class test_AppUpdatr;
15
16namespace governikus
17{
19 : public QObject
20{
21 Q_OBJECT
22
23 private:
24 friend class Env;
25 friend class ::test_AppUpdatr;
26
27 bool mForceUpdate;
28 QUrl mAppUpdateJsonUrl;
29 AppUpdateData mAppUpdateData;
30 QString mDownloadPath;
31 bool mDownloadInProgress;
32
33 static QCryptographicHash::Algorithm getHashAlgo(const QByteArray& pAlgo);
34
35 AppUpdater();
36 ~AppUpdater() override = default;
37
38 void clearDownloaderConnection();
39 bool download(const QUrl& pUrl);
40 QString save(const QByteArray& pData, const QString& pFilename);
41
42 public:
43 bool abortDownload();
44 bool downloadUpdate();
45 bool checkAppUpdate(bool pForceUpdate = false);
46 [[nodiscard]] const AppUpdateData& getUpdateData() const;
47 void skipVersion(const QString& pVersion);
48
49#ifndef QT_NO_DEBUG
50 [[nodiscard]] QString getDownloadPath() const;
51 void setDownloadPath(const QString& pPath);
52#endif
53
54 private Q_SLOTS:
55 void onDownloadFinished(const QUrl& pUpdateUrl, const QDateTime& pNewTimestamp, const QByteArray& pData);
56 void onDownloadFailed(const QUrl& pUpdateUrl, GlobalStatus::Code pErrorCode);
57 void onDownloadUnnecessary(const QUrl& pUpdateUrl);
58 void onDownloadProgress(const QUrl& pUpdateUrl, qint64 pBytesReceived, qint64 pBytesTotal);
59
60 Q_SIGNALS:
61 void fireAppcastCheckFinished(bool pUpdateAvailable, const GlobalStatus& pError);
63 void fireAppDownloadProgress(qint64 pBytesReceived, qint64 pBytesTotal);
64};
65
66} // namespace governikus
Definition: AppUpdateData.h:22
Definition: AppUpdater.h:20
QString getDownloadPath() const
Definition: AppUpdater.cpp:131
void setDownloadPath(const QString &pPath)
Definition: AppUpdater.cpp:137
void fireAppcastCheckFinished(bool pUpdateAvailable, const GlobalStatus &pError)
void skipVersion(const QString &pVersion)
Definition: AppUpdater.cpp:123
bool downloadUpdate()
Definition: AppUpdater.cpp:104
void fireAppDownloadProgress(qint64 pBytesReceived, qint64 pBytesTotal)
void fireAppDownloadFinished(const GlobalStatus &pError)
const AppUpdateData & getUpdateData() const
Definition: AppUpdater.cpp:117
bool abortDownload()
Definition: AppUpdater.cpp:93
bool checkAppUpdate(bool pForceUpdate=false)
Definition: AppUpdater.cpp:36
Definition: Env.h:44
Definition: GlobalStatus.h:20
Code
Definition: GlobalStatus.h:26
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15