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"
|
2019-05-03 10:10:19 +00:00
|
|
|
#include "core/subsurface-qt/DiveListNotifier.h"
|
2017-07-29 05:01:33 +00:00
|
|
|
#include <QQuickWidget>
|
|
|
|
#include <QList>
|
|
|
|
|
|
|
|
#undef IGNORE
|
|
|
|
|
|
|
|
class QResizeEvent;
|
|
|
|
class QQuickItem;
|
|
|
|
class MapWidgetHelper;
|
|
|
|
|
|
|
|
class MapWidget : public QQuickWidget {
|
|
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
MapWidget(QWidget *parent = NULL);
|
|
|
|
~MapWidget();
|
|
|
|
|
|
|
|
static MapWidget *instance();
|
|
|
|
void reload();
|
2019-08-30 14:51:59 +00:00
|
|
|
void selectionChanged();
|
2019-08-30 15:38:54 +00:00
|
|
|
void setSelected(const QVector<dive_site *> &divesites);
|
2019-08-30 13:25:59 +00:00
|
|
|
bool editMode() const;
|
2017-07-29 05:01:33 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void centerOnDiveSite(struct dive_site *);
|
|
|
|
void centerOnIndex(const QModelIndex& idx);
|
2019-05-02 20:41:24 +00:00
|
|
|
void selectedDivesChanged(const 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-06-23 07:22:26 +00:00
|
|
|
void divesChanged(const QVector<dive *> &, DiveField field);
|
2017-07-29 05:01:33 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
static MapWidget *m_instance;
|
|
|
|
QQuickItem *m_rootItem;
|
|
|
|
MapWidgetHelper *m_mapHelper;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAPWIDGET_H
|