Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickanchors_p.h |
Source code | Switch to Preprocessed file |
Line | Source | Count |
---|---|---|
1 | /**************************************************************************** | - |
2 | ** | - |
3 | ** Copyright (C) 2016 The Qt Company Ltd. | - |
4 | ** Contact: https://www.qt.io/licensing/ | - |
5 | ** | - |
6 | ** This file is part of the QtQuick module of the Qt Toolkit. | - |
7 | ** | - |
8 | ** $QT_BEGIN_LICENSE:LGPL$ | - |
9 | ** Commercial License Usage | - |
10 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
11 | ** accordance with the commercial license agreement provided with the | - |
12 | ** Software or, alternatively, in accordance with the terms contained in | - |
13 | ** a written agreement between you and The Qt Company. For licensing terms | - |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - |
15 | ** information use the contact form at https://www.qt.io/contact-us. | - |
16 | ** | - |
17 | ** GNU Lesser General Public License Usage | - |
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
19 | ** General Public License version 3 as published by the Free Software | - |
20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - |
21 | ** packaging of this file. Please review the following information to | - |
22 | ** ensure the GNU Lesser General Public License version 3 requirements | - |
23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - |
24 | ** | - |
25 | ** GNU General Public License Usage | - |
26 | ** Alternatively, this file may be used under the terms of the GNU | - |
27 | ** General Public License version 2.0 or (at your option) the GNU General | - |
28 | ** Public license version 3 or any later version approved by the KDE Free | - |
29 | ** Qt Foundation. The licenses are as published by the Free Software | - |
30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - |
31 | ** included in the packaging of this file. Please review the following | - |
32 | ** information to ensure the GNU General Public License requirements will | - |
33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - |
34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - |
35 | ** | - |
36 | ** $QT_END_LICENSE$ | - |
37 | ** | - |
38 | ****************************************************************************/ | - |
39 | - | |
40 | #ifndef QQUICKANCHORS_P_H | - |
41 | #define QQUICKANCHORS_P_H | - |
42 | - | |
43 | // | - |
44 | // W A R N I N G | - |
45 | // ------------- | - |
46 | // | - |
47 | // This file is not part of the Qt API. It exists purely as an | - |
48 | // implementation detail. This header file may change from version to | - |
49 | // version without notice, or even be removed. | - |
50 | // | - |
51 | // We mean it. | - |
52 | // | - |
53 | - | |
54 | #include <qqml.h> | - |
55 | - | |
56 | #include <QtCore/QObject> | - |
57 | - | |
58 | #include <private/qtquickglobal_p.h> | - |
59 | - | |
60 | QT_BEGIN_NAMESPACE | - |
61 | - | |
62 | class QQuickItem; | - |
63 | class QQuickAnchorsPrivate; | - |
64 | class QQuickAnchorLine; | - |
65 | class Q_QUICK_PRIVATE_EXPORT QQuickAnchors : public QObject | - |
66 | { | - |
67 | Q_OBJECT | - |
68 | - | |
69 | Q_PROPERTY(QQuickAnchorLine left READ left WRITE setLeft RESET resetLeft NOTIFY leftChanged) | - |
70 | Q_PROPERTY(QQuickAnchorLine right READ right WRITE setRight RESET resetRight NOTIFY rightChanged) | - |
71 | Q_PROPERTY(QQuickAnchorLine horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter NOTIFY horizontalCenterChanged) | - |
72 | Q_PROPERTY(QQuickAnchorLine top READ top WRITE setTop RESET resetTop NOTIFY topChanged) | - |
73 | Q_PROPERTY(QQuickAnchorLine bottom READ bottom WRITE setBottom RESET resetBottom NOTIFY bottomChanged) | - |
74 | Q_PROPERTY(QQuickAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter NOTIFY verticalCenterChanged) | - |
75 | Q_PROPERTY(QQuickAnchorLine baseline READ baseline WRITE setBaseline RESET resetBaseline NOTIFY baselineChanged) | - |
76 | Q_PROPERTY(qreal margins READ margins WRITE setMargins NOTIFY marginsChanged) | - |
77 | Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin RESET resetLeftMargin NOTIFY leftMarginChanged) | - |
78 | Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin RESET resetRightMargin NOTIFY rightMarginChanged) | - |
79 | Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged) | - |
80 | Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin RESET resetTopMargin NOTIFY topMarginChanged) | - |
81 | Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin RESET resetBottomMargin NOTIFY bottomMarginChanged) | - |
82 | Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged) | - |
83 | Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged) | - |
84 | Q_PROPERTY(QQuickItem *fill READ fill WRITE setFill RESET resetFill NOTIFY fillChanged) | - |
85 | Q_PROPERTY(QQuickItem *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged) | - |
86 | Q_PROPERTY(bool alignWhenCentered READ alignWhenCentered WRITE setAlignWhenCentered NOTIFY centerAlignedChanged) | - |
87 | - | |
88 | public: | - |
89 | QQuickAnchors(QQuickItem *item, QObject *parent=nullptr); | - |
90 | ~QQuickAnchors() override; | - |
91 | - | |
92 | enum Anchor | - |
93 | #if defined(Q_CC_CLANG) || !defined(Q_CC_GNU) // meaning: clang and msvc, but NOT gcc proper (because, you know, Q_CC_CLANG implies Q_CC_GNU) | - |
94 | // Not specifying the enum base type will have MSVC 'interpret' it as signed instead of an unsigned bit-field. | - |
95 | // However, specifying the enum base type breaks many GCCs, which complain that it can't store all values in a 7 bit bitfield. | - |
96 | : uint | - |
97 | #endif | - |
98 | { | - |
99 | InvalidAnchor = 0x0, | - |
100 | LeftAnchor = 0x01, | - |
101 | RightAnchor = 0x02, | - |
102 | TopAnchor = 0x04, | - |
103 | BottomAnchor = 0x08, | - |
104 | HCenterAnchor = 0x10, | - |
105 | VCenterAnchor = 0x20, | - |
106 | BaselineAnchor = 0x40, | - |
107 | Horizontal_Mask = LeftAnchor | RightAnchor | HCenterAnchor, | - |
108 | Vertical_Mask = TopAnchor | BottomAnchor | VCenterAnchor | BaselineAnchor | - |
109 | }; | - |
110 | Q_DECLARE_FLAGS(Anchors, Anchor) | - |
111 | - | |
112 | QQuickAnchorLine left() const; | - |
113 | void setLeft(const QQuickAnchorLine &edge); | - |
114 | void resetLeft(); | - |
115 | - | |
116 | QQuickAnchorLine right() const; | - |
117 | void setRight(const QQuickAnchorLine &edge); | - |
118 | void resetRight(); | - |
119 | - | |
120 | QQuickAnchorLine horizontalCenter() const; | - |
121 | void setHorizontalCenter(const QQuickAnchorLine &edge); | - |
122 | void resetHorizontalCenter(); | - |
123 | - | |
124 | QQuickAnchorLine top() const; | - |
125 | void setTop(const QQuickAnchorLine &edge); | - |
126 | void resetTop(); | - |
127 | - | |
128 | QQuickAnchorLine bottom() const; | - |
129 | void setBottom(const QQuickAnchorLine &edge); | - |
130 | void resetBottom(); | - |
131 | - | |
132 | QQuickAnchorLine verticalCenter() const; | - |
133 | void setVerticalCenter(const QQuickAnchorLine &edge); | - |
134 | void resetVerticalCenter(); | - |
135 | - | |
136 | QQuickAnchorLine baseline() const; | - |
137 | void setBaseline(const QQuickAnchorLine &edge); | - |
138 | void resetBaseline(); | - |
139 | - | |
140 | qreal leftMargin() const; | - |
141 | void setLeftMargin(qreal); | - |
142 | void resetLeftMargin(); | - |
143 | - | |
144 | qreal rightMargin() const; | - |
145 | void setRightMargin(qreal); | - |
146 | void resetRightMargin(); | - |
147 | - | |
148 | qreal horizontalCenterOffset() const; | - |
149 | void setHorizontalCenterOffset(qreal); | - |
150 | - | |
151 | qreal topMargin() const; | - |
152 | void setTopMargin(qreal); | - |
153 | void resetTopMargin(); | - |
154 | - | |
155 | qreal bottomMargin() const; | - |
156 | void setBottomMargin(qreal); | - |
157 | void resetBottomMargin(); | - |
158 | - | |
159 | qreal margins() const; | - |
160 | void setMargins(qreal); | - |
161 | - | |
162 | qreal verticalCenterOffset() const; | - |
163 | void setVerticalCenterOffset(qreal); | - |
164 | - | |
165 | qreal baselineOffset() const; | - |
166 | void setBaselineOffset(qreal); | - |
167 | - | |
168 | QQuickItem *fill() const; | - |
169 | void setFill(QQuickItem *); | - |
170 | void resetFill(); | - |
171 | - | |
172 | QQuickItem *centerIn() const; | - |
173 | void setCenterIn(QQuickItem *); | - |
174 | void resetCenterIn(); | - |
175 | - | |
176 | Anchors usedAnchors() const; | - |
177 | Qt::Orientations activeDirections() const; | - |
178 | - | |
179 | bool mirrored(); | - |
180 | - | |
181 | bool alignWhenCentered() const; | - |
182 | void setAlignWhenCentered(bool); | - |
183 | - | |
184 | void classBegin(); | - |
185 | void componentComplete(); | - |
186 | - | |
187 | Q_SIGNALS: | - |
188 | void leftChanged(); | - |
189 | void rightChanged(); | - |
190 | void topChanged(); | - |
191 | void bottomChanged(); | - |
192 | void verticalCenterChanged(); | - |
193 | void horizontalCenterChanged(); | - |
194 | void baselineChanged(); | - |
195 | void fillChanged(); | - |
196 | void centerInChanged(); | - |
197 | void leftMarginChanged(); | - |
198 | void rightMarginChanged(); | - |
199 | void topMarginChanged(); | - |
200 | void bottomMarginChanged(); | - |
201 | void marginsChanged(); | - |
202 | void verticalCenterOffsetChanged(); | - |
203 | void horizontalCenterOffsetChanged(); | - |
204 | void baselineOffsetChanged(); | - |
205 | void centerAlignedChanged(); | - |
206 | - | |
207 | private: | - |
208 | friend class QQuickItemPrivate; | - |
209 | Q_DISABLE_COPY(QQuickAnchors) | - |
210 | Q_DECLARE_PRIVATE(QQuickAnchors) executed 81368 times by 84 tests: return reinterpret_cast<QQuickAnchorsPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 5475 times by 28 tests: return reinterpret_cast<const QQuickAnchorsPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
| 5475-81368 |
211 | }; | - |
212 | Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickAnchors::Anchors) | - |
213 | - | |
214 | QT_END_NAMESPACE | - |
215 | - | |
216 | QML_DECLARE_TYPE(QQuickAnchors) | - |
217 | - | |
218 | #endif // QQUICKANCHORS_P_H | - |
Source code | Switch to Preprocessed file |