File indexing completed on 2024-05-12 05:38:56

0001 /* SPDX-FileCopyrightText: 2020 Noah Davis <noahadvs@gmail.com>
0002  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0003  */
0004 
0005 #ifndef BREEZEDIAL_H
0006 #define BREEZEDIAL_H
0007 
0008 #include <QtQuick>
0009 
0010 class BreezeDialPrivate;
0011 
0012 class BreezeDial : public QQuickPaintedItem
0013 {
0014     Q_OBJECT
0015     Q_PROPERTY(QColor backgroundBorderColor READ backgroundBorderColor WRITE setBackgroundBorderColor NOTIFY backgroundBorderColorChanged)
0016     Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged)
0017     Q_PROPERTY(QColor fillBorderColor READ fillBorderColor WRITE setFillBorderColor NOTIFY fillBorderColorChanged)
0018     Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged)
0019     Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged)
0020     Q_PROPERTY(qreal grooveThickness READ grooveThickness WRITE setGrooveThickness NOTIFY grooveThicknessChanged)
0021     Q_PROPERTY(bool notchesVisible READ notchesVisible WRITE setNotchesVisible NOTIFY notchesVisibleChanged)
0022     QML_NAMED_ELEMENT(BreezeDial)
0023 
0024 public:
0025     explicit BreezeDial(QQuickItem *parent = nullptr);
0026     ~BreezeDial();
0027 
0028     void paint(QPainter *painter) override;
0029 
0030     QColor backgroundBorderColor() const;
0031     void setBackgroundBorderColor(const QColor &color);
0032 
0033     QColor backgroundColor() const;
0034     void setBackgroundColor(const QColor &color);
0035 
0036     QColor fillBorderColor() const;
0037     void setFillBorderColor(const QColor &color);
0038 
0039     QColor fillColor() const;
0040     void setFillColor(const QColor &color);
0041 
0042     qreal angle() const;
0043     void setAngle(const qreal angle);
0044 
0045     qreal grooveThickness() const;
0046     void setGrooveThickness(const qreal grooveThickness);
0047 
0048     bool notchesVisible() const;
0049     void setNotchesVisible(const qreal notchesVisible);
0050 
0051 Q_SIGNALS:
0052     void backgroundBorderColorChanged();
0053     void backgroundColorChanged();
0054     void fillBorderColorChanged();
0055     void fillColorChanged();
0056     void angleChanged();
0057     void grooveThicknessChanged();
0058     void notchesVisibleChanged();
0059 
0060 private:
0061     const std::unique_ptr<BreezeDialPrivate> d_ptr;
0062     Q_DECLARE_PRIVATE(BreezeDial)
0063     Q_DISABLE_COPY(BreezeDial)
0064 };
0065 
0066 #endif