File indexing completed on 2024-05-19 16:42:07

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 class QQuickIconPrivate;
0018 
0019 class QQuickIcon
0020 {
0021     Q_GADGET
0022     Q_PROPERTY(QString name READ name WRITE setName RESET resetName FINAL)
0023     Q_PROPERTY(QUrl source READ source WRITE setSource RESET resetSource FINAL)
0024     Q_PROPERTY(int width READ width WRITE setWidth RESET resetWidth FINAL)
0025     Q_PROPERTY(int height READ height WRITE setHeight RESET resetHeight FINAL)
0026     Q_PROPERTY(QColor color READ color WRITE setColor RESET resetColor FINAL)
0027     Q_PROPERTY(bool cache READ cache WRITE setCache RESET resetCache FINAL)
0028     QML_ANONYMOUS
0029 
0030 public:
0031     QQuickIcon();
0032     QQuickIcon(const QQuickIcon &other);
0033     ~QQuickIcon();
0034 
0035     QQuickIcon &operator=(const QQuickIcon &other);
0036     bool operator==(const QQuickIcon &other) const;
0037     bool operator!=(const QQuickIcon &other) const;
0038 
0039     bool isEmpty() const;
0040 
0041     QString name() const;
0042     void setName(const QString &name);
0043     void resetName();
0044 
0045     QUrl source() const;
0046     void setSource(const QUrl &source);
0047     void resetSource();
0048 
0049     QString nameOrSource() const;
0050 
0051     int width() const;
0052     void setWidth(int width);
0053     void resetWidth();
0054 
0055     int height() const;
0056     void setHeight(int height);
0057     void resetHeight();
0058 
0059     QColor color() const;
0060     void setColor(const QColor &color);
0061     void resetColor();
0062 
0063     bool cache() const;
0064     void setCache(bool cache);
0065     void resetCache();
0066 
0067     QQuickIcon resolve(const QQuickIcon &other) const;
0068 
0069 private:
0070     QExplicitlySharedDataPointer<QQuickIconPrivate> d;
0071 };
0072 
0073 #endif // QQUICKICON_P_H