KPkPass

barcode.h
1 /*
2  SPDX-FileCopyrightText: 2018 Volker Krause <[email protected]>
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 
16 class QJsonObject;
17 
18 namespace KPkPass
19 {
20 class BarcodePrivate;
21 class Pass;
22 
23 /** A pass barcode element.
24  * @see https://developer.apple.com/library/content/documentation/UserExperience/Reference/PassKit_Bundle/Chapters/LowerLevel.html
25  */
26 class 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 
34 public:
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  Q_REQUIRED_RESULT QString alternativeText() const;
43  /** The barcode type. */
44  Q_REQUIRED_RESULT Format format() const;
45  /** The message encoded in the barcode. */
46  Q_REQUIRED_RESULT QString message() const;
47  /** Encoding used for the message() content. */
48  Q_REQUIRED_RESULT QString messageEncoding() const;
49 
50 private:
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:26
Base class for a pkpass file.
Definition: pass.h:34
QString message
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Sep 30 2023 03:55:45 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.