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;
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
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15
UNKNOWN
Definition: SmartCardDefinitions.h:18
defineEnumType(ActivationType, UNKNOWN, SHOWUI, STATUS, TCTOKENURL) defineEnumType(StatusFormat
Format types for status responses.