2017-07-29 05:01:33 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef QMLMAPWIDGETHELPER_H
|
|
|
|
#define QMLMAPWIDGETHELPER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2018-03-08 19:35:44 +00:00
|
|
|
#include <QGeoCoordinate>
|
|
|
|
#include <QVariant>
|
2017-07-29 05:01:33 +00:00
|
|
|
|
|
|
|
class MapLocationModel;
|
|
|
|
class MapLocation;
|
|
|
|
struct dive_site;
|
|
|
|
|
|
|
|
class MapWidgetHelper : public QObject {
|
|
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QObject *map MEMBER m_map)
|
|
|
|
Q_PROPERTY(MapLocationModel *model MEMBER m_mapLocationModel NOTIFY modelChanged)
|
|
|
|
Q_PROPERTY(bool editMode READ editMode WRITE setEditMode NOTIFY editModeChanged)
|
2017-08-12 00:58:26 +00:00
|
|
|
Q_PROPERTY(QString pluginObject READ pluginObject NOTIFY pluginObjectChanged)
|
2017-07-29 05:01:33 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MapWidgetHelper(QObject *parent = NULL);
|
|
|
|
|
|
|
|
void centerOnDiveSite(struct dive_site *);
|
2018-04-02 19:48:23 +00:00
|
|
|
Q_INVOKABLE QGeoCoordinate getCoordinatesForUUID(QVariant dive_site_uuid);
|
2018-03-08 19:38:14 +00:00
|
|
|
Q_INVOKABLE void centerOnDiveSiteUUID(QVariant dive_site_uuid);
|
|
|
|
Q_INVOKABLE void reloadMapLocations();
|
2017-07-29 05:01:33 +00:00
|
|
|
Q_INVOKABLE void copyToClipboardCoordinates(QGeoCoordinate coord, bool formatTraditional);
|
|
|
|
Q_INVOKABLE void calculateSmallCircleRadius(QGeoCoordinate coord);
|
2017-11-09 16:43:21 +00:00
|
|
|
Q_INVOKABLE void updateCurrentDiveSiteCoordinatesFromMap(quint32 uuid, QGeoCoordinate coord);
|
2017-08-06 23:58:19 +00:00
|
|
|
Q_INVOKABLE void selectVisibleLocations();
|
2017-11-09 16:43:21 +00:00
|
|
|
void updateCurrentDiveSiteCoordinatesToMap();
|
2017-07-29 05:01:33 +00:00
|
|
|
bool editMode();
|
|
|
|
void setEditMode(bool editMode);
|
2017-08-12 00:58:26 +00:00
|
|
|
QString pluginObject();
|
2017-07-29 05:01:33 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QObject *m_map;
|
|
|
|
MapLocationModel *m_mapLocationModel;
|
|
|
|
qreal m_smallCircleRadius;
|
|
|
|
QList<int> m_selectedDiveIds;
|
|
|
|
bool m_editMode;
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void selectedLocationChanged(MapLocation *);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void modelChanged();
|
|
|
|
void editModeChanged();
|
|
|
|
void selectedDivesChanged(QList<int> list);
|
|
|
|
void coordinatesChanged();
|
2017-08-12 00:58:26 +00:00
|
|
|
void pluginObjectChanged();
|
2017-07-29 05:01:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|