1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <mutationevent.hxx>
22 using namespace css::uno
;
23 using namespace css::xml::dom
;
24 using namespace css::xml::dom::events
;
28 CMutationEvent::CMutationEvent()
29 : m_attrChangeType(AttrChangeType_MODIFICATION
)
33 CMutationEvent::~CMutationEvent()
37 Reference
< XNode
> SAL_CALL
CMutationEvent::getRelatedNode()
39 std::unique_lock
const g(m_Mutex
);
43 OUString SAL_CALL
CMutationEvent::getPrevValue()
45 std::unique_lock
const g(m_Mutex
);
49 OUString SAL_CALL
CMutationEvent::getNewValue()
51 std::unique_lock
const g(m_Mutex
);
55 OUString SAL_CALL
CMutationEvent::getAttrName()
57 std::unique_lock
const g(m_Mutex
);
61 AttrChangeType SAL_CALL
CMutationEvent::getAttrChange()
63 std::unique_lock
const g(m_Mutex
);
64 return m_attrChangeType
;
67 void SAL_CALL
CMutationEvent::initMutationEvent(const OUString
& typeArg
,
68 sal_Bool canBubbleArg
, sal_Bool cancelableArg
,
69 const Reference
< XNode
>& relatedNodeArg
, const OUString
& prevValueArg
,
70 const OUString
& newValueArg
, const OUString
& attrNameArg
,
71 AttrChangeType attrChangeArg
)
73 CEvent::initEvent(typeArg
, canBubbleArg
, cancelableArg
);
75 std::unique_lock
const g(m_Mutex
);
77 m_relatedNode
= relatedNodeArg
;
78 m_prevValue
= prevValueArg
;
79 m_newValue
= newValueArg
;
80 m_attrName
= attrNameArg
;
81 m_attrChangeType
= attrChangeArg
;
84 // delegate to CEvent, since we are inheriting from CEvent and XEvent
85 OUString SAL_CALL
CMutationEvent::getType()
87 return CEvent::getType();
90 Reference
< XEventTarget
> SAL_CALL
CMutationEvent::getTarget()
92 return CEvent::getTarget();
95 Reference
< XEventTarget
> SAL_CALL
CMutationEvent::getCurrentTarget()
97 return CEvent::getCurrentTarget();
100 PhaseType SAL_CALL
CMutationEvent::getEventPhase()
102 return CEvent::getEventPhase();
105 sal_Bool SAL_CALL
CMutationEvent::getBubbles()
107 return CEvent::getBubbles();
110 sal_Bool SAL_CALL
CMutationEvent::getCancelable()
112 return CEvent::getCancelable();
115 css::util::Time SAL_CALL
CMutationEvent::getTimeStamp()
117 return CEvent::getTimeStamp();
120 void SAL_CALL
CMutationEvent::stopPropagation()
122 CEvent::stopPropagation();
124 void SAL_CALL
CMutationEvent::preventDefault()
126 CEvent::preventDefault();
129 void SAL_CALL
CMutationEvent::initEvent(const OUString
& eventTypeArg
, sal_Bool canBubbleArg
,
130 sal_Bool cancelableArg
)
133 CEvent::initEvent(eventTypeArg
, canBubbleArg
, cancelableArg
);
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */