Coverage Report

Created: 2026-09-28 10:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/unoxml/source/events/event.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 <event.hxx>
21
22
using namespace css::uno;
23
using namespace css::xml::dom::events;
24
25
namespace DOM::events
26
{
27
28
    CEvent::CEvent()
29
0
        : m_canceled(false)
30
0
        , m_phase(PhaseType_CAPTURING_PHASE)
31
0
        , m_bubbles(false)
32
0
        , m_cancelable(true)
33
0
    {
34
0
    }
35
36
    CEvent::~CEvent()
37
0
    {
38
0
    }
39
40
    OUString SAL_CALL CEvent::getType()
41
0
    {
42
0
        std::unique_lock const g(m_Mutex);
43
0
        return m_eventType;
44
0
    }
45
46
    Reference< XEventTarget > SAL_CALL
47
    CEvent::getTarget()
48
0
    {
49
0
        std::unique_lock const g(m_Mutex);
50
0
        return m_target;
51
0
    }
52
53
    Reference< XEventTarget > SAL_CALL
54
    CEvent::getCurrentTarget()
55
0
    {
56
0
        std::unique_lock const g(m_Mutex);
57
0
        return m_currentTarget;
58
0
    }
59
60
    PhaseType SAL_CALL CEvent::getEventPhase()
61
0
    {
62
0
        std::unique_lock const g(m_Mutex);
63
0
        return m_phase;
64
0
    }
65
66
    sal_Bool SAL_CALL CEvent::getBubbles()
67
0
    {
68
0
        std::unique_lock const g(m_Mutex);
69
0
        return m_bubbles;
70
0
    }
71
72
    sal_Bool SAL_CALL CEvent::getCancelable()
73
0
    {
74
0
        std::unique_lock const g(m_Mutex);
75
0
        return m_cancelable;
76
0
    }
77
78
    css::util::Time SAL_CALL
79
    CEvent::getTimeStamp()
80
0
    {
81
0
        std::unique_lock const g(m_Mutex);
82
0
        return m_time;
83
0
    }
84
85
    void SAL_CALL CEvent::stopPropagation()
86
0
    {
87
0
        std::unique_lock const g(m_Mutex);
88
0
        if (m_cancelable) { m_canceled = true; }
89
0
    }
90
91
    void SAL_CALL CEvent::preventDefault()
92
0
    {
93
0
    }
94
95
    void SAL_CALL
96
    CEvent::initEvent(OUString const& eventTypeArg, sal_Bool canBubbleArg,
97
        sal_Bool cancelableArg)
98
0
    {
99
0
        std::unique_lock const g(m_Mutex);
100
101
0
        m_eventType = eventTypeArg;
102
0
        m_bubbles = canBubbleArg;
103
0
        m_cancelable = cancelableArg;
104
0
    }
105
106
}
107
108
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */