Re-factored the source to use the new coordinate classes
[situare] / src / gps / geopositioninfo.h
index 9718f52..8262832 100644 (file)
 #include <QObject>
 #include <QDateTime>
 
+#include "coordinates/geocoordinate.h"
+
+/**
+* @brief GeoPositionInfo class stores geo position info.
+*/
 class GeoPositionInfo
 {
 public:
+    /**
+    * @brief Constructor.
+    */
     GeoPositionInfo();
 
-    enum Attribute {HorizontalAccuracy};
+/******************************************************************************
+* MEMBER FUNCTIONS AND SLOTS
+******************************************************************************/
+public:
+    /**
+    * @brief Returns accuracy.
+    *
+    * Returns -1 if accuracy is not accurate.
+    *
+    * @return qreal
+    */
+    qreal accuracy() const;
+
+    /**
+    * @brief Returns geo coordinates.
+    *
+    * @return GeoCoordinate
+    */
+    GeoCoordinate coordinate() const;
+
+    /**
+    * @brief Checks if the accuracy is accurate.
+    *
+    * @return true if accurate, false otherwise
+    */
+    bool isAccurate() const;
 
-    void setLatitude(qreal latitude);
-    qreal latitude() const;
-    void setLongitude(qreal longitude);
-    qreal longitude() const;
+    /**
+    * @brief Checks the validity of the GeoPositionInfo.
+    *
+    * Checks coordinate validity.
+    *
+    * @return true if valid, false otherwise
+    */
+    bool isValid();
+
+    /**
+    * @brief Sets accuracy.
+    *
+    * @param accurate true if accuracy is accurate (satellite positioning)
+    * @param accuracy accuracy value
+    */
+    void setAccuracy(bool accurate, qreal accuracy);
+
+    /**
+    * @brief Sets geo coordinates.
+    *
+    * @param coordinate GeoCoordinate
+    */
+    void setCoordinate(const GeoCoordinate &coordinate);
+
+
+    /**
+    * @brief Sets timestamp.
+    *
+    * @param time timestamp in seconds
+    */
     void setTimestamp(qreal time);
+
+    /**
+    * @brief Returns timestamp.
+    *
+    * @return QDateTime
+    */
     QDateTime timestamp() const;
-    bool isValid() const;
-    void setAttribute(Attribute attribute, qreal value);
-    qreal attribute(Attribute attribute);
-    bool hasAttribute(Attribute attribute);
 
+/******************************************************************************
+* DATA MEMBERS
+******************************************************************************/
 private:
-    QDateTime m_timestamp;
-    qreal m_latitude;
-    qreal m_longitude;
+    QDateTime m_timestamp;      ///< Timestamp
+    GeoCoordinate m_coordinate; ///< GeoCoordinate
+    qreal m_horizontalAccuracy; ///< Horizontal accuracy
+    bool m_isAccurate;          ///< Is accurate
 };
 
 #endif // GEOPOSITIONINFO_H