| 
									
										
										
										
											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"
 | 
					
						
							| 
									
										
										
										
											2019-05-03 12:10:19 +02:00
										 |  |  | #include "core/subsurface-qt/DiveListNotifier.h"
 | 
					
						
							| 
									
										
										
										
											2017-07-28 22:01:33 -07: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 16:51:59 +02:00
										 |  |  | 	void selectionChanged(); | 
					
						
							| 
									
										
										
										
											2019-08-30 17:38:54 +02:00
										 |  |  | 	void setSelected(const QVector<dive_site *> &divesites); | 
					
						
							| 
									
										
										
										
											2019-08-30 15:25:59 +02:00
										 |  |  | 	bool editMode() const; | 
					
						
							| 
									
										
										
										
											2017-07-28 22:01:33 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | public slots: | 
					
						
							|  |  |  | 	void centerOnDiveSite(struct dive_site *); | 
					
						
							|  |  |  | 	void centerOnIndex(const QModelIndex& idx); | 
					
						
							| 
									
										
										
										
											2019-05-02 22:41:24 +02:00
										 |  |  | 	void selectedDivesChanged(const 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-06-23 09:22:26 +02:00
										 |  |  | 	void divesChanged(const QVector<dive *> &, DiveField field); | 
					
						
							| 
									
										
										
										
											2017-07-28 22:01:33 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  | 	static MapWidget *m_instance; | 
					
						
							|  |  |  | 	QQuickItem *m_rootItem; | 
					
						
							|  |  |  | 	MapWidgetHelper *m_mapHelper; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // MAPWIDGET_H
 |