1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 module com
{ module sun
{ module star
{ module script
{
24 /** registers listeners for specified events.
26 published
interface XEventAttacherManager
: com
::sun
::star
::uno
::XInterface
28 /** registers one event for an object identified by its index.
30 <p>If any object is attached under this index, then this
31 event is attached automatically.</p>
33 com::sun::star::beans::IntrospectionException and
34 com::sun::star::script::CannotCreateAdapterException
35 that can be thrown by methods of XEventAttacher are caught
38 void registerScriptEvent
( [in] long nIndex
,
39 [in] com
::sun
::star
::script
::ScriptEventDescriptor aScriptEvent
)
40 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
42 /** registers several events for an object identified by its index.
44 <p>The result is the same as if the method registerScriptEvent()
45 was called once for each ScriptEventDescriptor
48 <p>If any object is attached under this index, then this
49 event is attached automatically (see attach())</p>
52 com::sun::star::beans::IntrospectionException and
53 com::sun::star::script::CannotCreateAdapterException
54 that can be thrown by methods of XEventAttacher are caught
57 @see registerScriptEvent
60 void registerScriptEvents
( [in] long nIndex
,
61 [in] sequence
<com
::sun
::star
::script
::ScriptEventDescriptor
> aScriptEvents
)
62 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
64 /** revokes the registration of an event.
66 <p>The parameters <var>ListenerType</var> and
67 <var>EventMethod</var> are equivalent to the first two
68 members of the ScriptEventDescriptor
69 used to register events. If this event at this index has
70 been attached to any object, it is detached automatically
74 com::sun::star::beans::IntrospectionException and
75 com::sun::star::script::CannotCreateAdapterException
76 that can be thrown by methods of XEventAttacher are caught
81 void revokeScriptEvent
( [in] long nIndex
,
82 [in] string aListenerType
,
83 [in] string aEventMethod
,
84 [in] string aRemoveListenerParam
)
85 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
87 /** revokes all events which are registered for the given index.
89 <p>If the events at this index have been attached to any
90 object, they are detached automatically.
95 void revokeScriptEvents
( [in] long nIndex
)
96 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
98 /** creates an empty entry at the given position.
100 <p>The index <var>n</var> of all entries with <code>n &gt;=
101 nIndex</code> will be increased by one.</p>
103 void insertEntry
( [in] long nIndex
)
104 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
106 /** removes the entry at the given position.
108 <p>If any events are registered at this index, they will
109 be revoked, too. So if the events at this index have been
110 attached to any object they are detached automatically.
115 void removeEntry
( [in] long nIndex
)
116 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
119 all events registered for the given object index.
122 an index previously inserted with the method insertEntry.
124 @throws IllegalArgumentException
125 if Index is not valid.
127 sequence
<com
::sun
::star
::script
::ScriptEventDescriptor
> getScriptEvents
( [in] long Index
)
128 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
130 /** attaches all the ScriptEvents which are registered
131 for the given index to the given object.
133 <p>Exceptions of type
134 com::sun::star::beans::IntrospectionException and
135 com::sun::star::script::CannotCreateAdapterException
136 that can be thrown by methods of XEventAttacher are caught
139 void attach
( [in] long nIndex
,
140 [in] com
::sun
::star
::uno
::XInterface xObject
,
142 raises
( com
::sun
::star
::lang
::IllegalArgumentException
,
143 com
::sun
::star
::lang
::ServiceNotRegisteredException
);
145 /** detaches all the ScriptEvents from the given object
146 which are registered at this object for the given index.
148 <p>Exceptions of type
149 com::sun::star::beans::IntrospectionException and
150 com::sun::star::script::CannotCreateAdapterException
151 that can be thrown by methods of XEventAttacher are caught
154 void detach
( [in] long nIndex
,
155 [in] com
::sun
::star
::uno
::XInterface xObject
)
156 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
158 /** adds an XScriptListener that will be notified when an
159 event takes place. For that a
160 ScriptEventDescriptor is registered at and
161 attached to an object by an XEventAttacherManager.
163 <p>It is suggested to allow multiple registration of the same listener,
164 thus for each time a listener is added, it has to be removed.
166 @see removeScriptListener
168 void addScriptListener
( [in] com
::sun
::star
::script
::XScriptListener xListener
)
169 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
171 /** removes a XScriptListener from the listener list.
173 <p>Nothing happens if the listener is not registered.
175 <p>It is suggested to allow multiple registration of the same listener,
176 thus for each time a listener is added, it has to be removed.
178 @see addScriptListener
180 void removeScriptListener
( [in] com
::sun
::star
::script
::XScriptListener Listener
)
181 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
188 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */