KItinerary

ssbv2ticket.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 "ssbticketbase.h"
11 
12 #include <QMetaType>
13 
14 namespace KItinerary {
15 
16 /** ERA SSB ticket barcode (version 2).
17  * @see ERA TAP TSI TD B.12 - ยง15 Appendix B - SSB - old version
18  */
19 class KITINERARY_EXPORT SSBv2Ticket : protected SSBTicketBase
20 {
21  Q_GADGET
22  SSB_NUM_PROPERTY(version, 0, 4)
23  SSB_NUM_PROPERTY(issuerCode, 4, 14)
24  SSB_NUM_PROPERTY(publicKeyVersion, 18, 4)
25  SSB_NUM_PROPERTY(rct2TypeIndicator, 22, 1)
26  SSB_NUM_PROPERTY(numberOfTickets, 23, 6)
27  SSB_NUM_PROPERTY(numberOfAdultPassengers, 29, 7)
28  SSB_NUM_PROPERTY(numberOfChildPassengers, 36, 7)
29  SSB_NUM_PROPERTY(firstDayOfValidity, 43, 9)
30  SSB_NUM_PROPERTY(lastDayOfValidity, 52, 9)
31  SSB_NUM_PROPERTY(customerNumberType, 61, 1)
32  SSB_LONG_PROPERTY(customerNumber, 62, 47)
33  SSB_NUM_PROPERTY(departureStationType, 109, 1)
34  SSB_NUM_PROPERTY(departureStationNum, 110, 30)
35  SSB_STR_PROPERTY(departureStationAlpha, 110, 5)
36  SSB_NUM_PROPERTY(arrivalStationType, 140, 1)
37  SSB_NUM_PROPERTY(arrivalStationNum, 141, 30)
38  SSB_STR_PROPERTY(arrivalStationAlpha, 141, 5)
39  SSB_NUM_PROPERTY(departureTime, 171, 6)
40  SSB_NUM_PROPERTY(trainNumber, 177, 25) // alpha 5 encoding??
41  SSB_LONG_PROPERTY(reservationReference, 202, 40)
42  SSB_NUM_PROPERTY(classOfTransport, 242, 6)
43  SSB_NUM_PROPERTY(coachNumber, 248, 10)
44  SSB_NUM_PROPERTY(seatNumber, 258, 7) // 250 in trenitalia??
45  SSB_STR_PROPERTY(berthNumber, 265, 1)
46  SSB_NUM_PROPERTY(overbookingIndicator, 211, 1)
47  SSB_STR_PROPERTY(issuerPNRNumber, 272, 7)
48  SSB_NUM_PROPERTY(ticketType, 314, 4)
49  SSB_NUM_PROPERTY(specimen, 318, 1)
50  SSB_STR_PROPERTY(viaStations, 319, 5) // is that the correct encoding? page 131 of TAP TSI Annex B.6 could also be read as 6 times 5 bit content
51  SSB_NUM_PROPERTY(railwayCarrierCode, 349, 14)
52  SSB_STR_PROPERTY(reference, 363, 8)
53 
54  Q_PROPERTY(QByteArray rawData READ rawData STORED false)
55 
56 public:
57  SSBv2Ticket();
58  explicit SSBv2Ticket(const QByteArray &data);
59  ~SSBv2Ticket();
60 
61  /** Returns @c true if this is a valid SSB ticket. */
62  bool isValid() const;
63 
64  /** Raw barcode data. */
65  QByteArray rawData() const;
66 
67  /** Returns @c true if @p data might be an ERA SSB ticket. */
68  static bool maybeSSB(const QByteArray &data);
69 };
70 
71 }
72 
73 Q_DECLARE_METATYPE(KItinerary::SSBv2Ticket)
74 
Classes for reservation/travel data models, data extraction and data augmentation.
Internal base class for ERA SSB tickets.
Definition: ssbticketbase.h:19
ERA SSB ticket barcode (version 2).
Definition: ssbv2ticket.h:19
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Jan 17 2022 23:06:16 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.