merge the formfield patch from ooo-build
[ooovba.git] / unoxml / source / events / eventdispatcher.hxx
blob08b4fe124c2f0cc8e1241a5dba283e5633810a6c
2 //#include <multimap>
3 #include <map>
4 #include <vector>
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>
10 #include "event.hxx"
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
26 private:
27 static TypeListenerMap captureListeners;
28 static TypeListenerMap targetListeners;
30 public:
31 static sal_Bool dispatchEvent(xmlNodePtr aNode, const Reference< XEvent >& aEvent);
33 static void addListener(
34 xmlNodePtr pNode,
35 OUString aType,
36 const Reference<com::sun::star::xml::dom::events::XEventListener>& aListener,
37 sal_Bool bCapture);
39 static void removeListener(
40 xmlNodePtr pNode,
41 OUString aType,
42 const Reference<com::sun::star::xml::dom::events::XEventListener>& aListener,
43 sal_Bool bCapture);
45 static void callListeners(
46 xmlNodePtr pNode,
47 OUString aType,
48 const Reference< XEvent >& xEvent,
49 sal_Bool bCapture);