LibreOffice
LibreOffice 24.2 SDK API Reference
Public Member Functions | List of all members
XScriptContext Interface Reference

This interface is provided to scripts, and provides a means of access to the various interfaces which they might need to perform some action on a document. More...

import"XScriptContext.idl";

Inheritance diagram for XScriptContext:
XInterface

Public Member Functions

::com::sun::star::frame::XModel getDocument ()
 Obtain the document reference on which the script can operate. More...
 
::com::sun::star::document::XScriptInvocationContext getInvocationContext ()
 provides access to the context where the script was invoked More...
 
::com::sun::star::frame::XDesktop getDesktop ()
 Obtain the desktop reference on which the script can operate. More...
 
::com::sun::star::uno::XComponentContext getComponentContext ()
 Obtain the component context which the script can use to create other uno components. 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 is provided to scripts, and provides a means of access to the various interfaces which they might need to perform some action on a document.

It is required to be passed as the first argument for any Java scripts.

Member Function Documentation

◆ getComponentContext()

::com::sun::star::uno::XComponentContext getComponentContext ( )

Obtain the component context which the script can use to create other uno components.

Returns
com::sun::star::uno::XComponentContext interface

◆ getDesktop()

Obtain the desktop reference on which the script can operate.

Returns
com::sun::star::frame::XDesktop interface

◆ getDocument()

::com::sun::star::frame::XModel getDocument ( )

Obtain the document reference on which the script can operate.

Returns
com::sun::star::frame::XModel interface

◆ getInvocationContext()

provides access to the context where the script was invoked

In some cases, it is possible that scripts, embedded in a document, are executed from within a context which is not the document itself. In this case, the getInvocationContext member allows to access this context.

Note that the returned context is allowed to be NULL, in this case, the document as returned by getDocument is the invocation context.

If the returned context is not NULL, its ScriptContainer attribute equals the document as returned by XScriptContext::getDocument.

Since
OOo 3.0

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