AusweisApp2
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 
17 class test_HistorySettings;
18 
19 
20 namespace governikus
21 {
22 
23 defineEnumType(TimePeriod,
24  PAST_HOUR,
25  PAST_DAY,
26  PAST_WEEK,
27  LAST_FOUR_WEEKS,
28  ALL_HISTORY,
29  UNKNOWN
30  )
31 
32 class 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 
48  [[nodiscard]] bool isEnabled() const;
49  void setEnabled(bool pEnabled);
50 
51  [[nodiscard]] const QVector<HistoryInfo>& getHistoryInfos() const;
52  void setHistoryInfos(const QVector<HistoryInfo>& pHistoryInfos);
53  void addHistoryInfo(const HistoryInfo& pHistoryInfo);
54  int deleteSettings(const QDateTime& pLatestToKeep = QDateTime());
55  int deleteSettings(const TimePeriod& pPeriodToRemove);
56 
57  Q_SIGNALS:
58  void fireEnabledChanged(bool pValue);
59  void fireHistoryInfosChanged();
60 };
61 
62 
63 } // namespace governikus
A simple template renderer.
Definition: ActivationContext.h:15
UNKNOWN
Definition: ResponseApdu.h:63
defineEnumType(ActivationType, UNKNOWN, SHOWUI, STATUS, TCTOKENURL) defineEnumType(StatusFormat
Format types for status responses.