Kaydet (Commit) a95cef65 authored tarafından Lars Oppermann's avatar Lars Oppermann

#i25594# other event types

üst a17bb0b9
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: document.cxx,v $ * $RCSfile: document.cxx,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change: $Author: lo $ $Date: 2004-02-27 16:41:55 $ * last change: $Author: lo $ $Date: 2004-03-01 13:24:17 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -75,6 +75,8 @@ ...@@ -75,6 +75,8 @@
#include "../events/event.hxx" #include "../events/event.hxx"
#include "../events/mutationevent.hxx" #include "../events/mutationevent.hxx"
#include "../events/uievent.hxx"
#include "../events/mouseevent.hxx"
namespace DOM namespace DOM
{ {
...@@ -545,15 +547,14 @@ namespace DOM ...@@ -545,15 +547,14 @@ namespace DOM
aType.compareToAscii("DOMAttrModified") == 0|| aType.compareToAscii("DOMAttrModified") == 0||
aType.compareToAscii("DOMCharacterDataModified") == 0) aType.compareToAscii("DOMCharacterDataModified") == 0)
{ {
events::CMutationEvent* pMEvent = new events::CMutationEvent; pEvent = new events::CMutationEvent;
pEvent = pMEvent;
} else if ( } else if (
aType.compareToAscii("DOMFocusIn") == 0|| aType.compareToAscii("DOMFocusIn") == 0||
aType.compareToAscii("DOMFocusOut") == 0|| aType.compareToAscii("DOMFocusOut") == 0||
aType.compareToAscii("DOMActivate") == 0) aType.compareToAscii("DOMActivate") == 0)
{ {
// XXX UIEvents pEvent = new events::CUIEvent;
throw RuntimeException();
} else if ( } else if (
aType.compareToAscii("click") == 0|| aType.compareToAscii("click") == 0||
aType.compareToAscii("mousedown") == 0|| aType.compareToAscii("mousedown") == 0||
...@@ -562,8 +563,7 @@ namespace DOM ...@@ -562,8 +563,7 @@ namespace DOM
aType.compareToAscii("mousemove") == 0|| aType.compareToAscii("mousemove") == 0||
aType.compareToAscii("mouseout") == 0 ) aType.compareToAscii("mouseout") == 0 )
{ {
// XXX MouseEvents pEvent = new events::CMouseEvent;
throw RuntimeException();
} }
else // generic event else // generic event
{ {
......
#include "eventdispatcher.hxx" #include "eventdispatcher.hxx"
#include "event.hxx"
#include "mutationevent.hxx" #include "mutationevent.hxx"
#include "uievent.hxx"
#include "mouseevent.hxx"
#include "../dom/node.hxx" #include "../dom/node.hxx"
namespace DOM { namespace events { namespace DOM { namespace events {
...@@ -103,20 +106,50 @@ namespace DOM { namespace events { ...@@ -103,20 +106,50 @@ namespace DOM { namespace events {
aMEvent->getNewValue(), aMEvent->getAttrName(), aMEvent->getNewValue(), aMEvent->getAttrName(),
aMEvent->getAttrChange()); aMEvent->getAttrChange());
pEvent = pMEvent; pEvent = pMEvent;
} else if ( // UIEvent
aType.compareToAscii("DOMFocusIn") == 0||
aType.compareToAscii("DOMFocusOut") == 0||
aType.compareToAscii("DOMActivate") == 0)
{
Reference< XUIEvent > aUIEvent(aEvent, UNO_QUERY);
CUIEvent* pUIEvent = new CUIEvent;
pUIEvent->initUIEvent(aType,
aUIEvent->getBubbles(), aUIEvent->getCancelable(),
aUIEvent->getView(), aUIEvent->getDetail());
pEvent = pUIEvent;
} else if ( // MouseEvent
aType.compareToAscii("click") == 0||
aType.compareToAscii("mousedown") == 0||
aType.compareToAscii("mouseup") == 0||
aType.compareToAscii("mouseover") == 0||
aType.compareToAscii("mousemove") == 0||
aType.compareToAscii("mouseout") == 0)
{
Reference< XMouseEvent > aMouseEvent(aEvent, UNO_QUERY);
CMouseEvent *pMouseEvent = new CMouseEvent;
pMouseEvent->initMouseEvent(aType,
aMouseEvent->getBubbles(), aMouseEvent->getCancelable(),
aMouseEvent->getView(), aMouseEvent->getDetail(),
aMouseEvent->getScreenX(), aMouseEvent->getScreenY(),
aMouseEvent->getClientX(), aMouseEvent->getClientY(),
aMouseEvent->getCtrlKey(), aMouseEvent->getAltKey(),
aMouseEvent->getShiftKey(), aMouseEvent->getMetaKey(),
aMouseEvent->getButton(), aMouseEvent->getRelatedTarget());
pEvent = pMouseEvent;
} }
else // generic event else // generic event
{ {
pEvent = new CEvent; pEvent = new CEvent;
pEvent->initEvent( pEvent->initEvent(
aType, aEvent->getBubbles(), aEvent->getCancelable()); aType, aEvent->getBubbles(), aEvent->getCancelable());
} }
pEvent->m_target = Reference< XEventTarget >(DOM::CNode::get(aNodePtr)); pEvent->m_target = Reference< XEventTarget >(DOM::CNode::get(aNodePtr));
pEvent->m_currentTarget = aEvent->getCurrentTarget(); pEvent->m_currentTarget = aEvent->getCurrentTarget();
pEvent->m_time = aEvent->getTimeStamp(); pEvent->m_time = aEvent->getTimeStamp();
xEvent = Reference< XEvent >(static_cast< CEvent* >(pEvent));
// create the reference to the provate event implementation
// that will be dispatched to the listeners
xEvent = Reference< XEvent >(pEvent);
// build the path from target node to the root // build the path from target node to the root
NodeVector captureVector; NodeVector captureVector;
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
# #
# $RCSfile: makefile.mk,v $ # $RCSfile: makefile.mk,v $
# #
# $Revision: 1.1 $ # $Revision: 1.2 $
# #
# last change: $Author: lo $ $Date: 2004-02-16 16:41:50 $ # last change: $Author: lo $ $Date: 2004-03-01 13:24:19 $
# #
# The Contents of this file are made available subject to the terms of # The Contents of this file are made available subject to the terms of
# either of the following licenses # either of the following licenses
...@@ -77,6 +77,8 @@ SLOFILES =\ ...@@ -77,6 +77,8 @@ SLOFILES =\
$(SLO)$/event.obj \ $(SLO)$/event.obj \
$(SLO)$/eventdispatcher.obj \ $(SLO)$/eventdispatcher.obj \
$(SLO)$/mutationevent.obj \ $(SLO)$/mutationevent.obj \
$(SLO)$/uievent.obj \
$(SLO)$/mouseevent.obj \
$(SLO)$/testlistener.obj $(SLO)$/testlistener.obj
# --- Targets ------------------------------------------------------ # --- Targets ------------------------------------------------------
......
...@@ -73,8 +73,7 @@ namespace DOM { namespace events ...@@ -73,8 +73,7 @@ namespace DOM { namespace events
sal_Bool SAL_CALL CMutationEvent::getCancelable() throw (RuntimeException) sal_Bool SAL_CALL CMutationEvent::getCancelable() throw (RuntimeException)
{ {
// mutation events cannot be canceled return CEvent::getCancelable();
return sal_False;
} }
com::sun::star::util::Time SAL_CALL CMutationEvent::getTimeStamp() throw (RuntimeException) com::sun::star::util::Time SAL_CALL CMutationEvent::getTimeStamp() throw (RuntimeException)
...@@ -84,11 +83,11 @@ namespace DOM { namespace events ...@@ -84,11 +83,11 @@ namespace DOM { namespace events
void SAL_CALL CMutationEvent::stopPropagation() throw (RuntimeException) void SAL_CALL CMutationEvent::stopPropagation() throw (RuntimeException)
{ {
// do nothing, does not apply to mutation events CEvent::stopPropagation();
} }
void SAL_CALL CMutationEvent::preventDefault() throw (RuntimeException) void SAL_CALL CMutationEvent::preventDefault() throw (RuntimeException)
{ {
// no effect CEvent::preventDefault();
} }
void SAL_CALL CMutationEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg, void SAL_CALL CMutationEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment