KItinerary

programmembership.h
1 /*
2  SPDX-FileCopyrightText: 2021 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 "person.h"
12 #include "token.h"
13 
14 namespace KItinerary {
15 
16 class ProgramMembershipPrivate;
17 
18 /** A frequent traveler, bonus points or discount scheme program membership.
19  * @see https://schema.org/ProgramMembership
20  */
21 class KITINERARY_EXPORT ProgramMembership
22 {
23  KITINERARY_GADGET(ProgramMembership)
24  KITINERARY_PROPERTY(QString, programName, setProgramName)
25  KITINERARY_PROPERTY(QString, membershipNumber, setMembershipNumber)
26  KITINERARY_PROPERTY(KItinerary::Person, member, setMember)
27 
28  /** KItinerary extension: barcode token for program membership cards
29  * having a barcode representation (e.g. Deutsch Bahn BahnCards).
30  * Semantics are the same as of Ticket::ticketToken.
31  * @see Ticket::ticketToken
32  */
33  KITINERARY_PROPERTY(QString, token, setToken)
34 
35  /** The type of the token. */
36  Q_PROPERTY(KItinerary::Token::TokenType tokenType READ tokenType STORED false)
37  /** The token payload for barcodes, otherwise the same as ticketToken.
38  * For binary content barcodes this is a QByteArray, otherwise a QString.
39  */
40  Q_PROPERTY(QVariant tokenData READ tokenData STORED false)
41 
42  /** Non-standard extension for ticket validity time ranges. */
43  KITINERARY_PROPERTY(QDateTime, validFrom, setValidFrom)
44  KITINERARY_PROPERTY(QDateTime, validUntil, setValidUntil)
45 
46 public:
47  Token::TokenType tokenType() const;
48  QVariant tokenData() const;
49 
50 private:
51  QExplicitlySharedDataPointer<ProgramMembershipPrivate> d;
52 };
53 
54 }
55 
56 Q_DECLARE_METATYPE(KItinerary::ProgramMembership)
57 
Barcode token utilities.
Definition: token.h:23
A person.
Definition: person.h:19
A frequent traveler, bonus points or discount scheme program membership.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Wed Sep 28 2022 04:03:03 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.