merged tag ooo/OOO330_m14
[LibreOffice.git] / udkapi / com / sun / star / script / XEventAttacherManager.idl
blob16f209d876a53ab720e6007a6f577d088b947030
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef __com_sun_star_script_XEventAttacherManager_idl__
28 #define __com_sun_star_script_XEventAttacherManager_idl__
30 #ifndef __com_sun_star_uno_XInterface_idl__
31 #include <com/sun/star/uno/XInterface.idl>
32 #endif
34 #ifndef __com_sun_star_script_ScriptEventDescriptor_idl__
35 #include <com/sun/star/script/ScriptEventDescriptor.idl>
36 #endif
38 #ifndef __com_sun_star_lang_IllegalArgumentException_idl__
39 #include <com/sun/star/lang/IllegalArgumentException.idl>
40 #endif
42 #ifndef __com_sun_star_lang_ServiceNotRegisteredException_idl__
43 #include <com/sun/star/lang/ServiceNotRegisteredException.idl>
44 #endif
46 #ifndef __com_sun_star_script_XScriptListener_idl__
47 #include <com/sun/star/script/XScriptListener.idl>
48 #endif
51 //=============================================================================
53 module com { module sun { module star { module script {
55 //=============================================================================
56 /** registers listeners for specified events.
58 published interface XEventAttacherManager: com::sun::star::uno::XInterface
60 //-------------------------------------------------------------------------
61 /** registers one event for an object identified by its index.
63 <p>If any object is attached under this index, then this
64 event is attached automatically.</p>
65 <p>Exceptions of type
66 <type scope="com::sun::star::beans">IntrospectionException</type> and
67 <type scope="com::sun::star::script">CannotCreateAdapterException</type>
68 that can be thrown by methods of <type>XEventAttacher</type> are caught
69 and ignored.</p>
71 void registerScriptEvent( [in] long nIndex,
72 [in] com::sun::star::script::ScriptEventDescriptor aScriptEvent )
73 raises( com::sun::star::lang::IllegalArgumentException );
75 //-------------------------------------------------------------------------
76 /** registers several events for an object identified by its index.
78 <p>The result is the same as if the method <member>registerScriptEvent
79 </member> was called once for each <type>ScriptEventDescriptor</type>
80 in the sequence.</p>
82 <p>If any object is attached under this index, then this
83 event is attached automatically (see <member>attach</member>)</p>
85 <p>Exceptions of type
86 <type scope="com::sun::star::beans">IntrospectionException</type> and
87 <type scope="com::sun::star::script">CannotCreateAdapterException</type>
88 that can be thrown by methods of <type>XEventAttacher</type> are caught
89 and ignored.</p>
91 @see registerScriptEvent
92 @see attach
94 void registerScriptEvents( [in] long nIndex,
95 [in] sequence<com::sun::star::script::ScriptEventDescriptor> aScriptEvents )
96 raises( com::sun::star::lang::IllegalArgumentException );
98 //-------------------------------------------------------------------------
99 /** revokes the registration of an event.
101 <p>The parameters <var>ListenerType</var> and
102 <var>EventMethod</var> are equivalent to the first two
103 members of the <type>ScriptEventDescriptor</type>
104 used to register events. If this event at this index has
105 been attached to any object, it is detached automatically
106 (see <member>attach</member>).</p>
108 <p>Exceptions of type
109 <type scope="com::sun::star::beans">IntrospectionException</type> and
110 <type scope="com::sun::star::script">CannotCreateAdapterException</type>
111 that can be thrown by methods of <type>XEventAttacher</type> are caught
112 and ignored.</p>
114 @see attach
116 void revokeScriptEvent( [in] long nIndex,
117 [in] string aListenerType,
118 [in] string aEventMethod,
119 [in] string aRemoveListenerParam )
120 raises( com::sun::star::lang::IllegalArgumentException );
122 //-------------------------------------------------------------------------
123 /** revokes all events which are registered for the given index.
125 <p>If the events at this index have been attached to any
126 object, they are detached automatically.
127 (see <member>attach</member>).</p>
129 @see attach
131 void revokeScriptEvents( [in] long nIndex )
132 raises( com::sun::star::lang::IllegalArgumentException );
134 //-------------------------------------------------------------------------
135 /** creates an empty entry at the given position.
137 <p>The index <var>n</var> of all entries with <code>n &amp;gt;=
138 nIndex</code> will be increased by one.</p>
140 void insertEntry( [in] long nIndex )
141 raises( com::sun::star::lang::IllegalArgumentException );
143 //-------------------------------------------------------------------------
144 /** removes the entry at the given position.
146 <p>If any events are registered at this index, they will
147 be revoked, too. So if the events at this index have been
148 attached to any object they are detached automatically.
149 (see <member>attach</member>).</p>
151 @see attach
153 void removeEntry( [in] long nIndex )
154 raises( com::sun::star::lang::IllegalArgumentException );
156 //-------------------------------------------------------------------------
157 /** @eturns
158 all events registered for the given object index.
160 @param Index
161 an index previously inserted with the method insertEntry.
163 @throws IllegalArgumentException
164 if Index is not valid.
166 sequence<com::sun::star::script::ScriptEventDescriptor> getScriptEvents( [in] long Index )
167 raises( com::sun::star::lang::IllegalArgumentException );
169 //-------------------------------------------------------------------------
170 /** attaches all the <type>ScriptEvent</type>s which are registered
171 for the given index to the given object.
173 <p>Exceptions of type
174 <type scope="com::sun::star::beans">IntrospectionException</type> and
175 <type scope="com::sun::star::script">CannotCreateAdapterException</type>
176 that can be thrown by methods of <type>XEventAttacher</type> are caught
177 and ignored.</p>
179 void attach( [in] long nIndex,
180 [in] com::sun::star::uno::XInterface xObject,
181 [in] any aHelper )
182 raises( com::sun::star::lang::IllegalArgumentException,
183 com::sun::star::lang::ServiceNotRegisteredException );
185 //-------------------------------------------------------------------------
186 /** detaches all the <type>ScriptEvent</type>s from the given object
187 which are registered at this object for the given index.
189 <p>Exceptions of type
190 <type scope="com::sun::star::beans">IntrospectionException</type> and
191 <type scope="com::sun::star::script">CannotCreateAdapterException</type>
192 that can be thrown by methods of <type>XEventAttacher</type> are caught
193 and ignored.</p>
195 void detach( [in] long nIndex,
196 [in] com::sun::star::uno::XInterface xObject )
197 raises( com::sun::star::lang::IllegalArgumentException );
199 //-------------------------------------------------------------------------
200 /** adds an <type>XScriptListener</type> that will be notified when an
201 event takes place. For that a
202 <type>ScriptEventDescriptor</type> is registered at and
203 attached to an object by an <type>XEventAttacherManager</type>.
205 <p>It is suggested to allow multiple registration of the same listener,
206 thus for each time a listener is added, it has to be removed.
208 @see removeScriptListener
210 void addScriptListener( [in] com::sun::star::script::XScriptListener xListener )
211 raises( com::sun::star::lang::IllegalArgumentException );
213 //-------------------------------------------------------------------------
214 /** removes a <type>XScriptListener</type> from the listener list.
216 <p>Nothing happens if the listener is not registered.
218 <p>It is suggested to allow multiple registration of the same listener,
219 thus for each time a listener is added, it has to be removed.
221 @see addScriptListener
223 void removeScriptListener( [in] com::sun::star::script::XScriptListener Listener )
224 raises( com::sun::star::lang::IllegalArgumentException );
228 //=============================================================================
230 }; }; }; };
232 #endif