KItinerary

ticket.cpp
1/*
2 SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "ticket.h"
8#include "datatypes_p.h"
9
10#include <QByteArray>
11
12#include <cmath>
13
14using namespace KItinerary;
15
16namespace KItinerary {
17
18class SeatPrivate : public QSharedData
19{
20public:
21 QString seatNumber;
22 QString seatRow;
23 QString seatSection;
24 QString seatingType;
25 QString identifier;
26};
27
28KITINERARY_MAKE_CLASS(Seat)
29KITINERARY_MAKE_PROPERTY(Seat, QString, seatNumber, setSeatNumber)
30KITINERARY_MAKE_PROPERTY(Seat, QString, seatRow, setSeatRow)
31KITINERARY_MAKE_PROPERTY(Seat, QString, seatSection, setSeatSection)
32KITINERARY_MAKE_PROPERTY(Seat, QString, seatingType, setSeatingType)
33KITINERARY_MAKE_PROPERTY(Seat, QString, identifier, setIdentifier)
34KITINERARY_MAKE_OPERATOR(Seat)
35
36class TicketPrivate : public QSharedData
37{
38public:
39 QString name;
40 Organization issuedBy;
41 QString ticketNumber;
42 Seat ticketedSeat;
43 QString ticketToken;
44 Person underName;
45 QVariantList subjectOf;
46 QDateTime validFrom;
47 QDateTime validUntil;
48 double totalPrice = NAN;
49 QString priceCurrency;
50 QString identifier;
51};
52
53KITINERARY_MAKE_CLASS(Ticket)
54KITINERARY_MAKE_PROPERTY(Ticket, QString, name, setName)
55KITINERARY_MAKE_PROPERTY(Ticket, Organization, issuedBy, setIssuedBy)
56KITINERARY_MAKE_PROPERTY(Ticket, QString, ticketNumber, setTicketNumber)
57KITINERARY_MAKE_PROPERTY(Ticket, Seat, ticketedSeat, setTicketedSeat)
58KITINERARY_MAKE_PROPERTY(Ticket, QString, ticketToken, setTicketToken)
59KITINERARY_MAKE_PROPERTY(Ticket, Person, underName, setUnderName)
60KITINERARY_MAKE_PROPERTY(Ticket, QVariantList, subjectOf, setSubjectOf)
61KITINERARY_MAKE_PROPERTY(Ticket, QDateTime, validFrom, setValidFrom)
62KITINERARY_MAKE_PROPERTY(Ticket, QDateTime, validUntil, setValidUntil)
63KITINERARY_MAKE_PROPERTY(Ticket, double, totalPrice, setTotalPrice)
64KITINERARY_MAKE_PROPERTY(Ticket, QString, priceCurrency, setPriceCurrency)
65KITINERARY_MAKE_PROPERTY(Ticket, QString, identifier, setIdentifier)
66KITINERARY_MAKE_OPERATOR(Ticket)
67
69{
70 return Token::tokenType(d->ticketToken);
71}
72
74{
75 return Token::tokenData(d->ticketToken);
76}
77
78}
79
80#include "moc_ticket.cpp"
A person.
Definition person.h:20
A reserved seat.
Definition ticket.h:23
A booked ticket.
Definition ticket.h:41
QVariant ticketTokenData
The ticket token payload for barcodes, otherwise the same as ticketToken.
Definition ticket.h:57
KItinerary::Token::TokenType ticketTokenType
The type of the content in ticketToken.
Definition ticket.h:53
static QVariant tokenData(const QString &token)
Determine token content for the given token.
Definition token.cpp:41
TokenType
Token format.
Definition token.h:28
static TokenType tokenType(QStringView token)
Determine token type for the given token.
Definition token.cpp:13
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 Mon Nov 18 2024 12:09:58 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.