summaryrefslogtreecommitdiffstats
path: root/qt-models/divelocationmodel.h
blob: 4e5adf10475d65ef595bfe1714456f784fd8dde8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef DIVELOCATIONMODEL_H
#define DIVELOCATIONMODEL_H

#include <QAbstractListModel>
#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;
};

#endif