2015-05-30 00:19:44 +00:00
|
|
|
#ifndef DIVELOCATIONMODEL_H
|
|
|
|
#define DIVELOCATIONMODEL_H
|
|
|
|
|
2015-07-01 21:46:27 +00:00
|
|
|
#include <QAbstractTableModel>
|
2015-06-22 20:24:15 +00:00
|
|
|
#include <QStringListModel>
|
2015-06-01 20:54:13 +00:00
|
|
|
#include <stdint.h>
|
2015-05-30 00:19:44 +00:00
|
|
|
|
2015-07-14 21:43:47 +00:00
|
|
|
class QLineEdit;
|
|
|
|
|
2015-08-26 00:03:20 +00:00
|
|
|
#define RECENTLY_ADDED_DIVESITE 1
|
|
|
|
|
2015-07-01 21:46:27 +00:00
|
|
|
class LocationInformationModel : public QAbstractTableModel {
|
2015-05-30 00:19:44 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-07-01 21:46:27 +00:00
|
|
|
enum Columns { UUID, NAME, LATITUDE, LONGITUDE, COORDS, DESCRIPTION, NOTES, TAXONOMY_1, TAXONOMY_2, TAXONOMY_3, COLUMNS};
|
2015-05-30 01:22:24 +00:00
|
|
|
static LocationInformationModel *instance();
|
2015-07-01 21:46:27 +00:00
|
|
|
int columnCount(const QModelIndex &parent) const;
|
2015-05-30 00:19:44 +00:00
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
QVariant data(const QModelIndex &index = QModelIndex(), int role = Qt::DisplayRole) const;
|
2015-08-24 17:37:18 +00:00
|
|
|
int32_t addDiveSite(const QString& name, timestamp_t divetime, int lat = 0, int lon = 0);
|
2015-06-02 01:16:07 +00:00
|
|
|
bool setData(const QModelIndex &index, const QVariant &value, int role);
|
2015-06-02 02:13:51 +00:00
|
|
|
bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
|
2015-07-14 21:43:47 +00:00
|
|
|
void setFirstRowTextField(QLineEdit *textField);
|
2015-06-02 02:13:51 +00:00
|
|
|
|
2015-05-30 01:22:24 +00:00
|
|
|
public slots:
|
2015-05-30 00:19:44 +00:00
|
|
|
void update();
|
|
|
|
private:
|
2015-05-30 01:22:24 +00:00
|
|
|
LocationInformationModel(QObject *obj = 0);
|
2015-05-30 00:19:44 +00:00
|
|
|
int internalRowCount;
|
2015-07-14 21:43:47 +00:00
|
|
|
QLineEdit *textField;
|
2015-05-30 00:19:44 +00:00
|
|
|
};
|
|
|
|
|
2015-06-22 20:24:15 +00:00
|
|
|
class GeoReferencingOptionsModel : public QStringListModel {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
static GeoReferencingOptionsModel *instance();
|
|
|
|
private:
|
|
|
|
GeoReferencingOptionsModel(QObject *parent = 0);
|
|
|
|
};
|
|
|
|
|
2015-05-30 00:19:44 +00:00
|
|
|
#endif
|