xref: /AOO41X/main/udkapi/com/sun/star/script/XEventAttacherManager.idl (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir#ifndef __com_sun_star_script_XEventAttacherManager_idl__
28*cdf0e10cSrcweir#define __com_sun_star_script_XEventAttacherManager_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__
31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir#ifndef __com_sun_star_script_ScriptEventDescriptor_idl__
35*cdf0e10cSrcweir#include <com/sun/star/script/ScriptEventDescriptor.idl>
36*cdf0e10cSrcweir#endif
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
39*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
40*cdf0e10cSrcweir#endif
41*cdf0e10cSrcweir
42*cdf0e10cSrcweir#ifndef __com_sun_star_lang_ServiceNotRegisteredException_idl__
43*cdf0e10cSrcweir#include <com/sun/star/lang/ServiceNotRegisteredException.idl>
44*cdf0e10cSrcweir#endif
45*cdf0e10cSrcweir
46*cdf0e10cSrcweir#ifndef __com_sun_star_script_XScriptListener_idl__
47*cdf0e10cSrcweir#include <com/sun/star/script/XScriptListener.idl>
48*cdf0e10cSrcweir#endif
49*cdf0e10cSrcweir
50*cdf0e10cSrcweir
51*cdf0e10cSrcweir//=============================================================================
52*cdf0e10cSrcweir
53*cdf0e10cSrcweir module com {  module sun {  module star {  module script {
54*cdf0e10cSrcweir
55*cdf0e10cSrcweir//=============================================================================
56*cdf0e10cSrcweir/** registers listeners for specified events.
57*cdf0e10cSrcweir */
58*cdf0e10cSrcweirpublished interface XEventAttacherManager: com::sun::star::uno::XInterface
59*cdf0e10cSrcweir{
60*cdf0e10cSrcweir	//-------------------------------------------------------------------------
61*cdf0e10cSrcweir	/** registers one event for an object identified by its index.
62*cdf0e10cSrcweir
63*cdf0e10cSrcweir		<p>If any object is attached under this index, then this
64*cdf0e10cSrcweir		event is attached automatically.</p>
65*cdf0e10cSrcweir		<p>Exceptions of type
66*cdf0e10cSrcweir		<type scope="com::sun::star::beans">IntrospectionException</type> and
67*cdf0e10cSrcweir		<type scope="com::sun::star::script">CannotCreateAdapterException</type>
68*cdf0e10cSrcweir		that can be thrown by methods of <type>XEventAttacher</type> are caught
69*cdf0e10cSrcweir		and ignored.</p>
70*cdf0e10cSrcweir	 */
71*cdf0e10cSrcweir	void registerScriptEvent( [in] long nIndex,
72*cdf0e10cSrcweir			 [in] com::sun::star::script::ScriptEventDescriptor aScriptEvent )
73*cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException );
74*cdf0e10cSrcweir
75*cdf0e10cSrcweir	//-------------------------------------------------------------------------
76*cdf0e10cSrcweir	/** registers several events for an object identified by its index.
77*cdf0e10cSrcweir
78*cdf0e10cSrcweir		<p>The result is the same as if the method <member>registerScriptEvent
79*cdf0e10cSrcweir		</member> was called once for each <type>ScriptEventDescriptor</type>
80*cdf0e10cSrcweir		in the sequence.</p>
81*cdf0e10cSrcweir
82*cdf0e10cSrcweir		<p>If any object is attached under this index, then this
83*cdf0e10cSrcweir		event is attached automatically (see <member>attach</member>)</p>
84*cdf0e10cSrcweir
85*cdf0e10cSrcweir		<p>Exceptions of type
86*cdf0e10cSrcweir		<type scope="com::sun::star::beans">IntrospectionException</type> and
87*cdf0e10cSrcweir		<type scope="com::sun::star::script">CannotCreateAdapterException</type>
88*cdf0e10cSrcweir		that can be thrown by methods of <type>XEventAttacher</type> are caught
89*cdf0e10cSrcweir		and ignored.</p>
90*cdf0e10cSrcweir
91*cdf0e10cSrcweir		@see registerScriptEvent
92*cdf0e10cSrcweir		@see attach
93*cdf0e10cSrcweir	 */
94*cdf0e10cSrcweir	void registerScriptEvents( [in] long nIndex,
95*cdf0e10cSrcweir			 [in] sequence<com::sun::star::script::ScriptEventDescriptor> aScriptEvents )
96*cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException );
97*cdf0e10cSrcweir
98*cdf0e10cSrcweir	//-------------------------------------------------------------------------
99*cdf0e10cSrcweir	/** revokes the registration of an event.
100*cdf0e10cSrcweir
101*cdf0e10cSrcweir		<p>The parameters <var>ListenerType</var> and
102*cdf0e10cSrcweir		<var>EventMethod</var> are equivalent to the first two
103*cdf0e10cSrcweir		members of the <type>ScriptEventDescriptor</type>
104*cdf0e10cSrcweir		used to register events. If this event at this index has
105*cdf0e10cSrcweir		been attached to any object, it is detached automatically
106*cdf0e10cSrcweir		(see <member>attach</member>).</p>
107*cdf0e10cSrcweir
108*cdf0e10cSrcweir		<p>Exceptions of type
109*cdf0e10cSrcweir		<type scope="com::sun::star::beans">IntrospectionException</type> and
110*cdf0e10cSrcweir		<type scope="com::sun::star::script">CannotCreateAdapterException</type>
111*cdf0e10cSrcweir		that can be thrown by methods of <type>XEventAttacher</type> are caught
112*cdf0e10cSrcweir		and ignored.</p>
113*cdf0e10cSrcweir
114*cdf0e10cSrcweir		@see attach
115*cdf0e10cSrcweir	 */
116*cdf0e10cSrcweir	void revokeScriptEvent( [in] long nIndex,
117*cdf0e10cSrcweir			 [in] string aListenerType,
118*cdf0e10cSrcweir			 [in] string aEventMethod,
119*cdf0e10cSrcweir			 [in] string aRemoveListenerParam )
120*cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException );
121*cdf0e10cSrcweir
122*cdf0e10cSrcweir	//-------------------------------------------------------------------------
123*cdf0e10cSrcweir	/** revokes all events which are registered for the given index.
124*cdf0e10cSrcweir
125*cdf0e10cSrcweir		<p>If the events at this index have been attached to any
126*cdf0e10cSrcweir		object, they are detached automatically.
127*cdf0e10cSrcweir		(see <member>attach</member>).</p>
128*cdf0e10cSrcweir
129*cdf0e10cSrcweir		@see attach
130*cdf0e10cSrcweir	 */
131*cdf0e10cSrcweir	void revokeScriptEvents( [in] long nIndex )
132*cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException );
133*cdf0e10cSrcweir
134*cdf0e10cSrcweir	//-------------------------------------------------------------------------
135*cdf0e10cSrcweir	/** creates an empty entry at the given position.
136*cdf0e10cSrcweir
137*cdf0e10cSrcweir		<p>The index <var>n</var> of all entries with <code>n &amp;gt;=
138*cdf0e10cSrcweir		nIndex</code> will be increased by one.</p>
139*cdf0e10cSrcweir	 */
140*cdf0e10cSrcweir	void insertEntry( [in] long nIndex )
141*cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException );
142*cdf0e10cSrcweir
143*cdf0e10cSrcweir	//-------------------------------------------------------------------------
144*cdf0e10cSrcweir	/** removes the entry at the given position.
145*cdf0e10cSrcweir
146*cdf0e10cSrcweir		<p>If any events are registered at this index, they will
147*cdf0e10cSrcweir		be revoked, too. So if the events at this index have been
148*cdf0e10cSrcweir		attached to any object they are detached automatically.
149*cdf0e10cSrcweir		(see <member>attach</member>).</p>
150*cdf0e10cSrcweir
151*cdf0e10cSrcweir		@see attach
152*cdf0e10cSrcweir	 */
153*cdf0e10cSrcweir	void removeEntry( [in] long nIndex )
154*cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException );
155*cdf0e10cSrcweir
156*cdf0e10cSrcweir	//-------------------------------------------------------------------------
157*cdf0e10cSrcweir	/** @eturns
158*cdf0e10cSrcweir			all events registered for the given object index.
159*cdf0e10cSrcweir
160*cdf0e10cSrcweir		@param Index
161*cdf0e10cSrcweir			an index previously inserted with the method insertEntry.
162*cdf0e10cSrcweir
163*cdf0e10cSrcweir		@throws IllegalArgumentException
164*cdf0e10cSrcweir			if Index is not valid.
165*cdf0e10cSrcweir	 */
166*cdf0e10cSrcweir	sequence<com::sun::star::script::ScriptEventDescriptor> getScriptEvents( [in] long Index )
167*cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException );
168*cdf0e10cSrcweir
169*cdf0e10cSrcweir	//-------------------------------------------------------------------------
170*cdf0e10cSrcweir	/** attaches all the <type>ScriptEvent</type>s which are registered
171*cdf0e10cSrcweir		for the given index to the given object.
172*cdf0e10cSrcweir
173*cdf0e10cSrcweir		<p>Exceptions of type
174*cdf0e10cSrcweir		<type scope="com::sun::star::beans">IntrospectionException</type> and
175*cdf0e10cSrcweir		<type scope="com::sun::star::script">CannotCreateAdapterException</type>
176*cdf0e10cSrcweir		that can be thrown by methods of <type>XEventAttacher</type> are caught
177*cdf0e10cSrcweir		and ignored.</p>
178*cdf0e10cSrcweir	 */
179*cdf0e10cSrcweir	void attach( [in] long nIndex,
180*cdf0e10cSrcweir			 [in] com::sun::star::uno::XInterface xObject,
181*cdf0e10cSrcweir			 [in] any aHelper )
182*cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException,
183*cdf0e10cSrcweir					com::sun::star::lang::ServiceNotRegisteredException );
184*cdf0e10cSrcweir
185*cdf0e10cSrcweir	//-------------------------------------------------------------------------
186*cdf0e10cSrcweir	/** detaches all the <type>ScriptEvent</type>s from the given object
187*cdf0e10cSrcweir		which are registered at this object for the given index.
188*cdf0e10cSrcweir
189*cdf0e10cSrcweir		<p>Exceptions of type
190*cdf0e10cSrcweir		<type scope="com::sun::star::beans">IntrospectionException</type> and
191*cdf0e10cSrcweir		<type scope="com::sun::star::script">CannotCreateAdapterException</type>
192*cdf0e10cSrcweir		that can be thrown by methods of <type>XEventAttacher</type> are caught
193*cdf0e10cSrcweir		and ignored.</p>
194*cdf0e10cSrcweir	 */
195*cdf0e10cSrcweir	void detach( [in] long nIndex,
196*cdf0e10cSrcweir			 [in] com::sun::star::uno::XInterface xObject )
197*cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException );
198*cdf0e10cSrcweir
199*cdf0e10cSrcweir	//-------------------------------------------------------------------------
200*cdf0e10cSrcweir	/** adds an <type>XScriptListener</type> that will be notified when an
201*cdf0e10cSrcweir		event takes place. For that a
202*cdf0e10cSrcweir		<type>ScriptEventDescriptor</type> is registered at and
203*cdf0e10cSrcweir		attached to an object by an <type>XEventAttacherManager</type>.
204*cdf0e10cSrcweir
205*cdf0e10cSrcweir       <p>It is suggested to allow multiple registration of the same listener,
206*cdf0e10cSrcweir	    thus for each time a listener is added, it has to be removed.
207*cdf0e10cSrcweir
208*cdf0e10cSrcweir		@see removeScriptListener
209*cdf0e10cSrcweir	 */
210*cdf0e10cSrcweir	void addScriptListener( [in] com::sun::star::script::XScriptListener xListener )
211*cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException );
212*cdf0e10cSrcweir
213*cdf0e10cSrcweir	//-------------------------------------------------------------------------
214*cdf0e10cSrcweir	/** removes a <type>XScriptListener</type> from the listener list.
215*cdf0e10cSrcweir
216*cdf0e10cSrcweir		<p>Nothing happens if the listener is not registered.
217*cdf0e10cSrcweir
218*cdf0e10cSrcweir       <p>It is suggested to allow multiple registration of the same listener,
219*cdf0e10cSrcweir	    thus for each time a listener is added, it has to be removed.
220*cdf0e10cSrcweir
221*cdf0e10cSrcweir		@see addScriptListener
222*cdf0e10cSrcweir	 */
223*cdf0e10cSrcweir	void removeScriptListener( [in] com::sun::star::script::XScriptListener Listener )
224*cdf0e10cSrcweir			raises( com::sun::star::lang::IllegalArgumentException );
225*cdf0e10cSrcweir
226*cdf0e10cSrcweir};
227*cdf0e10cSrcweir
228*cdf0e10cSrcweir//=============================================================================
229*cdf0e10cSrcweir
230*cdf0e10cSrcweir}; }; }; };
231*cdf0e10cSrcweir
232*cdf0e10cSrcweir#endif
233