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 
30  KITINERARY_PROPERTY(QString, identifier, setIdentifier)
31 private:
33 };
34 
35 class TicketPrivate;
36 
37 /** A booked ticket.
38  * @see https://schema.org/Ticket
39  */
40 class KITINERARY_EXPORT Ticket
41 {
42  KITINERARY_GADGET(Ticket)
43  KITINERARY_PROPERTY(QString, name, setName)
44  KITINERARY_PROPERTY(KItinerary::Organization, issuedBy, setIssuedBy)
45  KITINERARY_PROPERTY(QString, ticketNumber, setTicketNumber)
46  KITINERARY_PROPERTY(KItinerary::Seat, ticketedSeat, setTicketedSeat)
47  /** The raw ticket token string.
48  * @see ticketTokenType, ticketTokenData
49  */
50  KITINERARY_PROPERTY(QString, ticketToken, setTicketToken)
51 
52  /** The type of the content in ticketToken. */
53  Q_PROPERTY(KItinerary::Token::TokenType ticketTokenType READ ticketTokenType STORED false)
54  /** The ticket token payload for barcodes, otherwise the same as ticketToken.
55  * For binary content barcodes this is a QByteArray, otherwise a QString.
56  */
57  Q_PROPERTY(QVariant ticketTokenData READ ticketTokenData STORED false)
58 
59  KITINERARY_PROPERTY(KItinerary::Person, underName, setUnderName)
60  KITINERARY_PROPERTY(QVariantList, subjectOf, setSubjectOf)
61 
62  /** Non-standard extension for ticket validity time ranges. */
63  KITINERARY_PROPERTY(QDateTime, validFrom, setValidFrom)
64  KITINERARY_PROPERTY(QDateTime, validUntil, setValidUntil)
65 
66  KITINERARY_PROPERTY(double, totalPrice, setTotalPrice)
67  KITINERARY_PROPERTY(QString, priceCurrency, setPriceCurrency)
68 
69  KITINERARY_PROPERTY(QString, identifier, setIdentifier)
70 
71 public:
72  /** The type of content in the ticketToken property.
73  * @deprecated Use Token::TokenType instead.
74  */
76  Unknown = Token::Unknown, ///< Unknown or empty ticket token
77  Url = Token::Url, ///< A download URL
78  QRCode = Token::QRCode, ///< QR code
79  AztecCode = Token::AztecCode, ///< Aztec code
80  Code128 = Token::Code128, ///< Code 128 barcode
81  DataMatrix = Token::DataMatrix, ///< A DataMatrix barcode
82  PDF417 = Token::PDF417, ///< A PDF417 barcode
83  };
84  Q_ENUM(TicketTokenType)
85 
86  Token::TokenType ticketTokenType() const;
87  QVariant ticketTokenData() const;
88 private:
90 };
91 
92 }
93 
94 Q_DECLARE_METATYPE(KItinerary::Seat)
95 Q_DECLARE_METATYPE(KItinerary::Ticket)
96 
A booked ticket.
Definition: ticket.h:40
@ 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:75
@ 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-2023 The KDE developers.
Generated on Sat Dec 9 2023 03:57:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.