2016-01-07 18:01:24 +00:00
|
|
|
#ifndef DIVE_QOBJECT_H
|
|
|
|
#define DIVE_QOBJECT_H
|
|
|
|
|
|
|
|
#include "../dive.h"
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
2016-01-11 14:09:27 +00:00
|
|
|
#include <QStringList>
|
2016-01-07 18:01:24 +00:00
|
|
|
|
|
|
|
class DiveObjectHelper : public QObject {
|
2016-01-11 14:14:45 +00:00
|
|
|
Q_OBJECT
|
2016-01-07 18:01:24 +00:00
|
|
|
Q_PROPERTY(int number READ number CONSTANT)
|
|
|
|
Q_PROPERTY(int id READ id CONSTANT)
|
|
|
|
Q_PROPERTY(int rating READ rating CONSTANT)
|
|
|
|
Q_PROPERTY(QString date READ date CONSTANT)
|
|
|
|
Q_PROPERTY(QString time READ time CONSTANT)
|
|
|
|
Q_PROPERTY(QString location READ location CONSTANT)
|
|
|
|
Q_PROPERTY(QString gps READ gps CONSTANT)
|
|
|
|
Q_PROPERTY(QString duration READ duration CONSTANT)
|
2016-02-15 00:26:37 +00:00
|
|
|
Q_PROPERTY(bool noDive READ noDive CONSTANT)
|
2016-01-07 18:01:24 +00: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)
|
|
|
|
Q_PROPERTY(QStringList weights READ weights CONSTANT)
|
2016-02-06 06:53:12 +00:00
|
|
|
Q_PROPERTY(bool singleWeight READ singleWeight CONSTANT)
|
2016-01-07 18:01:24 +00:00
|
|
|
Q_PROPERTY(QString suit READ suit CONSTANT)
|
|
|
|
Q_PROPERTY(QStringList cylinders READ cylinders CONSTANT)
|
|
|
|
Q_PROPERTY(QString trip READ trip CONSTANT)
|
2016-01-27 04:06:30 +00:00
|
|
|
Q_PROPERTY(QString tripMeta READ tripMeta CONSTANT)
|
2016-01-07 18:01:24 +00:00
|
|
|
Q_PROPERTY(QString maxcns READ maxcns CONSTANT)
|
|
|
|
Q_PROPERTY(QString otu READ otu CONSTANT)
|
2016-01-27 17:34:34 +00:00
|
|
|
Q_PROPERTY(QString sumWeight READ sumWeight CONSTANT)
|
2016-02-15 00:26:37 +00:00
|
|
|
Q_PROPERTY(QString getCylinder READ getCylinder CONSTANT)
|
|
|
|
Q_PROPERTY(QString startPressure READ startPressure CONSTANT)
|
|
|
|
Q_PROPERTY(QString endPressure READ endPressure CONSTANT)
|
|
|
|
Q_PROPERTY(QString firstGas READ firstGas CONSTANT)
|
2016-01-07 18:01:24 +00:00
|
|
|
public:
|
2016-01-11 14:14:45 +00:00
|
|
|
DiveObjectHelper(struct dive *dive = NULL);
|
|
|
|
~DiveObjectHelper();
|
|
|
|
int number() const;
|
|
|
|
int id() const;
|
|
|
|
int rating() const;
|
|
|
|
QString date() const;
|
|
|
|
timestamp_t timestamp() const;
|
|
|
|
QString time() const;
|
|
|
|
QString location() const;
|
|
|
|
QString gps() const;
|
|
|
|
QString duration() const;
|
2016-02-15 00:26:37 +00:00
|
|
|
bool noDive() const;
|
2016-01-11 14:14:45 +00: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;
|
|
|
|
QStringList weights() const;
|
|
|
|
QString weight(int idx) const;
|
2016-02-06 06:53:12 +00:00
|
|
|
bool singleWeight() const;
|
2016-01-11 14:14:45 +00:00
|
|
|
QString suit() const;
|
|
|
|
QStringList cylinders() const;
|
|
|
|
QString cylinder(int idx) const;
|
|
|
|
QString trip() const;
|
2016-01-27 04:06:30 +00:00
|
|
|
QString tripMeta() const;
|
2016-01-11 14:14:45 +00:00
|
|
|
QString maxcns() const;
|
|
|
|
QString otu() const;
|
2016-01-27 17:34:34 +00:00
|
|
|
QString sumWeight() const;
|
|
|
|
QString getCylinder() const;
|
2016-02-09 16:19:06 +00:00
|
|
|
QString startPressure() const;
|
|
|
|
QString endPressure() const;
|
2016-02-13 17:34:29 +00:00
|
|
|
QString firstGas() const;
|
2016-01-07 18:01:24 +00:00
|
|
|
|
2016-01-11 14:14:45 +00:00
|
|
|
private:
|
|
|
|
struct dive *m_dive;
|
2016-01-07 18:01:24 +00:00
|
|
|
};
|
2016-01-11 14:14:45 +00:00
|
|
|
Q_DECLARE_METATYPE(DiveObjectHelper *)
|
2016-01-07 18:01:24 +00:00
|
|
|
|
2016-01-11 14:09:27 +00:00
|
|
|
#endif
|