AusweisApp2/src/settings/HistorySettings.h

64 lines
1.1 KiB
C
Raw Normal View History

2017-07-03 09:30:10 +02:00
/*!
* \brief Represents history settings.
*
2018-03-28 15:10:51 +02:00
* \copyright Copyright (c) 2015-2018 Governikus GmbH & Co. KG, Germany
2017-07-03 09:30:10 +02:00
*/
#pragma once
#include "AbstractSettings.h"
2018-03-28 15:10:51 +02:00
#include "EnumHelper.h"
2017-12-20 14:54:05 +01:00
#include "HistoryInfo.h"
2017-07-03 09:30:10 +02:00
#include <QVector>
2017-12-20 14:54:05 +01:00
2017-07-03 09:30:10 +02:00
class test_HistorySettings;
2017-12-20 14:54:05 +01:00
namespace governikus
2017-07-03 09:30:10 +02:00
{
2018-03-28 15:10:51 +02:00
defineEnumType(TimePeriod,
PAST_HOUR,
PAST_DAY,
PAST_WEEK,
LAST_FOUR_WEEKS,
ALL_HISTORY,
UNKNOWN
)
2017-07-03 09:30:10 +02:00
class HistorySettings
: public AbstractSettings
{
Q_OBJECT
friend class AppSettings;
2017-09-15 10:23:30 +02:00
friend class ::test_HistorySettings;
2017-07-03 09:30:10 +02:00
private:
2017-12-20 14:54:05 +01:00
QSharedPointer<QSettings> mStore;
2017-07-03 09:30:10 +02:00
HistorySettings();
public:
2017-12-20 14:54:05 +01:00
virtual ~HistorySettings() override;
2017-07-03 09:30:10 +02:00
virtual void save() override;
bool isEnabled() const;
void setEnabled(bool pEnabled);
2017-12-20 14:54:05 +01:00
QVector<HistoryInfo> getHistoryInfos() const;
void setHistoryInfos(const QVector<HistoryInfo>& pHistoryInfos);
void addHistoryInfo(const HistoryInfo& pHistoryInfo);
2018-03-28 15:10:51 +02:00
int deleteSettings(const QDateTime& pLatestToKeep = QDateTime());
int deleteSettings(const TimePeriod& pPeriodToRemove);
2017-07-03 09:30:10 +02:00
Q_SIGNALS:
2017-12-20 14:54:05 +01:00
void fireEnabledChanged(bool pValue);
void fireHistoryInfosChanged();
2017-07-03 09:30:10 +02:00
};
} /* namespace governikus */