xref: /trunk/main/udkapi/com/sun/star/script/XEngine.idl (revision cdf0e10c)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27#ifndef __com_sun_star_script_XEngine_idl__
28#define __com_sun_star_script_XEngine_idl__
29
30#ifndef __com_sun_star_uno_XInterface_idl__
31#include <com/sun/star/uno/XInterface.idl>
32#endif
33
34#ifndef __com_sun_star_script_XLibraryAccess_idl__
35#include <com/sun/star/script/XLibraryAccess.idl>
36#endif
37
38#ifndef __com_sun_star_script_XEngineListener_idl__
39#include <com/sun/star/script/XEngineListener.idl>
40#endif
41
42
43//=============================================================================
44
45module com {  module sun {  module star {  module script {
46
47//=============================================================================
48/** makes it possible to control a scripting engine.
49	@deprecated
50 */
51published interface XEngine: com::sun::star::uno::XInterface
52{
53	//-------------------------------------------------------------------------
54	/** sets an interface to an object as a scripting root.
55
56		<p>If the root object implements the XInvocation interface,
57		then the engine uses this interface to set/get properties and
58		call methods.
59		</p>
60	 */
61	void setRoot( [in] com::sun::star::uno::XInterface xRoot );
62
63	//-------------------------------------------------------------------------
64	/** gets an interface to the object which is the scripting root.
65	 */
66	com::sun::star::uno::XInterface getRoot();
67
68	//-------------------------------------------------------------------------
69	/** sets an access object to get external functions.
70	 */
71	void setLibraryAccess( [in] com::sun::star::script::XLibraryAccess Library );
72
73	//-------------------------------------------------------------------------
74	/** compiles a script module in the scope of the root object.
75	 */
76	boolean compile( [in] string ModuleName,
77			 [in] string Script,
78			 [in] boolean CreateDebugInfo );
79
80	//-------------------------------------------------------------------------
81	/** runs a script specified by a string.
82
83		<p>The arguments given in <var>aArgs</var> can be ignored by
84		the engine.  The Script is executed synchronously.</p>
85	 */
86	any run( [in] string aScript,
87			 [in] com::sun::star::uno::XInterface xThis,
88			 [in] sequence<any> aArgs );
89
90	//-------------------------------------------------------------------------
91	/** runs the script specified by a string and makes callbacks.
92
93		<p>The arguments given in <var>aArgs</var> can be ignored by
94		the engine.  The script is executed asynchronously.
95
96		</p>
97	 */
98	void runAsync( [in] string acript,
99			 [in] com::sun::star::uno::XInterface xThis,
100			 [in] sequence<any> args,
101			 [in] com::sun::star::script::XEngineListener xCallback );
102
103	//-------------------------------------------------------------------------
104	/** terminates the execution of the running script.
105
106		<p>The waiting queue is cleared too.</p>
107	 */
108	void cancel();
109
110	//-------------------------------------------------------------------------
111	/** adds an engine listener.
112
113       <p>It is suggested to allow multiple registration of the same listener,
114	    thus for each time a listener is added, it has to be removed.
115	 */
116	void addEngineListener( [in] com::sun::star::script::XEngineListener Listener );
117
118	//-------------------------------------------------------------------------
119	/** removes an engine listener.
120
121       <p>It is suggested to allow multiple registration of the same listener,
122	    thus for each time a listener is added, it has to be removed.
123	 */
124	void removeEngineListener( [in] com::sun::star::script::XEngineListener Listener );
125
126};
127
128//=============================================================================
129
130}; }; }; };
131
132#endif
133