Version 3.6.0.4, tag libreoffice-3.6.0.4
[LibreOffice.git] / unoxml / source / events / mouseevent.cxx
blob6e60df7fd669d17ce3ae78520db30d0e04df1a1e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include <mouseevent.hxx>
31 namespace DOM { namespace events
33 CMouseEvent::CMouseEvent()
34 : CMouseEvent_Base()
35 , m_screenX(0)
36 , m_screenY(0)
37 , m_clientX(0)
38 , m_clientY(0)
39 , m_ctrlKey(sal_False)
40 , m_shiftKey(sal_False)
41 , m_altKey(sal_False)
42 , m_metaKey(sal_False)
43 , m_button(0)
47 sal_Int32 SAL_CALL CMouseEvent::getScreenX() throw (RuntimeException)
49 ::osl::MutexGuard const g(m_Mutex);
50 return m_screenX;
52 sal_Int32 SAL_CALL CMouseEvent::getScreenY() throw (RuntimeException)
54 ::osl::MutexGuard const g(m_Mutex);
55 return m_screenY;
57 sal_Int32 SAL_CALL CMouseEvent::getClientX() throw (RuntimeException)
59 ::osl::MutexGuard const g(m_Mutex);
60 return m_clientX;
62 sal_Int32 SAL_CALL CMouseEvent::getClientY() throw (RuntimeException)
64 ::osl::MutexGuard const g(m_Mutex);
65 return m_clientY;
67 sal_Bool SAL_CALL CMouseEvent::getCtrlKey() throw (RuntimeException)
69 ::osl::MutexGuard const g(m_Mutex);
70 return m_ctrlKey;
72 sal_Bool SAL_CALL CMouseEvent::getShiftKey() throw (RuntimeException)
74 ::osl::MutexGuard const g(m_Mutex);
75 return m_shiftKey;
77 sal_Bool SAL_CALL CMouseEvent::getAltKey() throw (RuntimeException)
79 ::osl::MutexGuard const g(m_Mutex);
80 return m_altKey;
82 sal_Bool SAL_CALL CMouseEvent::getMetaKey() throw (RuntimeException)
84 ::osl::MutexGuard const g(m_Mutex);
85 return m_metaKey;
87 sal_Int16 SAL_CALL CMouseEvent::getButton() throw (RuntimeException)
89 ::osl::MutexGuard const g(m_Mutex);
90 return m_button;
92 Reference< XEventTarget > SAL_CALL CMouseEvent::getRelatedTarget() throw(RuntimeException)
94 ::osl::MutexGuard const g(m_Mutex);
95 return m_relatedTarget;
98 void SAL_CALL CMouseEvent::initMouseEvent(
99 const OUString& typeArg,
100 sal_Bool canBubbleArg,
101 sal_Bool cancelableArg,
102 const Reference< XAbstractView >& viewArg,
103 sal_Int32 detailArg,
104 sal_Int32 screenXArg,
105 sal_Int32 screenYArg,
106 sal_Int32 clientXArg,
107 sal_Int32 clientYArg,
108 sal_Bool ctrlKeyArg,
109 sal_Bool altKeyArg,
110 sal_Bool shiftKeyArg,
111 sal_Bool metaKeyArg,
112 sal_Int16 buttonArg,
113 const Reference< XEventTarget >& /*relatedTargetArg*/)
114 throw(RuntimeException)
116 ::osl::MutexGuard const g(m_Mutex);
118 CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
119 m_screenX = screenXArg;
120 m_screenY = screenYArg;
121 m_clientX = clientXArg;
122 m_clientY = clientYArg;
123 m_ctrlKey = ctrlKeyArg;
124 m_altKey = altKeyArg;
125 m_shiftKey = shiftKeyArg;
126 m_metaKey = metaKeyArg;
127 m_button = buttonArg;
130 // delegate to CUIEvent, since we are inheriting from CUIEvent and XUIEvent
131 Reference< XAbstractView > SAL_CALL CMouseEvent::getView() throw(RuntimeException)
133 return CUIEvent::getView();
136 sal_Int32 SAL_CALL CMouseEvent::getDetail() throw(RuntimeException)
138 return CUIEvent::getDetail();
141 void SAL_CALL CMouseEvent::initUIEvent(const OUString& typeArg,
142 sal_Bool canBubbleArg,
143 sal_Bool cancelableArg,
144 const Reference< XAbstractView >& viewArg,
145 sal_Int32 detailArg) throw(RuntimeException)
147 CUIEvent::initUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
150 OUString SAL_CALL CMouseEvent::getType() throw (RuntimeException)
152 return CUIEvent::getType();
155 Reference< XEventTarget > SAL_CALL CMouseEvent::getTarget() throw (RuntimeException)
157 return CUIEvent::getTarget();
160 Reference< XEventTarget > SAL_CALL CMouseEvent::getCurrentTarget() throw (RuntimeException)
162 return CUIEvent::getCurrentTarget();
165 PhaseType SAL_CALL CMouseEvent::getEventPhase() throw (RuntimeException)
167 return CUIEvent::getEventPhase();
170 sal_Bool SAL_CALL CMouseEvent::getBubbles() throw (RuntimeException)
172 return CEvent::getBubbles();
175 sal_Bool SAL_CALL CMouseEvent::getCancelable() throw (RuntimeException)
177 return CUIEvent::getCancelable();
180 com::sun::star::util::Time SAL_CALL CMouseEvent::getTimeStamp() throw (RuntimeException)
182 return CUIEvent::getTimeStamp();
185 void SAL_CALL CMouseEvent::stopPropagation() throw (RuntimeException)
187 CUIEvent::stopPropagation();
190 void SAL_CALL CMouseEvent::preventDefault() throw (RuntimeException)
192 CUIEvent::preventDefault();
195 void SAL_CALL CMouseEvent::initEvent(const OUString& eventTypeArg, sal_Bool canBubbleArg,
196 sal_Bool cancelableArg) throw (RuntimeException)
198 // base initializer
199 CUIEvent::initEvent(eventTypeArg, canBubbleArg, cancelableArg);
203 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */