KItinerary

reservation.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 "place.h"
13#include "programmembership.h"
14
15class QUrl;
16
17namespace KItinerary {
18
19class ReservationPrivate;
20
21/** Abstract base class for reservations.
22 * @see https://schema.org/Reservation
23 */
24class KITINERARY_EXPORT Reservation
25{
26public:
27 /** Reservation status enum.
28 * @see https://schema.org/ReservationStatusType
29 */
31 ReservationConfirmed,
32 ReservationCancelled,
33 ReservationHold,
34 ReservationPending,
35 };
36 Q_ENUM(ReservationStatus)
37
38 KITINERARY_GADGET(Reservation)
39 KITINERARY_PROPERTY(QString, reservationNumber, setReservationNumber)
40 KITINERARY_PROPERTY(QVariant, reservationFor, setReservationFor)
41 KITINERARY_PROPERTY(QVariant, reservedTicket, setReservedTicket)
42 KITINERARY_PROPERTY(QVariant, underName, setUnderName)
43 KITINERARY_PROPERTY(KItinerary::Organization, provider, setProvider)
44 KITINERARY_PROPERTY(QUrl, url, setUrl)
45 KITINERARY_PROPERTY(QVariantList, potentialAction, setPotentialAction)
46 KITINERARY_PROPERTY(QDateTime, modifiedTime, setModifiedTime)
47 KITINERARY_PROPERTY(QVariantList, subjectOf, setSubjectOf)
48 KITINERARY_PROPERTY(ReservationStatus, reservationStatus, setReservationStatus)
49 KITINERARY_PROPERTY(KItinerary::ProgramMembership, programMembershipUsed, setProgramMembershipUsed)
50
51 // KDE extensions
52 /** Pass type identifier of an associated Apple Wallet boarding pass.
53 * @see KPkPass::Pass::passTypeIdentifier
54 */
55 KITINERARY_PROPERTY(QString, pkpassPassTypeIdentifier, setPkpassPassTypeIdentifier)
56 /** Serial number of an associated Apple Wallet boarding pass.
57 * @see KPkPass::Pass::serialNumber
58 */
59 KITINERARY_PROPERTY(QString, pkpassSerialNumber, setPkpassSerialNumber)
60
61 KITINERARY_PROPERTY(double, totalPrice, setTotalPrice)
62 KITINERARY_PROPERTY(QString, priceCurrency, setPriceCurrency)
63
64protected:
65 ///@cond internal
66 QExplicitlySharedDataPointer<ReservationPrivate> d;
67 ///@endcond
68};
69
70class LodgingReservationPrivate;
71
72/** A hotel reservation.
73 * @see https://schema.org/LodgingReservation
74 * @see https://developers.google.com/gmail/markup/reference/hotel-reservation
75 */
76class KITINERARY_EXPORT LodgingReservation : public Reservation
77{
78 KITINERARY_GADGET(LodgingReservation)
79 KITINERARY_PROPERTY(QDateTime, checkinTime, setCheckinTime)
80 KITINERARY_PROPERTY(QDateTime, checkoutTime, setCheckoutTime)
81};
82
83class FlightReservationPrivate;
84
85/** A flight reservation.
86 * @see https://schema.org/FlightReservation
87 * @see https://developers.google.com/gmail/markup/reference/flight-reservation
88 */
89class KITINERARY_EXPORT FlightReservation : public Reservation
90{
91 KITINERARY_GADGET(FlightReservation)
92 /** Passenger sequence number
93 * Despite the name, do not expect this to be a number, infants without
94 * their own seat get vendor-defined codes here for example.
95 * @see https://schema.org/passengerSequenceNumber
96 */
97 KITINERARY_PROPERTY(QString, passengerSequenceNumber, setPassengerSequenceNumber)
98
99 // Google extensions
100 KITINERARY_PROPERTY(QString, airplaneSeat, setAirplaneSeat)
101 KITINERARY_PROPERTY(QString, boardingGroup, setBoardingGroup)
102};
103
104class TrainReservationPrivate;
105
106/** A train reservation.
107 * @see https://schema.org/TrainReservation
108 */
109class KITINERARY_EXPORT TrainReservation : public Reservation
110{
111 KITINERARY_GADGET(TrainReservation)
112};
113
114class BusReservationPrivate;
115
116/** A bus reservation.
117 * @see https://schema.org/BusReservation
118 */
119class KITINERARY_EXPORT BusReservation : public Reservation
120{
121 KITINERARY_GADGET(BusReservation)
122};
123
124class FoodEstablishmentReservationPrivate;
125
126/** A restaurant reservation.
127 * @see https://schema.org/FoodEstablishmentReservation
128 * @see https://developers.google.com/gmail/markup/reference/restaurant-reservation
129 */
130class KITINERARY_EXPORT FoodEstablishmentReservation : public Reservation
131{
132 KITINERARY_GADGET(FoodEstablishmentReservation)
133 KITINERARY_PROPERTY(QDateTime, endTime, setEndTime)
134 KITINERARY_PROPERTY(int, partySize, setPartySize)
135 KITINERARY_PROPERTY(QDateTime, startTime, setStartTime)
136};
137
138class EventReservationPrivate;
139
140/** An event reservation.
141 * @see https://schema.org/EventReservation
142 * @see https://developers.google.com/gmail/markup/reference/event-reservation
143 */
144class KITINERARY_EXPORT EventReservation : public Reservation
145{
146 KITINERARY_GADGET(EventReservation)
147};
148
149class RentalCarReservationPrivate;
150
151/** A Rental Car reservation.
152 * @see https://developers.google.com/gmail/markup/reference/rental-car
153 */
154class KITINERARY_EXPORT RentalCarReservation : public Reservation
155{
156 KITINERARY_GADGET(RentalCarReservation)
157 KITINERARY_PROPERTY(QDateTime, dropoffTime, setDropoffTime)
158 KITINERARY_PROPERTY(QDateTime, pickupTime, setPickupTime)
159 KITINERARY_PROPERTY(KItinerary::Place, pickupLocation, setPickupLocation)
160 KITINERARY_PROPERTY(KItinerary::Place, dropoffLocation, setDropoffLocation)
161};
162
163class TaxiReservationPrivate;
164
165/** A Taxi reservation.
166 * @see https://schema.org/TaxiReservation
167 */
168class KITINERARY_EXPORT TaxiReservation : public Reservation
169{
170 KITINERARY_GADGET(TaxiReservation)
171 KITINERARY_PROPERTY(QDateTime, pickupTime, setPickupTime)
172 KITINERARY_PROPERTY(KItinerary::Place, pickupLocation, setPickupLocation)
173};
174
175class BoatReservationPrivate;
176
177/** A boat or ferry reservation.
178 * @see https://schema.org/BoatReservation
179 */
180class KITINERARY_EXPORT BoatReservation : public Reservation
181{
182 KITINERARY_GADGET(BoatReservation)
183};
184
185
186}
187
189Q_DECLARE_METATYPE(KItinerary::FlightReservation)
190Q_DECLARE_METATYPE(KItinerary::LodgingReservation)
191Q_DECLARE_METATYPE(KItinerary::TrainReservation)
192Q_DECLARE_METATYPE(KItinerary::BusReservation)
194Q_DECLARE_METATYPE(KItinerary::EventReservation)
195Q_DECLARE_METATYPE(KItinerary::RentalCarReservation)
196Q_DECLARE_METATYPE(KItinerary::TaxiReservation)
197Q_DECLARE_METATYPE(KItinerary::BoatReservation)
A boat or ferry reservation.
A bus reservation.
An event reservation.
A flight reservation.
Definition reservation.h:90
A hotel reservation.
Definition reservation.h:77
Base class for places.
Definition place.h:69
A frequent traveler, bonus points or discount scheme program membership.
A Rental Car reservation.
Abstract base class for reservations.
Definition reservation.h:25
ReservationStatus
Reservation status enum.
Definition reservation.h:30
A Taxi reservation.
A train reservation.
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 Fri Nov 22 2024 12:00:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.