3 import com
.sun
.star
.accessibility
.AccessibleEventObject
;
4 import com
.sun
.star
.accessibility
.XAccessibleContext
;
5 import com
.sun
.star
.accessibility
.XAccessibleEventBroadcaster
;
6 import com
.sun
.star
.accessibility
.XAccessibleEventListener
;
7 import com
.sun
.star
.lang
.EventObject
;
8 import com
.sun
.star
.uno
.UnoRuntime
;
10 /** Base class for object views that regsiters as accessibility event
13 abstract class ListeningObjectView
15 implements XAccessibleEventListener
17 public ListeningObjectView (ObjectViewContainer aContainer
)
22 /** Add this object as event listener at the broadcasting
25 public void SetObject (XAccessibleContext xContext
)
27 super.SetObject (xContext
);
28 XAccessibleEventBroadcaster xBroadcaster
=
29 (XAccessibleEventBroadcaster
)UnoRuntime
.queryInterface(
30 XAccessibleEventBroadcaster
.class, xContext
);
31 if (xBroadcaster
!= null)
32 xBroadcaster
.addEventListener (this);
36 /** Remove this object as event listener from the broadcasting
39 public void Destroy ()
42 XAccessibleEventBroadcaster xBroadcaster
=
43 (XAccessibleEventBroadcaster
)UnoRuntime
.queryInterface(
44 XAccessibleEventBroadcaster
.class, mxContext
);
45 if (xBroadcaster
!= null)
46 xBroadcaster
.removeEventListener (this);
49 /** Derived classes have to implement this method to handle incoming
52 abstract public void notifyEvent (AccessibleEventObject aEvent
);
54 /** The disposing event is ignored per default. If a derived class is
55 interested it can overwrite this method.
57 public void disposing (EventObject aEvent
)