LibreOffice LibreOffice 25.2 SDK API Reference

Public Member Functions | List of all members
XScript Interface Reference

This interface represents an invocable script or UNO function. More...

`import"XScript.idl";`

Inheritance diagram for XScript:

## Public Member Functions
any | invoke ([in] sequence< any > aParams, [out] sequence< short > aOutParamIndex, [out] sequence< any > aOutParam) raises ( ::com::sun::star::script::provider::ScriptFrameworkErrorException , ::com::sun::star::reflection::InvocationTargetException)
| invoke the script or function represented by the implementing object More...
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object. More...
void | acquire ()
| increases the reference counter by one. More...
void | release ()
| decreases the reference counter by one. More...

## Detailed Description

This interface represents an invocable script or UNO function.

## Member Function Documentation

## ◆ invoke()

any invoke | ( | [in] sequence< any > | aParams,
|  | [out] sequence< short > | aOutParamIndex,
|  | [out] sequence< any > | aOutParam
| ) |  |
raises | ( | ::com::sun::star::script::provider::ScriptFrameworkErrorException ,
|  | ::com::sun::star::reflection::InvocationTargetException
| ) |  |

invoke the script or function represented by the implementing object

Parameters

  aParams | all parameters; pure, out parameters are undefined in sequence, i.e., the value has to be ignored by the callee
  aOutParamIndex | out indices, indicating the position of the out or inout parameters in the list of arguments to the script
  aOutParam | out parameters

For example, if the script had the signature
`long foo( [inout] string a, [in] string b, [out] string c )`
the call would look like
`bar.invoke( {"foo", "foo2", "this-is-ignored" }, aOutParamIndex, aOutParam);`
and after the call the out sequences would contain

aOutParamIndex={0,2};
aOutParam={"string from a", "string from c"};

Returns
  the value returned from the function being invoked

Exceptions

  com::sun::star::reflection::InvocationTargetException | if an error occurs while attempting to invoke a script the information is captured. If the error or exception is generated by the script itself it is wrapped as either ScriptErrorRaisedException or ScriptExceptionRaisedException or ScriptFrameworkErrorException are wrapped as ScriptFrameworkErrorExceptions.

The documentation for this interface was generated from the following file:

- com/sun/star/script/provider/XScript.idl