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
;
26 namespace DOM
{ namespace events
28 CMouseEvent::CMouseEvent()
42 sal_Int32 SAL_CALL
CMouseEvent::getScreenX()
44 ::osl::MutexGuard
const g(m_Mutex
);
47 sal_Int32 SAL_CALL
CMouseEvent::getScreenY()
49 ::osl::MutexGuard
const g(m_Mutex
);
52 sal_Int32 SAL_CALL
CMouseEvent::getClientX()
54 ::osl::MutexGuard
const g(m_Mutex
);
57 sal_Int32 SAL_CALL
CMouseEvent::getClientY()
59 ::osl::MutexGuard
const g(m_Mutex
);
62 sal_Bool SAL_CALL
CMouseEvent::getCtrlKey()
64 ::osl::MutexGuard
const g(m_Mutex
);
67 sal_Bool SAL_CALL
CMouseEvent::getShiftKey()
69 ::osl::MutexGuard
const g(m_Mutex
);
72 sal_Bool SAL_CALL
CMouseEvent::getAltKey()
74 ::osl::MutexGuard
const g(m_Mutex
);
77 sal_Bool SAL_CALL
CMouseEvent::getMetaKey()
79 ::osl::MutexGuard
const g(m_Mutex
);
82 sal_Int16 SAL_CALL
CMouseEvent::getButton()
84 ::osl::MutexGuard
const g(m_Mutex
);
87 Reference
< XEventTarget
> SAL_CALL
CMouseEvent::getRelatedTarget()
89 return Reference
< XEventTarget
>();
92 void SAL_CALL
CMouseEvent::initMouseEvent(
93 const OUString
& typeArg
,
94 sal_Bool canBubbleArg
,
95 sal_Bool cancelableArg
,
96 const Reference
< XAbstractView
>& viewArg
,
100 sal_Int32 clientXArg
,
101 sal_Int32 clientYArg
,
104 sal_Bool shiftKeyArg
,
107 const Reference
< XEventTarget
>& /*relatedTargetArg*/)
109 ::osl::MutexGuard
const g(m_Mutex
);
111 CUIEvent::initUIEvent(typeArg
, canBubbleArg
, cancelableArg
, viewArg
, detailArg
);
112 m_screenX
= screenXArg
;
113 m_screenY
= screenYArg
;
114 m_clientX
= clientXArg
;
115 m_clientY
= clientYArg
;
116 m_ctrlKey
= ctrlKeyArg
;
117 m_altKey
= altKeyArg
;
118 m_shiftKey
= shiftKeyArg
;
119 m_metaKey
= metaKeyArg
;
120 m_button
= buttonArg
;
123 // delegate to CUIEvent, since we are inheriting from CUIEvent and XUIEvent
124 Reference
< XAbstractView
> SAL_CALL
CMouseEvent::getView()
126 return CUIEvent::getView();
129 sal_Int32 SAL_CALL
CMouseEvent::getDetail()
131 return CUIEvent::getDetail();
134 void SAL_CALL
CMouseEvent::initUIEvent(const OUString
& typeArg
,
135 sal_Bool canBubbleArg
,
136 sal_Bool cancelableArg
,
137 const Reference
< XAbstractView
>& viewArg
,
140 CUIEvent::initUIEvent(typeArg
, canBubbleArg
, cancelableArg
, viewArg
, detailArg
);
143 OUString SAL_CALL
CMouseEvent::getType()
145 return CUIEvent::getType();
148 Reference
< XEventTarget
> SAL_CALL
CMouseEvent::getTarget()
150 return CUIEvent::getTarget();
153 Reference
< XEventTarget
> SAL_CALL
CMouseEvent::getCurrentTarget()
155 return CUIEvent::getCurrentTarget();
158 PhaseType SAL_CALL
CMouseEvent::getEventPhase()
160 return CUIEvent::getEventPhase();
163 sal_Bool SAL_CALL
CMouseEvent::getBubbles()
165 return CEvent::getBubbles();
168 sal_Bool SAL_CALL
CMouseEvent::getCancelable()
170 return CUIEvent::getCancelable();
173 css::util::Time SAL_CALL
CMouseEvent::getTimeStamp()
175 return CUIEvent::getTimeStamp();
178 void SAL_CALL
CMouseEvent::stopPropagation()
180 CUIEvent::stopPropagation();
183 void SAL_CALL
CMouseEvent::preventDefault()
185 CUIEvent::preventDefault();
188 void SAL_CALL
CMouseEvent::initEvent(const OUString
& eventTypeArg
, sal_Bool canBubbleArg
,
189 sal_Bool cancelableArg
)
192 CUIEvent::initEvent(eventTypeArg
, canBubbleArg
, cancelableArg
);
196 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */