KPkPass

location.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
13#include <memory>
14
15class QJsonObject;
16
17namespace KPkPass
18{
19class LocationPrivate;
20
21/** A pass location element.
22 * @see https://developer.apple.com/library/content/documentation/UserExperience/Reference/PassKit_Bundle/Chapters/LowerLevel.html
23 */
24class KPKPASS_EXPORT Location
25{
26 Q_GADGET
27 Q_PROPERTY(double altitude READ altitude CONSTANT)
28 Q_PROPERTY(double latitude READ latitude CONSTANT)
29 Q_PROPERTY(double longitude READ longitude CONSTANT)
30 Q_PROPERTY(QString relevantText READ relevantText CONSTANT)
31public:
32 Location();
33 ~Location();
34
35 /** Altitude in meters, NaN if not set. */
36 [[nodiscard]] double altitude() const;
37 /** Latitude in degree. */
38 [[nodiscard]] double latitude() const;
39 /** Longitude in degree. */
40 [[nodiscard]] double longitude() const;
41 /** Text to display when location is reached. */
42 [[nodiscard]] QString relevantText() const;
43
44private:
45 friend class Pass;
46 explicit Location(const QJsonObject &obj);
47 std::shared_ptr<LocationPrivate> d;
48};
49
50}
A pass location element.
Definition location.h:25
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.