KItinerary

reservation.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 "place.h"
13 #include "programmembership.h"
14 
15 class QUrl;
16 
17 namespace KItinerary {
18 
19 class ReservationPrivate;
20 
21 /** Abstract base class for reservations.
22  * @see https://schema.org/Reservation
23  */
24 class KITINERARY_EXPORT Reservation
25 {
26 public:
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_BASE_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 protected:
61  ///@cond internal
62  QExplicitlySharedDataPointer<ReservationPrivate> d;
63  ///@endcond
64 };
65 
66 /** A hotel reservation.
67  * @see https://schema.org/LodgingReservation
68  * @see https://developers.google.com/gmail/markup/reference/hotel-reservation
69  */
70 class KITINERARY_EXPORT LodgingReservation : public Reservation
71 {
72  KITINERARY_GADGET(LodgingReservation)
73  KITINERARY_PROPERTY(QDateTime, checkinTime, setCheckinTime)
74  KITINERARY_PROPERTY(QDateTime, checkoutTime, setCheckoutTime)
75 };
76 
77 /** A flight reservation.
78  * @see https://schema.org/FlightReservation
79  * @see https://developers.google.com/gmail/markup/reference/flight-reservation
80  */
81 class KITINERARY_EXPORT FlightReservation : public Reservation
82 {
83  KITINERARY_GADGET(FlightReservation)
84  /** Passenger sequence number
85  * Despite the name, do not expect this to be a number, infants without
86  * their own seat get vendor-defined codes here for example.
87  * @see https://schema.org/passengerSequenceNumber
88  */
89  KITINERARY_PROPERTY(QString, passengerSequenceNumber, setPassengerSequenceNumber)
90 
91  // Google extensions
92  KITINERARY_PROPERTY(QString, airplaneSeat, setAirplaneSeat)
93  KITINERARY_PROPERTY(QString, boardingGroup, setBoardingGroup)
94 };
95 
96 /** A train reservation.
97  * @see https://schema.org/TrainReservation
98  */
99 class KITINERARY_EXPORT TrainReservation : public Reservation
100 {
101  KITINERARY_GADGET(TrainReservation)
102 };
103 
104 /** A bus reservation.
105  * @see https://schema.org/BusReservation
106  */
107 class KITINERARY_EXPORT BusReservation : public Reservation
108 {
109  KITINERARY_GADGET(BusReservation)
110 };
111 
112 /** A restaurant reservation.
113  * @see https://schema.org/FoodEstablishmentReservation
114  * @see https://developers.google.com/gmail/markup/reference/restaurant-reservation
115  */
116 class KITINERARY_EXPORT FoodEstablishmentReservation : public Reservation
117 {
118  KITINERARY_GADGET(FoodEstablishmentReservation)
119  KITINERARY_PROPERTY(QDateTime, endTime, setEndTime)
120  KITINERARY_PROPERTY(int, partySize, setPartySize)
121  KITINERARY_PROPERTY(QDateTime, startTime, setStartTime)
122 };
123 
124 /** An event reservation.
125  * @see https://schema.org/EventReservation
126  * @see https://developers.google.com/gmail/markup/reference/event-reservation
127  */
128 class KITINERARY_EXPORT EventReservation : public Reservation
129 {
130  KITINERARY_GADGET(EventReservation)
131 };
132 
133 /** A Rental Car reservation.
134  * @see https://developers.google.com/gmail/markup/reference/rental-car
135  */
136 class KITINERARY_EXPORT RentalCarReservation : public Reservation
137 {
138  KITINERARY_GADGET(RentalCarReservation)
139  KITINERARY_PROPERTY(QDateTime, dropoffTime, setDropoffTime)
140  KITINERARY_PROPERTY(QDateTime, pickupTime, setPickupTime)
141  KITINERARY_PROPERTY(KItinerary::Place, pickupLocation, setPickupLocation)
142  KITINERARY_PROPERTY(KItinerary::Place, dropoffLocation, setDropoffLocation)
143 };
144 
145 /** A Taxi reservation.
146  * @see https://schema.org/TaxiReservation
147  */
148 class KITINERARY_EXPORT TaxiReservation : public Reservation
149 {
150  KITINERARY_GADGET(TaxiReservation)
151  KITINERARY_PROPERTY(QDateTime, pickupTime, setPickupTime)
152  KITINERARY_PROPERTY(KItinerary::Place, pickupLocation, setPickupLocation)
153 };
154 
155 /** A boat or ferry reservation.
156  * @see https://schema.org/BoatReservation
157  */
158 class KITINERARY_EXPORT BoatReservation : public Reservation
159 {
160  KITINERARY_GADGET(BoatReservation)
161 };
162 
163 
164 }
165 
167 Q_DECLARE_METATYPE(KItinerary::FlightReservation)
168 Q_DECLARE_METATYPE(KItinerary::LodgingReservation)
169 Q_DECLARE_METATYPE(KItinerary::TrainReservation)
170 Q_DECLARE_METATYPE(KItinerary::BusReservation)
172 Q_DECLARE_METATYPE(KItinerary::EventReservation)
173 Q_DECLARE_METATYPE(KItinerary::RentalCarReservation)
174 Q_DECLARE_METATYPE(KItinerary::TaxiReservation)
175 Q_DECLARE_METATYPE(KItinerary::BoatReservation)
An event reservation.
Definition: reservation.h:128
Classes for reservation/travel data models, data extraction and data augmentation.
A restaurant reservation.
Definition: reservation.h:116
A hotel reservation.
Definition: reservation.h:70
ReservationStatus
Reservation status enum.
Definition: reservation.h:30
Abstract base class for reservations.
Definition: reservation.h:24
A Taxi reservation.
Definition: reservation.h:148
A flight reservation.
Definition: reservation.h:81
Base class for places.
Definition: place.h:67
A boat or ferry reservation.
Definition: reservation.h:158
A Rental Car reservation.
Definition: reservation.h:136
A bus reservation.
Definition: reservation.h:107
An organization.
Definition: organization.h:30
A train reservation.
Definition: reservation.h:99
A frequent traveler, bonus points or discount scheme program membership.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Oct 24 2021 23:15:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.