AusweisApp2/src/services/Service.h

50 lines
1.0 KiB
C
Raw Normal View History

2017-12-20 14:54:05 +01:00
/*!
2019-05-22 10:08:38 +02:00
* \copyright Copyright (c) 2017-2019 Governikus GmbH & Co. KG, Germany
2017-12-20 14:54:05 +01:00
*/
#pragma once
#include "AppUpdater.h"
2019-01-03 15:06:22 +01:00
#include "Env.h"
2017-12-20 14:54:05 +01:00
#include <QTimer>
namespace governikus
{
class Service
: public QObject
{
Q_OBJECT
2019-01-03 15:06:22 +01:00
friend class Env;
2017-12-20 14:54:05 +01:00
private:
QTimer mTimer;
bool mUpdateScheduled;
bool mExplicitSuccessMessage;
const int mOneDayInMs = 1000 * 60 * 60 * 24;
protected:
Service();
2019-01-03 15:06:22 +01:00
virtual ~Service() = default;
static Service& getInstance();
2017-12-20 14:54:05 +01:00
private Q_SLOTS:
void doConfigurationsUpdate();
void doAppUpdate(bool pIgnoreNextVersionskip);
void onTimedUpdateTriggered();
void onAppUpdateFinished(bool pUpdateAvailable, const GlobalStatus& pError);
public:
void updateConfigurations();
void updateApp(bool pIgnoreNextVersionskip = false);
bool isUpdateScheduled();
void runUpdateIfNeeded();
const AppUpdateData& getUpdateData() const;
Q_SIGNALS:
void fireAppUpdateFinished(bool pUpdateAvailable, const GlobalStatus& pError);
void fireUpdateScheduled();
};
2019-01-03 15:06:22 +01:00
} // namespace governikus