LibreOffice
LibreOffice 25.8 SDK API 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";
Public Member Functions | |
::com::sun::star::frame::XModel | getDocument () |
Obtain the document reference on which the script can operate. | |
::com::sun::star::document::XScriptInvocationContext | getInvocationContext () |
provides access to the context where the script was invoked | |
::com::sun::star::frame::XDesktop | getDesktop () |
Obtain the desktop reference on which the script can operate. | |
::com::sun::star::uno::XComponentContext | getComponentContext () |
Obtain the component context which the script can use to create other uno components. | |
Public Member Functions inherited from XInterface | |
any | queryInterface ([in] type aType) |
queries for a new interface to an existing UNO object. | |
void | acquire () |
increases the reference counter by one. | |
void | release () |
decreases the reference counter by one. |
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.
::com::sun::star::uno::XComponentContext getComponentContext | ( | ) |
Obtain the component context which the script can use to create other uno components.
::com::sun::star::frame::XDesktop getDesktop | ( | ) |
Obtain the desktop reference on which the script can operate.
::com::sun::star::frame::XModel getDocument | ( | ) |
Obtain the document reference on which the script can operate.
::com::sun::star::document::XScriptInvocationContext 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
.