KItinerary

token.h
1/*
2 SPDX-FileCopyrightText: 2018-2022 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6#ifndef KITINERARY_TOKEN_H
7#define KITINERARY_TOKEN_H
8
9#include "kitinerary_export.h"
10
11#include <qobjectdefs.h>
12
13class QStringView;
14class QVariant;
15
16namespace KItinerary {
17
18/** Barcode token utilities.
19 * @see Ticket
20 * @see ProgramMembership
21 * @since 5.20.41
22 */
23class KITINERARY_EXPORT Token
24{
25 Q_GADGET
26public:
27 /** Token format. */
28 enum TokenType {
29 Unknown, ///< Unknown or empty ticket token
30 Url, ///< A download URL, if shown in a barcode its format can be determined by the application.
31 QRCode, ///< QR code
32 AztecCode, ///< Aztec code. Binary content is handled transparently by tokenData().
33 Code128, ///< Code 128 barcode
34 DataMatrix, ///< A DataMatrix barcode
35 PDF417, ///< A PDF417 barcode
36 Code39, ///< A Code 39 barcode
37 EAN13, ///< A EAN13 barcode
38 };
39 Q_ENUM(TokenType)
40
41 /** Determine token type for the given token. */
42 static TokenType tokenType(QStringView token);
43 /** Determine token content for the given token. */
44 static QVariant tokenData(const QString &token);
45};
46
47}
48
49#endif // KITINERARY_TOKEN_H
Barcode token utilities.
Definition token.h:24
TokenType
Token format.
Definition token.h:28
@ Unknown
Unknown or empty ticket token.
Definition token.h:29
@ PDF417
A PDF417 barcode.
Definition token.h:35
@ DataMatrix
A DataMatrix barcode.
Definition token.h:34
@ Code39
A Code 39 barcode.
Definition token.h:36
@ Code128
Code 128 barcode.
Definition token.h:33
@ AztecCode
Aztec code. Binary content is handled transparently by tokenData().
Definition token.h:32
@ EAN13
A EAN13 barcode.
Definition token.h:37
@ QRCode
QR code.
Definition token.h:31
@ Url
A download URL, if shown in a barcode its format can be determined by the application.
Definition token.h:30
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 Sat Dec 21 2024 16:56:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.