tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / unoxml / source / events / mouseevent.cxx
blob4ae8a1b557411e5d9c2676111a4279d1484a0607
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 <mouseevent.hxx>
22 using namespace css::uno;
23 using namespace css::xml::dom::events;
24 using namespace css::xml::dom::views;
26 namespace DOM::events
28 CMouseEvent::CMouseEvent()
29 : m_screenX(0)
30 , m_screenY(0)
31 , m_clientX(0)
32 , m_clientY(0)
33 , m_ctrlKey(false)
34 , m_shiftKey(false)
35 , m_altKey(false)
36 , m_metaKey(false)
37 , m_button(0)
41 sal_Int32 SAL_CALL CMouseEvent::getScreenX()
43 std::unique_lock const g(m_Mutex);
44 return m_screenX;
46 sal_Int32 SAL_CALL CMouseEvent::getScreenY()
48 std::unique_lock const g(m_Mutex);
49 return m_screenY;
51 sal_Int32 SAL_CALL CMouseEvent::getClientX()
53 std::unique_lock const g(m_Mutex);
54 return m_clientX;
56 sal_Int32 SAL_CALL CMouseEvent::getClientY()
58 std::unique_lock const g(m_Mutex);
59 return m_clientY;
61 sal_Bool SAL_CALL CMouseEvent::getCtrlKey()
63 std::unique_lock const g(m_Mutex);
64 return m_ctrlKey;
66 sal_Bool SAL_CALL CMouseEvent::getShiftKey()
68 std::unique_lock const g(m_Mutex);
69 return m_shiftKey;
71 sal_Bool SAL_CALL CMouseEvent::getAltKey()
73 std::unique_lock const g(m_Mutex);
74 return m_altKey;
76 sal_Bool SAL_CALL CMouseEvent::getMetaKey()
78 std::unique_lock const g(m_Mutex);
79 return m_metaKey;
81 sal_Int16 SAL_CALL CMouseEvent::getButton()
83 std::unique_lock const g(m_Mutex);
84 return m_button;
86 Reference< XEventTarget > SAL_CALL CMouseEvent::getRelatedTarget()
88 return Reference< XEventTarget >();
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*/)
108 CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
109 std::unique_lock const g(m_Mutex);
110 m_screenX = screenXArg;
111 m_screenY = screenYArg;
112 m_clientX = clientXArg;
113 m_clientY = clientYArg;
114 m_ctrlKey = ctrlKeyArg;
115 m_altKey = altKeyArg;
116 m_shiftKey = shiftKeyArg;
117 m_metaKey = metaKeyArg;
118 m_button = buttonArg;
121 // delegate to CUIEvent, since we are inheriting from CUIEvent and XUIEvent
122 Reference< XAbstractView > SAL_CALL CMouseEvent::getView()
124 return CUIEvent::getView();
127 sal_Int32 SAL_CALL CMouseEvent::getDetail()
129 return CUIEvent::getDetail();
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)
138 CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
141 OUString SAL_CALL CMouseEvent::getType()
143 return CUIEvent::getType();
146 Reference< XEventTarget > SAL_CALL CMouseEvent::getTarget()
148 return CUIEvent::getTarget();
151 Reference< XEventTarget > SAL_CALL CMouseEvent::getCurrentTarget()
153 return CUIEvent::getCurrentTarget();
156 PhaseType SAL_CALL CMouseEvent::getEventPhase()
158 return CUIEvent::getEventPhase();
161 sal_Bool SAL_CALL CMouseEvent::getBubbles()
163 return CEvent::getBubbles();
166 sal_Bool SAL_CALL CMouseEvent::getCancelable()
168 return CUIEvent::getCancelable();
171 css::util::Time SAL_CALL CMouseEvent::getTimeStamp()
173 return CUIEvent::getTimeStamp();
176 void SAL_CALL CMouseEvent::stopPropagation()
178 CUIEvent::stopPropagation();
181 void SAL_CALL CMouseEvent::preventDefault()
183 CUIEvent::preventDefault();
186 void SAL_CALL CMouseEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg,
187 sal_Bool cancelableArg)
189 // base initializer
190 CUIEvent::initEvent(eventTypeArg, canBubbleArg, cancelableArg);
194 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */