KPkPass

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