| Tutorial | Classes | Functions | QSA Developer | Language | Library | Qt API | Qt Script for Applications | ![]() |
This is the verbatim text of the qsinterpreter.h include file. It is provided only for illustration; the copyright remains with Trolltech.
/**************************************************************************** ** $Id$ ** ** Definition of the QSInterpreter class. ** ** Copyright (C) 2001-2002 Trolltech AS. All rights reserved. ** ** This file is part of the Qt Script for Applications framework (QSA). ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** Licensees holding a valid QSA Beta Evaluation Version license may use ** this file in accordance with the QSA Beta Evaluation Version License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for ** information about QSA Commercial License Agreements. ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** *****************************************************************************/ #ifndef QSINTERPRETER_H #define QSINTERPRETER_H #include <qobject.h> #include "qsaglobal.h" #include <qvariant.h> #include <qobjectlist.h> class QSProject; class QtApplicationScript; class QSInterpreterPrivate; class QSA_EXPORT QSInterpreter : public QObject { Q_OBJECT Q_ENUMS( ErrorMode ) Q_PROPERTY( ErrorMode errorMode READ errorMode WRITE setErrorMode ) public: QSInterpreter(); virtual ~QSInterpreter(); static QSInterpreter *defaultInterpreter(); QVariant evaluate( const QString &code, QObject *context = 0 ); QVariant call( const QString &function, const QValueList<QVariant> & arguments, QObject *context = 0 ); bool checkSyntax( const QString &code ); enum ErrorMode { Notify, AskForDebug, Debug, Nothing }; void setErrorMode( ErrorMode m ); ErrorMode errorMode() const; QSProject *currentProject() const; QObject *currentContext() const; // objects const QObjectList *objects() const; QString objectSource( QObject *object ) const; // signal handlers void addSignalHandler( QObject *sender, const char *signal, QObject *receiver, const char *qtscriptFunction ); void addSignalHandler( QObject *sender, const char *signal, const char *qtscriptFunction ); void removeSignalHandler( QObject *sender, const char *signal, QObject *receiver, const char *qtscriptFunction ); void removeSignalHandler( QObject *sender, const char *signal, const char *qtscriptFunction ); // code inspection QStringList functionsOf( const QString &context, bool includeSignature = FALSE ) const; QStringList functionsOf( QObject *context, bool includeSignature = FALSE ) const; QStringList globalFunctions( bool includeSignature = FALSE ) const; QStringList classes() const; QStringList classesOf( const QString &context ) const; QStringList classesOf( QObject *context ) const; QStringList globalClasses() const; QStringList variablesOf( const QString &context ) const; QStringList variablesOf( QObject *context ) const; QStringList globalVariables() const; public slots: void addObject( QObject *o ); void removeObject( QObject *o ); void clearObjects(); void setObjectSource( QObject *object, const QString &code, bool append = FALSE ); void clear(); signals: void error( const QString &message, const QString &filename, int lineNumber ); private: // disabled copy constructor and assignment operator QSInterpreter( const QSInterpreter & ); QSInterpreter& operator=( const QSInterpreter & ); private: QtApplicationScript *qas; ErrorMode em; QSInterpreterPrivate *d; }; #endif
Copyright © 2001-2002 Trolltech | Trademarks | QSA version 1.0.0-beta1
|