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

#i25594# other event types

üst a17bb0b9
......@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
......@@ -75,6 +75,8 @@
#include "../events/event.hxx"
#include "../events/mutationevent.hxx"
#include "../events/uievent.hxx"
#include "../events/mouseevent.hxx"
namespace DOM
{
......@@ -545,15 +547,14 @@ namespace DOM
aType.compareToAscii("DOMAttrModified") == 0||
aType.compareToAscii("DOMCharacterDataModified") == 0)
{
events::CMutationEvent* pMEvent = new events::CMutationEvent;
pEvent = pMEvent;
pEvent = new events::CMutationEvent;
} else if (
aType.compareToAscii("DOMFocusIn") == 0||
aType.compareToAscii("DOMFocusOut") == 0||
aType.compareToAscii("DOMActivate") == 0)
{
// XXX UIEvents
throw RuntimeException();
pEvent = new events::CUIEvent;
} else if (
aType.compareToAscii("click") == 0||
aType.compareToAscii("mousedown") == 0||
......@@ -562,8 +563,7 @@ namespace DOM
aType.compareToAscii("mousemove") == 0||
aType.compareToAscii("mouseout") == 0 )
{
// XXX MouseEvents
throw RuntimeException();
pEvent = new events::CMouseEvent;
}
else // generic event
{
......
#include "eventdispatcher.hxx"
#include "event.hxx"
#include "mutationevent.hxx"
#include "uievent.hxx"
#include "mouseevent.hxx"
#include "../dom/node.hxx"
namespace DOM { namespace events {
......@@ -103,20 +106,50 @@ namespace DOM { namespace events {
aMEvent->getNewValue(), aMEvent->getAttrName(),
aMEvent->getAttrChange());
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
{
pEvent = new CEvent;
pEvent->initEvent(
aType, aEvent->getBubbles(), aEvent->getCancelable());
}
pEvent->m_target = Reference< XEventTarget >(DOM::CNode::get(aNodePtr));
pEvent->m_currentTarget = aEvent->getCurrentTarget();
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
NodeVector captureVector;
......
......@@ -2,9 +2,9 @@
#
# $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
# either of the following licenses
......@@ -77,6 +77,8 @@ SLOFILES =\
$(SLO)$/event.obj \
$(SLO)$/eventdispatcher.obj \
$(SLO)$/mutationevent.obj \
$(SLO)$/uievent.obj \
$(SLO)$/mouseevent.obj \
$(SLO)$/testlistener.obj
# --- Targets ------------------------------------------------------
......
......@@ -73,8 +73,7 @@ namespace DOM { namespace events
sal_Bool SAL_CALL CMutationEvent::getCancelable() throw (RuntimeException)
{
// mutation events cannot be canceled
return sal_False;
return CEvent::getCancelable();
}
com::sun::star::util::Time SAL_CALL CMutationEvent::getTimeStamp() throw (RuntimeException)
......@@ -84,11 +83,11 @@ namespace DOM { namespace events
void SAL_CALL CMutationEvent::stopPropagation() throw (RuntimeException)
{
// do nothing, does not apply to mutation events
CEvent::stopPropagation();
}
void SAL_CALL CMutationEvent::preventDefault() throw (RuntimeException)
{
// no effect
CEvent::preventDefault();
}
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