KItinerary

ticket.h
1/*
2 SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
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
15namespace KItinerary {
16
17class SeatPrivate;
18
19/** A reserved seat.
20 * @see https://schema.org/Seat
21 */
22class 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)
31private:
33};
34
35class TicketPrivate;
36
37/** A booked ticket.
38 * @see https://schema.org/Ticket
39 */
40class 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
71public:
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;
88private:
90};
91
92}
93
94Q_DECLARE_METATYPE(KItinerary::Seat)
95Q_DECLARE_METATYPE(KItinerary::Ticket)
96
A person.
Definition person.h:20
A reserved seat.
Definition ticket.h:23
A booked ticket.
Definition ticket.h:41
TicketTokenType
The type of content in the ticketToken property.
Definition ticket.h:75
Barcode token utilities.
Definition token.h:24
TokenType
Token format.
Definition token.h:28
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-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.