Incorporated changes from bus project.
[ptas] / src / location.h
index dfb5d00..402b20e 100644 (file)
@@ -14,95 +14,53 @@ QTM_USE_NAMESPACE
 
 class Location : public QObject
 {
-Q_OBJECT
+    Q_OBJECT
 
-public:
-  Location( const QString &x, const QString &y, const QString &label=QString() );
-  Location( const QGeoPositionInfo &positionInfo, const QString &label=QString() );
-  Location( const Location &from );
-  Location &operator=( const Location &from );
-  Location( const QString &label=QString() );
+    Q_PROPERTY(QString longitude READ longitude())
+    Q_PROPERTY(QString latitude READ latitude())
+    Q_PROPERTY(QString address READ address() WRITE setAddress())
+    Q_PROPERTY(QString label READ label() WRITE setLabel())
+    Q_PROPERTY(bool valid READ isValid() WRITE setValid())
 
-  ~Location();
+    public:
+    Location(const QString &longitude, const QString &latitude, const QString &label=QString());
+    Location(const QGeoPositionInfo &positionInfo, const QString &label=QString());
+    Location(const Location &from);
+    Location &operator=(const Location &from);
+    Location(const QString &label=QString());
 
-  QString x() const;
+    ~Location();
 
-  QString y() const;
+    QString longitude() const;
 
-  void setLocation( const QGeoPositionInfo &positionInfo );
+    QString latitude() const;
 
-  void setAddress( const QString &address ) const;
-  QString address() const;
+    void setLocation(const QGeoPositionInfo &positionInfo);
 
-  void setLabel( const QString &label ) const;
-  QString label() const;
+    void setAddress(const QString &address) const;
+    QString address() const;
 
-  bool isValid() const;
+    void setLabel(const QString &label) const;
+    QString label() const;
 
-public Q_SLOTS:
-  void resolveAddress( const QString &address );
+    void setValid(bool valid) const;
+    bool isValid() const;
 
-Q_SIGNALS:
-  void becomeValid();
-  void becomeInValid();
-  void busy( bool busy );
+    public Q_SLOTS:
+    void resolveAddress(const QString &address);
 
-private Q_SLOTS:
-  void replyFinished( QNetworkReply * reply );
+    Q_SIGNALS:
+    void becomeValid();
+    void becomeInValid();
+    void busy(bool busy);
 
-private:
+    private Q_SLOTS:
+    void replyFinished(QNetworkReply * reply);
 
-  LocationPrivate *q;
-  QNetworkAccessManager *manager;
-
-  typedef uint KKJ;
-
-  /**
-   * Transformes WGS84 longitude/latitude coordinates to KKJ x/y coordinates.
-   * @param longitude the input longitude in degrees
-   * @param latitude the input latitude in degrees
-   * @param outX the result x (easting)
-   * @param outY the result y (northing)
-   */
-  void WGS84lola_to_KKJxy(double longitude, double latitude, KKJ *outX, KKJ *outY);
-
-  /**
-   * Transformes KKJ x/y coordinates to WGS84 longitude/latitude coordinates.
-   * @param x the input x (easting)
-   * @param y the input y (northing)
-   * @param outLongitude the result longitude in degrees
-   * @param outLatitude the result latitude in degrees
-   */
-  void KKJxy_to_WGS84lola(KKJ x, KKJ y, double *outLongitude, double *outLatitude);
-
-  // Degrees to radians
-  double radians(double deg);
-
-  // Radians to degrees
-  double degrees(double rad);
-
-  // Constants
-  // Longitude0 and Center meridian of KKJ bands
-  static const double KkjZoneInfo[][2];
-
-  // Function:  KKJ_Zone_I
-  int KKJ_Zone_I(KKJ easting);
-
-  // Function:  KKJ_Zone_Lo
-  int KKJ_Zone_Lo(double kkjlo);
-
-  // Function:  KKJlalo_to_WGS84lalo
-  void KKJlola_to_WGS84lola(double kkjlo, double kkjla, double *outLongitude, double *outLatitude);
-
-  // Function:  WGS84lalo_to_KKJlalo
-  void WGS84lola_to_KKJlola(double longitude, double latitude, double *outLongitude, double *outLatitude);
-
-  // Function:  KKJlalo_to_KKJxy
-  void KKJlola_to_KKJxy(double lon, double lat, int zoneNumber, KKJ *outX, KKJ *outY);
-
-  // Function:  KKJxy_to_KKJlalo
-  void KKJxy_to_KKJlola(KKJ x, KKJ y, double *outLongitude, double *outLatitude);
+    private:
 
+    LocationPrivate *q;
+    QNetworkAccessManager *manager;
 };
 
 #endif // LOCATION_H