Type: info
         Title: css.document.XScriptInvocationContext
     Posted by: [EMAIL PROTECTED]
      Affected: api
Effective from: CWS odbmacros2


*Summary*
--------
+ css.document.XScriptInvocationContext
+ css.script.provider.XScriptContext.getInvocationContext

*Description*
-------------
So far, users can execute document-based macros and scripts only from
within the very same document the macros are embedded into.

There are scenarios where it is desired to execute macros in another
document: Sub components of a database document (model-less components
such as  the query designer, but also components which are complete
documents themselves, namely reports and forms) should also allow the
user to execute macros which actually are embedded into the database
document.

For this, a new interface XScriptInvocationContext has been created:
/** indicates support for executing scripts contained in a, possibly
foreign,
    document.

    <p>If the component implementing it is a document, which supports
    embedding scripts into itself, then <member>ScriptContainer</member>
    refers to the document itself. Implementing this interface is
unnecessary
    then, instead the document should simply implement
    <type>XEmbeddedScripts</type> directly.</p>

    <p>If the interface is implemented by a document which does not itself
    support embedding scripts into it, but which  is associated
unambiguously
    with a document which does, then this other document is denoted by
    <member>ScriptContainer</member>.</p>

    <p>If the interface is implemented by a controller, then
    <member>ScriptContainer</member> refers to the document which
    supports embedding scripts, and which is unambiguously associated
    with the controller. This must not necessarily be the model
returned by
    <member
      scope="com::sun::star::frame">XController::getModel</member>.
    </p>

    @since OOo 2.4
 */
interface XScriptInvocationContext
{
    /** denotes the document which contains the scripts which are to be
        invoked from the component implementing the
        XScriptInvocationContext interface.
    */
    [attribute, readonly] XEmbeddedScripts ScriptContainer;
};


Various changes in our scripting framework have been made, so that now
- an XEmbeddedScripts interface is required to allow embedded scripts
  and macros into a document
- either XEmbeddedScripts or XScriptInvocationContext is needed at
  a document, or a controller, or a frame, in which a document-based
  macro should be executed.

To allow the scripts which are called in a context which is not the
script-embedding document itself to determine the invocation context,
the existing non-published interface XScriptContext got a new member
getScriptInvocationContext.


Send feedback to [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to