1// Copyright (C) 2019 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 QTQUICKFOREIGN_P_H
5#define QTQUICKFOREIGN_P_H
6
7#include <QtQuick/private/qtquickglobal_p.h>
8
9#include <QtGui/qstylehints.h>
10#include <QtGui/qeventpoint.h>
11#if QT_CONFIG(im)
12#include <QtGui/qinputmethod.h>
13#endif
14#if QT_CONFIG(validator)
15#include <QtGui/qvalidator.h>
16#endif
17#if QT_CONFIG(shortcut)
18#include <QtGui/qkeysequence.h>
19#endif
20
21#include <QtGui/qfontvariableaxis.h>
22
23#include <QtGui/QScreen>
24
25#include <QtQml/qqml.h>
26
27//
28// W A R N I N G
29// -------------
30//
31// This file is not part of the Qt API. It exists purely as an
32// implementation detail. This header file may change from version to
33// version without notice, or even be removed.
34//
35// We mean it.
36//
37
38QT_BEGIN_NAMESPACE
39
40struct QStyleHintsForeign
41{
42 Q_GADGET
43 QML_FOREIGN(QStyleHints)
44 QML_ANONYMOUS
45 QML_ADDED_IN_VERSION(6, 4)
46};
47
48struct QImageForeign
49{
50 Q_GADGET
51 QML_FOREIGN(QImage)
52 QML_ANONYMOUS
53};
54
55#if QT_CONFIG(validator)
56struct QValidatorForeign
57{
58 Q_GADGET
59 QML_FOREIGN(QValidator)
60 QML_ANONYMOUS
61 QML_ADDED_IN_VERSION(2, 0)
62};
63
64#if QT_CONFIG(regularexpression)
65struct QRegularExpressionValidatorForeign
66{
67 Q_GADGET
68 QML_FOREIGN(QRegularExpressionValidator)
69 QML_NAMED_ELEMENT(RegularExpressionValidator)
70 QML_ADDED_IN_VERSION(2, 14)
71};
72#endif // QT_CONFIG(regularexpression)
73
74#endif // QT_CONFIG(validator)
75
76#if QT_CONFIG(im)
77struct QInputMethodForeign
78{
79 Q_GADGET
80 QML_FOREIGN(QInputMethod)
81 QML_NAMED_ELEMENT(InputMethod)
82 QML_ADDED_IN_VERSION(2, 0)
83 QML_REMOVED_IN_VERSION(6, 4)
84 QML_UNCREATABLE("InputMethod is an abstract class.")
85};
86#endif // QT_CONFIG(im)
87
88#if QT_CONFIG(shortcut)
89namespace QKeySequenceForeign
90{
91 Q_NAMESPACE
92 QML_FOREIGN_NAMESPACE(QKeySequence)
93 QML_NAMED_ELEMENT(StandardKey)
94 QML_ADDED_IN_VERSION(2, 2)
95};
96#endif // QT_CONFIG(shortcut)
97
98struct QEventPointForeign
99{
100 Q_GADGET
101 QML_FOREIGN(QEventPoint)
102 QML_VALUE_TYPE(eventPoint)
103 QML_ADDED_IN_VERSION(6, 5)
104};
105
106// Prevent the same QEventPoint type from being exported into qmltypes
107// twice, as a value type and a namespace.
108// TODO: Remove once QTBUG-115855 is fixed.
109struct QEventPointDerived : public QEventPoint
110{
111 Q_GADGET
112};
113
114namespace QEventPointForeignNamespace
115{
116 Q_NAMESPACE
117 QML_FOREIGN_NAMESPACE(QEventPointDerived)
118 QML_NAMED_ELEMENT(EventPoint)
119 QML_ADDED_IN_VERSION(6, 6)
120};
121
122struct QFontVariableAxisForeign
123{
124 Q_GADGET
125 QML_ANONYMOUS
126 QML_ADDED_IN_VERSION(6, 9)
127 QML_FOREIGN(QFontVariableAxis)
128};
129
130struct QScreenForeign
131{
132 Q_GADGET
133 QML_FOREIGN(QScreen)
134 QML_ANONYMOUS
135 QML_ADDED_IN_VERSION(2, 3) // used in ScreenInfo
136};
137
138QT_END_NAMESPACE
139
140#endif // QTQUICKFOREIGN_P_H
141

source code of qtdeclarative/src/quick/util/qquickforeignutils_p.h