| 1 | // Copyright (C) 2024 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 QQUICKVECTORIMAGE_P_P_H |
| 5 | #define QQUICKVECTORIMAGE_P_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 <QQuickPaintedItem> |
| 19 | #include <QSvgRenderer> |
| 20 | #include <private/qquickitem_p.h> |
| 21 | #include "qquickvectorimage_p.h" |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | class QQuickVectorImagePrivate : public QQuickItemPrivate |
| 26 | { |
| 27 | Q_DECLARE_PUBLIC(QQuickVectorImage) |
| 28 | public: |
| 29 | QQuickVectorImagePrivate() = default; |
| 30 | virtual ~QQuickVectorImagePrivate() = default; |
| 31 | |
| 32 | void setSource(const QUrl &source); |
| 33 | void loadSvg(); |
| 34 | |
| 35 | enum Format { |
| 36 | Unknown, |
| 37 | Svg |
| 38 | }; |
| 39 | QQuickVectorImagePrivate::Format formatFromFilePath(const QString &filePath); |
| 40 | |
| 41 | QUrl sourceFile; |
| 42 | QQuickItem *svgItem = nullptr; |
| 43 | QQuickVectorImage::FillMode fillMode = QQuickVectorImage::Stretch; |
| 44 | QQuickVectorImage::RendererType preferredRendererType = QQuickVectorImage::GeometryRenderer; |
| 45 | }; |
| 46 | |
| 47 | QT_END_NAMESPACE |
| 48 | |
| 49 | #endif // QQUICKVECTORIMAGE_P_P_H |
| 50 |
