Kgapi

location.cpp
1 /*
2  SPDX-FileCopyrightText: 2012 Jan Grulich <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 
8 #include "location.h"
9 
10 using namespace KGAPI2;
11 
12 class Q_DECL_HIDDEN Location::Private
13 {
14  public:
15  Private();
16  Private(const Private &other);
17 
18  qulonglong timestamp = 0;
19  qint32 accuracy = -1;
20  qint32 speed = -1;
21  qint32 heading = -1;
22  qint32 altitude = 0;
23  qint32 altitudeAccuracy = -1;
24 };
25 
26 Location::Private::Private()
27 { }
28 
29 Location::Private::Private(const Private &other):
30  timestamp(other.timestamp),
31  accuracy(other.accuracy),
32  speed(other.speed),
33  heading(other.heading),
34  altitude(other.altitude),
35  altitudeAccuracy(other.altitudeAccuracy)
36 { }
37 
39  Object(),
40  KContacts::Geo(),
41  d(new Private)
42 { }
43 
45  Object(other),
46  KContacts::Geo(other),
47  d(new Private(*(other.d)))
48 { }
49 
51  Object(),
52  Geo(latitude, longitude),
53  d(new Private)
54 { }
55 
57 {
58  delete d;
59 }
60 
61 qulonglong Location::timestamp() const
62 {
63  return d->timestamp;
64 }
65 
66 qint32 Location::accuracy() const
67 {
68  return d->accuracy;
69 }
70 
71 qint32 Location::speed() const
72 {
73  return d->speed;
74 }
75 
76 qint32 Location::heading() const
77 {
78  return d->heading;
79 }
80 
81 qint32 Location::altitude() const
82 {
83  return d->altitude;
84 }
85 
87 {
88  return d->altitudeAccuracy;
89 }
90 
92 {
93  d->timestamp = timestamp;
94 }
95 
97 {
98  d->accuracy = accuracy;
99 }
100 
102 {
103  d->speed = speed;
104 }
105 
107 {
108  d->heading = heading;
109 }
110 
112 {
113  d->altitude = altitude;
114 }
115 
117 {
118  d->altitudeAccuracy = altitudeAccuracy;
119 }
qint32 speed() const
Returns ground speed of the user at the time this location was recorded.
Definition: location.cpp:71
float longitude() const
void setAltitudeAccuracy(qint32 altitudeAccuracy)
Sets altitude accuracy of this location.
Definition: location.cpp:116
Base class for all objects.
Definition: object.h:30
~Location() override
Destructor.
Definition: location.cpp:56
Location()
Constructor.
Definition: location.cpp:38
qint32 altitude() const
Returns altitude of this location.
Definition: location.cpp:81
void setTimestamp(qulonglong timestamp)
Sets timestamp of this location.
Definition: location.cpp:91
qint32 accuracy() const
Returns accuracy of the latitude and longitude in meters.
Definition: location.cpp:66
qint32 heading() const
Returns direction of travel of the user when this location was recorded.
Definition: location.cpp:76
A job to fetch a single map tile described by a StaticMapUrl.
Definition: blog.h:15
void setAltitude(qint32 altitude)
Sets altitude of this location.
Definition: location.cpp:111
qint32 altitudeAccuracy() const
Returns altitude accuracy.
Definition: location.cpp:86
void setSpeed(qint32 speed)
Sets speed of this location.
Definition: location.cpp:101
float latitude() const
void setHeading(qint32 heading)
Sets heading of this location.
Definition: location.cpp:106
qulonglong timestamp() const
Timestamp of when this location has been recorded.
Definition: location.cpp:61
void setAccuracy(qint32 accuracy)
Sets accuracy of this location.
Definition: location.cpp:96
Represents a single record about geographical location provided by Google Latitude service...
Definition: location.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Oct 24 2021 23:11:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.