AusweisApp2
CallCost.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include <QDebug>
10 #include <QJsonValue>
11 
12 
13 namespace governikus
14 {
15 
16 class CallCost
17 {
18  friend bool operator==(const CallCost& pLeft, const CallCost& pRight);
19 
20  int mFreeSeconds;
21  double mLandlineCentsPerMinute, mLandlineCentsPerCall;
22  double mMobileCentsPerMinute, mMobileCentsPerCall;
23 
24  public:
25  explicit CallCost(int pFreeSeconds = 0, double pLandlineCentsPerMinute = 0.0, double pLandlineCentsPerCall = 0.0, double pMobileCentsPerMinute = 0.0, double pMobileCentsPerCall = 0.0);
26  explicit CallCost(const QJsonValue& pJson);
27 
28  void load();
29  void save();
30 
31  [[nodiscard]] bool isNull() const;
32  [[nodiscard]] int getFreeSeconds() const;
33  [[nodiscard]] double getLandlineCentsPerMinute() const;
34  [[nodiscard]] double getLandlineCentsPerCall() const;
35  [[nodiscard]] double getMobileCentsPerMinute() const;
36  [[nodiscard]] double getMobileCentsPerCall() const;
37 };
38 
39 
40 inline bool operator==(const CallCost& pLeft, const CallCost& pRight)
41 {
42  return &pLeft == &pRight || (
43  pLeft.mFreeSeconds == pRight.mFreeSeconds &&
44  pLeft.mLandlineCentsPerMinute == pRight.mLandlineCentsPerMinute &&
45  pLeft.mLandlineCentsPerCall == pRight.mLandlineCentsPerCall &&
46  pLeft.mMobileCentsPerMinute == pRight.mMobileCentsPerMinute &&
47  pLeft.mMobileCentsPerCall == pRight.mMobileCentsPerCall);
48 }
49 
50 
51 } // namespace governikus
52 
53 QDebug operator<<(QDebug pDbg, const governikus::CallCost& pCallCost);
double getLandlineCentsPerMinute() const
Definition: CallCost.cpp:55
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:14
double getLandlineCentsPerCall() const
Definition: CallCost.cpp:61
int getFreeSeconds() const
Definition: CallCost.cpp:49
friend bool operator==(const CallCost &pLeft, const CallCost &pRight)
Definition: CallCost.h:40
Definition: CallCost.h:16
bool operator==(const CVCertificate &pLeft, const CVCertificate &pRight)
Definition: CVCertificate.h:72
CallCost(int pFreeSeconds=0, double pLandlineCentsPerMinute=0.0, double pLandlineCentsPerCall=0.0, double pMobileCentsPerMinute=0.0, double pMobileCentsPerCall=0.0)
Definition: CallCost.cpp:23
double getMobileCentsPerCall() const
Definition: CallCost.cpp:73
QDebug operator<<(QDebug pDbg, const governikus::CallCost &pCallCost)
Definition: CallCost.cpp:79
double getMobileCentsPerMinute() const
Definition: CallCost.cpp:67
bool isNull() const
Definition: CallCost.cpp:43