2017-07-28 22:01:33 -07:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef MAPWIDGET_H
|
|
|
|
#define MAPWIDGET_H
|
|
|
|
|
2018-10-08 12:57:46 +02:00
|
|
|
#include "core/units.h"
|
2017-07-28 22:01:33 -07: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 21:16:40 +02:00
|
|
|
void centerOnSelectedDiveSite();
|
2017-07-28 22:01:33 -07:00
|
|
|
void centerOnDiveSite(struct dive_site *);
|
|
|
|
void centerOnIndex(const QModelIndex& idx);
|
|
|
|
void endGetDiveCoordinates();
|
|
|
|
void repopulateLabels();
|
2018-10-25 10:07:45 +02:00
|
|
|
void prepareForGetDiveCoordinates(struct dive_site *ds);
|
2017-07-28 22:01:33 -07:00
|
|
|
void selectedDivesChanged(QList<int>);
|
2019-03-14 23:28:45 +01:00
|
|
|
void coordinatesChanged(struct dive_site *ds, const location_t &);
|
2017-07-28 21:19:00 -07:00
|
|
|
void doneLoading(QQuickWidget::Status status);
|
2019-03-14 22:48:03 +01:00
|
|
|
void diveSiteChanged(struct dive_site *ds, int field);
|
2017-07-28 22:01:33 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
static MapWidget *m_instance;
|
|
|
|
QQuickItem *m_rootItem;
|
|
|
|
MapWidgetHelper *m_mapHelper;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAPWIDGET_H
|