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  APP, PROVIDER, READER
24  };
25 
26  QTimer mTimer;
27  bool mUpdateScheduled;
28  bool mExplicitSuccessMessage;
29  const int mOneDayInMs = 1000 * 60 * 60 * 24;
30 
31  void doAppUpdate(UpdateType pType, bool pForceUpdate = false);
32 
33  private Q_SLOTS:
34  void onTimedUpdateTriggered();
35  void onProviderUpdateFinished();
36  void onAppUpdateFinished(bool pUpdateAvailable, const GlobalStatus& pError);
37 
38  protected:
39  Service();
40  virtual ~Service() = default;
41  static Service& getInstance();
42 
43  public:
44  void updateApp();
45  bool isUpdateScheduled();
46  Q_INVOKABLE void runUpdateIfNeeded();
47  const AppUpdateData& getUpdateData() const;
48 
49  Q_SIGNALS:
50  void fireAppUpdateFinished(bool pUpdateAvailable, const GlobalStatus& pError);
51  void fireUpdateScheduled();
52 };
53 
54 } // namespace governikus
READER
Definition: MsgTypes.h:16
Definition: GlobalStatus.h:19
bool isUpdateScheduled()
Definition: Service.cpp:108
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:14
Definition: Service.h:14
Service()
Definition: Service.cpp:81
Definition: AppUpdateData.h:19
void fireAppUpdateFinished(bool pUpdateAvailable, const GlobalStatus &pError)
Q_INVOKABLE void runUpdateIfNeeded()
Definition: Service.cpp:114
const AppUpdateData & getUpdateData() const
Definition: Service.cpp:124
void updateApp()
Definition: Service.cpp:102
virtual ~Service()=default
Definition: Env.h:38
static Service & getInstance()
Definition: Service.cpp:96