2017-07-16 23:04:05 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2017-07-14 21:54:13 +00:00
|
|
|
#ifndef MAPWIDGET_H
|
|
|
|
#define MAPWIDGET_H
|
|
|
|
|
|
|
|
#include <QQuickWidget>
|
2017-07-24 18:47:19 +00:00
|
|
|
#include <QList>
|
2017-07-14 21:54:13 +00:00
|
|
|
|
2017-07-15 21:19:18 +00:00
|
|
|
#undef IGNORE
|
|
|
|
|
2017-07-14 21:54:13 +00:00
|
|
|
class QResizeEvent;
|
|
|
|
class QQuickItem;
|
2017-07-16 00:16:13 +00:00
|
|
|
class MapWidgetHelper;
|
2017-07-14 22:26:13 +00:00
|
|
|
struct dive_site;
|
2017-07-14 21:54:13 +00:00
|
|
|
|
|
|
|
class MapWidget : public QQuickWidget {
|
|
|
|
|
2017-07-14 22:26:13 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2017-07-14 21:54:13 +00:00
|
|
|
public:
|
|
|
|
MapWidget(QWidget *parent = NULL);
|
|
|
|
~MapWidget();
|
|
|
|
|
|
|
|
static MapWidget *instance();
|
2017-07-15 19:58:16 +00:00
|
|
|
void reload();
|
2017-07-14 21:54:13 +00:00
|
|
|
|
2017-07-15 20:51:10 +00:00
|
|
|
signals:
|
|
|
|
void coordinatesChanged();
|
|
|
|
|
2017-07-14 22:26:13 +00:00
|
|
|
public slots:
|
|
|
|
void centerOnDiveSite(struct dive_site *);
|
2017-07-15 20:34:44 +00:00
|
|
|
void centerOnIndex(const QModelIndex& idx);
|
2017-07-15 20:13:54 +00:00
|
|
|
void endGetDiveCoordinates();
|
2017-07-15 20:41:31 +00:00
|
|
|
void repopulateLabels();
|
2017-07-15 20:51:51 +00:00
|
|
|
void prepareForGetDiveCoordinates();
|
2017-07-24 18:47:19 +00:00
|
|
|
void selectedDivesChanged(QList<int>);
|
2017-07-27 20:59:30 +00:00
|
|
|
void coordinatesChangedLocal();
|
2017-07-14 22:26:13 +00:00
|
|
|
|
2017-07-14 21:54:13 +00:00
|
|
|
private:
|
2017-07-27 20:59:30 +00:00
|
|
|
void setEditMode(bool editMode);
|
2017-07-14 21:54:13 +00:00
|
|
|
static MapWidget *m_instance;
|
|
|
|
QQuickItem *m_rootItem;
|
2017-07-16 00:16:13 +00:00
|
|
|
MapWidgetHelper *m_mapHelper;
|
2017-07-14 21:54:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAPWIDGET_H
|