// qscriptengine.sip generated by MetaSIP on Fri Sep 28 17:07:47 2007 // // This file is part of the QtScript Python extension module. // // Copyright (c) 2007 // Phil Thompson // // This file is part of PyQt. // // This copy of PyQt is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License version 2 as published by // the Free Software Foundation and appearing in the file LICENSE included in the // packaging of this file. // // PyQt is supplied in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // PyQt; see the file LICENSE. If not, write to the Free Software Foundation, // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. %If (Qt_4_3_0 -) %ModuleCode #include %End %End %If (Qt_4_3_0 -) class QScriptEngine : QObject { %TypeHeaderCode #include %End %ConvertToSubClassCode sipClass = (sipCpp->inherits(sipName_QScriptEngine) ? sipClass_QScriptEngine : 0); %End public: enum ValueOwnership { QtOwnership, ScriptOwnership, AutoOwnership, }; enum QObjectWrapOption { ExcludeChildObjects, ExcludeSuperClassMethods, ExcludeSuperClassProperties, AutoCreateDynamicProperties, }; typedef QFlags QObjectWrapOptions; QScriptEngine(); explicit QScriptEngine(QObject *parent /TransferThis/); virtual ~QScriptEngine(); QScriptValue globalObject() const; QScriptContext *currentContext() const; bool canEvaluate(const QString &program) const; QScriptValue evaluate(const QString &program, const QString &fileName = QString(), int lineNumber = 1); bool hasUncaughtException() const; QStringList uncaughtExceptionBacktrace() const; QScriptValue uncaughtException() const; int uncaughtExceptionLineNumber() const; QScriptValue nullValue(); QScriptValue undefinedValue(); QScriptValue newVariant(const QVariant &value); QScriptValue newRegExp(const QRegExp ®exp); QScriptValue newObject(); QScriptValue newArray(uint length = 0); QScriptValue newRegExp(const QString &pattern, const QString &flags); QScriptValue newDate(qsreal value); QScriptValue newDate(const QDateTime &value); QScriptValue newQObject(QObject *object /GetWrapper/, QScriptEngine::ValueOwnership ownership = QScriptEngine::QtOwnership, const QFlags &options = 0); %MethodCode // We have to handle the object ownership manually. Py_BEGIN_ALLOW_THREADS sipRes = new QScriptValue(sipCpp->newQObject(a0, a1, *a2)); Py_END_ALLOW_THREADS if (a1 == QScriptEngine::ScriptOwnership || (a1 == QScriptEngine::AutoOwnership && !a0->parent())) sipTransferTo(a0Wrapper, sipSelf); %End QScriptValue newQMetaObject(const QMetaObject *metaObject, const QScriptValue &ctor = QScriptValue()); QScriptValue defaultPrototype(int metaTypeId) const; void setDefaultPrototype(int metaTypeId, const QScriptValue &prototype); QScriptValue importExtension(const QString &extension); void collectGarbage(); void setProcessEventsInterval(int interval); int processEventsInterval() const; private: QScriptEngine(const QScriptEngine &); }; %End %If (Qt_4_3_0 -) QFlags operator|(QScriptEngine::QObjectWrapOption f1, QFlags f2); %End %If (Qt_4_3_0 -) QFlags operator|(QScriptEngine::QObjectWrapOption f1, QScriptEngine::QObjectWrapOption f2); %End