interface XEventAttacherManager in module com::sun::star::script::

(Global Index)

Syntax

interface XEventAttacherManager : com::sun::star::uno::XInterface ;

Description

registers listeners for specified events.

Method 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 ScriptEvent s which are registered for the given index to the given object.

detach detaches all the ScriptEvent s 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.

Method Details



registerScriptEvent

Syntax

void registerScriptEvent (
long nIndex,
com::sun::star::script::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.

IntrospectionException and CannotCreateAdapterException are thrown by XEventAttacher and are caught and ignored.


registerScriptEvents

Syntax

void registerScriptEvents (
long nIndex,
sequence< com::sun::star::script::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 were called once for each ScriptEventDescriptor in the sequence.

If any object is attached under this index, then this event is attached automatically. IntrospectionException and CannotCreateAdapterException from the XEventAttacher are caught and ignored.


revokeScriptEvent

Syntax

void revokeScriptEvent (
long nIndex,
string aListenerType,
string aEventMethod,
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.

The IntrospectionException and the CannotCreateAdapterException are thrown by the XEventAttacher and are caught and ignored.


revokeScriptEvents

Syntax

void revokeScriptEvents (
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.


insertEntry

Syntax

void insertEntry (
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

Syntax

void removeEntry (
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.


getScriptEvents

Syntax

sequence< com::sun::star::script::ScriptEventDescriptor > getScriptEvents (
long Index )
raises ( com::sun::star::lang::IllegalArgumentException );

Description

@eturns all events registered for the given object index.

Parameter Index

an index pevious inserted with the method insertEntry.

Throws

IllegalArgumentException if Index is not valid.

attach

Syntax

void attach (
long nIndex,
com::sun::star::uno::XInterface xObject,
any aHelper )
raises ( com::sun::star::lang::IllegalArgumentException , com::sun::star::lang::ServiceNotRegisteredException );

Description

attaches all the ScriptEvent s which are registered for the given index to the given object.

IntrospectionException and CannotCreateAdapterException are thrown by the XEventAttacher and are caught and ignored.


detach

Syntax

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

Description

detaches all the ScriptEvent s from the given object which are registered at this object for the given index.

IntrospectionException and "com::sun::star::script::CannotCreateAdapterException" from the XEventAttacher are caught and ignored.


addScriptListener

Syntax

void addScriptListener (
com::sun::star::script::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 .

See also

removeScriptListener

removeScriptListener

Syntax

void removeScriptListener (
com::sun::star::script::XScriptListener Listener )
raises ( com::sun::star::lang::IllegalArgumentException );

Description

removes a XScriptListener from the listener list.

Nothing happens if the listener is not registered.

See also

addScriptListener
Top of Page