1*e9cbe144SAndrew Rist /************************************************************** 2*e9cbe144SAndrew Rist * 3*e9cbe144SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*e9cbe144SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*e9cbe144SAndrew Rist * distributed with this work for additional information 6*e9cbe144SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*e9cbe144SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*e9cbe144SAndrew Rist * "License"); you may not use this file except in compliance 9*e9cbe144SAndrew Rist * with the License. You may obtain a copy of the License at 10*e9cbe144SAndrew Rist * 11*e9cbe144SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*e9cbe144SAndrew Rist * 13*e9cbe144SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*e9cbe144SAndrew Rist * software distributed under the License is distributed on an 15*e9cbe144SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*e9cbe144SAndrew Rist * KIND, either express or implied. See the License for the 17*e9cbe144SAndrew Rist * specific language governing permissions and limitations 18*e9cbe144SAndrew Rist * under the License. 19*e9cbe144SAndrew Rist * 20*e9cbe144SAndrew Rist *************************************************************/ 21*e9cbe144SAndrew Rist 22*e9cbe144SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #include <mutationevent.hxx> 25cdf0e10cSrcweir 26cdf0e10cSrcweir namespace DOM { namespace events 27cdf0e10cSrcweir { CMutationEvent()28cdf0e10cSrcweir CMutationEvent::CMutationEvent() 29cdf0e10cSrcweir : CMutationEvent_Base() 30cdf0e10cSrcweir , m_attrChangeType(AttrChangeType_MODIFICATION) 31cdf0e10cSrcweir { 32cdf0e10cSrcweir } 33cdf0e10cSrcweir ~CMutationEvent()34cdf0e10cSrcweir CMutationEvent::~CMutationEvent() 35cdf0e10cSrcweir { 36cdf0e10cSrcweir } 37cdf0e10cSrcweir getRelatedNode()38cdf0e10cSrcweir Reference< XNode > SAL_CALL CMutationEvent::getRelatedNode() throw (RuntimeException) 39cdf0e10cSrcweir { 40cdf0e10cSrcweir ::osl::MutexGuard const g(m_Mutex); 41cdf0e10cSrcweir return m_relatedNode; 42cdf0e10cSrcweir } 43cdf0e10cSrcweir getPrevValue()44cdf0e10cSrcweir OUString SAL_CALL CMutationEvent::getPrevValue() throw (RuntimeException) 45cdf0e10cSrcweir { 46cdf0e10cSrcweir ::osl::MutexGuard const g(m_Mutex); 47cdf0e10cSrcweir return m_prevValue; 48cdf0e10cSrcweir } 49cdf0e10cSrcweir getNewValue()50cdf0e10cSrcweir OUString SAL_CALL CMutationEvent::getNewValue() throw (RuntimeException) 51cdf0e10cSrcweir { 52cdf0e10cSrcweir ::osl::MutexGuard const g(m_Mutex); 53cdf0e10cSrcweir return m_newValue; 54cdf0e10cSrcweir } 55cdf0e10cSrcweir getAttrName()56cdf0e10cSrcweir OUString SAL_CALL CMutationEvent::getAttrName() throw (RuntimeException) 57cdf0e10cSrcweir { 58cdf0e10cSrcweir ::osl::MutexGuard const g(m_Mutex); 59cdf0e10cSrcweir return m_attrName; 60cdf0e10cSrcweir } 61cdf0e10cSrcweir getAttrChange()62cdf0e10cSrcweir AttrChangeType SAL_CALL CMutationEvent::getAttrChange() throw (RuntimeException) 63cdf0e10cSrcweir { 64cdf0e10cSrcweir ::osl::MutexGuard const g(m_Mutex); 65cdf0e10cSrcweir return m_attrChangeType; 66cdf0e10cSrcweir } 67cdf0e10cSrcweir initMutationEvent(const OUString & typeArg,sal_Bool canBubbleArg,sal_Bool cancelableArg,const Reference<XNode> & relatedNodeArg,const OUString & prevValueArg,const OUString & newValueArg,const OUString & attrNameArg,AttrChangeType attrChangeArg)68cdf0e10cSrcweir void SAL_CALL CMutationEvent::initMutationEvent(const OUString& typeArg, 69cdf0e10cSrcweir sal_Bool canBubbleArg, sal_Bool cancelableArg, 70cdf0e10cSrcweir const Reference< XNode >& relatedNodeArg, const OUString& prevValueArg, 71cdf0e10cSrcweir const OUString& newValueArg, const OUString& attrNameArg, 72cdf0e10cSrcweir AttrChangeType attrChangeArg) throw (RuntimeException) 73cdf0e10cSrcweir { 74cdf0e10cSrcweir ::osl::MutexGuard const g(m_Mutex); 75cdf0e10cSrcweir 76cdf0e10cSrcweir CEvent::initEvent(typeArg, canBubbleArg, cancelableArg); 77cdf0e10cSrcweir m_relatedNode = relatedNodeArg; 78cdf0e10cSrcweir m_prevValue = prevValueArg; 79cdf0e10cSrcweir m_newValue = newValueArg; 80cdf0e10cSrcweir m_attrName = attrNameArg; 81cdf0e10cSrcweir m_attrChangeType = attrChangeArg; 82cdf0e10cSrcweir } 83cdf0e10cSrcweir 84cdf0e10cSrcweir // delegate to CEvent, since we are inheriting from CEvent and XEvent getType()85cdf0e10cSrcweir OUString SAL_CALL CMutationEvent::getType() throw (RuntimeException) 86cdf0e10cSrcweir { 87cdf0e10cSrcweir return CEvent::getType(); 88cdf0e10cSrcweir } 89cdf0e10cSrcweir getTarget()90cdf0e10cSrcweir Reference< XEventTarget > SAL_CALL CMutationEvent::getTarget() throw (RuntimeException) 91cdf0e10cSrcweir { 92cdf0e10cSrcweir return CEvent::getTarget(); 93cdf0e10cSrcweir } 94cdf0e10cSrcweir getCurrentTarget()95cdf0e10cSrcweir Reference< XEventTarget > SAL_CALL CMutationEvent::getCurrentTarget() throw (RuntimeException) 96cdf0e10cSrcweir { 97cdf0e10cSrcweir return CEvent::getCurrentTarget(); 98cdf0e10cSrcweir } 99cdf0e10cSrcweir getEventPhase()100cdf0e10cSrcweir PhaseType SAL_CALL CMutationEvent::getEventPhase() throw (RuntimeException) 101cdf0e10cSrcweir { 102cdf0e10cSrcweir return CEvent::getEventPhase(); 103cdf0e10cSrcweir } 104cdf0e10cSrcweir getBubbles()105cdf0e10cSrcweir sal_Bool SAL_CALL CMutationEvent::getBubbles() throw (RuntimeException) 106cdf0e10cSrcweir { 107cdf0e10cSrcweir return CEvent::getBubbles(); 108cdf0e10cSrcweir } 109cdf0e10cSrcweir getCancelable()110cdf0e10cSrcweir sal_Bool SAL_CALL CMutationEvent::getCancelable() throw (RuntimeException) 111cdf0e10cSrcweir { 112cdf0e10cSrcweir return CEvent::getCancelable(); 113cdf0e10cSrcweir } 114cdf0e10cSrcweir getTimeStamp()115cdf0e10cSrcweir com::sun::star::util::Time SAL_CALL CMutationEvent::getTimeStamp() throw (RuntimeException) 116cdf0e10cSrcweir { 117cdf0e10cSrcweir return CEvent::getTimeStamp(); 118cdf0e10cSrcweir } 119cdf0e10cSrcweir stopPropagation()120cdf0e10cSrcweir void SAL_CALL CMutationEvent::stopPropagation() throw (RuntimeException) 121cdf0e10cSrcweir { 122cdf0e10cSrcweir CEvent::stopPropagation(); 123cdf0e10cSrcweir } preventDefault()124cdf0e10cSrcweir void SAL_CALL CMutationEvent::preventDefault() throw (RuntimeException) 125cdf0e10cSrcweir { 126cdf0e10cSrcweir CEvent::preventDefault(); 127cdf0e10cSrcweir } 128cdf0e10cSrcweir initEvent(const OUString & eventTypeArg,sal_Bool canBubbleArg,sal_Bool cancelableArg)129cdf0e10cSrcweir void SAL_CALL CMutationEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg, 130cdf0e10cSrcweir sal_Bool cancelableArg) throw (RuntimeException) 131cdf0e10cSrcweir { 132cdf0e10cSrcweir // base initializer 133cdf0e10cSrcweir CEvent::initEvent(eventTypeArg, canBubbleArg, cancelableArg); 134cdf0e10cSrcweir } 135cdf0e10cSrcweir }} 136cdf0e10cSrcweir 137