subsurface/mobile-widgets/qmlmapwidgethelper.h
Lubomir I. Ivanov c078e350e0 mapwidgethelper: emit a selectedDivesChanged() signal
The signal emits a QList<int> filled with dive idexes from the
main backend dive table.

The MapWidgetHelper QML instance handles that in onSelectedDivesChanged().
This will only be needed for the mobile version, as the desktop version
should connect it's own slot in MapWidget.cpp.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00

42 lines
1 KiB
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef QMLMAPWIDGETHELPER_H
#define QMLMAPWIDGETHELPER_H
#include <QObject>
class QGeoCoordinate;
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)
public:
explicit MapWidgetHelper(QObject *parent = NULL);
void centerOnDiveSite(struct dive_site *);
void reloadMapLocations();
Q_INVOKABLE void copyToClipboardCoordinates(QGeoCoordinate coord, bool formatTraditional);
Q_INVOKABLE void calculateSmallCircleRadius(QGeoCoordinate coord);
private:
QObject *m_map;
MapLocationModel *m_mapLocationModel;
qreal m_smallCircleRadius;
QList<int> m_selectedDiveIds;
private slots:
void selectedLocationChanged(MapLocation *);
signals:
void modelChanged();
void selectedDivesChanged(QList<int> list);
};
extern "C" const char *printGPSCoords(int lat, int lon);
#endif