6 #include <com/sun/star/uno/Reference.h>
7 #include <com/sun/star/xml/dom/events/EventType.hpp>
8 #include <com/sun/star/xml/dom/events/PhaseType.hpp>
9 #include <com/sun/star/xml/dom/events/XEvent.hpp>
12 using namespace com::sun::star::uno
;
13 using namespace com::sun::star::xml::dom
;
14 using namespace com::sun::star::xml::dom::events
;
16 namespace DOM
{ namespace events
19 typedef std::vector
< xmlNodePtr
> NodeVector
;
20 typedef std::multimap
< xmlNodePtr
, Reference
< com::sun::star::xml::dom::events::XEventListener
> > ListenerMap
;
21 typedef std::map
<OUString
, ListenerMap
*> TypeListenerMap
;
22 typedef std::vector
<ListenerMap::value_type
> ListenerPairVector
;
24 class CEventDispatcher
27 static TypeListenerMap captureListeners
;
28 static TypeListenerMap targetListeners
;
31 static sal_Bool
dispatchEvent(xmlNodePtr aNode
, const Reference
< XEvent
>& aEvent
);
33 static void addListener(
36 const Reference
<com::sun::star::xml::dom::events::XEventListener
>& aListener
,
39 static void removeListener(
42 const Reference
<com::sun::star::xml::dom::events::XEventListener
>& aListener
,
45 static void callListeners(
48 const Reference
< XEvent
>& xEvent
,