enum EUISCRIPTDATATYPE
{
EUSDT_INT,
EUSDT_UINT,
EUSDT_FLOAT,
EUSDT_DOUBLE,
EUSDT_STRING,
EUSDT_POINTER,
EUSDT_SCRIPTMETHOD,
EUSDT_SCRIPTINSTANCE,
};
class IUIScriptInstance;
class IUIScriptMethod;
class IUIScriptValue
{
public:
virtual ~IUIScriptValue() {}
virtual void Release() = 0;
virtual EUISCRIPTDATATYPE GetType() const = 0;
virtual IUIScriptValue * Clone() = 0;
virtual long ToInt() const = 0;
virtual unsigned long ToUInt() const = 0;
virtual const wchar_t * ToString() const = 0;
virtual float ToFloat() const = 0;
virtual double ToDouble() const = 0;
virtual void * ToPointer() const = 0;
virtual IUIScriptInstance * ToScriptInstance() const = 0;
virtual IUIScriptMethod * ToScriptMethod() const = 0;
virtual void SetValue( IUIScriptValue * pValue ) = 0;
virtual void SetPointer( void * pVal ) = 0;
virtual void SetInt( long lVal ) = 0;
virtual void SetUInt( unsigned long ulVal ) = 0;
virtual void SetString( const wchar_t * pszVal ) = 0;
virtual void SetFloat( float fVal ) = 0;
virtual void SetDouble( double dVal ) = 0;
virtual void SetScriptInstance( IUIScriptInstance * pInstance ) = 0;
virtual void SetScriptMethod( IUIScriptMethod * pMethod ) = 0;
};
class IUIScriptMethod
{
public:
virtual ~IUIScriptMethod() {}
virtual void Release() = 0;
virtual IUIScriptInstance * GetOwner() const = 0;
virtual IUIScriptValue * CallWithParams( IUIScriptValue ** pParams, int iParamCount ) = 0;
virtual IUIScriptValue * Call() = 0;
};
class IUIScriptInstance
{
public:
virtual ~IUIScriptInstance() {}
virtual void Release() = 0;
virtual IUIScriptMethod * GetMethod( const wchar_t * pszMethodName ) = 0;
virtual IUIScriptValue * GetVariableValue( const wchar_t * pszVariableName ) = 0;
virtual void SetVariableValue( const wchar_t * pszVariableName, IUIScriptValue * pValue ) = 0;
};
class IUIScriptContext : public IUIContext
{
public:
virtual ~IUIScriptContext() {}
virtual IUIScriptInstance * GetScriptInstance( const wchar_t * pszPath ) = 0;
virtual IUIScriptValue * ValueFromValue( IUIScriptValue * pValue ) = 0;
virtual IUIScriptValue * ValueFromPointer( void * pVal ) = 0;
virtual IUIScriptValue * ValueFromInt( long lVal ) = 0;
virtual IUIScriptValue * ValueFromUInt( unsigned long ulVal ) = 0;
virtual IUIScriptValue * ValueFromString( const wchar_t * pszVal ) = 0;
virtual IUIScriptValue * ValueFromFloat( float fVal ) = 0;
virtual IUIScriptValue * ValueFromDouble( double dVal ) = 0;
virtual IUIScriptValue * ValueFromScriptInstance( IUIScriptInstance * pInstance ) = 0;
virtual IUIScriptValue * ValueFromScriptMethod( IUIScriptMethod * pMethod ) = 0;
};