subsurface/qt-models/divelocationmodel.h
Tomaz Canabrava 7f83b35ec9 Add model to populate the Preferences for GeoRef
Simple model that list the options for GeoRef.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 17:10:57 -07:00

34 lines
991 B
C++

#ifndef DIVELOCATIONMODEL_H
#define DIVELOCATIONMODEL_H
#include <QAbstractListModel>
#include <QStringListModel>
#include <stdint.h>
class LocationInformationModel : public QAbstractListModel {
Q_OBJECT
public:
enum { DIVE_SITE_UUID = Qt::UserRole+1};
static LocationInformationModel *instance();
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index = QModelIndex(), int role = Qt::DisplayRole) const;
int32_t addDiveSite(const QString& name, int lat = 0, int lon = 0);
bool setData(const QModelIndex &index, const QVariant &value, int role);
bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
public slots:
void update();
private:
LocationInformationModel(QObject *obj = 0);
int internalRowCount;
};
class GeoReferencingOptionsModel : public QStringListModel {
Q_OBJECT
public:
static GeoReferencingOptionsModel *instance();
private:
GeoReferencingOptionsModel(QObject *parent = 0);
};
#endif