Differential D24817 Diff 68400 src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QXmlStreamNamespaceDeclaration.cpp
Changeset View
Changeset View
Standalone View
Standalone View
src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QXmlStreamNamespaceDeclaration.cpp
- This file was added.
1 | #include <QtScript/QScriptEngine> | ||||
---|---|---|---|---|---|
2 | #include <QtScript/QScriptContext> | ||||
3 | #include <QtScript/QScriptValue> | ||||
4 | #include <QtCore/QStringList> | ||||
5 | #include <QtCore/QDebug> | ||||
6 | #include <qmetaobject.h> | ||||
7 | #include <__package_shared.h> | ||||
8 | | ||||
9 | #include <qxmlstream.h> | ||||
10 | #include <QVariant> | ||||
11 | #include <qxmlstream.h> | ||||
12 | | ||||
13 | static const char * const qtscript_QXmlStreamNamespaceDeclaration_function_names[] = { | ||||
14 | "QXmlStreamNamespaceDeclaration" | ||||
15 | // static | ||||
16 | // prototype | ||||
17 | , "namespaceUri" | ||||
18 | , "equals" | ||||
19 | , "prefix" | ||||
20 | , "toString" | ||||
21 | }; | ||||
22 | | ||||
23 | static const char * const qtscript_QXmlStreamNamespaceDeclaration_function_signatures[] = { | ||||
24 | "\nString prefix, String namespaceUri\nQXmlStreamNamespaceDeclaration arg__1" | ||||
25 | // static | ||||
26 | // prototype | ||||
27 | , "" | ||||
28 | , "QXmlStreamNamespaceDeclaration other" | ||||
29 | , "" | ||||
30 | "" | ||||
31 | }; | ||||
32 | | ||||
33 | static const int qtscript_QXmlStreamNamespaceDeclaration_function_lengths[] = { | ||||
34 | 2 | ||||
35 | // static | ||||
36 | // prototype | ||||
37 | , 0 | ||||
38 | , 1 | ||||
39 | , 0 | ||||
40 | , 0 | ||||
41 | }; | ||||
42 | | ||||
43 | static QScriptValue qtscript_QXmlStreamNamespaceDeclaration_throw_ambiguity_error_helper( | ||||
44 | QScriptContext *context, const char *functionName, const char *signatures) | ||||
45 | { | ||||
46 | QStringList lines = QString::fromLatin1(signatures).split(QLatin1Char('\n')); | ||||
47 | QStringList fullSignatures; | ||||
48 | for (int i = 0; i < lines.size(); ++i) | ||||
49 | fullSignatures.append(QString::fromLatin1("%0(%1)").arg(functionName).arg(lines.at(i))); | ||||
50 | return context->throwError(QString::fromLatin1("QXmlStreamNamespaceDeclaration::%0(): could not find a function match; candidates are:\n%1") | ||||
51 | .arg(functionName).arg(fullSignatures.join(QLatin1String("\n")))); | ||||
52 | } | ||||
53 | | ||||
54 | Q_DECLARE_METATYPE(QXmlStreamNamespaceDeclaration) | ||||
55 | Q_DECLARE_METATYPE(QXmlStreamNamespaceDeclaration*) | ||||
56 | Q_DECLARE_METATYPE(QStringRef) | ||||
57 | | ||||
58 | // | ||||
59 | // QXmlStreamNamespaceDeclaration | ||||
60 | // | ||||
61 | | ||||
62 | static QScriptValue qtscript_QXmlStreamNamespaceDeclaration_prototype_call(QScriptContext *context, QScriptEngine *) | ||||
63 | { | ||||
64 | #if QT_VERSION > 0x040400 | ||||
65 | Q_ASSERT(context->callee().isFunction()); | ||||
66 | uint _id = context->callee().data().toUInt32(); | ||||
67 | #else | ||||
68 | uint _id; | ||||
69 | if (context->callee().isFunction()) | ||||
70 | _id = context->callee().data().toUInt32(); | ||||
71 | else | ||||
72 | _id = 0xBABE0000 + 3; | ||||
73 | #endif | ||||
74 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
75 | _id &= 0x0000FFFF; | ||||
76 | QXmlStreamNamespaceDeclaration* _q_self = qscriptvalue_cast<QXmlStreamNamespaceDeclaration*>(context->thisObject()); | ||||
77 | if (!_q_self) { | ||||
78 | return context->throwError(QScriptContext::TypeError, | ||||
79 | QString::fromLatin1("QXmlStreamNamespaceDeclaration.%0(): this object is not a QXmlStreamNamespaceDeclaration") | ||||
80 | .arg(qtscript_QXmlStreamNamespaceDeclaration_function_names[_id+1])); | ||||
81 | } | ||||
82 | | ||||
83 | switch (_id) { | ||||
84 | case 0: | ||||
85 | if (context->argumentCount() == 0) { | ||||
86 | QStringRef _q_result = _q_self->namespaceUri(); | ||||
87 | | ||||
88 | // TEMPLATE - core.convert_stringref_to_string - START | ||||
89 | QString _q_convertedResult = _q_result.toString(); | ||||
90 | // TEMPLATE - core.convert_stringref_to_string - END | ||||
91 | return qScriptValueFromValue(context->engine(), _q_convertedResult); | ||||
92 | } | ||||
93 | break; | ||||
94 | | ||||
95 | case 1: | ||||
96 | if (context->argumentCount() == 1) { | ||||
97 | QXmlStreamNamespaceDeclaration _q_arg0 = qscriptvalue_cast<QXmlStreamNamespaceDeclaration>(context->argument(0)); | ||||
98 | bool _q_result = _q_self->operator==(_q_arg0); | ||||
99 | return QScriptValue(context->engine(), _q_result); | ||||
100 | } | ||||
101 | break; | ||||
102 | | ||||
103 | case 2: | ||||
104 | if (context->argumentCount() == 0) { | ||||
105 | QStringRef _q_result = _q_self->prefix(); | ||||
106 | | ||||
107 | // TEMPLATE - core.convert_stringref_to_string - START | ||||
108 | QString _q_convertedResult = _q_result.toString(); | ||||
109 | // TEMPLATE - core.convert_stringref_to_string - END | ||||
110 | return qScriptValueFromValue(context->engine(), _q_convertedResult); | ||||
111 | } | ||||
112 | break; | ||||
113 | | ||||
114 | case 3: { | ||||
115 | QString result = QString::fromLatin1("QXmlStreamNamespaceDeclaration"); | ||||
116 | return QScriptValue(context->engine(), result); | ||||
117 | } | ||||
118 | | ||||
119 | default: | ||||
120 | Q_ASSERT(false); | ||||
121 | } | ||||
122 | return qtscript_QXmlStreamNamespaceDeclaration_throw_ambiguity_error_helper(context, | ||||
123 | qtscript_QXmlStreamNamespaceDeclaration_function_names[_id+1], | ||||
124 | qtscript_QXmlStreamNamespaceDeclaration_function_signatures[_id+1]); | ||||
125 | } | ||||
126 | | ||||
127 | static QScriptValue qtscript_QXmlStreamNamespaceDeclaration_static_call(QScriptContext *context, QScriptEngine *) | ||||
128 | { | ||||
129 | uint _id = context->callee().data().toUInt32(); | ||||
130 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
131 | _id &= 0x0000FFFF; | ||||
132 | switch (_id) { | ||||
133 | case 0: | ||||
134 | if (context->thisObject().strictlyEquals(context->engine()->globalObject())) { | ||||
135 | return context->throwError(QString::fromLatin1("QXmlStreamNamespaceDeclaration(): Did you forget to construct with 'new'?")); | ||||
136 | } | ||||
137 | if (context->argumentCount() == 0) { | ||||
138 | QXmlStreamNamespaceDeclaration _q_cpp_result; | ||||
139 | QScriptValue _q_result = context->engine()->newVariant(context->thisObject(), qVariantFromValue(_q_cpp_result)); | ||||
140 | return _q_result; | ||||
141 | } else if (context->argumentCount() == 1) { | ||||
142 | QXmlStreamNamespaceDeclaration _q_arg0 = qscriptvalue_cast<QXmlStreamNamespaceDeclaration>(context->argument(0)); | ||||
143 | QXmlStreamNamespaceDeclaration _q_cpp_result(_q_arg0); | ||||
144 | QScriptValue _q_result = context->engine()->newVariant(context->thisObject(), qVariantFromValue(_q_cpp_result)); | ||||
145 | return _q_result; | ||||
146 | } else if (context->argumentCount() == 2) { | ||||
147 | QString _q_arg0 = context->argument(0).toString(); | ||||
148 | QString _q_arg1 = context->argument(1).toString(); | ||||
149 | QXmlStreamNamespaceDeclaration _q_cpp_result(_q_arg0, _q_arg1); | ||||
150 | QScriptValue _q_result = context->engine()->newVariant(context->thisObject(), qVariantFromValue(_q_cpp_result)); | ||||
151 | return _q_result; | ||||
152 | } | ||||
153 | break; | ||||
154 | | ||||
155 | default: | ||||
156 | Q_ASSERT(false); | ||||
157 | } | ||||
158 | return qtscript_QXmlStreamNamespaceDeclaration_throw_ambiguity_error_helper(context, | ||||
159 | qtscript_QXmlStreamNamespaceDeclaration_function_names[_id], | ||||
160 | qtscript_QXmlStreamNamespaceDeclaration_function_signatures[_id]); | ||||
161 | } | ||||
162 | | ||||
163 | QScriptValue qtscript_create_QXmlStreamNamespaceDeclaration_class(QScriptEngine *engine) | ||||
164 | { | ||||
165 | engine->setDefaultPrototype(qMetaTypeId<QXmlStreamNamespaceDeclaration*>(), QScriptValue()); | ||||
166 | QScriptValue proto = engine->newVariant(qVariantFromValue((QXmlStreamNamespaceDeclaration*)0)); | ||||
167 | for (int i = 0; i < 4; ++i) { | ||||
168 | QScriptValue fun = engine->newFunction(qtscript_QXmlStreamNamespaceDeclaration_prototype_call, qtscript_QXmlStreamNamespaceDeclaration_function_lengths[i+1]); | ||||
169 | fun.setData(QScriptValue(engine, uint(0xBABE0000 + i))); | ||||
170 | proto.setProperty(QString::fromLatin1(qtscript_QXmlStreamNamespaceDeclaration_function_names[i+1]), | ||||
171 | fun, QScriptValue::SkipInEnumeration); | ||||
172 | } | ||||
173 | | ||||
174 | engine->setDefaultPrototype(qMetaTypeId<QXmlStreamNamespaceDeclaration>(), proto); | ||||
175 | engine->setDefaultPrototype(qMetaTypeId<QXmlStreamNamespaceDeclaration*>(), proto); | ||||
176 | | ||||
177 | QScriptValue ctor = engine->newFunction(qtscript_QXmlStreamNamespaceDeclaration_static_call, proto, qtscript_QXmlStreamNamespaceDeclaration_function_lengths[0]); | ||||
178 | ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0))); | ||||
179 | | ||||
180 | return ctor; | ||||
181 | } |