| 
									
										
										
										
											2017-04-27 20:24:53 +02:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | #ifndef DIVE_QOBJECT_H
 | 
					
						
							|  |  |  | #define DIVE_QOBJECT_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-31 22:27:07 +01:00
										 |  |  | #include "CylinderObjectHelper.h"
 | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | #include <QObject>
 | 
					
						
							|  |  |  | #include <QString>
 | 
					
						
							| 
									
										
										
										
											2016-01-11 06:09:27 -08:00
										 |  |  | #include <QStringList>
 | 
					
						
							| 
									
										
										
										
											2018-03-12 18:21:39 -07:00
										 |  |  | #include <QVariant>
 | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | 
 | 
					
						
							|  |  |  | class DiveObjectHelper : public QObject { | 
					
						
							| 
									
										
										
										
											2016-01-11 06:14:45 -08:00
										 |  |  | 	Q_OBJECT | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | 	Q_PROPERTY(int number READ number CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(int id READ id CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(int rating READ rating CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-07-16 09:59:05 +01:00
										 |  |  | 	Q_PROPERTY(int visibility READ visibility CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | 	Q_PROPERTY(QString date READ date CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(QString time READ time CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-04-14 05:38:11 -07:00
										 |  |  | 	Q_PROPERTY(int timestamp READ timestamp CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | 	Q_PROPERTY(QString location READ location CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(QString gps READ gps CONSTANT) | 
					
						
							| 
									
										
										
										
											2017-03-21 17:52:29 +01:00
										 |  |  | 	Q_PROPERTY(QString gps_decimal READ gps_decimal CONSTANT) | 
					
						
							| 
									
										
										
										
											2018-10-25 20:46:12 +02:00
										 |  |  | 	Q_PROPERTY(QVariant dive_site READ dive_site CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | 	Q_PROPERTY(QString duration READ duration CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-02-14 16:26:37 -08:00
										 |  |  | 	Q_PROPERTY(bool noDive READ noDive CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | 	Q_PROPERTY(QString depth READ depth CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(QString divemaster READ divemaster CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(QString buddy READ buddy CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(QString airTemp READ airTemp CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(QString waterTemp READ waterTemp CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(QString notes READ notes CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(QString tags READ tags CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(QString gas READ gas CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(QString sac READ sac CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-02-29 16:42:07 +02:00
										 |  |  | 	Q_PROPERTY(QString weightList READ weightList CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | 	Q_PROPERTY(QStringList weights READ weights CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-02-05 22:53:12 -08:00
										 |  |  | 	Q_PROPERTY(bool singleWeight READ singleWeight CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | 	Q_PROPERTY(QString suit READ suit CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-08-30 16:24:19 +02:00
										 |  |  | 	Q_PROPERTY(QStringList cylinderList READ cylinderList CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | 	Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-07-31 22:27:07 +01:00
										 |  |  | 	Q_PROPERTY(QList<CylinderObjectHelper*> cylinderObjects READ cylinderObjects CONSTANT) | 
					
						
							| 
									
										
										
										
											2018-11-22 22:10:38 +01:00
										 |  |  | 	Q_PROPERTY(QString tripId READ tripId CONSTANT) | 
					
						
							| 
									
										
										
										
											2018-04-14 17:34:33 -07:00
										 |  |  | 	Q_PROPERTY(int tripNrDives READ tripNrDives CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-07-18 23:08:27 +01:00
										 |  |  | 	Q_PROPERTY(int maxcns READ maxcns CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(int otu READ otu CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-01-27 18:34:34 +01:00
										 |  |  | 	Q_PROPERTY(QString sumWeight READ sumWeight CONSTANT) | 
					
						
							| 
									
										
										
										
											2018-07-12 11:57:21 +02:00
										 |  |  | 	Q_PROPERTY(QStringList getCylinder READ getCylinder CONSTANT) | 
					
						
							| 
									
										
										
										
											2018-07-17 11:49:42 +02:00
										 |  |  | 	Q_PROPERTY(QStringList startPressure READ startPressure CONSTANT) | 
					
						
							|  |  |  | 	Q_PROPERTY(QStringList endPressure READ endPressure CONSTANT) | 
					
						
							| 
									
										
										
										
											2018-07-16 18:25:21 +02:00
										 |  |  | 	Q_PROPERTY(QStringList firstGas READ firstGas CONSTANT) | 
					
						
							| 
									
										
										
										
											2018-10-16 07:56:41 -04:00
										 |  |  | 	Q_PROPERTY(QString fullText READ fullText CONSTANT) | 
					
						
							| 
									
										
										
										
											2018-10-19 21:15:56 -04:00
										 |  |  | 	Q_PROPERTY(QString fullTextNoNotes READ fullTextNoNotes CONSTANT) | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2016-01-11 06:14:45 -08:00
										 |  |  | 	DiveObjectHelper(struct dive *dive = NULL); | 
					
						
							|  |  |  | 	~DiveObjectHelper(); | 
					
						
							|  |  |  | 	int number() const; | 
					
						
							|  |  |  | 	int id() const; | 
					
						
							| 
									
										
										
										
											2018-10-24 21:14:33 +01:00
										 |  |  | 	struct dive *getDive() const; | 
					
						
							| 
									
										
										
										
											2016-01-11 06:14:45 -08:00
										 |  |  | 	int rating() const; | 
					
						
							| 
									
										
										
										
											2016-07-16 09:59:05 +01:00
										 |  |  | 	int visibility() const; | 
					
						
							| 
									
										
										
										
											2016-01-11 06:14:45 -08:00
										 |  |  | 	QString date() const; | 
					
						
							|  |  |  | 	timestamp_t timestamp() const; | 
					
						
							|  |  |  | 	QString time() const; | 
					
						
							|  |  |  | 	QString location() const; | 
					
						
							|  |  |  | 	QString gps() const; | 
					
						
							| 
									
										
										
										
											2017-03-21 17:52:29 +01:00
										 |  |  | 	QString gps_decimal() const; | 
					
						
							| 
									
										
										
										
											2018-10-25 20:46:12 +02:00
										 |  |  | 	QVariant dive_site() const; | 
					
						
							| 
									
										
										
										
											2016-01-11 06:14:45 -08:00
										 |  |  | 	QString duration() const; | 
					
						
							| 
									
										
										
										
											2016-02-14 16:26:37 -08:00
										 |  |  | 	bool noDive() const; | 
					
						
							| 
									
										
										
										
											2016-01-11 06:14:45 -08:00
										 |  |  | 	QString depth() const; | 
					
						
							|  |  |  | 	QString divemaster() const; | 
					
						
							|  |  |  | 	QString buddy() const; | 
					
						
							|  |  |  | 	QString airTemp() const; | 
					
						
							|  |  |  | 	QString waterTemp() const; | 
					
						
							|  |  |  | 	QString notes() const; | 
					
						
							|  |  |  | 	QString tags() const; | 
					
						
							|  |  |  | 	QString gas() const; | 
					
						
							|  |  |  | 	QString sac() const; | 
					
						
							| 
									
										
										
										
											2016-02-29 16:42:07 +02:00
										 |  |  | 	QString weightList() const; | 
					
						
							| 
									
										
										
										
											2016-01-11 06:14:45 -08:00
										 |  |  | 	QStringList weights() const; | 
					
						
							|  |  |  | 	QString weight(int idx) const; | 
					
						
							| 
									
										
										
										
											2016-02-05 22:53:12 -08:00
										 |  |  | 	bool singleWeight() const; | 
					
						
							| 
									
										
										
										
											2016-01-11 06:14:45 -08:00
										 |  |  | 	QString suit() const; | 
					
						
							| 
									
										
										
										
											2016-08-30 16:24:19 +02:00
										 |  |  | 	QStringList cylinderList() const; | 
					
						
							| 
									
										
										
										
											2016-01-11 06:14:45 -08:00
										 |  |  | 	QStringList cylinders() const; | 
					
						
							|  |  |  | 	QString cylinder(int idx) const; | 
					
						
							| 
									
										
										
										
											2016-07-31 22:27:07 +01:00
										 |  |  | 	QList<CylinderObjectHelper*> cylinderObjects() const; | 
					
						
							| 
									
										
										
										
											2018-11-22 22:10:38 +01:00
										 |  |  | 	QString tripId() const; | 
					
						
							| 
									
										
										
										
											2018-04-14 17:34:33 -07:00
										 |  |  | 	int tripNrDives() const; | 
					
						
							| 
									
										
										
										
											2016-07-18 23:08:27 +01:00
										 |  |  | 	int maxcns() const; | 
					
						
							|  |  |  | 	int otu() const; | 
					
						
							| 
									
										
										
										
											2016-01-27 18:34:34 +01:00
										 |  |  | 	QString sumWeight() const; | 
					
						
							| 
									
										
										
										
											2018-07-12 11:57:21 +02:00
										 |  |  | 	QStringList getCylinder() const; | 
					
						
							| 
									
										
										
										
											2018-07-17 11:49:42 +02:00
										 |  |  | 	QStringList startPressure() const; | 
					
						
							|  |  |  | 	QStringList endPressure() const; | 
					
						
							| 
									
										
										
										
											2018-07-16 18:25:21 +02:00
										 |  |  | 	QStringList firstGas() const; | 
					
						
							| 
									
										
										
										
											2018-10-16 07:56:41 -04:00
										 |  |  | 	QString fullText() const; | 
					
						
							| 
									
										
										
										
											2018-10-19 21:15:56 -04:00
										 |  |  | 	QString fullTextNoNotes() const; | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-11 06:14:45 -08:00
										 |  |  | private: | 
					
						
							|  |  |  | 	struct dive *m_dive; | 
					
						
							| 
									
										
										
										
											2016-07-31 22:27:07 +01:00
										 |  |  | 	QList<CylinderObjectHelper*> m_cyls; | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2016-01-11 06:14:45 -08:00
										 |  |  | 	Q_DECLARE_METATYPE(DiveObjectHelper *) | 
					
						
							| 
									
										
										
										
											2016-01-07 16:01:24 -02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-11 06:09:27 -08:00
										 |  |  | #endif
 |