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 #include "organization.h"
12 #include "person.h"
13 #include "token.h"
14 
15 namespace KItinerary {
16 
17 class SeatPrivate;
18 
19 /** A reserved seat.
20  * @see https://schema.org/Seat
21  */
22 class KITINERARY_EXPORT Seat
23 {
24  KITINERARY_GADGET(Seat)
25  KITINERARY_PROPERTY(QString, seatNumber, setSeatNumber)
26  KITINERARY_PROPERTY(QString, seatRow, setSeatRow)
27  KITINERARY_PROPERTY(QString, seatSection, setSeatSection)
28  KITINERARY_PROPERTY(QString, seatingType, setSeatingType)
29 private:
31 };
32 
33 class TicketPrivate;
34 
35 /** A booked ticket.
36  * @see https://schema.org/Ticket
37  */
38 class KITINERARY_EXPORT Ticket
39 {
40  KITINERARY_GADGET(Ticket)
41  KITINERARY_PROPERTY(QString, name, setName)
42  KITINERARY_PROPERTY(KItinerary::Organization, issuedBy, setIssuedBy)
43  KITINERARY_PROPERTY(QString, ticketNumber, setTicketNumber)
44  KITINERARY_PROPERTY(KItinerary::Seat, ticketedSeat, setTicketedSeat)
45  /** The raw ticket token string.
46  * @see ticketTokenType, ticketTokenData
47  */
48  KITINERARY_PROPERTY(QString, ticketToken, setTicketToken)
49 
50  /** The type of the content in ticketToken. */
51  Q_PROPERTY(KItinerary::Token::TokenType ticketTokenType READ ticketTokenType STORED false)
52  /** The ticket token payload for barcodes, otherwise the same as ticketToken.
53  * For binary content barcodes this is a QByteArray, otherwise a QString.
54  */
55  Q_PROPERTY(QVariant ticketTokenData READ ticketTokenData STORED false)
56 
57  KITINERARY_PROPERTY(KItinerary::Person, underName, setUnderName)
58 
59  /** Non-standard extension for ticket validity time ranges. */
60  KITINERARY_PROPERTY(QDateTime, validFrom, setValidFrom)
61  KITINERARY_PROPERTY(QDateTime, validUntil, setValidUntil)
62 
63 public:
64  /** The type of content in the ticketToken property.
65  * @deprecated Use Token::TokenType instead.
66  */
68  Unknown = Token::Unknown, ///< Unknown or empty ticket token
69  Url = Token::Url, ///< A download URL
70  QRCode = Token::QRCode, ///< QR code
71  AztecCode = Token::AztecCode, ///< Aztec code
72  Code128 = Token::Code128, ///< Code 128 barcode
73  DataMatrix = Token::DataMatrix, ///< A DataMatrix barcode
74  PDF417 = Token::PDF417, ///< A PDF417 barcode
75  };
76  Q_ENUM(TicketTokenType)
77 
78  Token::TokenType ticketTokenType() const;
79  QVariant ticketTokenData() const;
80 private:
82 };
83 
84 }
85 
86 Q_DECLARE_METATYPE(KItinerary::Seat)
87 Q_DECLARE_METATYPE(KItinerary::Ticket)
88 
A booked ticket.
Definition: ticket.h:38
@ Url
A download URL, if shown in a barcode its format can be determined by the application.
Definition: token.h:30
Barcode token utilities.
Definition: token.h:23
@ Code128
Code 128 barcode.
Definition: token.h:33
A person.
Definition: person.h:19
@ AztecCode
Aztec code. Binary content is handled transparently by tokenData().
Definition: token.h:32
TokenType
Token format.
Definition: token.h:28
TicketTokenType
Non-standard extension for ticket validity time ranges.
Definition: ticket.h:67
@ QRCode
QR code.
Definition: token.h:31
An organization.
Definition: organization.h:30
A reserved seat.
Definition: ticket.h:22
@ PDF417
A PDF417 barcode.
Definition: token.h:35
@ DataMatrix
A DataMatrix barcode.
Definition: token.h:34
@ Unknown
Unknown or empty ticket token.
Definition: token.h:29
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Jul 4 2022 04:04:45 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.