KItinerary

iatabcbp.h
1 /*
2  SPDX-FileCopyrightText: 2021 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "kitinerary_export.h"
10 #include "iatabcbpsections.h"
11 
12 #include <QMetaType>
13 #include <QString>
14 
15 namespace KItinerary {
16 
17 /**
18  * A IATA BarCoded Boarding Pass (BCBP)
19  */
20 class KITINERARY_EXPORT IataBcbp
21 {
22  Q_GADGET
23  Q_PROPERTY(KItinerary::IataBcbpUniqueMandatorySection uniqueMandatorySection READ uniqueMandatorySection)
24  Q_PROPERTY(KItinerary::IataBcbpUniqueConditionalSection uniqueConditionalSection READ uniqueConditionalSection)
25  Q_PROPERTY(KItinerary::IataBcbpSecuritySection securitySection READ securitySection)
26 
27  Q_PROPERTY(QString rawData READ rawData STORED false)
28 public:
29  IataBcbp();
30  explicit IataBcbp(const QString &data);
31  ~IataBcbp();
32 
33  bool isValid() const;
34 
35  IataBcbpUniqueMandatorySection uniqueMandatorySection() const;
36  bool hasUniqueConditionalSection() const;
37  IataBcbpUniqueConditionalSection uniqueConditionalSection() const;
38 
39  /** Mandatory section of @p leg. */
40  Q_INVOKABLE KItinerary::IataBcbpRepeatedMandatorySection repeatedMandatorySection(int leg) const;
41  /** Conditional (optional) section of @p leg. */
42  Q_INVOKABLE KItinerary::IataBcbpRepeatedConditionalSection repeatedConditionalSection(int leg) const;
43  /** Airline use (non-standard/vendor specific) section of @p leg. */
44  Q_INVOKABLE QString airlineUseSection(int leg) const;
45 
46  bool hasSecuritySection() const;
47  IataBcbpSecuritySection securitySection() const;
48 
49  /** Raw data, for generating barcodes out of this again. */
50  QString rawData() const;
51 
52  /** Fast checks whether this might be an IATA BCBP. */
53  static bool maybeIataBcbp(const QByteArray &data);
54  static bool maybeIataBcbp(const QString &data);
55 
56 private:
57  QString m_data;
58 };
59 
60 }
61 
62 Q_DECLARE_METATYPE(KItinerary::IataBcbp)
63 
Unique mandatory section of an IATA BCBP.
Repeated mandatory sections of an IATA BCBP, occurs once per leg.
Conditional (optional) sections of an IATA BCBP, occurs once per leg.
Security section of an IATA BCBP.
A IATA BarCoded Boarding Pass (BCBP)
Definition: iatabcbp.h:20
Unique conditional (optional) section of an IATA BCBP.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Wed Sep 28 2022 04:03:03 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.