/src/libreoffice/unoxml/source/events/mutationevent.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #include <mutationevent.hxx> |
21 | | |
22 | | using namespace css::uno; |
23 | | using namespace css::xml::dom; |
24 | | using namespace css::xml::dom::events; |
25 | | |
26 | | namespace DOM::events |
27 | | { |
28 | | CMutationEvent::CMutationEvent() |
29 | 0 | : m_attrChangeType(AttrChangeType_MODIFICATION) |
30 | 0 | { |
31 | 0 | } |
32 | | |
33 | | CMutationEvent::~CMutationEvent() |
34 | 0 | { |
35 | 0 | } |
36 | | |
37 | | Reference< XNode > SAL_CALL CMutationEvent::getRelatedNode() |
38 | 0 | { |
39 | 0 | std::unique_lock const g(m_Mutex); |
40 | 0 | return m_relatedNode; |
41 | 0 | } |
42 | | |
43 | | OUString SAL_CALL CMutationEvent::getPrevValue() |
44 | 0 | { |
45 | 0 | std::unique_lock const g(m_Mutex); |
46 | 0 | return m_prevValue; |
47 | 0 | } |
48 | | |
49 | | OUString SAL_CALL CMutationEvent::getNewValue() |
50 | 0 | { |
51 | 0 | std::unique_lock const g(m_Mutex); |
52 | 0 | return m_newValue; |
53 | 0 | } |
54 | | |
55 | | OUString SAL_CALL CMutationEvent::getAttrName() |
56 | 0 | { |
57 | 0 | std::unique_lock const g(m_Mutex); |
58 | 0 | return m_attrName; |
59 | 0 | } |
60 | | |
61 | | AttrChangeType SAL_CALL CMutationEvent::getAttrChange() |
62 | 0 | { |
63 | 0 | std::unique_lock const g(m_Mutex); |
64 | 0 | return m_attrChangeType; |
65 | 0 | } |
66 | | |
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) |
72 | 0 | { |
73 | 0 | CEvent::initEvent(typeArg, canBubbleArg, cancelableArg); |
74 | |
|
75 | 0 | std::unique_lock const g(m_Mutex); |
76 | |
|
77 | 0 | m_relatedNode = relatedNodeArg; |
78 | 0 | m_prevValue = prevValueArg; |
79 | 0 | m_newValue = newValueArg; |
80 | 0 | m_attrName = attrNameArg; |
81 | 0 | m_attrChangeType = attrChangeArg; |
82 | 0 | } |
83 | | |
84 | | // delegate to CEvent, since we are inheriting from CEvent and XEvent |
85 | | OUString SAL_CALL CMutationEvent::getType() |
86 | 0 | { |
87 | 0 | return CEvent::getType(); |
88 | 0 | } |
89 | | |
90 | | Reference< XEventTarget > SAL_CALL CMutationEvent::getTarget() |
91 | 0 | { |
92 | 0 | return CEvent::getTarget(); |
93 | 0 | } |
94 | | |
95 | | Reference< XEventTarget > SAL_CALL CMutationEvent::getCurrentTarget() |
96 | 0 | { |
97 | 0 | return CEvent::getCurrentTarget(); |
98 | 0 | } |
99 | | |
100 | | PhaseType SAL_CALL CMutationEvent::getEventPhase() |
101 | 0 | { |
102 | 0 | return CEvent::getEventPhase(); |
103 | 0 | } |
104 | | |
105 | | sal_Bool SAL_CALL CMutationEvent::getBubbles() |
106 | 0 | { |
107 | 0 | return CEvent::getBubbles(); |
108 | 0 | } |
109 | | |
110 | | sal_Bool SAL_CALL CMutationEvent::getCancelable() |
111 | 0 | { |
112 | 0 | return CEvent::getCancelable(); |
113 | 0 | } |
114 | | |
115 | | css::util::Time SAL_CALL CMutationEvent::getTimeStamp() |
116 | 0 | { |
117 | 0 | return CEvent::getTimeStamp(); |
118 | 0 | } |
119 | | |
120 | | void SAL_CALL CMutationEvent::stopPropagation() |
121 | 0 | { |
122 | 0 | CEvent::stopPropagation(); |
123 | 0 | } |
124 | | void SAL_CALL CMutationEvent::preventDefault() |
125 | 0 | { |
126 | 0 | CEvent::preventDefault(); |
127 | 0 | } |
128 | | |
129 | | void SAL_CALL CMutationEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg, |
130 | | sal_Bool cancelableArg) |
131 | 0 | { |
132 | | // base initializer |
133 | 0 | CEvent::initEvent(eventTypeArg, canBubbleArg, cancelableArg); |
134 | 0 | } |
135 | | } |
136 | | |
137 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |