KItinerary

token.h
1 /*
2  SPDX-FileCopyrightText: 2018-2022 Volker Krause <[email protected]>
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 
13 class QStringView;
14 class QVariant;
15 
16 namespace KItinerary {
17 
18 /** Barcode token utilities.
19  * @see Ticket
20  * @see ProgramMembership
21  * @since 5.20.41
22  */
23 class KITINERARY_EXPORT Token
24 {
25  Q_GADGET
26 public:
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
@ Url
A download URL, if shown in a barcode its format can be determined by the application.
Definition: token.h:30
@ Code39
A Code 39 barcode.
Definition: token.h:36
Barcode token utilities.
Definition: token.h:23
@ Code128
Code 128 barcode.
Definition: token.h:33
@ AztecCode
Aztec code. Binary content is handled transparently by tokenData().
Definition: token.h:32
TokenType
Token format.
Definition: token.h:28
@ QRCode
QR code.
Definition: token.h:31
@ EAN13
A EAN13 barcode.
Definition: token.h:37
@ PDF417
A PDF417 barcode.
Definition: token.h:35
@ DataMatrix
A DataMatrix barcode.
Definition: token.h:34
@ Unknown
Unknown or empty ticket token.
Definition: token.h:29
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Nov 30 2023 03:57:58 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.