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