KItinerary

programmembership.h
1/*
2 SPDX-FileCopyrightText: 2021 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 "person.h"
12#include "token.h"
13
14namespace KItinerary {
15
16class ProgramMembershipPrivate;
17
18/** A frequent traveler, bonus points or discount scheme program membership.
19 * @see https://schema.org/ProgramMembership
20 */
21class 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 KITINERARY_PROPERTY(QVariantList, subjectOf, setSubjectOf)
28
29 /** KItinerary extension: barcode token for program membership cards
30 * having a barcode representation (e.g. Deutsch Bahn BahnCards).
31 * Semantics are the same as of Ticket::ticketToken.
32 * @see Ticket::ticketToken
33 */
34 KITINERARY_PROPERTY(QString, token, setToken)
35
36 /** The type of the token. */
37 Q_PROPERTY(KItinerary::Token::TokenType tokenType READ tokenType STORED false)
38 /** The token payload for barcodes, otherwise the same as ticketToken.
39 * For binary content barcodes this is a QByteArray, otherwise a QString.
40 */
41 Q_PROPERTY(QVariant tokenData READ tokenData STORED false)
42
43 /** Non-standard extension for ticket validity time ranges. */
44 KITINERARY_PROPERTY(QDateTime, validFrom, setValidFrom)
45 KITINERARY_PROPERTY(QDateTime, validUntil, setValidUntil)
46
47public:
48 Token::TokenType tokenType() const;
49 QVariant tokenData() const;
50
51private:
52 QExplicitlySharedDataPointer<ProgramMembershipPrivate> d;
53};
54
55}
56
57Q_DECLARE_METATYPE(KItinerary::ProgramMembership)
58
A person.
Definition person.h:20
A frequent traveler, bonus points or discount scheme program membership.
Barcode token utilities.
Definition token.h:24
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.