KPkPass

barcode.h
1/*
2 SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "kpkpass_export.h"
10
11#include <QMetaType>
12#include <QString>
13
14#include <memory>
15
16class QJsonObject;
17
18namespace KPkPass
19{
20class BarcodePrivate;
21class Pass;
22
23/** A pass barcode element.
24 * @see https://developer.apple.com/library/content/documentation/UserExperience/Reference/PassKit_Bundle/Chapters/LowerLevel.html
25 */
26class KPKPASS_EXPORT Barcode
27{
28 Q_GADGET
29 Q_PROPERTY(QString alternativeText READ alternativeText CONSTANT)
30 Q_PROPERTY(Format format READ format CONSTANT)
31 Q_PROPERTY(QString message READ message CONSTANT)
32 Q_PROPERTY(QString messageEncoding READ messageEncoding CONSTANT)
33
34public:
35 enum Format {
36 Invalid,
37 QR,
38 PDF417,
39 Aztec,
40 Code128
41 };
42 Q_ENUM(Format)
43
44 Barcode();
45 ~Barcode();
46
47 /** A human readable version of the barcode data. */
48 [[nodiscard]] QString alternativeText() const;
49 /** The barcode type. */
50 [[nodiscard]] Format format() const;
51 /** The message encoded in the barcode. */
52 [[nodiscard]] QString message() const;
53 /** Encoding used for the message() content. */
54 [[nodiscard]] QString messageEncoding() const;
55
56private:
57 friend class Pass;
58 explicit Barcode(const QJsonObject &obj, const Pass *file);
59 std::shared_ptr<BarcodePrivate> d;
60};
61
62}
A pass barcode element.
Definition barcode.h:27
Base class for a pkpass file.
Definition pass.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:39:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.