Kgapi

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

KDE's Doxygen guidelines are available online.