2017-07-16 23:04:05 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2017-07-15 23:51:08 +00:00
|
|
|
#ifndef QMLMAPWIDGETHELPER_H
|
|
|
|
#define QMLMAPWIDGETHELPER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2017-07-21 14:31:58 +00:00
|
|
|
class QGeoCoordinate;
|
2017-07-17 15:02:37 +00:00
|
|
|
class MapLocationModel;
|
2017-07-18 23:50:07 +00:00
|
|
|
class MapLocation;
|
2017-07-16 21:06:05 +00:00
|
|
|
struct dive_site;
|
|
|
|
|
2017-07-15 23:51:08 +00:00
|
|
|
class MapWidgetHelper : public QObject {
|
|
|
|
|
|
|
|
Q_OBJECT
|
2017-07-16 20:46:50 +00:00
|
|
|
Q_PROPERTY(QObject *map MEMBER m_map)
|
2017-07-17 15:02:37 +00:00
|
|
|
Q_PROPERTY(MapLocationModel *model MEMBER m_mapLocationModel NOTIFY modelChanged)
|
2017-07-15 23:51:08 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MapWidgetHelper(QObject *parent = NULL);
|
|
|
|
|
2017-07-16 21:06:05 +00:00
|
|
|
void centerOnDiveSite(struct dive_site *);
|
2017-07-17 19:43:10 +00:00
|
|
|
void reloadMapLocations();
|
2017-07-21 14:31:58 +00:00
|
|
|
Q_INVOKABLE void copyToClipboardCoordinates(QGeoCoordinate coord, bool formatTraditional);
|
2017-07-24 01:14:28 +00:00
|
|
|
Q_INVOKABLE void calculateSmallCircleRadius(QGeoCoordinate coord);
|
2017-07-16 21:06:05 +00:00
|
|
|
|
2017-07-16 20:46:50 +00:00
|
|
|
private:
|
|
|
|
QObject *m_map;
|
2017-07-17 15:02:37 +00:00
|
|
|
MapLocationModel *m_mapLocationModel;
|
2017-07-24 01:14:28 +00:00
|
|
|
qreal m_smallCircleRadius;
|
2017-07-24 18:15:23 +00:00
|
|
|
QList<int> m_selectedDiveIds;
|
2017-07-17 15:02:37 +00:00
|
|
|
|
2017-07-18 23:50:07 +00:00
|
|
|
private slots:
|
|
|
|
void selectedLocationChanged(MapLocation *);
|
|
|
|
|
2017-07-17 15:02:37 +00:00
|
|
|
signals:
|
|
|
|
void modelChanged();
|
2017-07-15 23:51:08 +00:00
|
|
|
};
|
|
|
|
|
2017-07-21 14:31:58 +00:00
|
|
|
extern "C" const char *printGPSCoords(int lat, int lon);
|
|
|
|
|
2017-07-15 23:51:08 +00:00
|
|
|
#endif
|