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();
|
|
|
|
|
|
|
|
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>);
|
2019-03-14 22:28:45 +00:00
|
|
|
void coordinatesChanged(struct dive_site *ds, const location_t &);
|
2017-07-29 04:19:00 +00:00
|
|
|
void doneLoading(QQuickWidget::Status status);
|
2019-03-14 21:48:03 +00:00
|
|
|
void diveSiteChanged(struct dive_site *ds, int field);
|
2017-07-29 05:01:33 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static MapWidget *m_instance;
|
|
|
|
QQuickItem *m_rootItem;
|
|
|
|
MapWidgetHelper *m_mapHelper;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAPWIDGET_H
|