1 | // Copyright (C) 2016 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 QQUICKSCALEGRID_P_P_H |
5 | #define QQUICKSCALEGRID_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 "qquickborderimage_p.h" |
19 | |
20 | #include <QtQml/qqml.h> |
21 | #include <QtCore/qobject.h> |
22 | |
23 | #include <QtQuick/private/qquickpixmapcache_p.h> |
24 | #include <private/qtquickglobal_p.h> |
25 | |
26 | QT_BEGIN_NAMESPACE |
27 | |
28 | class Q_QUICK_PRIVATE_EXPORT QQuickScaleGrid : public QObject |
29 | { |
30 | Q_OBJECT |
31 | |
32 | Q_PROPERTY(int left READ left WRITE setLeft NOTIFY leftBorderChanged FINAL) |
33 | Q_PROPERTY(int top READ top WRITE setTop NOTIFY topBorderChanged FINAL) |
34 | Q_PROPERTY(int right READ right WRITE setRight NOTIFY rightBorderChanged FINAL) |
35 | Q_PROPERTY(int bottom READ bottom WRITE setBottom NOTIFY bottomBorderChanged FINAL) |
36 | QML_ANONYMOUS |
37 | QML_ADDED_IN_VERSION(2, 0) |
38 | |
39 | public: |
40 | QQuickScaleGrid(QObject *parent=nullptr); |
41 | |
42 | bool isNull() const; |
43 | |
44 | int left() const { return _left; } |
45 | void setLeft(int); |
46 | |
47 | int top() const { return _top; } |
48 | void setTop(int); |
49 | |
50 | int right() const { return _right; } |
51 | void setRight(int); |
52 | |
53 | int bottom() const { return _bottom; } |
54 | void setBottom(int); |
55 | |
56 | Q_SIGNALS: |
57 | void borderChanged(); |
58 | void leftBorderChanged(); |
59 | void topBorderChanged(); |
60 | void rightBorderChanged(); |
61 | void bottomBorderChanged(); |
62 | |
63 | private: |
64 | int _left; |
65 | int _top; |
66 | int _right; |
67 | int _bottom; |
68 | }; |
69 | |
70 | class Q_AUTOTEST_EXPORT QQuickGridScaledImage |
71 | { |
72 | public: |
73 | QQuickGridScaledImage(); |
74 | QQuickGridScaledImage(const QQuickGridScaledImage &); |
75 | QQuickGridScaledImage(QIODevice*); |
76 | QQuickGridScaledImage &operator=(const QQuickGridScaledImage &); |
77 | bool isValid() const; |
78 | int gridLeft() const; |
79 | int gridRight() const; |
80 | int gridTop() const; |
81 | int gridBottom() const; |
82 | QQuickBorderImage::TileMode horizontalTileRule() const { return _h; } |
83 | QQuickBorderImage::TileMode verticalTileRule() const { return _v; } |
84 | |
85 | QString pixmapUrl() const; |
86 | |
87 | private: |
88 | static QQuickBorderImage::TileMode stringToRule(QStringView); |
89 | |
90 | private: |
91 | int _l; |
92 | int _r; |
93 | int _t; |
94 | int _b; |
95 | QQuickBorderImage::TileMode _h; |
96 | QQuickBorderImage::TileMode _v; |
97 | QString _pix; |
98 | }; |
99 | |
100 | QT_END_NAMESPACE |
101 | |
102 | QML_DECLARE_TYPE(QQuickScaleGrid) |
103 | |
104 | #endif // QQUICKSCALEGRID_P_P_H |
105 | |