File indexing completed on 2024-05-12 05:22:24

0001 /*
0002     SPDX-FileCopyrightText: 2012 Jan Grulich <grulja@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include "kgapilatitude_export.h"
0010 #include "object.h"
0011 #include "types.h"
0012 
0013 #include <KContacts/Geo>
0014 
0015 #include <QSharedPointer>
0016 
0017 namespace KGAPI2
0018 {
0019 
0020 /**
0021  * @brief Represents a single record about geographical location provided
0022  *        by Google Latitude service.
0023  *
0024  * @author Jan Grulich <grulja@gmail.com>
0025  * @since 0.4
0026  */
0027 class KGAPILATITUDE_DEPRECATED_EXPORT Location : public KGAPI2::Object, public KContacts::Geo
0028 {
0029 public:
0030     /**
0031      * @brief Constructor
0032      */
0033     Location();
0034 
0035     /**
0036      * @brief Constructor
0037      *
0038      * @param latitude
0039      * @param longitude
0040      */
0041     Location(float latitude, float longitude);
0042 
0043     /**
0044      * @brief Copy constructor
0045      */
0046     Location(const Location &other);
0047 
0048     /**
0049      * @brief Destructor
0050      */
0051     ~Location() override;
0052 
0053     /**
0054      * @brief Timestamp of when this location has been recorded.
0055      *
0056      * Also serves as location unique ID
0057      */
0058     qulonglong timestamp() const;
0059 
0060     /**
0061      * @brief Sets timestamp of this location.
0062      */
0063     void setTimestamp(qulonglong timestamp);
0064 
0065     /**
0066      * @brief Returns accuracy of the latitude and longitude in meters.
0067      *
0068      * @return Returns -1 when accuracy is not defined.
0069      */
0070     [[nodiscard]] qint32 accuracy() const;
0071 
0072     /**
0073      * @brief Sets accuracy of this location.
0074      */
0075     void setAccuracy(qint32 accuracy);
0076 
0077     /**
0078      * @brief Returns ground speed of the user at the time this location was
0079      *        recorded.
0080      *
0081      * @return Returns -1 when speed is not defined.
0082      */
0083     [[nodiscard]] qint32 speed() const;
0084 
0085     /**
0086      * @brief Sets speed of this location.
0087      */
0088     void setSpeed(qint32 speed);
0089 
0090     /**
0091      * @brief Returns direction of travel of the user when this location was
0092      *        recorded.
0093      *
0094      * @return Returns -1 when heading is not defined.
0095      */
0096     [[nodiscard]] qint32 heading() const;
0097 
0098     /**
0099      * @brief Sets heading of this location.
0100      */
0101     void setHeading(qint32 heading);
0102 
0103     /**
0104      * @brief Returns altitude of this location.
0105      *
0106      * @return Returns 0 when altitude is not defined.
0107      */
0108     [[nodiscard]] qint32 altitude() const;
0109 
0110     /**
0111      * @brief Sets altitude of this location.
0112      */
0113     void setAltitude(qint32 altitude);
0114 
0115     /**
0116      * @brief Returns altitude accuracy.
0117      *
0118      * @return Returns -1 when altitude accuracy is not defined.
0119      */
0120     [[nodiscard]] qint32 altitudeAccuracy() const;
0121 
0122     /**
0123      * @brief Sets altitude accuracy of this location.
0124      */
0125     void setAltitudeAccuracy(qint32 altitudeAccuracy);
0126 
0127 private:
0128     class Private;
0129     Private *const d;
0130     friend class Private;
0131 };
0132 
0133 } // namespace KGAPI2