Modified route arrow icons.
[situare] / src / gps / geopositioninfo.h
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Jussi Laitinen - jussi.laitinen@ixonos.com
6
7    Situare is free software; you can redistribute it and/or
8    modify it under the terms of the GNU General Public License
9    version 2 as published by the Free Software Foundation.
10
11    Situare is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with Situare; if not, write to the Free Software
18    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
19    USA.
20 */
21
22 #ifndef GEOPOSITIONINFO_H
23 #define GEOPOSITIONINFO_H
24
25 #include <QObject>
26 #include <QDateTime>
27
28 #include "coordinates/geocoordinate.h"
29
30 /**
31 * @brief GeoPositionInfo class stores geo position info.
32 */
33 class GeoPositionInfo
34 {
35 public:
36     /**
37     * @brief Constructor.
38     */
39     GeoPositionInfo();
40
41 /******************************************************************************
42 * MEMBER FUNCTIONS AND SLOTS
43 ******************************************************************************/
44 public:
45     /**
46     * @brief Returns accuracy.
47     *
48     * Returns -1 if accuracy is not accurate.
49     *
50     * @return qreal
51     */
52     qreal accuracy() const;
53
54     /**
55     * @brief Returns geo coordinates.
56     *
57     * @return GeoCoordinate
58     */
59     GeoCoordinate coordinate() const;
60
61     /**
62     * @brief Checks if the accuracy is accurate.
63     *
64     * @return true if accurate, false otherwise
65     */
66     bool isAccurate() const;
67
68     /**
69     * @brief Checks the validity of the GeoPositionInfo.
70     *
71     * Checks coordinate validity.
72     *
73     * @return true if valid, false otherwise
74     */
75     bool isValid();
76
77     /**
78     * @brief Sets accuracy.
79     *
80     * @param accurate true if accuracy is accurate (satellite positioning)
81     * @param accuracy accuracy value
82     */
83     void setAccuracy(bool accurate, qreal accuracy);
84
85     /**
86     * @brief Sets geo coordinates.
87     *
88     * @param coordinate GeoCoordinate
89     */
90     void setCoordinate(const GeoCoordinate &coordinate);
91
92
93     /**
94     * @brief Sets timestamp.
95     *
96     * @param time timestamp in seconds
97     */
98     void setTimestamp(qreal time);
99
100     /**
101     * @brief Returns timestamp.
102     *
103     * @return QDateTime
104     */
105     QDateTime timestamp() const;
106
107 /******************************************************************************
108 * DATA MEMBERS
109 ******************************************************************************/
110 private:
111     QDateTime m_timestamp;      ///< Timestamp
112     GeoCoordinate m_coordinate; ///< GeoCoordinate
113     qreal m_horizontalAccuracy; ///< Horizontal accuracy
114     bool m_isAccurate;          ///< Is accurate
115 };
116
117 #endif // GEOPOSITIONINFO_H