Coverage Report

Created: 2025-11-16 09:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/unoxml/source/events/mouseevent.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 <mouseevent.hxx>
21
22
using namespace css::uno;
23
using namespace css::xml::dom::events;
24
using namespace css::xml::dom::views;
25
26
namespace DOM::events
27
{
28
    CMouseEvent::CMouseEvent()
29
0
        : m_screenX(0)
30
0
        , m_screenY(0)
31
0
        , m_clientX(0)
32
0
        , m_clientY(0)
33
0
        , m_ctrlKey(false)
34
0
        , m_shiftKey(false)
35
0
        , m_altKey(false)
36
0
        , m_metaKey(false)
37
0
        , m_button(0)
38
0
    {
39
0
    }
40
41
    sal_Int32 SAL_CALL CMouseEvent::getScreenX()
42
0
    {
43
0
        std::unique_lock const g(m_Mutex);
44
0
        return m_screenX;
45
0
    }
46
    sal_Int32 SAL_CALL CMouseEvent::getScreenY()
47
0
    {
48
0
        std::unique_lock const g(m_Mutex);
49
0
        return m_screenY;
50
0
    }
51
    sal_Int32 SAL_CALL CMouseEvent::getClientX()
52
0
    {
53
0
        std::unique_lock const g(m_Mutex);
54
0
        return m_clientX;
55
0
    }
56
    sal_Int32 SAL_CALL CMouseEvent::getClientY()
57
0
    {
58
0
        std::unique_lock const g(m_Mutex);
59
0
        return m_clientY;
60
0
    }
61
    sal_Bool SAL_CALL CMouseEvent::getCtrlKey()
62
0
    {
63
0
        std::unique_lock const g(m_Mutex);
64
0
        return m_ctrlKey;
65
0
    }
66
    sal_Bool SAL_CALL CMouseEvent::getShiftKey()
67
0
    {
68
0
        std::unique_lock const g(m_Mutex);
69
0
        return m_shiftKey;
70
0
    }
71
    sal_Bool SAL_CALL CMouseEvent::getAltKey()
72
0
    {
73
0
        std::unique_lock const g(m_Mutex);
74
0
        return m_altKey;
75
0
    }
76
    sal_Bool SAL_CALL CMouseEvent::getMetaKey()
77
0
    {
78
0
        std::unique_lock const g(m_Mutex);
79
0
        return m_metaKey;
80
0
    }
81
    sal_Int16 SAL_CALL CMouseEvent::getButton()
82
0
    {
83
0
        std::unique_lock const g(m_Mutex);
84
0
        return m_button;
85
0
    }
86
    Reference< XEventTarget > SAL_CALL CMouseEvent::getRelatedTarget()
87
0
    {
88
0
        return Reference< XEventTarget >();
89
0
    }
90
91
    void SAL_CALL CMouseEvent::initMouseEvent(
92
                        const OUString& typeArg,
93
                        sal_Bool canBubbleArg,
94
                        sal_Bool cancelableArg,
95
                        const Reference< XAbstractView >& viewArg,
96
                        sal_Int32 detailArg,
97
                        sal_Int32 screenXArg,
98
                        sal_Int32 screenYArg,
99
                        sal_Int32 clientXArg,
100
                        sal_Int32 clientYArg,
101
                        sal_Bool ctrlKeyArg,
102
                        sal_Bool altKeyArg,
103
                        sal_Bool shiftKeyArg,
104
                        sal_Bool metaKeyArg,
105
                        sal_Int16 buttonArg,
106
                        const Reference< XEventTarget >& /*relatedTargetArg*/)
107
0
    {
108
0
        CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
109
0
        std::unique_lock const g(m_Mutex);
110
0
        m_screenX = screenXArg;
111
0
        m_screenY = screenYArg;
112
0
        m_clientX = clientXArg;
113
0
        m_clientY = clientYArg;
114
0
        m_ctrlKey = ctrlKeyArg;
115
0
        m_altKey = altKeyArg;
116
0
        m_shiftKey = shiftKeyArg;
117
0
        m_metaKey = metaKeyArg;
118
0
        m_button = buttonArg;
119
0
    }
120
121
    // delegate to CUIEvent, since we are inheriting from CUIEvent and XUIEvent
122
    Reference< XAbstractView > SAL_CALL CMouseEvent::getView()
123
0
    {
124
0
        return CUIEvent::getView();
125
0
    }
126
127
    sal_Int32 SAL_CALL CMouseEvent::getDetail()
128
0
    {
129
0
        return CUIEvent::getDetail();
130
0
    }
131
132
    void SAL_CALL CMouseEvent::initUIEvent(const OUString& typeArg,
133
                     sal_Bool canBubbleArg,
134
                     sal_Bool cancelableArg,
135
                     const Reference< XAbstractView >& viewArg,
136
                     sal_Int32 detailArg)
137
0
    {
138
0
        CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
139
0
    }
140
141
    OUString SAL_CALL CMouseEvent::getType()
142
0
    {
143
0
        return CUIEvent::getType();
144
0
    }
145
146
    Reference< XEventTarget > SAL_CALL CMouseEvent::getTarget()
147
0
    {
148
0
        return CUIEvent::getTarget();
149
0
    }
150
151
    Reference< XEventTarget > SAL_CALL CMouseEvent::getCurrentTarget()
152
0
    {
153
0
        return CUIEvent::getCurrentTarget();
154
0
    }
155
156
    PhaseType SAL_CALL CMouseEvent::getEventPhase()
157
0
    {
158
0
        return CUIEvent::getEventPhase();
159
0
    }
160
161
    sal_Bool SAL_CALL CMouseEvent::getBubbles()
162
0
    {
163
0
        return CEvent::getBubbles();
164
0
    }
165
166
    sal_Bool SAL_CALL CMouseEvent::getCancelable()
167
0
    {
168
0
        return CUIEvent::getCancelable();
169
0
    }
170
171
    css::util::Time SAL_CALL CMouseEvent::getTimeStamp()
172
0
    {
173
0
        return CUIEvent::getTimeStamp();
174
0
    }
175
176
    void SAL_CALL CMouseEvent::stopPropagation()
177
0
    {
178
0
        CUIEvent::stopPropagation();
179
0
    }
180
181
    void SAL_CALL CMouseEvent::preventDefault()
182
0
    {
183
0
        CUIEvent::preventDefault();
184
0
    }
185
186
    void SAL_CALL CMouseEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg,
187
        sal_Bool cancelableArg)
188
0
    {
189
        // base initializer
190
0
        CUIEvent::initEvent(eventTypeArg, canBubbleArg, cancelableArg);
191
0
    }
192
}
193
194
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */