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 { Invalid, QR, PDF417, Aztec, Code128 };
36 Q_ENUM(Format)
37
38 Barcode();
39 ~Barcode();
40
41 /** A human readable version of the barcode data. */
42 [[nodiscard]] QString alternativeText() const;
43 /** The barcode type. */
44 [[nodiscard]] Format format() const;
45 /** The message encoded in the barcode. */
46 [[nodiscard]] QString message() const;
47 /** Encoding used for the message() content. */
48 [[nodiscard]] QString messageEncoding() const;
49
50private:
51 friend class Pass;
52 explicit Barcode(const QJsonObject &obj, const Pass *file);
53 std::shared_ptr<BarcodePrivate> d;
54};
55
56}
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 Fri Jul 26 2024 12:01:03 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.