1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
;
28 CMouseEvent::CMouseEvent()
41 sal_Int32 SAL_CALL
CMouseEvent::getScreenX()
43 std::unique_lock
const g(m_Mutex
);
46 sal_Int32 SAL_CALL
CMouseEvent::getScreenY()
48 std::unique_lock
const g(m_Mutex
);
51 sal_Int32 SAL_CALL
CMouseEvent::getClientX()
53 std::unique_lock
const g(m_Mutex
);
56 sal_Int32 SAL_CALL
CMouseEvent::getClientY()
58 std::unique_lock
const g(m_Mutex
);
61 sal_Bool SAL_CALL
CMouseEvent::getCtrlKey()
63 std::unique_lock
const g(m_Mutex
);
66 sal_Bool SAL_CALL
CMouseEvent::getShiftKey()
68 std::unique_lock
const g(m_Mutex
);
71 sal_Bool SAL_CALL
CMouseEvent::getAltKey()
73 std::unique_lock
const g(m_Mutex
);
76 sal_Bool SAL_CALL
CMouseEvent::getMetaKey()
78 std::unique_lock
const g(m_Mutex
);
81 sal_Int16 SAL_CALL
CMouseEvent::getButton()
83 std::unique_lock
const g(m_Mutex
);
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
,
100 sal_Int32 clientYArg
,
103 sal_Bool shiftKeyArg
,
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
,
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
)
190 CUIEvent::initEvent(eventTypeArg
, canBubbleArg
, cancelableArg
);
194 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */