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

0001 /* SPDX-FileCopyrightText: 2017 The Qt Company Ltd.
0002  * SPDX-FileCopyrightText: 2020 Noah Davis <noahadvs@gmail.com>
0003  * SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-or-later
0004  */
0005 // Almost completely copy/pasted from qtquickcontrols2 so that I don't need to depend on private headers
0006 
0007 #ifndef QQUICKICON_P_H
0008 #define QQUICKICON_P_H
0009 
0010 #include <QtCore/qobjectdefs.h>
0011 #include <QtCore/qshareddata.h>
0012 #include <QtCore/qstring.h>
0013 #include <QtCore/qurl.h>
0014 #include <QtGui/qcolor.h>
0015 #include <QtQml/qqml.h>
0016 
0017 namespace Breeze
0018 {
0019 
0020 class QQuickIconPrivate;
0021 
0022 class QQuickIcon
0023 {
0024     Q_GADGET
0025     Q_PROPERTY(QString name READ name WRITE setName RESET resetName FINAL)
0026     Q_PROPERTY(QUrl source READ source WRITE setSource RESET resetSource FINAL)
0027     Q_PROPERTY(int width READ width WRITE setWidth RESET resetWidth FINAL)
0028     Q_PROPERTY(int height READ height WRITE setHeight RESET resetHeight FINAL)
0029     Q_PROPERTY(QColor color READ color WRITE setColor RESET resetColor FINAL)
0030     Q_PROPERTY(bool cache READ cache WRITE setCache RESET resetCache FINAL)
0031 
0032 public:
0033     QQuickIcon();
0034     QQuickIcon(const QQuickIcon &other);
0035     ~QQuickIcon();
0036 
0037     QQuickIcon &operator=(const QQuickIcon &other);
0038     bool operator==(const QQuickIcon &other) const;
0039     bool operator!=(const QQuickIcon &other) const;
0040 
0041     bool isEmpty() const;
0042 
0043     QString name() const;
0044     void setName(const QString &name);
0045     void resetName();
0046 
0047     QUrl source() const;
0048     void setSource(const QUrl &source);
0049     void resetSource();
0050 
0051     QString nameOrSource() const;
0052 
0053     int width() const;
0054     void setWidth(int width);
0055     void resetWidth();
0056 
0057     int height() const;
0058     void setHeight(int height);
0059     void resetHeight();
0060 
0061     QColor color() const;
0062     void setColor(const QColor &color);
0063     void resetColor();
0064 
0065     bool cache() const;
0066     void setCache(bool cache);
0067     void resetCache();
0068 
0069     QQuickIcon resolve(const QQuickIcon &other) const;
0070 
0071 private:
0072     QExplicitlySharedDataPointer<QQuickIconPrivate> d;
0073 };
0074 
0075 }
0076 
0077 #endif // QQUICKICON_P_H