1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_script_provider_XScriptContext_idl__
25#define __com_sun_star_script_provider_XScriptContext_idl__
26
27#ifndef __com_sun_star_uno_XInterface_idl__
28#include <com/sun/star/uno/XInterface.idl>
29#endif
30
31#ifndef __com_sun_star_frame_XDesktop_idl__
32#include <com/sun/star/frame/XDesktop.idl>
33#endif
34
35#ifndef __com_sun_star_frame_XModel_idl__
36#include <com/sun/star/frame/XModel.idl>
37#endif
38
39#ifndef __com_sun_star_uno_XComponentContext_idl__
40#include <com/sun/star/uno/XComponentContext.idl>
41#endif
42
43
44module com { module sun { module star { module document {
45    interface XScriptInvocationContext;
46}; }; }; };
47
48//===========================================================================
49
50module com { module sun { module star { module script { module provider {
51
52//===========================================================================
53/**
54    This interface is provided to scripts, and provides a means of access to
55    the various interfaces which they might need to perform some action on
56    a document. It is required to be passed as the first argument for any
57    Java scripts.
58*/
59interface XScriptContext : ::com::sun::star::uno::XInterface {
60
61    //----------------------------------------------------------------------
62    /**
63        Obtain the document reference on which the script can operate
64
65        @returns
66	      <type scope="com::sun::star::frame">XModel</type> interface
67    */
68    ::com::sun::star::frame::XModel getDocument();
69
70    /** provides access to the context where the script was invoked
71
72        <p>In some cases, it is possible that scripts, embedded in a document,
73        are executed from within a context which is <em>not</em> the document
74        itself. In this case, the <code>getInvocationContext</code> member allows
75        to access this context.</p>
76
77        <p>Note that the returned context is allowed to be <NULL/>, in this case,
78        the document as returned by <code>getDocument</code> is the invocation context.</p>
79
80        <p>If the returned context is not <NULL/>, its <code>ScriptContainer</code> attribute
81        equals the document as returned by <code>XScriptContext::getDocument</code>.</p>
82
83        @since OpenOffice 3.0
84    */
85    ::com::sun::star::document::XScriptInvocationContext getInvocationContext();
86
87    /**
88        Obtain the desktop reference on which the script can operate
89
90        @returns
91	      <type scope="com::sun::star::frame">XDesktop</type> interface
92    */
93    ::com::sun::star::frame::XDesktop getDesktop();
94
95    /**
96        Obtain the component context which the script can use to create
97        other uno components
98
99        @returns
100	      <type scope="com::sun::star::uno">XComponentContext</type> interface
101    */
102    ::com::sun::star::uno::XComponentContext getComponentContext();
103
104
105};
106
107//===========================================================================
108}; }; }; }; }; // ::com::sun::star::script::provider
109
110#endif
111