AusweisApp2
Lade ...
Suche ...
Keine Treffer
HistorySettings.h
gehe zur Dokumentation dieser Datei
1
7#pragma once
8
9#include "AbstractSettings.h"
10
11#include "EnumHelper.h"
12#include "HistoryInfo.h"
13
14#include <QVector>
15
16
17class test_HistorySettings;
18
19
20namespace governikus
21{
22
23defineEnumType(TimePeriod,
24 PAST_HOUR,
25 PAST_DAY,
26 PAST_WEEK,
27 LAST_FOUR_WEEKS,
28 ALL_HISTORY,
30 )
31
32class HistorySettings
33 : public AbstractSettings
34{
35 Q_OBJECT
36 friend class AppSettings;
37
38 private:
39 QSharedPointer<QSettings> mStore;
40 QVector<HistoryInfo> mHistoryInfos;
41
42 HistorySettings();
43 [[nodiscard]] QVector<HistoryInfo> getHistoryInfosFromStore() const;
44
45 public:
46 ~HistorySettings() override = default;
47 void save() override;
48
49 [[nodiscard]] bool isEnabled() const;
50 void setEnabled(bool pEnabled);
51
52 [[nodiscard]] const QVector<HistoryInfo>& getHistoryInfos() const;
53 void setHistoryInfos(const QVector<HistoryInfo>& pHistoryInfos);
54 void addHistoryInfo(const HistoryInfo& pHistoryInfo);
55 int deleteSettings(const QDateTime& pLatestToKeep = QDateTime());
56 int deleteSettings(const TimePeriod& pPeriodToRemove);
57
58 Q_SIGNALS:
59 void fireEnabledChanged(bool pValue);
60 void fireHistoryInfosChanged();
61};
62
63
64} // namespace governikus
#define defineEnumType(enumName,...)
Definition: EnumHelper.h:96
A simple template renderer.
Definition: ActivationContext.h:15
UNKNOWN
Definition: ResponseApdu.h:63