AusweisApp2
Service.h
gehe zur Dokumentation dieser Datei
1 
5 #pragma once
6 
7 #include "AppUpdater.h"
8 #include "Env.h"
9 
10 #include <QTimer>
11 
12 namespace governikus
13 {
14 class Service
15  : public QObject
16 {
17  Q_OBJECT
18  friend class Env;
19 
20  private:
21  enum class UpdateType
22  {
23  APPCAST, PROVIDER, READER
24  };
25 
26  QTimer mTimer;
27  bool mUpdateScheduled;
28  bool mExplicitSuccessMessage;
29  const int mOneDayInMs = 1000 * 60 * 60 * 24;
30 
31  Service();
32  ~Service() override = default;
33  void doAppUpdate(UpdateType pType, bool pForceUpdate = false);
34 
35  private Q_SLOTS:
36  void onTimedUpdateTriggered();
37  void onProviderUpdateFinished();
38  void onAppcastFinished(bool pUpdateAvailable, const GlobalStatus& pError);
39 
40  public:
41  void updateAppcast();
42  [[nodiscard]] bool isUpdateScheduled() const;
43  Q_INVOKABLE void runUpdateIfNeeded();
44  [[nodiscard]] const AppUpdateData& getUpdateData() const;
45 
46  Q_SIGNALS:
47  void fireAppcastFinished(bool pUpdateAvailable, const GlobalStatus& pError);
49 };
50 
51 } // namespace governikus
AppUpdateData.h
governikus::READER
READER
Definition: MsgTypes.h:22
governikus::Service::getUpdateData
const AppUpdateData & getUpdateData() const
Definition: Service.cpp:115
governikus::GlobalStatus::isNoError
bool isNoError() const
governikus::Service::fireUpdateScheduled
void fireUpdateScheduled()
governikus::GlobalStatus::Code::Downloader_Missing_Platform
@ Downloader_Missing_Platform
AppSettings.h
ReaderConfiguration.h
governikus::Env
Definition: Env.h:44
Service.h
governikus::Service
Definition: Service.h:16
governikus::AppUpdater::fireAppcastCheckFinished
void fireAppcastCheckFinished(bool pUpdateAvailable, const GlobalStatus &pError)
governikus::Service::updateAppcast
void updateAppcast()
Definition: Service.cpp:91
governikus
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15
AppUpdater.h
governikus::ProviderConfiguration::fireNoUpdateAvailable
void fireNoUpdateAvailable()
governikus::AppUpdateData
Definition: AppUpdateData.h:22
Env.h
governikus::Service::runUpdateIfNeeded
Q_INVOKABLE void runUpdateIfNeeded()
Definition: Service.cpp:103
governikus::GlobalStatus
Definition: GlobalStatus.h:20
governikus::ProviderConfiguration::fireUpdated
void fireUpdated()
ProviderConfiguration.h
governikus::GlobalStatus::isError
bool isError() const
governikus::Service::fireAppcastFinished
void fireAppcastFinished(bool pUpdateAvailable, const GlobalStatus &pError)
governikus::GlobalStatus::getStatusCode
Code getStatusCode() const
governikus::Service::isUpdateScheduled
bool isUpdateScheduled() const
Definition: Service.cpp:97