Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: script ::

interface XEventAttacherManager
Description
registers listeners for specified events.

Methods' Summary
registerScriptEvent registers one event for an object identified by its index.  
registerScriptEvents registers several events for an object identified by its index.  
revokeScriptEvent revokes the registration of an event.  
revokeScriptEvents revokes all events which are registered for the given index.  
insertEntry creates an empty entry at the given position.  
removeEntry removes the entry at the given position.  
getScriptEvents @eturns all events registered for the given object index.  
attach attaches all the ScriptEvents which are registered for the given index to the given object.  
detach detaches all the ScriptEvents from the given object which are registered at this object for the given index.  
addScriptListener adds an XScriptListener that will be notified when an event takes place. For that a ScriptEventDescriptor is registered at and attached to an object by an XEventAttacherManager.  
removeScriptListener removes a XScriptListener from the listener list.  
Methods' Details
registerScriptEvent
void
registerScriptEvent( [in] long  nIndex,
[in] ScriptEventDescriptor  aScriptEvent )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
registers one event for an object identified by its index.

If any object is attached under this index, then this event is attached automatically.

Exceptions of type ::com::sun::star::beans::IntrospectionException and CannotCreateAdapterException that can be thrown by methods of XEventAttacher are caught and ignored.

registerScriptEvents
void
registerScriptEvents( [in] long  nIndex,
[in] sequence< ScriptEventDescriptor >  aScriptEvents )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
registers several events for an object identified by its index.

The result is the same as if the method registerScriptEvent was called once for each ScriptEventDescriptor in the sequence.

If any object is attached under this index, then this event is attached automatically (see attach)

Exceptions of type ::com::sun::star::beans::IntrospectionException and CannotCreateAdapterException that can be thrown by methods of XEventAttacher are caught and ignored.

See also
registerScriptEvent, attach
revokeScriptEvent
void
revokeScriptEvent( [in] long  nIndex,
[in] string  aListenerType,
[in] string  aEventMethod,
[in] string  aRemoveListenerParam )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
revokes the registration of an event.

The parameters ListenerType and EventMethod are equivalent to the first two members of the ScriptEventDescriptor used to register events. If this event at this index has been attached to any object, it is detached automatically (see attach).

Exceptions of type ::com::sun::star::beans::IntrospectionException and CannotCreateAdapterException that can be thrown by methods of XEventAttacher are caught and ignored.

See also
attach
revokeScriptEvents
void
revokeScriptEvents( [in] long  nIndex )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
revokes all events which are registered for the given index.

If the events at this index have been attached to any object, they are detached automatically. (see attach).

See also
attach
insertEntry
void
insertEntry( [in] long  nIndex )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
creates an empty entry at the given position.

The index n of all entries with n &gt;= nIndex will be increased by one.

removeEntry
void
removeEntry( [in] long  nIndex )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
removes the entry at the given position.

If any events are registered at this index, they will be revoked, too. So if the events at this index have been attached to any object they are detached automatically. (see attach).

See also
attach
getScriptEvents
sequence< ScriptEventDescriptor >
getScriptEvents( [in] long  Index )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
@eturns all events registered for the given object index.
Parameter Index
an index previously inserted with the method insertEntry.
Throws
IllegalArgumentException if Index is not valid.
attach
void
attach( [in] long  nIndex,
[in] ::com::sun::star::uno::XInterface  xObject,
[in] any  aHelper )
raises( ::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::lang::ServiceNotRegisteredException );

Description
attaches all the ScriptEvents which are registered for the given index to the given object.

Exceptions of type ::com::sun::star::beans::IntrospectionException and CannotCreateAdapterException that can be thrown by methods of XEventAttacher are caught and ignored.

detach
void
detach( [in] long  nIndex,
[in] ::com::sun::star::uno::XInterface  xObject )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
detaches all the ScriptEvents from the given object which are registered at this object for the given index.

Exceptions of type ::com::sun::star::beans::IntrospectionException and CannotCreateAdapterException that can be thrown by methods of XEventAttacher are caught and ignored.

addScriptListener
void
addScriptListener( [in] XScriptListener  xListener )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
adds an XScriptListener that will be notified when an event takes place. For that a ScriptEventDescriptor is registered at and attached to an object by an XEventAttacherManager.

It is suggested to allow multiple registration of the same listener, thus for each time a listener is added, it has to be removed.

See also
removeScriptListener
removeScriptListener
void
removeScriptListener( [in] XScriptListener  Listener )
raises( ::com::sun::star::lang::IllegalArgumentException );

Description
removes a XScriptListener from the listener list.

Nothing happens if the listener is not registered.

It is suggested to allow multiple registration of the same listener, thus for each time a listener is added, it has to be removed.

See also
addScriptListener
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.