KPkPass::Pass Class

Base class for a pkpass file. More...

Header: #include <KPkPass/Pass>
CMake: find_package(KPim6PkPass REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::PkPass)
Inherits: QObject
Inherited By:

KPkPass::BoardingPass

Public Types

enum Type { BoardingPass, Coupon, EventTicket, Generic, StoreCard }

Public Functions

(since 26.08) QImage artwork(unsigned int devicePixelRatio = 1) const
(since 26.08) QList<KPkPass::Field> auxiliaryFieldsInRow(int row) const
(since 26.08) int auxiliaryFieldsRowCount() const
QImage background(unsigned int devicePixelRatio = 1) const
KPkPass::Field field(const QString &key) const
QList<KPkPass::Field> fields() const
QImage footer(unsigned int devicePixelRatio = 1) const
bool hasBarcode() const
bool hasImage(const QString &baseName) const
QImage icon(unsigned int devicePixelRatio = 1) const
QImage image(const QString &baseName, unsigned int devicePixelRatio = 1) const
QList<KPkPass::Location> locations() const
QImage logo(unsigned int devicePixelRatio = 1) const
(since 26.08) QString lookupMessage(const QString &msg) const
int maximumDistance() const
QUrl passUpdateUrl() const
(since 26.08) QStringList preferredStyleSchemes() const
(since 26.08) QImage primaryLogo(unsigned int devicePixelRatio = 1) const
QByteArray rawData() const
(since 26.08) QJsonValue rawValue(const QString &key) const
(since 26.08) QList<KPkPass::Seat> seats() const
(since 26.08) QImage secondaryLogo(unsigned int devicePixelRatio = 1) const
(since 26.08) QJsonObject semanticTags() const
QImage strip(unsigned int devicePixelRatio = 1) const
QImage thumbnail(unsigned int devicePixelRatio = 1) const

Static Public Members

KPkPass::Pass *fromData(const QByteArray &data, QObject *parent = nullptr)
KPkPass::Pass *fromFile(const QString &fileName, QObject *parent = nullptr)

Detailed Description

See also https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/index.html and https://developer.apple.com/library/content/documentation/UserExperience/Reference/PassKit_Bundle/Chapters/TopLevel.html.

Member Type Documentation

enum Pass::Type

Type of the pass.

Member Function Documentation

[invokable, since 26.08] QImage Pass::artwork(unsigned int devicePixelRatio = 1) const

Returns the artwork background image if present.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

This function was introduced in 26.08.

[invokable, since 26.08] QList<KPkPass::Field> Pass::auxiliaryFieldsInRow(int row) const

Returns only those auxiliary fields in \p row.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

This function was introduced in 26.08.

[since 26.08] int Pass::auxiliaryFieldsRowCount() const

Number of auxiliary field rows.

This function was introduced in 26.08.

[invokable] QImage Pass::background(unsigned int devicePixelRatio = 1) const

Returns the background image if present.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

KPkPass::Field Pass::field(const QString &key) const

Returns the field with key key.

QList<KPkPass::Field> Pass::fields() const

Returns all fields found in this pass.

Returns the footer image if present.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[static] KPkPass::Pass *Pass::fromData(const QByteArray &data, QObject *parent = nullptr)

Create a appropriate sub-class based on the pkpass file type.

[static] KPkPass::Pass *Pass::fromFile(const QString &fileName, QObject *parent = nullptr)

Create a appropriate sub-class based on the pkpass file type.

bool Pass::hasBarcode() const

Returns all barcodes defined in the pass.

bool Pass::hasImage(const QString &baseName) const

Returns true if an image asset with the given base name exists. baseName The name of the asset, without the file type and high dpi extensions.

[invokable] QImage Pass::icon(unsigned int devicePixelRatio = 1) const

Returns the pass icon.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

QImage Pass::image(const QString &baseName, unsigned int devicePixelRatio = 1) const

Returns an image asset of this pass. baseName The name of the asset, without the file name extension. devicePixelRatio The device pixel ration, for loading highdpi assets.

QList<KPkPass::Location> Pass::locations() const

Locations associated with this pass.

Returns the pass logo.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[invokable, since 26.08] QString Pass::lookupMessage(const QString &msg) const

Lookup a message in the passes translation catalog. This is mainly necessary for semantic tags or raw values of type localized string, other properties already do this internally.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

This function was introduced in 26.08.

int Pass::maximumDistance() const

Distance in meters to any of the pass locations before this pass becomes relevant.

QUrl Pass::passUpdateUrl() const

Pass update URL.

See also https://developer.apple.com/library/content/documentation/PassKit/Reference/PassKit_WebService/WebService.html.

[since 26.08] QStringList Pass::preferredStyleSchemes() const

Preferred style schemes.

This function was introduced in 26.08.

Returns the pass primary logo.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

This function was introduced in 26.08.

QByteArray Pass::rawData() const

The raw data of this pass. That is the binary representation of the ZIP archive which contains all the pass data.

[invokable, since 26.08] QJsonValue Pass::rawValue(const QString &key) const

Returns a raw entry from this pass' pass.json. Useful e.g. for semi-standardized additional flight information values.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

This function was introduced in 26.08.

[since 26.08] QList<KPkPass::Seat> Pass::seats() const

Returns seat information specified in semantic tag data.

This function was introduced in 26.08.

Returns the pass secondary logo.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

This function was introduced in 26.08.

[since 26.08] QJsonObject Pass::semanticTags() const

Returns the semantic tags, if available.

This function was introduced in 26.08.

[invokable] QImage Pass::strip(unsigned int devicePixelRatio = 1) const

Returns the strip image if present.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[invokable] QImage Pass::thumbnail(unsigned int devicePixelRatio = 1) const

Returns the thumbnail image if present.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.