TQAxScriptEngine Class

Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# TQAxScriptEngine Class Reference
[TQAxContainer module]

The TQAxScriptEngine class provides a wrapper around a script engine. More...

This class is part of the TQt ActiveTQt Extension.

`#include <qaxscript.h>`

Inherits TQAxObject.

List of all member functions.

## Public Members

- enum State { Uninitialized = 0, Initialized = 5, Started = 1, Connected = 2, Disconnected = 3, Closed = 4 }
- TQAxScriptEngine ( const TQString & language, TQAxScript * script )
- ~TQAxScriptEngine ()
- bool isValid () const
- bool hasIntrospection () const
- TQString scriptLanguage () const
- State state () const
- void setState ( State st )
- void addItem ( const TQString & name )
- long queryInterface ( const TQUuid & uuid, void ** iface ) const

## Detailed Description

This class is defined in the TQt ActiveTQt Extension, which can be found in the `qt/extensions` directory. It is not included in the main TQt API.

The TQAxScriptEngine class provides a wrapper around a script engine.

Every instance of the TQAxScriptEngine class represents an interpreter for script code in a particular scripting language. The class is usually not used directly. The TQAxScript and TQAxScriptManager classes provide convenient functions to handle and call script code.

Direct access to the script engine is provided through queryInterface().

Warning: This class is not available with the bcc5.5 and MingW compilers.

## Member Type Documentation

### TQAxScriptEngine::State

The State enumeration defines the different states a script engine can be in.

- `TQAxScriptEngine::Uninitialized` - The script has been created, but not yet initialized
- `TQAxScriptEngine::Initialized` - The script has been initialized, but is not running
- `TQAxScriptEngine::Started` - The script can execute code, but does not yet handle events
- `TQAxScriptEngine::Connected` - The script can execute code and is connected so that it can handle events
- `TQAxScriptEngine::Disconnected` - The script is loaded, but is not connected to event sources
- `TQAxScriptEngine::Closed` - The script has been closed.

## Member Function Documentation

### TQAxScriptEngine::TQAxScriptEngine ( const TQString & language, TQAxScript * script )

Constructs a TQAxScriptEngine object interpreting script code in language provided by the code in script. This is usually done by the TQAxScript class when loading a script.

Instances of TQAxScriptEngine should always have both a language and a script.

### TQAxScriptEngine::~TQAxScriptEngine ()

Destroys the TQAxScriptEngine object, releasing all allocated resources.

### void TQAxScriptEngine::addItem ( const TQString & name )

Registers an item with the script engine. Script code can refer to this item using name.

### bool TQAxScriptEngine::hasIntrospection () const

Returns true if the script engine supports introspection; otherwise returns false.

### bool TQAxScriptEngine::isValid () const

Returns true if the script engine has been initialized correctly; otherwise returns false.

### long TQAxScriptEngine::queryInterface ( const TQUuid & uuid, void ** iface ) const

Requests the interface uuid from the script engine object and sets the value of iface to the provided interface, or to 0 if the requested interface could not be provided.

Returns the result of the QueryInterface implementation of the COM object.

### TQString TQAxScriptEngine::scriptLanguage () const

Returns the scripting language, for example "VBScript", or "JScript".

### void TQAxScriptEngine::setState ( State st )

Sets the state of the script engine to st. Calling this function is usually not necessary.

### State TQAxScriptEngine::state () const

Returns the state of the script engine.

This file is part of the TQt toolkit. Copyright © 1995-2007 Trolltech. All Rights Reserved.