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