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 namespace DOM
{ namespace events
24 CMouseEvent::CMouseEvent()
30 , m_ctrlKey(sal_False
)
31 , m_shiftKey(sal_False
)
33 , m_metaKey(sal_False
)
38 sal_Int32 SAL_CALL
CMouseEvent::getScreenX() throw (RuntimeException
)
40 ::osl::MutexGuard
const g(m_Mutex
);
43 sal_Int32 SAL_CALL
CMouseEvent::getScreenY() throw (RuntimeException
)
45 ::osl::MutexGuard
const g(m_Mutex
);
48 sal_Int32 SAL_CALL
CMouseEvent::getClientX() throw (RuntimeException
)
50 ::osl::MutexGuard
const g(m_Mutex
);
53 sal_Int32 SAL_CALL
CMouseEvent::getClientY() throw (RuntimeException
)
55 ::osl::MutexGuard
const g(m_Mutex
);
58 sal_Bool SAL_CALL
CMouseEvent::getCtrlKey() throw (RuntimeException
)
60 ::osl::MutexGuard
const g(m_Mutex
);
63 sal_Bool SAL_CALL
CMouseEvent::getShiftKey() throw (RuntimeException
)
65 ::osl::MutexGuard
const g(m_Mutex
);
68 sal_Bool SAL_CALL
CMouseEvent::getAltKey() throw (RuntimeException
)
70 ::osl::MutexGuard
const g(m_Mutex
);
73 sal_Bool SAL_CALL
CMouseEvent::getMetaKey() throw (RuntimeException
)
75 ::osl::MutexGuard
const g(m_Mutex
);
78 sal_Int16 SAL_CALL
CMouseEvent::getButton() throw (RuntimeException
)
80 ::osl::MutexGuard
const g(m_Mutex
);
83 Reference
< XEventTarget
> SAL_CALL
CMouseEvent::getRelatedTarget() throw(RuntimeException
)
85 ::osl::MutexGuard
const g(m_Mutex
);
86 return m_relatedTarget
;
89 void SAL_CALL
CMouseEvent::initMouseEvent(
90 const OUString
& typeArg
,
91 sal_Bool canBubbleArg
,
92 sal_Bool cancelableArg
,
93 const Reference
< XAbstractView
>& viewArg
,
101 sal_Bool shiftKeyArg
,
104 const Reference
< XEventTarget
>& /*relatedTargetArg*/)
105 throw(RuntimeException
)
107 ::osl::MutexGuard
const g(m_Mutex
);
109 CUIEvent::initUIEvent(typeArg
, canBubbleArg
, cancelableArg
, viewArg
, detailArg
);
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() throw(RuntimeException
)
124 return CUIEvent::getView();
127 sal_Int32 SAL_CALL
CMouseEvent::getDetail() throw(RuntimeException
)
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
) throw(RuntimeException
)
138 CUIEvent::initUIEvent(typeArg
, canBubbleArg
, cancelableArg
, viewArg
, detailArg
);
141 OUString SAL_CALL
CMouseEvent::getType() throw (RuntimeException
)
143 return CUIEvent::getType();
146 Reference
< XEventTarget
> SAL_CALL
CMouseEvent::getTarget() throw (RuntimeException
)
148 return CUIEvent::getTarget();
151 Reference
< XEventTarget
> SAL_CALL
CMouseEvent::getCurrentTarget() throw (RuntimeException
)
153 return CUIEvent::getCurrentTarget();
156 PhaseType SAL_CALL
CMouseEvent::getEventPhase() throw (RuntimeException
)
158 return CUIEvent::getEventPhase();
161 sal_Bool SAL_CALL
CMouseEvent::getBubbles() throw (RuntimeException
)
163 return CEvent::getBubbles();
166 sal_Bool SAL_CALL
CMouseEvent::getCancelable() throw (RuntimeException
)
168 return CUIEvent::getCancelable();
171 com::sun::star::util::Time SAL_CALL
CMouseEvent::getTimeStamp() throw (RuntimeException
)
173 return CUIEvent::getTimeStamp();
176 void SAL_CALL
CMouseEvent::stopPropagation() throw (RuntimeException
)
178 CUIEvent::stopPropagation();
181 void SAL_CALL
CMouseEvent::preventDefault() throw (RuntimeException
)
183 CUIEvent::preventDefault();
186 void SAL_CALL
CMouseEvent::initEvent(const OUString
& eventTypeArg
, sal_Bool canBubbleArg
,
187 sal_Bool cancelableArg
) throw (RuntimeException
)
190 CUIEvent::initEvent(eventTypeArg
, canBubbleArg
, cancelableArg
);
194 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */