(incubating) | The Free and Open Productivity Suite
Announcing Apache OpenOffice 3.4

Developer's Guide

API

SDK

Tips 'n' Tricks

Miscellaneous

Content for OpenOffice.org version 3.3.

:: com :: sun :: star :: script :: provider ::

unpublished interface XScriptContext
Usage Restrictions
not published
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.

Methods' Summary
getDocument Obtain the document reference on which the script can operate  
getInvocationContext provides access to the context where the script was invoked  
getDesktop Obtain the desktop reference on which the script can operate  
getComponentContext Obtain the component context which the script can use to create other uno components  
Methods' Details
getDocument
::com::sun::star::frame::XModel
getDocument();

Description
Obtain the document reference on which the script can operate
Returns
::com::sun::star::frame::XModel interface
getInvocationContext
::com::sun::star::document::XScriptInvocationContext
getInvocationContext();

Description
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
getDesktop
::com::sun::star::frame::XDesktop
getDesktop();

Description
Obtain the desktop reference on which the script can operate
Returns
::com::sun::star::frame::XDesktop interface
getComponentContext
::com::sun::star::uno::XComponentContext
getComponentContext();

Description
Obtain the component context which the script can use to create other uno components
Returns
::com::sun::star::uno::XComponentContext interface
Top of Page

Apache Feather

Copyright & License | Privacy | Contact Us

Apache and the Apache feather logos are trademarks of The Apache Software Foundation. OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.

Apache OpenOffice is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.