| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QCANDLESTICKMODELMAPPER_H |
| 5 | #define QCANDLESTICKMODELMAPPER_H |
| 6 | |
| 7 | #include <QtCharts/QChartGlobal> |
| 8 | #include <QtCore/QObject> |
| 9 | |
| 10 | Q_MOC_INCLUDE(<QtCharts/qcandlestickseries.h>) |
| 11 | Q_MOC_INCLUDE(<QtCore/qabstractitemmodel.h>) |
| 12 | |
| 13 | QT_BEGIN_NAMESPACE |
| 14 | class QAbstractItemModel; |
| 15 | QT_END_NAMESPACE |
| 16 | |
| 17 | QT_BEGIN_NAMESPACE |
| 18 | |
| 19 | class QCandlestickModelMapperPrivate; |
| 20 | class QCandlestickSeries; |
| 21 | |
| 22 | class Q_CHARTS_EXPORT QCandlestickModelMapper : public QObject |
| 23 | { |
| 24 | Q_OBJECT |
| 25 | Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced) |
| 26 | Q_PROPERTY(QCandlestickSeries *series READ series WRITE setSeries NOTIFY seriesReplaced) |
| 27 | |
| 28 | public: |
| 29 | explicit QCandlestickModelMapper(QObject *parent = nullptr); |
| 30 | |
| 31 | void setModel(QAbstractItemModel *model); |
| 32 | QAbstractItemModel *model() const; |
| 33 | |
| 34 | void setSeries(QCandlestickSeries *series); |
| 35 | QCandlestickSeries *series() const; |
| 36 | |
| 37 | virtual Qt::Orientation orientation() const = 0; |
| 38 | |
| 39 | Q_SIGNALS: |
| 40 | void modelReplaced(); |
| 41 | void seriesReplaced(); |
| 42 | |
| 43 | protected: |
| 44 | void setTimestamp(int timestamp); |
| 45 | int timestamp() const; |
| 46 | |
| 47 | void setOpen(int open); |
| 48 | int open() const; |
| 49 | |
| 50 | void setHigh(int high); |
| 51 | int high() const; |
| 52 | |
| 53 | void setLow(int low); |
| 54 | int low() const; |
| 55 | |
| 56 | void setClose(int close); |
| 57 | int close() const; |
| 58 | |
| 59 | void setFirstSetSection(int firstSetSection); |
| 60 | int firstSetSection() const; |
| 61 | |
| 62 | void setLastSetSection(int lastSetSection); |
| 63 | int lastSetSection() const; |
| 64 | |
| 65 | protected: |
| 66 | QCandlestickModelMapperPrivate * const d_ptr; |
| 67 | Q_DECLARE_PRIVATE(QCandlestickModelMapper) |
| 68 | }; |
| 69 | |
| 70 | QT_END_NAMESPACE |
| 71 | |
| 72 | #endif // QCANDLESTICKMODELMAPPER_H |
| 73 | |