File indexing completed on 2024-04-28 15:39:05

0001 // SPDX-FileCopyrightText: 2020 Tobias Leupold <tl at stonemx dot de>
0002 //
0003 // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 
0005 #ifndef COORDINATESFORMATTER_H
0006 #define COORDINATESFORMATTER_H
0007 
0008 // Qt includes
0009 #include <QObject>
0010 
0011 // Local classes
0012 class Coordinates;
0013 
0014 // Qt classes
0015 class QLocale;
0016 
0017 class CoordinatesFormatter : public QObject
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     explicit CoordinatesFormatter(QObject *parent, QLocale *locale);
0023     QString lon(const Coordinates &coordinates) const;
0024     QString lat(const Coordinates &coordinates) const;
0025     QString alt(const Coordinates &coordinates) const;
0026 
0027 private: // Functions
0028     QString formatLonLat(double value) const;
0029 
0030 private: // Variables
0031     QLocale *m_locale;
0032 
0033 };
0034 
0035 #endif // COORDINATESFORMATTER_H