// SPDX-License-Identifier: GPL-2.0 /* * models.h * * header file for the equipment models of Subsurface * */ #ifndef MODELS_H #define MODELS_H #include #include #include #include #include #include "core/metrics.h" #include "cleanertablemodel.h" #include "treemodel.h" struct dive; class GasSelectionModel : public QAbstractListModel { Q_OBJECT public: GasSelectionModel(const dive &d, int dcNr, QObject *parent); QVariant data(const QModelIndex &index, int role) const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override; private: std::vector> gasNames; }; class DiveTypeSelectionModel : public QAbstractListModel { Q_OBJECT public: DiveTypeSelectionModel(const dive &d, int dcNr, QObject *parent); QVariant data(const QModelIndex &index, int role) const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override; private: std::vector> diveTypes; }; class LanguageModel : public QAbstractListModel { Q_OBJECT public: static LanguageModel *instance(); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override; private: LanguageModel(QObject *parent = 0); QStringList languages; }; #endif // MODELS_H