xref: /aoo41x/main/udkapi/com/sun/star/script/XEngine.idl (revision 408a4873)
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#ifndef __com_sun_star_script_XEngine_idl__
24#define __com_sun_star_script_XEngine_idl__
25
26#ifndef __com_sun_star_uno_XInterface_idl__
27#include <com/sun/star/uno/XInterface.idl>
28#endif
29
30#ifndef __com_sun_star_script_XLibraryAccess_idl__
31#include <com/sun/star/script/XLibraryAccess.idl>
32#endif
33
34#ifndef __com_sun_star_script_XEngineListener_idl__
35#include <com/sun/star/script/XEngineListener.idl>
36#endif
37
38
39//=============================================================================
40
41module com {  module sun {  module star {  module script {
42
43//=============================================================================
44/** makes it possible to control a scripting engine.
45	@deprecated
46 */
47published interface XEngine: com::sun::star::uno::XInterface
48{
49	//-------------------------------------------------------------------------
50	/** sets an interface to an object as a scripting root.
51
52		<p>If the root object implements the XInvocation interface,
53		then the engine uses this interface to set/get properties and
54		call methods.
55		</p>
56	 */
57	void setRoot( [in] com::sun::star::uno::XInterface xRoot );
58
59	//-------------------------------------------------------------------------
60	/** gets an interface to the object which is the scripting root.
61	 */
62	com::sun::star::uno::XInterface getRoot();
63
64	//-------------------------------------------------------------------------
65	/** sets an access object to get external functions.
66	 */
67	void setLibraryAccess( [in] com::sun::star::script::XLibraryAccess Library );
68
69	//-------------------------------------------------------------------------
70	/** compiles a script module in the scope of the root object.
71	 */
72	boolean compile( [in] string ModuleName,
73			 [in] string Script,
74			 [in] boolean CreateDebugInfo );
75
76	//-------------------------------------------------------------------------
77	/** runs a script specified by a string.
78
79		<p>The arguments given in <var>aArgs</var> can be ignored by
80		the engine.  The Script is executed synchronously.</p>
81	 */
82	any run( [in] string aScript,
83			 [in] com::sun::star::uno::XInterface xThis,
84			 [in] sequence<any> aArgs );
85
86	//-------------------------------------------------------------------------
87	/** runs the script specified by a string and makes callbacks.
88
89		<p>The arguments given in <var>aArgs</var> can be ignored by
90		the engine.  The script is executed asynchronously.
91
92		</p>
93	 */
94	void runAsync( [in] string acript,
95			 [in] com::sun::star::uno::XInterface xThis,
96			 [in] sequence<any> args,
97			 [in] com::sun::star::script::XEngineListener xCallback );
98
99	//-------------------------------------------------------------------------
100	/** terminates the execution of the running script.
101
102		<p>The waiting queue is cleared too.</p>
103	 */
104	void cancel();
105
106	//-------------------------------------------------------------------------
107	/** adds an engine listener.
108
109       <p>It is suggested to allow multiple registration of the same listener,
110	    thus for each time a listener is added, it has to be removed.
111	 */
112	void addEngineListener( [in] com::sun::star::script::XEngineListener Listener );
113
114	//-------------------------------------------------------------------------
115	/** removes an engine listener.
116
117       <p>It is suggested to allow multiple registration of the same listener,
118	    thus for each time a listener is added, it has to be removed.
119	 */
120	void removeEngineListener( [in] com::sun::star::script::XEngineListener Listener );
121
122};
123
124//=============================================================================
125
126}; }; }; };
127
128#endif
129