KItinerary

iatabcbp.h
1/*
2 SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
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
15namespace KItinerary {
16
17/**
18 * A IATA BarCoded Boarding Pass (BCBP)
19 */
20class 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)
28public:
29 IataBcbp();
30 explicit IataBcbp(const QString &data);
31 ~IataBcbp();
32
33 [[nodiscard]] bool isValid() const;
34
35 [[nodiscard]] IataBcbpUniqueMandatorySection uniqueMandatorySection() const;
36 [[nodiscard]] bool hasUniqueConditionalSection() const;
37 [[nodiscard]] IataBcbpUniqueConditionalSection uniqueConditionalSection() const;
38
39 /** Mandatory section of @p leg. */
40 Q_INVOKABLE [[nodiscard]] KItinerary::IataBcbpRepeatedMandatorySection repeatedMandatorySection(int leg) const;
41 /** Conditional (optional) section of @p leg. */
42 Q_INVOKABLE [[nodiscard]] KItinerary::IataBcbpRepeatedConditionalSection repeatedConditionalSection(int leg) const;
43 /** Airline use (non-standard/vendor specific) section of @p leg. */
44 Q_INVOKABLE [[nodiscard]] QString airlineUseSection(int leg) const;
45
46 [[nodiscard]] bool hasSecuritySection() const;
47 [[nodiscard]] IataBcbpSecuritySection securitySection() const;
48
49 /** Raw data, for generating barcodes out of this again. */
50 [[nodiscard]] QString rawData() const;
51
52 /** Fast checks whether this might be an IATA BCBP. */
53 [[nodiscard]] static bool maybeIataBcbp(const QByteArray &data);
54 [[nodiscard]] static bool maybeIataBcbp(const QString &data);
55
56private:
57 QString m_data;
58};
59
60}
61
Conditional (optional) sections of an IATA BCBP, occurs once per leg.
Repeated mandatory sections of an IATA BCBP, occurs once per leg.
Security section of an IATA BCBP.
Unique conditional (optional) section of an IATA BCBP.
Unique mandatory section of an IATA BCBP.
A IATA BarCoded Boarding Pass (BCBP)
Definition iatabcbp.h:21
Classes for reservation/travel data models, data extraction and data augmentation.
Definition berelement.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:14:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.