diff options
Diffstat (limited to 'qt-ui/diveplanner.h')
-rw-r--r-- | qt-ui/diveplanner.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h index 1393d9f78..84ac4a817 100644 --- a/qt-ui/diveplanner.h +++ b/qt-ui/diveplanner.h @@ -12,6 +12,43 @@ class QListView; class QModelIndex; +struct computedPoint { + int computedTime; + unsigned int computedDepth; + computedPoint(int computedTime_, unsigned int computedDepth_) { + computedTime = computedTime_; + computedDepth = computedDepth_; + }; + computedPoint() {}; +}; + +class DivePlannerDisplay : public QAbstractTableModel { + Q_OBJECT +private: + explicit DivePlannerDisplay(QObject *parent = 0); + QVector<computedPoint> computedPoints; + +public: + static DivePlannerDisplay *instance(); + enum Sections { + COMPUTED_DEPTH, + COMPUTED_DURATION, + COLUMNS + }; + virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; + virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + virtual Qt::ItemFlags flags(const QModelIndex &index) const; + void clear(); + computedPoint at(int row); + int size(); + void removeStops(); + void addStops(); + void insertPoint(const struct computedPoint &p); +}; + class DivePlannerPointsModel : public QAbstractTableModel { Q_OBJECT public: |