KItinerary

ticket.h
1 /*
2  SPDX-FileCopyrightText: 2018 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 "datatypes.h"
11 
12 namespace KItinerary {
13 
14 class SeatPrivate;
15 
16 /** A reserved seat.
17  * @see https://schema.org/Seat
18  */
19 class KITINERARY_EXPORT Seat
20 {
21  KITINERARY_GADGET(Seat)
22  KITINERARY_PROPERTY(QString, seatNumber, setSeatNumber)
23  KITINERARY_PROPERTY(QString, seatRow, setSeatRow)
24  KITINERARY_PROPERTY(QString, seatSection, setSeatSection)
25  KITINERARY_PROPERTY(QString, seatingType, setSeatingType)
26 private:
28 };
29 
30 class TicketPrivate;
31 
32 /** A booked ticket.
33  * @see https://schema.org/Ticket
34  */
35 class KITINERARY_EXPORT Ticket
36 {
37  KITINERARY_GADGET(Ticket)
38  KITINERARY_PROPERTY(QString, name, setName)
39  KITINERARY_PROPERTY(KItinerary::Seat, ticketedSeat, setTicketedSeat)
40  /** The raw ticket token string.
41  * @see ticketTokenType, ticketTokenData
42  */
43  KITINERARY_PROPERTY(QString, ticketToken, setTicketToken)
44 
45  /** The type of the content in ticketToken. */
46  Q_PROPERTY(TicketTokenType ticketTokenType READ ticketTokenType STORED false)
47  /** The ticket token payload for barcodes, otherwise the same as ticketToken.
48  * For binary content barcodes this is a QByteArray, otherwise a QString.
49  */
50  Q_PROPERTY(QVariant ticketTokenData READ ticketTokenData STORED false)
51 
52 public:
53  /** The type of content in the ticketToken property. */
55  Unknown, ///< Unknown or empty ticket token
56  Url, ///< A download URL
57  QRCode, ///< QR code
58  AztecCode, ///< Aztec code
59  Code128, ///< Code 128 barcode
60  DataMatrix, ///< A DataMatrix barcode
61  PDF417, ///< A PDF417 barcode
62  };
63  Q_ENUM(TicketTokenType)
64 
65  TicketTokenType ticketTokenType() const;
66  QVariant ticketTokenData() const;
67 private:
68  QExplicitlySharedDataPointer<TicketPrivate> d;
69 };
70 
71 }
72 
73 Q_DECLARE_METATYPE(KItinerary::Seat)
74 Q_DECLARE_METATYPE(KItinerary::Ticket)
75 
A download URL.
Definition: ticket.h:56
Classes for reservation/travel data models, data extraction and data augmentation.
Unknown or empty ticket token.
Definition: ticket.h:55
A DataMatrix barcode.
Definition: ticket.h:60
const QLatin1String name
TicketTokenType
The type of content in the ticketToken property.
Definition: ticket.h:54
A booked ticket.
Definition: ticket.h:35
A PDF417 barcode.
Definition: ticket.h:61
A reserved seat.
Definition: ticket.h:19
Code 128 barcode.
Definition: ticket.h:59
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Jan 25 2022 23:06:15 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.