Kgapi

latitude/location.h
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#pragma once
8
9#include "kgapilatitude_export.h"
10#include "object.h"
11#include "types.h"
12
13#include <KContacts/Geo>
14
15#include <QSharedPointer>
16
17namespace KGAPI2
18{
19
20/**
21 * @brief Represents a single record about geographical location provided
22 * by Google Latitude service.
23 *
24 * @author Jan Grulich <grulja@gmail.com>
25 * @since 0.4
26 */
27class KGAPILATITUDE_DEPRECATED_EXPORT Location : public KGAPI2::Object, public KContacts::Geo
28{
29public:
30 /**
31 * @brief Constructor
32 */
33 Location();
34
35 /**
36 * @brief Constructor
37 *
38 * @param latitude
39 * @param longitude
40 */
41 Location(float latitude, float longitude);
42
43 /**
44 * @brief Copy constructor
45 */
46 Location(const Location &other);
47
48 /**
49 * @brief Destructor
50 */
51 ~Location() override;
52
53 /**
54 * @brief Timestamp of when this location has been recorded.
55 *
56 * Also serves as location unique ID
57 */
58 qulonglong timestamp() const;
59
60 /**
61 * @brief Sets timestamp of this location.
62 */
63 void setTimestamp(qulonglong timestamp);
64
65 /**
66 * @brief Returns accuracy of the latitude and longitude in meters.
67 *
68 * @return Returns -1 when accuracy is not defined.
69 */
70 [[nodiscard]] qint32 accuracy() const;
71
72 /**
73 * @brief Sets accuracy of this location.
74 */
75 void setAccuracy(qint32 accuracy);
76
77 /**
78 * @brief Returns ground speed of the user at the time this location was
79 * recorded.
80 *
81 * @return Returns -1 when speed is not defined.
82 */
83 [[nodiscard]] qint32 speed() const;
84
85 /**
86 * @brief Sets speed of this location.
87 */
88 void setSpeed(qint32 speed);
89
90 /**
91 * @brief Returns direction of travel of the user when this location was
92 * recorded.
93 *
94 * @return Returns -1 when heading is not defined.
95 */
96 [[nodiscard]] qint32 heading() const;
97
98 /**
99 * @brief Sets heading of this location.
100 */
101 void setHeading(qint32 heading);
102
103 /**
104 * @brief Returns altitude of this location.
105 *
106 * @return Returns 0 when altitude is not defined.
107 */
108 [[nodiscard]] qint32 altitude() const;
109
110 /**
111 * @brief Sets altitude of this location.
112 */
113 void setAltitude(qint32 altitude);
114
115 /**
116 * @brief Returns altitude accuracy.
117 *
118 * @return Returns -1 when altitude accuracy is not defined.
119 */
120 [[nodiscard]] qint32 altitudeAccuracy() const;
121
122 /**
123 * @brief Sets altitude accuracy of this location.
124 */
125 void setAltitudeAccuracy(qint32 altitudeAccuracy);
126
127private:
128 class Private;
129 Private *const d;
130 friend class Private;
131};
132
133} // namespace KGAPI2
Represents a single record about geographical location provided by Google Latitude service.
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.