2017-07-29 05:01:33 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef MAPWIDGET_H
|
|
|
|
#define MAPWIDGET_H
|
|
|
|
|
2018-10-08 10:57:46 +00:00
|
|
|
#include "core/units.h"
|
2017-07-29 05:01:33 +00:00
|
|
|
#include <QQuickWidget>
|
|
|
|
#include <QList>
|
|
|
|
|
|
|
|
#undef IGNORE
|
|
|
|
|
|
|
|
class QResizeEvent;
|
|
|
|
class QQuickItem;
|
|
|
|
class MapWidgetHelper;
|
|
|
|
struct dive_site;
|
|
|
|
|
|
|
|
class MapWidget : public QQuickWidget {
|
|
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
MapWidget(QWidget *parent = NULL);
|
|
|
|
~MapWidget();
|
|
|
|
|
|
|
|
static MapWidget *instance();
|
|
|
|
void reload();
|
|
|
|
|
|
|
|
signals:
|
2018-10-20 18:12:15 +00:00
|
|
|
void coordinatesChanged(const location_t &);
|
2017-07-29 05:01:33 +00:00
|
|
|
|
|
|
|
public slots:
|
2018-10-08 19:16:40 +00:00
|
|
|
void centerOnSelectedDiveSite();
|
2017-07-29 05:01:33 +00:00
|
|
|
void centerOnDiveSite(struct dive_site *);
|
|
|
|
void centerOnIndex(const QModelIndex& idx);
|
|
|
|
void endGetDiveCoordinates();
|
|
|
|
void repopulateLabels();
|
2018-10-25 08:07:45 +00:00
|
|
|
void prepareForGetDiveCoordinates(struct dive_site *ds);
|
2017-07-29 05:01:33 +00:00
|
|
|
void selectedDivesChanged(QList<int>);
|
2018-10-20 18:12:15 +00:00
|
|
|
void coordinatesChangedLocal(const location_t &);
|
2017-07-29 04:19:00 +00:00
|
|
|
void doneLoading(QQuickWidget::Status status);
|
2018-10-25 10:23:19 +00:00
|
|
|
void updateDiveSiteCoordinates(struct dive_site *ds, const location_t &);
|
2017-07-29 05:01:33 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static MapWidget *m_instance;
|
|
|
|
QQuickItem *m_rootItem;
|
|
|
|
MapWidgetHelper *m_mapHelper;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAPWIDGET_H
|