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_XEventAttacher_idl__
24#define __com_sun_star_script_XEventAttacher_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_lang_XEventListener_idl__
31#include <com/sun/star/lang/XEventListener.idl>
32#endif
33
34#ifndef __com_sun_star_script_XAllListener_idl__
35#include <com/sun/star/script/XAllListener.idl>
36#endif
37
38#ifndef __com_sun_star_lang_IllegalArgumentException_idl__
39#include <com/sun/star/lang/IllegalArgumentException.idl>
40#endif
41
42#ifndef __com_sun_star_beans_IntrospectionException_idl__
43#include <com/sun/star/beans/IntrospectionException.idl>
44#endif
45
46#ifndef __com_sun_star_script_CannotCreateAdapterException_idl__
47#include <com/sun/star/script/CannotCreateAdapterException.idl>
48#endif
49
50#ifndef __com_sun_star_lang_ServiceNotRegisteredException_idl__
51#include <com/sun/star/lang/ServiceNotRegisteredException.idl>
52#endif
53
54
55//=============================================================================
56
57 module com {  module sun {  module star {  module script {
58
59//=============================================================================
60/** makes it possible to attach script events given by a sequence of
61	<type>ScriptEventDescriptor</type> structures to a given interface.
62 */
63published interface XEventAttacher: com::sun::star::uno::XInterface
64{
65	//-------------------------------------------------------------------------
66	/** registers the given "AllListener" object as a listener at the
67		given interface by creating a suitable listener adapter and
68		calling the "addListener" method corresponding to the
69		"ListenerType".
70	 */
71	com::sun::star::lang::XEventListener attachListener( [in] com::sun::star::uno::XInterface xTarget,
72			 [in] com::sun::star::script::XAllListener xAllListener,
73			 [in] any aHelper,
74			 [in] string aListenerType,
75			 [in] string aAddListenerParam )
76			raises( com::sun::star::lang::IllegalArgumentException,
77					com::sun::star::beans::IntrospectionException,
78					com::sun::star::script::CannotCreateAdapterException,
79					com::sun::star::lang::ServiceNotRegisteredException );
80
81	//-------------------------------------------------------------------------
82	/** registers an object as a listener at the given interface by
83		creating a suitable listener adapter and calling the method
84		which corresponds to the listener type.
85
86		<p>Only the event corresponding to the given event method
87		will be delegated to <var>xAllListener</var>.</p>
88	 */
89	com::sun::star::lang::XEventListener attachSingleEventListener( [in] com::sun::star::uno::XInterface xTarget,
90			 [in] com::sun::star::script::XAllListener xAllListener,
91			 [in] any aHelper,
92			 [in] string aListenerType,
93			 [in] string aAddListenerParam,
94			 [in] string aEventMethod )
95			raises( com::sun::star::lang::IllegalArgumentException,
96					com::sun::star::beans::IntrospectionException,
97					com::sun::star::script::CannotCreateAdapterException,
98					com::sun::star::lang::ServiceNotRegisteredException );
99
100	//-------------------------------------------------------------------------
101	/** removes a listener object as a listener from the given interface.
102
103		<p> This method can and should be used as a contrary method
104		to the two attach methods.</p>
105	 */
106	void removeListener( [in] com::sun::star::uno::XInterface xTarget,
107			 [in] string aListenerType,
108			 [in] string aRemoveListenerParam,
109			 [in] com::sun::star::lang::XEventListener xToRemoveListener )
110			raises( com::sun::star::lang::IllegalArgumentException,
111					com::sun::star::beans::IntrospectionException );
112
113};
114
115//=============================================================================
116
117}; }; }; };
118
119#endif
120