Bump version to 24.04.3.4
[LibreOffice.git] / unoxml / source / events / event.cxx
blobe3b092ff3831a3217b1abca083f4088d0efca7d2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 <event.hxx>
22 using namespace css::uno;
23 using namespace css::xml::dom::events;
25 namespace DOM::events
28 CEvent::CEvent()
29 : m_canceled(false)
30 , m_phase(PhaseType_CAPTURING_PHASE)
31 , m_bubbles(false)
32 , m_cancelable(true)
36 CEvent::~CEvent()
40 OUString SAL_CALL CEvent::getType()
42 std::unique_lock const g(m_Mutex);
43 return m_eventType;
46 Reference< XEventTarget > SAL_CALL
47 CEvent::getTarget()
49 std::unique_lock const g(m_Mutex);
50 return m_target;
53 Reference< XEventTarget > SAL_CALL
54 CEvent::getCurrentTarget()
56 std::unique_lock const g(m_Mutex);
57 return m_currentTarget;
60 PhaseType SAL_CALL CEvent::getEventPhase()
62 std::unique_lock const g(m_Mutex);
63 return m_phase;
66 sal_Bool SAL_CALL CEvent::getBubbles()
68 std::unique_lock const g(m_Mutex);
69 return m_bubbles;
72 sal_Bool SAL_CALL CEvent::getCancelable()
74 std::unique_lock const g(m_Mutex);
75 return m_cancelable;
78 css::util::Time SAL_CALL
79 CEvent::getTimeStamp()
81 std::unique_lock const g(m_Mutex);
82 return m_time;
85 void SAL_CALL CEvent::stopPropagation()
87 std::unique_lock const g(m_Mutex);
88 if (m_cancelable) { m_canceled = true; }
91 void SAL_CALL CEvent::preventDefault()
95 void SAL_CALL
96 CEvent::initEvent(OUString const& eventTypeArg, sal_Bool canBubbleArg,
97 sal_Bool cancelableArg)
99 std::unique_lock const g(m_Mutex);
101 m_eventType = eventTypeArg;
102 m_bubbles = canBubbleArg;
103 m_cancelable = cancelableArg;
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */