| 1 | // Copyright (C) 2025 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 QSVGUTILS_P_H |
| 5 | #define QSVGUTILS_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 "qtsvgglobal_p.h" |
| 19 | #include <QString> |
| 20 | |
| 21 | QT_BEGIN_NAMESPACE |
| 22 | |
| 23 | namespace QSvgUtils { |
| 24 | |
| 25 | enum LengthType { |
| 26 | LT_PERCENT, |
| 27 | LT_PX, |
| 28 | LT_PC, |
| 29 | LT_PT, |
| 30 | LT_MM, |
| 31 | LT_CM, |
| 32 | LT_IN, |
| 33 | LT_OTHER |
| 34 | }; |
| 35 | |
| 36 | bool isDigit(ushort ch); |
| 37 | qreal toDouble(const QChar *&str); |
| 38 | qreal toDouble(QStringView str, bool *ok = NULL); |
| 39 | qreal parseLength(QStringView str, LengthType *type, bool *ok = NULL); |
| 40 | qreal convertToPixels(qreal len, bool , LengthType type); |
| 41 | |
| 42 | }; |
| 43 | |
| 44 | QT_END_NAMESPACE |
| 45 | |
| 46 | #endif // QSVGUTILS_P_H |
| 47 | |