Differential D24817 Diff 68400 src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QXmlStreamAttribute.cpp
Changeset View
Changeset View
Standalone View
Standalone View
src/scripting/qtbindings/generated_cpp/com_trolltech_qt_core/qtscript_QXmlStreamAttribute.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_QXmlStreamAttribute_function_names[] = { | ||||
14 | "QXmlStreamAttribute" | ||||
15 | // static | ||||
16 | // prototype | ||||
17 | , "isDefault" | ||||
18 | , "name" | ||||
19 | , "namespaceUri" | ||||
20 | , "equals" | ||||
21 | , "prefix" | ||||
22 | , "qualifiedName" | ||||
23 | , "value" | ||||
24 | , "toString" | ||||
25 | }; | ||||
26 | | ||||
27 | static const char * const qtscript_QXmlStreamAttribute_function_signatures[] = { | ||||
28 | "\nString namespaceUri, String name, String value\nString qualifiedName, String value\nQXmlStreamAttribute arg__1" | ||||
29 | // static | ||||
30 | // prototype | ||||
31 | , "" | ||||
32 | , "" | ||||
33 | , "" | ||||
34 | , "QXmlStreamAttribute other" | ||||
35 | , "" | ||||
36 | , "" | ||||
37 | , "" | ||||
38 | "" | ||||
39 | }; | ||||
40 | | ||||
41 | static const int qtscript_QXmlStreamAttribute_function_lengths[] = { | ||||
42 | 3 | ||||
43 | // static | ||||
44 | // prototype | ||||
45 | , 0 | ||||
46 | , 0 | ||||
47 | , 0 | ||||
48 | , 1 | ||||
49 | , 0 | ||||
50 | , 0 | ||||
51 | , 0 | ||||
52 | , 0 | ||||
53 | }; | ||||
54 | | ||||
55 | static QScriptValue qtscript_QXmlStreamAttribute_throw_ambiguity_error_helper( | ||||
56 | QScriptContext *context, const char *functionName, const char *signatures) | ||||
57 | { | ||||
58 | QStringList lines = QString::fromLatin1(signatures).split(QLatin1Char('\n')); | ||||
59 | QStringList fullSignatures; | ||||
60 | for (int i = 0; i < lines.size(); ++i) | ||||
61 | fullSignatures.append(QString::fromLatin1("%0(%1)").arg(functionName).arg(lines.at(i))); | ||||
62 | return context->throwError(QString::fromLatin1("QXmlStreamAttribute::%0(): could not find a function match; candidates are:\n%1") | ||||
63 | .arg(functionName).arg(fullSignatures.join(QLatin1String("\n")))); | ||||
64 | } | ||||
65 | | ||||
66 | Q_DECLARE_METATYPE(QXmlStreamAttribute) | ||||
67 | Q_DECLARE_METATYPE(QXmlStreamAttribute*) | ||||
68 | Q_DECLARE_METATYPE(QStringRef) | ||||
69 | | ||||
70 | // | ||||
71 | // QXmlStreamAttribute | ||||
72 | // | ||||
73 | | ||||
74 | static QScriptValue qtscript_QXmlStreamAttribute_prototype_call(QScriptContext *context, QScriptEngine *) | ||||
75 | { | ||||
76 | #if QT_VERSION > 0x040400 | ||||
77 | Q_ASSERT(context->callee().isFunction()); | ||||
78 | uint _id = context->callee().data().toUInt32(); | ||||
79 | #else | ||||
80 | uint _id; | ||||
81 | if (context->callee().isFunction()) | ||||
82 | _id = context->callee().data().toUInt32(); | ||||
83 | else | ||||
84 | _id = 0xBABE0000 + 7; | ||||
85 | #endif | ||||
86 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
87 | _id &= 0x0000FFFF; | ||||
88 | QXmlStreamAttribute* _q_self = qscriptvalue_cast<QXmlStreamAttribute*>(context->thisObject()); | ||||
89 | if (!_q_self) { | ||||
90 | return context->throwError(QScriptContext::TypeError, | ||||
91 | QString::fromLatin1("QXmlStreamAttribute.%0(): this object is not a QXmlStreamAttribute") | ||||
92 | .arg(qtscript_QXmlStreamAttribute_function_names[_id+1])); | ||||
93 | } | ||||
94 | | ||||
95 | switch (_id) { | ||||
96 | case 0: | ||||
97 | if (context->argumentCount() == 0) { | ||||
98 | bool _q_result = _q_self->isDefault(); | ||||
99 | return QScriptValue(context->engine(), _q_result); | ||||
100 | } | ||||
101 | break; | ||||
102 | | ||||
103 | case 1: | ||||
104 | if (context->argumentCount() == 0) { | ||||
105 | QStringRef _q_result = _q_self->name(); | ||||
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 2: | ||||
115 | if (context->argumentCount() == 0) { | ||||
116 | QStringRef _q_result = _q_self->namespaceUri(); | ||||
117 | | ||||
118 | // TEMPLATE - core.convert_stringref_to_string - START | ||||
119 | QString _q_convertedResult = _q_result.toString(); | ||||
120 | // TEMPLATE - core.convert_stringref_to_string - END | ||||
121 | return qScriptValueFromValue(context->engine(), _q_convertedResult); | ||||
122 | } | ||||
123 | break; | ||||
124 | | ||||
125 | case 3: | ||||
126 | if (context->argumentCount() == 1) { | ||||
127 | QXmlStreamAttribute _q_arg0 = qscriptvalue_cast<QXmlStreamAttribute>(context->argument(0)); | ||||
128 | bool _q_result = _q_self->operator==(_q_arg0); | ||||
129 | return QScriptValue(context->engine(), _q_result); | ||||
130 | } | ||||
131 | break; | ||||
132 | | ||||
133 | case 4: | ||||
134 | if (context->argumentCount() == 0) { | ||||
135 | QStringRef _q_result = _q_self->prefix(); | ||||
136 | | ||||
137 | // TEMPLATE - core.convert_stringref_to_string - START | ||||
138 | QString _q_convertedResult = _q_result.toString(); | ||||
139 | // TEMPLATE - core.convert_stringref_to_string - END | ||||
140 | return qScriptValueFromValue(context->engine(), _q_convertedResult); | ||||
141 | } | ||||
142 | break; | ||||
143 | | ||||
144 | case 5: | ||||
145 | if (context->argumentCount() == 0) { | ||||
146 | QStringRef _q_result = _q_self->qualifiedName(); | ||||
147 | | ||||
148 | // TEMPLATE - core.convert_stringref_to_string - START | ||||
149 | QString _q_convertedResult = _q_result.toString(); | ||||
150 | // TEMPLATE - core.convert_stringref_to_string - END | ||||
151 | return qScriptValueFromValue(context->engine(), _q_convertedResult); | ||||
152 | } | ||||
153 | break; | ||||
154 | | ||||
155 | case 6: | ||||
156 | if (context->argumentCount() == 0) { | ||||
157 | QStringRef _q_result = _q_self->value(); | ||||
158 | | ||||
159 | // TEMPLATE - core.convert_stringref_to_string - START | ||||
160 | QString _q_convertedResult = _q_result.toString(); | ||||
161 | // TEMPLATE - core.convert_stringref_to_string - END | ||||
162 | return qScriptValueFromValue(context->engine(), _q_convertedResult); | ||||
163 | } | ||||
164 | break; | ||||
165 | | ||||
166 | case 7: { | ||||
167 | QString result = QString::fromLatin1("QXmlStreamAttribute"); | ||||
168 | return QScriptValue(context->engine(), result); | ||||
169 | } | ||||
170 | | ||||
171 | default: | ||||
172 | Q_ASSERT(false); | ||||
173 | } | ||||
174 | return qtscript_QXmlStreamAttribute_throw_ambiguity_error_helper(context, | ||||
175 | qtscript_QXmlStreamAttribute_function_names[_id+1], | ||||
176 | qtscript_QXmlStreamAttribute_function_signatures[_id+1]); | ||||
177 | } | ||||
178 | | ||||
179 | static QScriptValue qtscript_QXmlStreamAttribute_static_call(QScriptContext *context, QScriptEngine *) | ||||
180 | { | ||||
181 | uint _id = context->callee().data().toUInt32(); | ||||
182 | Q_ASSERT((_id & 0xFFFF0000) == 0xBABE0000); | ||||
183 | _id &= 0x0000FFFF; | ||||
184 | switch (_id) { | ||||
185 | case 0: | ||||
186 | if (context->thisObject().strictlyEquals(context->engine()->globalObject())) { | ||||
187 | return context->throwError(QString::fromLatin1("QXmlStreamAttribute(): Did you forget to construct with 'new'?")); | ||||
188 | } | ||||
189 | if (context->argumentCount() == 0) { | ||||
190 | QXmlStreamAttribute _q_cpp_result; | ||||
191 | QScriptValue _q_result = context->engine()->newVariant(context->thisObject(), qVariantFromValue(_q_cpp_result)); | ||||
192 | return _q_result; | ||||
193 | } else if (context->argumentCount() == 1) { | ||||
194 | QXmlStreamAttribute _q_arg0 = qscriptvalue_cast<QXmlStreamAttribute>(context->argument(0)); | ||||
195 | QXmlStreamAttribute _q_cpp_result(_q_arg0); | ||||
196 | QScriptValue _q_result = context->engine()->newVariant(context->thisObject(), qVariantFromValue(_q_cpp_result)); | ||||
197 | return _q_result; | ||||
198 | } else if (context->argumentCount() == 2) { | ||||
199 | QString _q_arg0 = context->argument(0).toString(); | ||||
200 | QString _q_arg1 = context->argument(1).toString(); | ||||
201 | QXmlStreamAttribute _q_cpp_result(_q_arg0, _q_arg1); | ||||
202 | QScriptValue _q_result = context->engine()->newVariant(context->thisObject(), qVariantFromValue(_q_cpp_result)); | ||||
203 | return _q_result; | ||||
204 | } else if (context->argumentCount() == 3) { | ||||
205 | QString _q_arg0 = context->argument(0).toString(); | ||||
206 | QString _q_arg1 = context->argument(1).toString(); | ||||
207 | QString _q_arg2 = context->argument(2).toString(); | ||||
208 | QXmlStreamAttribute _q_cpp_result(_q_arg0, _q_arg1, _q_arg2); | ||||
209 | QScriptValue _q_result = context->engine()->newVariant(context->thisObject(), qVariantFromValue(_q_cpp_result)); | ||||
210 | return _q_result; | ||||
211 | } | ||||
212 | break; | ||||
213 | | ||||
214 | default: | ||||
215 | Q_ASSERT(false); | ||||
216 | } | ||||
217 | return qtscript_QXmlStreamAttribute_throw_ambiguity_error_helper(context, | ||||
218 | qtscript_QXmlStreamAttribute_function_names[_id], | ||||
219 | qtscript_QXmlStreamAttribute_function_signatures[_id]); | ||||
220 | } | ||||
221 | | ||||
222 | QScriptValue qtscript_create_QXmlStreamAttribute_class(QScriptEngine *engine) | ||||
223 | { | ||||
224 | engine->setDefaultPrototype(qMetaTypeId<QXmlStreamAttribute*>(), QScriptValue()); | ||||
225 | QScriptValue proto = engine->newVariant(qVariantFromValue((QXmlStreamAttribute*)0)); | ||||
226 | for (int i = 0; i < 8; ++i) { | ||||
227 | QScriptValue fun = engine->newFunction(qtscript_QXmlStreamAttribute_prototype_call, qtscript_QXmlStreamAttribute_function_lengths[i+1]); | ||||
228 | fun.setData(QScriptValue(engine, uint(0xBABE0000 + i))); | ||||
229 | proto.setProperty(QString::fromLatin1(qtscript_QXmlStreamAttribute_function_names[i+1]), | ||||
230 | fun, QScriptValue::SkipInEnumeration); | ||||
231 | } | ||||
232 | | ||||
233 | engine->setDefaultPrototype(qMetaTypeId<QXmlStreamAttribute>(), proto); | ||||
234 | engine->setDefaultPrototype(qMetaTypeId<QXmlStreamAttribute*>(), proto); | ||||
235 | | ||||
236 | QScriptValue ctor = engine->newFunction(qtscript_QXmlStreamAttribute_static_call, proto, qtscript_QXmlStreamAttribute_function_lengths[0]); | ||||
237 | ctor.setData(QScriptValue(engine, uint(0xBABE0000 + 0))); | ||||
238 | | ||||
239 | return ctor; | ||||
240 | } |