| 1 | // Copyright (C) 2021 The Qt Company Ltd. | 
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only | 
| 3 |  | 
| 4 | #ifndef QQUICKMATERIALBUSYINDICATOR_P_H | 
| 5 | #define QQUICKMATERIALBUSYINDICATOR_P_H | 
| 6 |  | 
| 7 | // | 
| 8 | //  W A R N I N G | 
| 9 | //  ------------- | 
| 10 | // | 
| 11 | // This file is not part of the Qt API.  It exists purely as an | 
| 12 | // implementation detail.  This header file may change from version to | 
| 13 | // version without notice, or even be removed. | 
| 14 | // | 
| 15 | // We mean it. | 
| 16 | // | 
| 17 |  | 
| 18 | #include <QtGui/qcolor.h> | 
| 19 | #include <QtQuick/qquickitem.h> | 
| 20 | #include <QtCore/private/qglobal_p.h> | 
| 21 |  | 
| 22 | QT_BEGIN_NAMESPACE | 
| 23 |  | 
| 24 | class QQuickMaterialBusyIndicator : public QQuickItem | 
| 25 | { | 
| 26 |     Q_OBJECT | 
| 27 |     Q_PROPERTY(QColor color READ color WRITE setColor FINAL) | 
| 28 |     Q_PROPERTY(bool running READ isRunning WRITE setRunning FINAL) | 
| 29 |     QML_NAMED_ELEMENT(BusyIndicatorImpl) | 
| 30 |     QML_ADDED_IN_VERSION(2, 0) | 
| 31 |  | 
| 32 | public: | 
| 33 |     explicit QQuickMaterialBusyIndicator(QQuickItem *parent = nullptr); | 
| 34 |  | 
| 35 |     QColor color() const; | 
| 36 |     void setColor(const QColor &color); | 
| 37 |  | 
| 38 |     bool isRunning() const; | 
| 39 |     void setRunning(bool running); | 
| 40 |  | 
| 41 |     int elapsed() const; | 
| 42 |  | 
| 43 | protected: | 
| 44 |     void itemChange(ItemChange change, const ItemChangeData &data) override; | 
| 45 |     QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override; | 
| 46 |  | 
| 47 | private: | 
| 48 |     bool m_running = false; | 
| 49 |     int m_elapsed = 0; | 
| 50 |     QColor m_color = Qt::black; | 
| 51 | }; | 
| 52 |  | 
| 53 | QT_END_NAMESPACE | 
| 54 |  | 
| 55 | #endif // QQUICKMATERIALBUSYINDICATOR_P_H | 
| 56 |  |