Bump version to 6.4-15
[LibreOffice.git] / unoxml / source / events / mouseevent.cxx
blob6b84ec577be7a0c1512588d96cf53009b9d08083
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 { namespace events
28 CMouseEvent::CMouseEvent()
29 : CMouseEvent_Base()
30 , m_screenX(0)
31 , m_screenY(0)
32 , m_clientX(0)
33 , m_clientY(0)
34 , m_ctrlKey(false)
35 , m_shiftKey(false)
36 , m_altKey(false)
37 , m_metaKey(false)
38 , m_button(0)
42 sal_Int32 SAL_CALL CMouseEvent::getScreenX()
44 ::osl::MutexGuard const g(m_Mutex);
45 return m_screenX;
47 sal_Int32 SAL_CALL CMouseEvent::getScreenY()
49 ::osl::MutexGuard const g(m_Mutex);
50 return m_screenY;
52 sal_Int32 SAL_CALL CMouseEvent::getClientX()
54 ::osl::MutexGuard const g(m_Mutex);
55 return m_clientX;
57 sal_Int32 SAL_CALL CMouseEvent::getClientY()
59 ::osl::MutexGuard const g(m_Mutex);
60 return m_clientY;
62 sal_Bool SAL_CALL CMouseEvent::getCtrlKey()
64 ::osl::MutexGuard const g(m_Mutex);
65 return m_ctrlKey;
67 sal_Bool SAL_CALL CMouseEvent::getShiftKey()
69 ::osl::MutexGuard const g(m_Mutex);
70 return m_shiftKey;
72 sal_Bool SAL_CALL CMouseEvent::getAltKey()
74 ::osl::MutexGuard const g(m_Mutex);
75 return m_altKey;
77 sal_Bool SAL_CALL CMouseEvent::getMetaKey()
79 ::osl::MutexGuard const g(m_Mutex);
80 return m_metaKey;
82 sal_Int16 SAL_CALL CMouseEvent::getButton()
84 ::osl::MutexGuard const g(m_Mutex);
85 return m_button;
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,
97 sal_Int32 detailArg,
98 sal_Int32 screenXArg,
99 sal_Int32 screenYArg,
100 sal_Int32 clientXArg,
101 sal_Int32 clientYArg,
102 sal_Bool ctrlKeyArg,
103 sal_Bool altKeyArg,
104 sal_Bool shiftKeyArg,
105 sal_Bool metaKeyArg,
106 sal_Int16 buttonArg,
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,
138 sal_Int32 detailArg)
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)
191 // base initializer
192 CUIEvent::initEvent(eventTypeArg, canBubbleArg, cancelableArg);
196 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */