KItinerary

uic9183flex.h
1/*
2 SPDX-FileCopyrightText: 2025 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6#ifndef KITINERARY_UIC9183FLEX_H
7#define KITINERARY_UIC9183FLEX_H
8
9#include "kitinerary_export.h"
10#include "uic9183block.h"
11
12#include "era/fcbticket.h"
13
14namespace KItinerary {
15
16class Uic9183FlexPrivate;
17
18/** Represents a U_FLEX block holding different versions of an FCB payload.
19 * @see ERA TAP TSI TD B.12 Digital Security Elements For Rail Passenger Ticketing - ยง11 FCB - Flexible Content Barcode
20 */
21class KITINERARY_EXPORT Uic9183Flex
22{
23 Q_GADGET
24 Q_PROPERTY(QVariant fcb READ fcbVariant)
25
26public:
27 Uic9183Flex();
28 /** Parse U_FLEX block in @p data.
29 * It's the callers responsibility to ensure @p data outlives this instance, the data
30 * is not copied.
31 * @param block A UIC 918.3 U_FLEX data block
32 */
33 Uic9183Flex(const Uic9183Block &block);
34 Uic9183Flex(const Uic9183Flex&);
35 ~Uic9183Flex();
36 Uic9183Flex& operator=(const Uic9183Flex&);
37
38 /** Returns whether this is a valid U_FLEX layout block. */
39 [[nodiscard]] bool isValid() const;
40
41 /** Issuing date/time. */
42 [[nodiscard]] QDateTime issuingDateTime() const;
43
44 /** @c true when this is a valid FCB with at least one transport document. */
45 [[nodiscard]] bool hasTransportDocument() const;
46 /** Transport documents of the contained FCB. */
47 [[nodiscard]] QList<QVariant> transportDocuments() const;
48
49 /** Returns the FCB payload.
50 * Varies depending on the version of this block.
51 */
52 [[nodiscard]] const Fcb::UicRailTicketData& fcb() const;
53
54 static constexpr const char RecordId[] = "U_FLEX";
55
56private:
57 [[nodiscard]] QVariant fcbVariant() const;
58
60};
61
62}
63
64#endif
A data block from a UIC 918.3 ticket.
QDateTime issuingDateTime() const
Issuing date/time.
bool isValid() const
Returns whether this is a valid U_FLEX layout block.
QList< QVariant > transportDocuments() const
Transport documents of the contained FCB.
bool hasTransportDocument() const
true when this is a valid FCB with at least one transport document.
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-2025 The KDE developers.
Generated on Fri Mar 28 2025 11:59:50 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.